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.
514 lines
1.6 MiB
514 lines
1.6 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[218,5,6,7,8,9,12,21],{"+BqJ":function(wt,Pe,U){wt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(Q,B){"use strict";function q(a,c){a.cmdState.push(c)}function K(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function M(a){var c=a.cmdState.pop();c&&c.closeBracket()}function Y(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 V(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=V("importmodule","tag",["string","builtin"]),r.documentclass=V("documentclass","tag",["","atom"]),r.usepackage=V("usepackage","tag",["atom"]),r.begin=V("begin","tag",["atom"]),r.end=V("end","tag",["atom"]),r.label=V("label","tag",["atom"]),r.ref=V("ref","tag",["atom"]),r.eqref=V("eqref","tag",["atom"]),r.cite=V("cite","tag",["atom"]),r.bibitem=V("bibitem","tag",["atom"]),r.Bibitem=V("Bibitem","tag",["atom"]),r.RBibitem=V("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,q(c,s),D(c,g),s.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return D(c,function(u,o){return p(u,o,"\\]")}),"keyword";if(a.match("\\("))return D(c,function(u,o){return p(u,o,"\\)")}),"keyword";if(a.match("$$"))return D(c,function(u,o){return p(u,o,"$$")}),"keyword";if(a.match("$"))return D(c,function(u,o){return p(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,g);else return"error";return"bracket"}else return t=="{"||t=="["?(s=r.DEFAULT,s=new s,q(c,s),"bracket"):/\d/.test(t)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),s=Y(c),s.name=="begin"&&(s.argument=a.current()),s.styleIdentifier())}function p(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 g(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),M(c),m(a,c))}return{startState:function(){var a=B.inMathMode?function(c,s){return p(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:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(wt,Pe,U){},"/cxE":function(wt,Pe,U){"use strict";U.d(Pe,"f",function(){return B}),U.d(Pe,"g",function(){return q}),U.d(Pe,"h",function(){return K}),U.d(Pe,"e",function(){return Y}),U.d(Pe,"b",function(){return V}),U.d(Pe,"c",function(){return r}),U.d(Pe,"d",function(){return D}),U.d(Pe,"a",function(){return m});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(g=>{g(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const Q=new ne;function B(p){Y(p)||Q.onUnexpectedError(p);return}function q(p){Y(p)||Q.onUnexpectedExternalError(p);return}function K(p){if(p instanceof Error){let{name:g,message:a}=p;const c=p.stacktrace||p.stack;return{$isError:!0,name:g,message:a,stack:c}}return p}const M="Canceled";function Y(p){return p instanceof Error&&p.name===M&&p.message===M}function V(){const p=new Error(M);return p.name=p.message,p}function r(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function D(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class m extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(V,r,D){var m=D&&D!=ne.Init;if(r&&!m)V.on("blur",K),V.on("change",M),V.on("swapDoc",M),ne.on(V.getInputField(),"compositionupdate",V.state.placeholderCompose=function(){q(V)}),M(V);else if(!r&&m){V.off("blur",K),V.off("change",M),V.off("swapDoc",M),ne.off(V.getInputField(),"compositionupdate",V.state.placeholderCompose),Q(V);var p=V.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}r&&!V.hasFocus()&&K(V)});function Q(V){V.state.placeholder&&(V.state.placeholder.parentNode.removeChild(V.state.placeholder),V.state.placeholder=null)}function B(V){Q(V);var r=V.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=V.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var D=V.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),r.appendChild(D),V.display.lineSpace.insertBefore(r,V.display.lineSpace.firstChild)}function q(V){setTimeout(function(){var r=!1,D=V.getInputField();D.nodeName=="TEXTAREA"?r=!D.value:V.lineCount()==1&&(r=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),r?B(V):Q(V)},20)}function K(V){Y(V)&&B(V)}function M(V){var r=V.getWrapperElement(),D=Y(V);r.className=r.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?B(V):Q(V)}function Y(V){return V.lineCount()===1&&V.getLine(0)===""}})},"1eCo":function(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){"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};ne.defineMode("xml",function(q,K){var M=q.indentUnit,Y={},V=K.htmlMode?Q:B;for(var r in V)Y[r]=V[r];for(var r in K)Y[r]=K[r];var D,m;function p(f,T){function x(W){return T.tokenize=W,W(f,T)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?x(c("atom","]]>")):null:f.match("--")?x(c("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),x(s(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),T.tokenize=c("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",T.tokenize=g,"tag bracket");if(_=="&"){var j;return f.eat("#")?f.eat("x")?j=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):j=f.eatWhile(/[\d]/)&&f.eat(";"):j=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),j?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function g(f,T){var x=f.next();if(x==">"||x=="/"&&f.eat(">"))return T.tokenize=p,D=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return D="equals",null;if(x=="<"){T.tokenize=p,T.state=o,T.tagName=T.tagStart=null;var _=T.tokenize(f,T);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(x)?(T.tokenize=a(x),T.stringStartCol=f.column(),T.tokenize(f,T)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(f){var T=function(x,_){for(;!x.eol();)if(x.next()==f){_.tokenize=g;break}return"string"};return T.isInAttribute=!0,T}function c(f,T){return function(x,_){for(;!x.eol();){if(x.match(T)){_.tokenize=p;break}x.next()}return f}}function s(f){return function(T,x){for(var _;(_=T.next())!=null;){if(_=="<")return x.tokenize=s(f+1),x.tokenize(T,x);if(_==">")if(f==1){x.tokenize=p;break}else return x.tokenize=s(f-1),x.tokenize(T,x)}return"meta"}}function i(f,T,x){this.prev=f.context,this.tagName=T,this.indent=f.indented,this.startOfLine=x,(Y.doNotIndent.hasOwnProperty(T)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function t(f){f.context&&(f.context=f.context.prev)}function u(f,T){for(var x;;){if(!f.context)return;if(x=f.context.tagName,!Y.contextGrabbers.hasOwnProperty(x)||!Y.contextGrabbers[x].hasOwnProperty(T))return;t(f)}}function o(f,T,x){return f=="openTag"?(x.tagStart=T.column(),O):f=="closeTag"?S:o}function O(f,T,x){return f=="word"?(x.tagName=T.current(),m="tag",P):Y.allowMissingTagName&&f=="endTag"?(m="tag bracket",P(f,T,x)):(m="error",O)}function S(f,T,x){if(f=="word"){var _=T.current();return x.context&&x.context.tagName!=_&&Y.implicitlyClosed.hasOwnProperty(x.context.tagName)&&t(x),x.context&&x.context.tagName==_||Y.matchClosing===!1?(m="tag",R):(m="tag error",A)}else return Y.allowMissingTagName&&f=="endTag"?(m="tag bracket",R(f,T,x)):(m="error",A)}function R(f,T,x){return f!="endTag"?(m="error",R):(t(x),o)}function A(f,T,x){return m="error",R(f,T,x)}function P(f,T,x){if(f=="word")return m="attribute",w;if(f=="endTag"||f=="selfcloseTag"){var _=x.tagName,j=x.tagStart;return x.tagName=x.tagStart=null,f=="selfcloseTag"||Y.autoSelfClosers.hasOwnProperty(_)?u(x,_):(u(x,_),x.context=new i(x,_,j==x.indented)),o}return m="error",P}function w(f,T,x){return f=="equals"?E:(Y.allowMissing||(m="error"),P(f,T,x))}function E(f,T,x){return f=="string"?h:f=="word"&&Y.allowUnquoted?(m="string",P):(m="error",P(f,T,x))}function h(f,T,x){return f=="string"?h:P(f,T,x)}return{startState:function(f){var T={tokenize:p,state:o,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(T.baseIndent=f),T},token:function(f,T){if(!T.tagName&&f.sol()&&(T.indented=f.indentation()),f.eatSpace())return null;D=null;var x=T.tokenize(f,T);return(x||D)&&x!="comment"&&(m=null,T.state=T.state(D||x,f,T),m&&(x=m=="error"?x+" error":m)),x},indent:function(f,T,x){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+M;if(_&&_.noIndent)return ne.Pass;if(f.tokenize!=g&&f.tokenize!=p)return x?x.match(/^(\s*)/)[0].length:0;if(f.tagName)return Y.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+M*(Y.multilineTagIndentFactor||1);if(Y.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var j=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(j&&j[1])for(;_;)if(_.tagName==j[2]){_=_.prev;break}else if(Y.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(j)for(;_;){var W=Y.contextGrabbers[_.tagName];if(W&&W.hasOwnProperty(j[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+M:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Y.htmlMode?"html":"xml",helperType:Y.htmlMode?"html":"xml",skipAttribute:function(f){f.state==E&&(f.state=P)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var T=[],x=f.context;x;x=x.prev)x.tagName&&T.push(x.tagName);return T.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Q});class ne{constructor(B){this.element=B,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class Q{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let B=this._first;for(;B!==ne.Undefined;){const q=B.next;B.prev=ne.Undefined,B.next=ne.Undefined,B=q}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(B){return this._insert(B,!1)}push(B){return this._insert(B,!0)}_insert(B,q){const K=new ne(B);if(this._first===ne.Undefined)this._first=K,this._last=K;else if(q){const Y=this._last;this._last=K,K.prev=Y,Y.next=K}else{const Y=this._first;this._first=K,K.next=Y,Y.prev=K}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(K))}}shift(){if(this._first===ne.Undefined)return;{const B=this._first.element;return this._remove(this._first),B}}pop(){if(this._last===ne.Undefined)return;{const B=this._last.element;return this._remove(this._last),B}}_remove(B){if(B.prev!==ne.Undefined&&B.next!==ne.Undefined){const q=B.prev;q.next=B.next,B.next.prev=q}else B.prev===ne.Undefined&&B.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):B.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):B.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let B=this._first;for(;B!==ne.Undefined;)yield B.element,B=B.next}}},"2aBv":function(wt,Pe,U){"use strict";var ne=U("2qtc"),Q=U("kLXV"),B=U("0Owb"),q=U("14J3"),K=U("BMrR"),M=U("jCWc"),Y=U("kPKH"),V=U("+L6B"),r=U("2/Rp"),D=U("oBTY"),m=U("tJVT"),p=U("q1tI"),g=U.n(p),a=U("ngQI"),c=U("Ty5D"),s=U("YIbm"),i=U.n(s),t=function(o){var O=o.visible,S=o.onOk,R=o.onCancel,A=o.data,P=Object(p.useState)([]),w=Object(m.a)(P,2),E=w[0],h=w[1],f=Object(p.useState)(!1),T=Object(m.a)(f,2),x=T[0],_=T[1],j=Object(c.i)();Object(p.useEffect)(function(){if(!O){h([]),_(!1);return}h(Object(D.a)(A)||[])},[O]);var W=function(){_(!0),S(E,function(){_(!1)})},C=function(){R()},F=function(H,J,ae){var fe=Array.from(H),ge=fe.splice(J,1),Te=Object(m.a)(ge,1),Ue=Te[0];return fe.splice(ae,0,Ue),fe},k=function(H,J){if(!H.destination)return;var ae=F(J,H.source.index,H.destination.index);h(ae)};return g.a.createElement(Q.a,{title:"\u9898\u578B\u6392\u5E8F",visible:O,centered:!0,onCancel:C,footer:g.a.createElement("div",null,g.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),g.a.createElement(r.a,{onClick:C},"\u53D6\u6D88"),g.a.createElement(r.a,{type:"primary",loading:x,onClick:W},"\u786E\u8BA4")),width:"680px"},g.a.createElement("div",{className:i.a.content},g.a.createElement(K.a,null,g.a.createElement(Y.a,{span:12},"\u5E8F\u53F7"),g.a.createElement(Y.a,{span:12},"\u9898\u578B\u540D\u79F0")),g.a.createElement(a.a,{onDragEnd:function(H){return k(H,E)}},g.a.createElement(a.c,{droppableId:"droppable"},function(y,H){return g.a.createElement("div",Object(B.a)({ref:y.innerRef},y.droppableProps,{style:{width:"100%"}}),E.map(function(J,ae){return g.a.createElement(a.b,{key:ae,draggableId:ae.toString(),index:ae},function(fe,ge){return g.a.createElement("aside",Object(B.a)({ref:fe.innerRef},fe.draggableProps,fe.dragHandleProps),g.a.createElement("div",null,g.a.createElement(K.a,{style:{backgroundColor:ae%2===0?"#f5f5f5":"#fff"}},g.a.createElement(Y.a,{span:12},ae+1),g.a.createElement(Y.a,{span:12},J))))})}))}))))};Pe.a=t},"3/fG":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Q});function ne(B,q){let K;return q.length===0?K=B:K=B.replace(/\{(\d+)\}/g,function(M,Y){const V=Y[0];return typeof q[V]!="undefined"?q[V]:M}),K}function Q(B,q,...K){return ne(q,K)}},"55Ip":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return u});var ne=U("Ty5D"),Q=U("dI71"),B=U("q1tI"),q=U.n(B),K=U("YS25"),M=U("17x9"),Y=U.n(M),V=U("wx14"),r=U("zLVn"),D=U("9R94"),m=function(E){Object(Q.a)(h,E);function h(){for(var T,x=arguments.length,_=new Array(x),j=0;j<x;j++)_[j]=arguments[j];return T=E.call.apply(E,[this].concat(_))||this,T.history=Object(K.a)(T.props),T}var f=h.prototype;return f.render=function(){return q.a.createElement(ne.c,{history:this.history,children:this.props.children})},h}(q.a.Component),p=function(E){Object(Q.a)(h,E);function h(){for(var T,x=arguments.length,_=new Array(x),j=0;j<x;j++)_[j]=arguments[j];return T=E.call.apply(E,[this].concat(_))||this,T.history=Object(K.b)(T.props),T}var f=h.prototype;return f.render=function(){return q.a.createElement(ne.c,{history:this.history,children:this.props.children})},h}(q.a.Component),g=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=q.a.forwardRef;typeof s=="undefined"&&(s=c);function i(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var t=s(function(E,h){var f=E.innerRef,T=E.navigate,x=E.onClick,_=Object(r.a)(E,["innerRef","navigate","onClick"]),j=_.target,W=Object(V.a)({},_,{onClick:function(F){try{x&&x(F)}catch(k){throw F.preventDefault(),k}!F.defaultPrevented&&F.button===0&&(!j||j==="_self")&&!i(F)&&(F.preventDefault(),T())}});return c!==s?W.ref=h||f:W.ref=f,q.a.createElement("a",W)}),u=s(function(E,h){var f=E.component,T=f===void 0?t:f,x=E.replace,_=E.to,j=E.innerRef,W=Object(r.a)(E,["component","replace","to","innerRef"]);return q.a.createElement(ne.e.Consumer,null,function(C){C||Object(D.a)(!1);var F=C.history,k=a(g(_,C.location),C.location),y=k?F.createHref(k):"",H=Object(V.a)({},W,{href:y,navigate:function(){var ae=g(_,C.location),fe=x?F.replace:F.push;fe(ae)}});return c!==s?H.ref=h||j:H.innerRef=j,q.a.createElement(T,H)})});if(!1)var o,O;var S=function(h){return h},R=q.a.forwardRef;typeof R=="undefined"&&(R=S);function A(){for(var E=arguments.length,h=new Array(E),f=0;f<E;f++)h[f]=arguments[f];return h.filter(function(T){return T}).join(" ")}var P=R(function(E,h){var f=E["aria-current"],T=f===void 0?"page":f,x=E.activeClassName,_=x===void 0?"active":x,j=E.activeStyle,W=E.className,C=E.exact,F=E.isActive,k=E.location,y=E.sensitive,H=E.strict,J=E.style,ae=E.to,fe=E.innerRef,ge=Object(r.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return q.a.createElement(ne.e.Consumer,null,function(Te){Te||Object(D.a)(!1);var Ue=k||Te.location,Se=a(g(ae,Ue),Ue),Le=Se.pathname,ye=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Z=ye?Object(ne.f)(Ue.pathname,{path:ye,exact:C,sensitive:y,strict:H}):null,v=!!(F?F(Z,Ue):Z),L=v?A(W,_):W,z=v?Object(V.a)({},J,{},j):J,ee=Object(V.a)({"aria-current":v&&T||null,className:L,style:z,to:Se},ge);return S!==R?ee.ref=h||fe:ee.innerRef=fe,q.a.createElement(u,ee)})});if(!1)var w},"5VLF":function(wt,Pe,U){"use strict";var ne,Q;function B(q,K,M){var Y=function(V,r){return q.js_beautify(V,r)};return Y.js=q.js_beautify,Y.css=K.css_beautify,Y.html=M.html_beautify,Y.js_beautify=q.js_beautify,Y.css_beautify=K.css_beautify,Y.html_beautify=M.html_beautify,Y}!(ne=[U("6UM0"),U("TXwP"),U("psGv")],Q=function(q,K,M){return B(q,K,M)}.apply(Pe,ne),Q!==void 0&&(wt.exports=Q))},"5Y4S":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return B});var ne=U("MNsG");const Q=ne.b.performance&&typeof ne.b.performance.now=="function";class B{constructor(q){this._highResolution=Q&&q,this._startTime=this._now(),this._stopTime=-1}static create(q=!0){return new B(q)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6+eU":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return R});var ne=U("wx14"),Q=U("rePB"),B=U("VTBJ"),q=U("1OyB"),K=U("vuIU"),M=U("Ji7U"),Y=U("LK+K"),V=U("q1tI"),r=U.n(V),D=U("TSYQ"),m=U.n(D),p=function(P){var w,E="".concat(P.rootPrefixCls,"-item"),h=m()(E,"".concat(E,"-").concat(P.page),(w={},Object(Q.a)(w,"".concat(E,"-active"),P.active),Object(Q.a)(w,P.className,!!P.className),Object(Q.a)(w,"".concat(E,"-disabled"),!P.page),w)),f=function(){P.onClick(P.page)},T=function(_){P.onKeyPress(_,P.onClick,P.page)};return r.a.createElement("li",{title:P.showTitle?P.page:null,className:h,onClick:f,onKeyPress:T,tabIndex:"0"},P.itemRender(P.page,"page",r.a.createElement("a",{rel:"nofollow"},P.page)))},g=p,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(M.a)(w,A);var P=Object(Y.a)(w);function w(){var E;Object(q.a)(this,w);for(var h=arguments.length,f=new Array(h),T=0;T<h;T++)f[T]=arguments[T];return E=P.call.apply(P,[this].concat(f)),E.state={goInputText:""},E.buildOptionText=function(x){return"".concat(x," ").concat(E.props.locale.items_per_page)},E.changeSize=function(x){E.props.changeSize(Number(x))},E.handleChange=function(x){E.setState({goInputText:x.target.value})},E.handleBlur=function(x){var _=E.props,j=_.goButton,W=_.quickGo,C=_.rootPrefixCls,F=E.state.goInputText;if(j||F==="")return;if(x.relatedTarget&&(x.relatedTarget.className.indexOf("".concat(C,"-prev"))>=0||x.relatedTarget.className.indexOf("".concat(C,"-next"))>=0))return;E.setState({goInputText:""}),W(E.getValidValue())},E.go=function(x){var _=E.state.goInputText;if(_==="")return;(x.keyCode===a.ENTER||x.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(K.a)(w,[{key:"getValidValue",value:function(){var h=this.state,f=h.goInputText,T=h.current;return!f||isNaN(f)?T:Number(f)}},{key:"getPageSizeOptions",value:function(){var h=this.props,f=h.pageSize,T=h.pageSizeOptions;return T.some(function(x){return x.toString()===f.toString()})?T:T.concat([f.toString()]).sort(function(x,_){var j=isNaN(Number(x))?0:Number(x),W=isNaN(Number(_))?0:Number(_);return j-W})}},{key:"render",value:function(){var h=this,f=this.props,T=f.pageSize,x=f.locale,_=f.rootPrefixCls,j=f.changeSize,W=f.quickGo,C=f.goButton,F=f.selectComponentClass,k=f.buildOptionText,y=f.selectPrefixCls,H=f.disabled,J=this.state.goInputText,ae="".concat(_,"-options"),fe=F,ge=null,Te=null,Ue=null;if(!j&&!W)return null;var Se=this.getPageSizeOptions();if(j&&fe){var Le=Se.map(function(ye,Z){return r.a.createElement(fe.Option,{key:Z,value:ye.toString()},(k||h.buildOptionText)(ye))});ge=r.a.createElement(fe,{disabled:H,prefixCls:y,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(T||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Z){return Z.parentNode}},Le)}return W&&(C&&(Ue=typeof C=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ae,"-quick-jumper-button")},x.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},C)),Te=r.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},x.jump_to,r.a.createElement("input",{disabled:H,type:"text",value:J,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,Ue)),r.a.createElement("li",{className:"".concat(ae)},ge,Te)}}]),w}(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,P,w){return w}function O(A,P,w){var E=typeof A=="undefined"?P.pageSize:A;return Math.floor((w.total-1)/E)+1}var S=function(A){Object(M.a)(w,A);var P=Object(Y.a)(w);function w(E){var h;Object(q.a)(this,w),h=P.call(this,E),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(O(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,W){var C=h.props.prefixCls,F=j||r.a.createElement("button",{type:"button","aria-label":W,className:"".concat(C,"-item-link")});return typeof j=="function"&&(F=r.a.createElement(j,Object(B.a)({},h.props))),F},h.savePaginationNode=function(j){h.paginationNode=j},h.isValid=function(j){return u(j)&&j!==h.state.current},h.shouldDisplayQuickJumper=function(){var j=h.props,W=j.showQuickJumper,C=j.pageSize,F=j.total;return F<=C?!1:W},h.handleKeyDown=function(j){(j.keyCode===a.ARROW_UP||j.keyCode===a.ARROW_DOWN)&&j.preventDefault()},h.handleKeyUp=function(j){var W=h.getValidValue(j),C=h.state.currentInputValue;W!==C&&h.setState({currentInputValue:W}),j.keyCode===a.ENTER?h.handleChange(W):j.keyCode===a.ARROW_UP?h.handleChange(W-1):j.keyCode===a.ARROW_DOWN&&h.handleChange(W+1)},h.changePageSize=function(j){var W=h.state.current,C=O(j,h.state,h.props);W=W>C?C:W,C===0&&(W=h.state.current),typeof j=="number"&&("pageSize"in h.props||h.setState({pageSize:j}),"current"in h.props||h.setState({current:W,currentInputValue:W})),h.props.onShowSizeChange(W,j),"onChange"in h.props&&h.props.onChange&&h.props.onChange(W,j)},h.handleChange=function(j){var W=h.props.disabled,C=j;if(h.isValid(C)&&!W){var F=O(void 0,h.state,h.props);C>F?C=F:C<1&&(C=1),"current"in h.props||h.setState({current:C,currentInputValue:C});var k=h.state.pageSize;return h.props.onChange(C,k),C}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<O(void 0,h.state,h.props)},h.runIfEnter=function(j,W){if(j.key==="Enter"||j.charCode===13){for(var C=arguments.length,F=new Array(C>2?C-2:0),k=2;k<C;k++)F[k-2]=arguments[k];W.apply(void 0,F)}},h.runIfEnterPrev=function(j){h.runIfEnter(j,h.prev)},h.runIfEnterNext=function(j){h.runIfEnter(j,h.next)},h.runIfEnterJumpPrev=function(j){h.runIfEnter(j,h.jumpPrev)},h.runIfEnterJumpNext=function(j){h.runIfEnter(j,h.jumpNext)},h.handleGoTO=function(j){(j.keyCode===a.ENTER||j.type==="click")&&h.handleChange(h.state.currentInputValue)};var f=E.onChange!==t,T="current"in E;T&&!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 x=E.defaultCurrent;"current"in E&&(x=E.current);var _=E.defaultPageSize;return"pageSize"in E&&(_=E.pageSize),x=Math.min(x,O(_,void 0,E)),h.state={current:x,currentInputValue:x,pageSize:_},h}return Object(K.a)(w,[{key:"componentDidUpdate",value:function(h,f){var T=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var x=this.paginationNode.querySelector(".".concat(T,"-item-").concat(f.current));x&&document.activeElement===x&&x.blur()}}},{key:"getValidValue",value:function(h){var f=h.target.value,T=O(void 0,this.state,this.props),x=this.state.currentInputValue,_;return f===""?_=f:isNaN(Number(f))?_=x:f>=T?_=T:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var h=this.props,f=h.showSizeChanger,T=h.total,x=h.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:T>x}},{key:"renderPrev",value:function(h){var f=this.props,T=f.prevIcon,x=f.itemRender,_=x(h,"prev",this.getItemIcon(T,"prev page")),j=!this.hasPrev();return Object(V.isValidElement)(_)?Object(V.cloneElement)(_,{disabled:j}):_}},{key:"renderNext",value:function(h){var f=this.props,T=f.nextIcon,x=f.itemRender,_=x(h,"next",this.getItemIcon(T,"next page")),j=!this.hasNext();return Object(V.isValidElement)(_)?Object(V.cloneElement)(_,{disabled:j}):_}},{key:"render",value:function(){var h=this,f=this.props,T=f.prefixCls,x=f.className,_=f.style,j=f.disabled,W=f.hideOnSinglePage,C=f.total,F=f.locale,k=f.showQuickJumper,y=f.showLessItems,H=f.showTitle,J=f.showTotal,ae=f.simple,fe=f.itemRender,ge=f.showPrevNextJumpers,Te=f.jumpPrevIcon,Ue=f.jumpNextIcon,Se=f.selectComponentClass,Le=f.selectPrefixCls,ye=f.pageSizeOptions,Z=this.state,v=Z.current,L=Z.pageSize,z=Z.currentInputValue;if(W===!0&&C<=L)return null;var ee=O(void 0,this.state,this.props),$=[],Ee=null,Fe=null,qe=null,Ce=null,Me=null,He=k&&k.goButton,Ke=y?1:2,ut=v-1>0?v-1:0,bt=v+1<ee?v+1:ee,Lt=Object.keys(this.props).reduce(function(de,he){return(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(de[he]=h.props[he]),de},{});if(ae)return He&&(typeof He=="boolean"?Me=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F.jump_to_confirm):Me=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},He),Me=r.a.createElement("li",{title:H?"".concat(F.jump_to).concat(v,"/").concat(ee):null,className:"".concat(T,"-simple-pager")},Me)),r.a.createElement("ul",Object(ne.a)({className:m()(T,"".concat(T,"-simple"),Object(Q.a)({},"".concat(T,"-disabled"),j),x),style:_,ref:this.savePaginationNode},Lt),r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(T,"-prev"),Object(Q.a)({},"".concat(T,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ut)),r.a.createElement("li",{title:H?"".concat(v,"/").concat(ee):null,className:"".concat(T,"-simple-pager")},r.a.createElement("input",{type:"text",value:z,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(T,"-slash")},"/"),ee),r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(T,"-next"),Object(Q.a)({},"".concat(T,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(bt)),Me);if(ee<=3+Ke*2){var Ft={locale:F,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:fe};ee||$.push(r.a.createElement(g,Object(ne.a)({},Ft,{key:"noPager",page:ee,className:"".concat(T,"-disabled")})));for(var Yt=1;Yt<=ee;Yt+=1){var Xt=v===Yt;$.push(r.a.createElement(g,Object(ne.a)({},Ft,{key:Yt,page:Yt,active:Xt})))}}else{var Je=y?F.prev_3:F.prev_5,Qe=y?F.next_3:F.next_5;ge&&(Ee=r.a.createElement("li",{title:H?Je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(T,"-jump-prev"),Object(Q.a)({},"".concat(T,"-jump-prev-custom-icon"),!!Te))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),Fe=r.a.createElement("li",{title:H?Qe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(T,"-jump-next"),Object(Q.a)({},"".concat(T,"-jump-next-custom-icon"),!!Ue))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ue,"next page")))),Ce=r.a.createElement(g,{locale:F,last:!0,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ee,page:ee,active:!1,showTitle:H,itemRender:fe}),qe=r.a.createElement(g,{locale:F,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:fe});var _t=Math.max(1,v-Ke),xt=Math.min(v+Ke,ee);v-1<=Ke&&(xt=1+Ke*2),ee-v<=Ke&&(_t=ee-Ke*2);for(var _e=_t;_e<=xt;_e+=1){var ie=v===_e;$.push(r.a.createElement(g,{locale:F,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:_e,page:_e,active:ie,showTitle:H,itemRender:fe}))}v-1>=Ke*2&&v!==1+2&&($[0]=Object(V.cloneElement)($[0],{className:"".concat(T,"-item-after-jump-prev")}),$.unshift(Ee)),ee-v>=Ke*2&&v!==ee-2&&($[$.length-1]=Object(V.cloneElement)($[$.length-1],{className:"".concat(T,"-item-before-jump-next")}),$.push(Fe)),_t!==1&&$.unshift(qe),xt!==ee&&$.push(Ce)}var oe=null;J&&(oe=r.a.createElement("li",{className:"".concat(T,"-total-text")},J(C,[C===0?0:(v-1)*L+1,v*L>C?C:v*L])));var ce=!this.hasPrev()||!ee,we=!this.hasNext()||!ee;return r.a.createElement("ul",Object(ne.a)({className:m()(T,x,Object(Q.a)({},"".concat(T,"-disabled"),j)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Lt),oe,r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(T,"-prev"),Object(Q.a)({},"".concat(T,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(ut)),$,r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:we?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(T,"-next"),Object(Q.a)({},"".concat(T,"-disabled"),we)),"aria-disabled":we},this.renderNext(bt)),r.a.createElement(s,{disabled:j,locale:F,rootPrefixCls:T,selectComponentClass:Se,selectPrefixCls:Le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:v,pageSize:L,pageSizeOptions:ye,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:He}))}}],[{key:"getDerivedStateFromProps",value:function(h,f){var T={};if("current"in h&&(T.current=h.current,h.current!==f.current&&(T.currentInputValue=T.current)),"pageSize"in h&&h.pageSize!==f.pageSize){var x=f.current,_=O(h.pageSize,f,h);x=x>_?_:x,"current"in h||(T.current=x,T.currentInputValue=x),T.pageSize=h.pageSize}return T}}]),w}(r.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var R=S},"69hG":function(wt,Pe,U){wt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(wt,Pe,U){"use strict";var ne=U("wCXF"),Q=U("n6Qo");U.d(Pe,"b",function(){return Q.a});var B=U("IBYe"),q=U("6eGT"),K=U("hW8S");U.d(Pe,"a",function(){return K.a}),Pe.c=ne.b},"6UM0":function(wt,Pe,U){var ne,Q;(function(){var B;(function(){"use strict";var K=[function(r,D,m){var p=m(1).Beautifier,g=m(5).Options;function a(c,s){var i=new p(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new g}},function(r,D,m){var p=m(2).Output,g=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(y,H){return H.indexOf(y)!==-1}function O(y){return y.replace(/^\s+/g,"")}function S(y){for(var H={},J=0;J<y.length;J++)H[y[J].replace(/-/g,"_")]=y[J];return H}function R(y,H){return y&&y.type===u.RESERVED&&y.text===H}function A(y,H){return y&&y.type===u.RESERVED&&o(y.text,H)}var P=["case","return","do","if","throw","else","await","break","continue","async"],w=["before-newline","after-newline","preserve-newline"],E=S(w),h=[E.before_newline,E.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(y,H){if(H.multiline_frame||H.mode===f.ForInitializer||H.mode===f.Conditional)return;y.remove_indent(H.start_line_index)}function x(y){y=y.replace(a.allLineBreaks,`
|
|
`);for(var H=[],J=y.indexOf(`
|
|
`);J!==-1;)H.push(y.substring(0,J)),y=y.substring(J+1),J=y.indexOf(`
|
|
`);return y.length&&H.push(y),H}function _(y){return y===f.ArrayLiteral}function j(y){return o(y,[f.Expression,f.ForInitializer,f.Conditional])}function W(y,H){for(var J=0;J<y.length;J++){var ae=y[J].trim();if(ae.charAt(0)!==H)return!1}return!0}function C(y,H){for(var J=0,ae=y.length,fe;J<ae;J++)if(fe=y[J],fe&&fe.indexOf(H)!==0)return!1;return!0}function F(y,H){H=H||{},this._source_text=y||"",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(y,H){var J=0;y&&(J=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>J&&(J=y.line_indent_level));var ae={mode:H,parent:y,last_token:y?y.last_token:new g(u.START_BLOCK,""),last_word:y?y.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:J,alignment:0,line_indent_level:y?y.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},F.prototype._reset=function(y){var H=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var J=new s(y,this._options);return this._tokens=J.tokenize(),y},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,H=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
`,H&&a.lineBreak.test(H||"")&&(J=H.match(a.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return y=this._output.get_code(J),y},F.prototype.handle_token=function(y,H){y.type===u.START_EXPR?this.handle_start_expr(y):y.type===u.END_EXPR?this.handle_end_expr(y):y.type===u.START_BLOCK?this.handle_start_block(y):y.type===u.END_BLOCK?this.handle_end_block(y):y.type===u.WORD?this.handle_word(y):y.type===u.RESERVED?this.handle_word(y):y.type===u.SEMICOLON?this.handle_semicolon(y):y.type===u.STRING?this.handle_string(y):y.type===u.EQUALS?this.handle_equals(y):y.type===u.OPERATOR?this.handle_operator(y):y.type===u.COMMA?this.handle_comma(y):y.type===u.BLOCK_COMMENT?this.handle_block_comment(y,H):y.type===u.COMMENT?this.handle_comment(y,H):y.type===u.DOT?this.handle_dot(y):y.type===u.EOF?this.handle_eof(y):y.type===u.UNKNOWN?this.handle_unknown(y,H):this.handle_unknown(y,H)},F.prototype.handle_whitespace_and_comments=function(y,H){var J=y.newlines,ae=this._options.keep_array_indentation&&_(this._flags.mode);if(y.comments_before)for(var fe=y.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,H),this.handle_token(fe,H),fe=y.comments_before.next();if(ae)for(var ge=0;ge<J;ge+=1)this.print_newline(ge>0,H);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,H);for(var Te=1;Te<J;Te+=1)this.print_newline(!0,H)}};var k=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(y,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&y.newlines||H,ae=o(this._flags.last_token.text,t)||o(y.text,t);if(ae){var fe=o(this._flags.last_token.text,t)&&o(this._options.operator_position,h)||o(y.text,t);J=J&&fe}if(J)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,k))return;this._output.set_wrap_point()}},F.prototype.print_newline=function(y,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 J=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&R(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.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(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.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(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.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(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),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&&T(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(y){var H=!1;return H=H||A(this._flags.last_token,["var","let","const"])&&y.type===u.WORD,H=H||R(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,k)&&!y.newlines,H=H||R(this._flags.last_token,"else")&&!(R(y,"if")&&!y.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&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==u.WORD&&y.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(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,A(y,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var H=f.Expression;if(y.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(y),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"&&y.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(y);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var ae=this._tokens.peek(-4);A(J,["async","function"])||J.text==="*"&&A(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(ae.text==="{"||ae.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(y);(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(y,y.newlines),this.print_token(y),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(y){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.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(y),this.restore_mode(),T(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(y){this.handle_whitespace_and_comments(y);var H=this._tokens.peek(),J=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):J&&(o(J.text,[":",","])&&o(H.type,[u.STRING,u.WORD,u.RESERVED])||o(H.text,["get","set","..."])&&o(J.type,[u.WORD,u.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(J.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 ae=!H.comments_before&&H.text==="}",fe=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,Te=null;this._flags.inline_frame=!0;do if(ge+=1,Te=this._tokens.peek(ge-1),Te.newlines){this._flags.inline_frame=!1;break}while(Te.type!==u.EOF&&!(Te.type===u.END_BLOCK&&Te.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(fe||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,P)&&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(y),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(y),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);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(y)},F.prototype.handle_word=function(y){if(y.type===u.RESERVED){if(o(y.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)y.type=u.WORD;else if(y.text==="import"&&o(this._tokens.peek().text,["(","."]))y.type=u.WORD;else if(o(y.text,["as","from"])&&!this._flags.import_block)y.type=u.WORD;else if(this._flags.mode===f.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(y.type=u.WORD)}}if(this.start_of_statement(y)?A(this._flags.last_token,["var","let","const"])&&y.type===u.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!j(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(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(R(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&R(y,"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(y,["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(y),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(y)),R(y,"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()&&!y.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,k)?this._output.space_before_token=!0:R(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&&(j(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var J="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":A(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===f.BlockStatement?J="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&j(this._flags.mode)?J="SPACE":this._flags.last_token.type===u.STRING?J="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,["{",","]))?J="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),A(y,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),A(y,["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"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?A(this._flags.last_token,P)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(y,["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(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(R(y,"if")&&R(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(y,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():J==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===u.WORD||y.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===u.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&R(y,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var H=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&R(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},F.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),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(y):y.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},F.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},F.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)):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(y)},F.prototype.handle_operator=function(y){var H=y.text==="*"&&(A(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),J=o(y.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(y)){var ae=!H;this.handle_whitespace_and_comments(y,ae)}if(y.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===u.OPERATOR&&o(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),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 fe=!0,ge=!0,Te=!1;if(y.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Te=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!J&&!H&&this._options.preserve_newlines&&o(y.text,t)){var Ue=y.text===":",Se=Ue&&Te,Le=Ue&&!Te;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Le,this.print_token(y),(!Ue||Se)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!Ue||Se?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case E.preserve_newline:Le||this.allow_wrap_or_preserved_newline(y),fe=!(this._output.just_added_newline()||Le),this._output.space_before_token=fe,this.print_token(y),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(y),fe=!1;var ye=this._tokens.peek();ge=ye&&o(ye.type,[u.WORD,u.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),fe=this._flags.last_token.type===u.START_BLOCK,ge=!1;else if(o(y.text,["--","++","!","~"])||J){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),fe=!1,ge=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var Z=A(this._flags.last_token,P)&&y.newlines;Z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Z,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(fe=!0),this._flags.last_token.type===u.RESERVED?fe=!0:this._flags.last_token.type===u.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===u.OPERATOR&&(fe=o(y.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(y.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(ge=!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||fe,this.print_token(y),this._output.space_before_token=ge},F.prototype.handle_block_comment=function(y,H){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,H),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,H)},F.prototype.print_block_commment=function(y,H){var J=x(y.text),ae,fe=!1,ge=!1,Te=y.whitespace_before,Ue=Te.length;if(this.print_newline(!1,H),this.print_token_line_indentation(y),this._output.add_token(J[0]),this.print_newline(!1,H),J.length>1){for(J=J.slice(1),fe=W(J,"*"),ge=C(J,Te),fe&&(this._flags.alignment=1),ae=0;ae<J.length;ae++)fe?(this.print_token_line_indentation(y),this._output.add_token(O(J[ae]))):ge&&J[ae]?(this.print_token_line_indentation(y),this._output.add_token(J[ae].substring(Ue))):(this._output.current_line.set_indent(-1),this._output.add_token(J[ae])),this.print_newline(!1,H);this._flags.alignment=0}},F.prototype.handle_comment=function(y,H){y.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,H)},F.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,P)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,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(y)},F.prototype.handle_unknown=function(y,H){this.print_token(y),y.text[y.text.length-1]===`
|
|
`&&this.print_newline(!1,H)},F.prototype.handle_eof=function(y){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},r.exports.Beautifier=F},function(r){function D(g){this.__parent=g,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 g=new D(this.__parent);return g.set_indent(this.__indent_count,this.__alignment_count),g},D.prototype.item=function(g){return g<0?this.__items[this.__items.length+g]:this.__items[g]},D.prototype.has_match=function(g){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(g))return!0;return!1},D.prototype.set_indent=function(g,a){this.is_empty()&&(this.__indent_count=g||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 g=this.__parent.current_line;return g.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),g.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),g.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,g.__items[0]===" "&&(g.__items.splice(0,1),g.__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(g){this.__items.push(g);var a=g.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=g.length-a:this.__character_count+=g.length},D.prototype.pop=function(){var g=null;return this.is_empty()||(g=this.__items.pop(),this.__character_count-=g.length),g},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 g="";return this.is_empty()?this.__parent.indent_empty_lines&&(g=this.__parent.get_indent_string(this.__indent_count)):(g=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),g+=this.__items.join("")),g};function m(g,a){this.__cache=[""],this.__indent_size=g.indent_size,this.__indent_string=g.indent_char,g.indent_with_tabs||(this.__indent_string=new Array(g.indent_size+1).join(g.indent_char)),a=a||"",g.indent_level>0&&(a=new Array(g.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(g,a){var c=this.__base_string_length;return a=a||0,g<0&&(c=0),c+=g*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(g,a){var c=this.__base_string;return a=a||0,g<0&&(g=0,c=""),a+=g*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(g){for(;g>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var g=this.__cache.length,a=0,c="";this.__indent_size&&g>=this.__indent_size&&(a=Math.floor(g/this.__indent_size),g-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),g&&(c+=new Array(g+1).join(" ")),this.__cache.push(c)};function p(g,a){this.__indent_cache=new m(g,a),this.raw=!1,this._end_with_newline=g.end_with_newline,this.indent_size=g.indent_size,this.wrap_line_length=g.wrap_line_length,this.indent_empty_lines=g.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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(g,a){return this.__indent_cache.get_indent_string(g,a)},p.prototype.get_indent_size=function(g,a){return this.__indent_cache.get_indent_size(g,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(g){return this.is_empty()||!g&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(g){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 g!==`
|
|
`&&(c=c.replace(/[\n]/g,g)),c},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(g,a){return g=g||0,a=a||0,this.next_line.set_indent(g,a),this.__lines.length>1?(this.current_line.set_indent(g,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(g){for(var a=0;a<g.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(g.whitespace_before),this.current_line.push(g.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(g){this.__add_space_before_token(),this.current_line.push(g),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(g){for(var a=this.__lines.length;g<a;)this.__lines[g]._remove_indent(),g++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(g){for(g=g===void 0?!1:g,this.current_line.trim();g&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(g,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(g)!==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=p},function(r){function D(m,p,g,a){this.type=m,this.text=p,this.comments_before=null,this.newlines=g||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",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\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+g+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+p+g+a+"])*";D.identifier=new RegExp(c+s,"g"),D.identifierStart=new RegExp(c),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+g+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 p=m(6).Options,g=["before-newline","after-newline","preserve-newline"];function a(c){p.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",g),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new p,r.exports.Options=a},function(r){function D(g,a){this.raw_options=m(g,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(g,a){var c=this.raw_options[g],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(g,a){var c=this.raw_options[g],s=c===void 0?!!a:!!c;return s},D.prototype._get_characters=function(g,a){var c=this.raw_options[g],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},D.prototype._get_number=function(g,a){var c=this.raw_options[g];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(g,a,c){var s=this._get_selection_list(g,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+g+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[g]+"'");return s[0]},D.prototype._get_selection_list=function(g,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(g,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+g+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[g]+"'");return s},D.prototype._is_valid_selection=function(g,a){return g.length&&a.length&&!g.some(function(c){return a.indexOf(c)===-1})};function m(g,a){var c={};g=p(g);var s;for(s in g)s!==a&&(c[s]=g[s]);if(a&&g[a])for(s in g[a])c[s]=g[a][s];return c}function p(g){var a={},c;for(c in g){var s=c.replace(/-/g,"_");a[s]=g[c]}return a}r.exports.Options=D,r.exports.normalizeOpts=p,r.exports.mergeOpts=m},function(r,D,m){var p=m(8).InputScanner,g=m(9).Tokenizer,a=m(9).TOKEN,c=m(13).Directives,s=m(4),i=m(12).Pattern,t=m(14).TemplatablePattern;function u(W,C){return C.indexOf(W)!==-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},O=new c(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,R=/[0-9]/,A=/[^\d\.]/,P=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var E=new RegExp(w),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"]),T=new RegExp("^(?:"+f.join("|")+")$"),x,_=function(W,C){g.call(this,W,C),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),k=new t(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(s.identifier).matching(s.identifierMatch),number:F.matching(S),punct:F.matching(E),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:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};_.prototype=new g,_.prototype._is_comment=function(W){return W.type===o.COMMENT||W.type===o.BLOCK_COMMENT||W.type===o.UNKNOWN},_.prototype._is_opening=function(W){return W.type===o.START_BLOCK||W.type===o.START_EXPR},_.prototype._is_closing=function(W,C){return(W.type===o.END_BLOCK||W.type===o.END_EXPR)&&C&&(W.text==="]"&&C.text==="["||W.text===")"&&C.text==="("||W.text==="}"&&C.text==="{")},_.prototype._reset=function(){x=!1},_.prototype._get_next_token=function(W,C){var F=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(o.EOF,""):(F=F||this._read_non_javascript(k),F=F||this._read_string(k),F=F||this._read_word(W),F=F||this._read_singles(k),F=F||this._read_comment(k),F=F||this._read_regexp(k,W),F=F||this._read_xml(k,W),F=F||this._read_punctuation(),F=F||this._create_token(o.UNKNOWN,this._input.next()),F)},_.prototype._read_word=function(W){var C;if(C=this.__patterns.identifier.read(),C!=="")return C=C.replace(s.allLineBreaks,`
|
|
`),!(W.type===o.DOT||W.type===o.RESERVED&&(W.text==="set"||W.text==="get"))&&T.test(C)?(C==="in"||C==="of")&&(W.type===o.WORD||W.type===o.STRING)?this._create_token(o.OPERATOR,C):this._create_token(o.RESERVED,C):this._create_token(o.WORD,C);if(C=this.__patterns.number.read(),C!=="")return this._create_token(o.WORD,C)},_.prototype._read_singles=function(W){var C=null;return W==="("||W==="["?C=this._create_token(o.START_EXPR,W):W===")"||W==="]"?C=this._create_token(o.END_EXPR,W):W==="{"?C=this._create_token(o.START_BLOCK,W):W==="}"?C=this._create_token(o.END_BLOCK,W):W===";"?C=this._create_token(o.SEMICOLON,W):W==="."&&A.test(this._input.peek(1))?C=this._create_token(o.DOT,W):W===","&&(C=this._create_token(o.COMMA,W)),C&&this._input.next(),C},_.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(o.EQUALS,W):W==="?."?this._create_token(o.DOT,W):this._create_token(o.OPERATOR,W)},_.prototype._read_non_javascript=function(W){var C="";if(W==="#"){if(this._is_first_token()&&(C=this.__patterns.shebang.read(),C))return this._create_token(o.UNKNOWN,C.trim()+`
|
|
`);if(C=this.__patterns.include.read(),C)return this._create_token(o.UNKNOWN,C.trim()+`
|
|
`);W=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(R)){do W=this._input.next(),F+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(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(W==="<"&&this._is_first_token()){if(C=this.__patterns.html_comment_start.read(),C){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)C+=this._input.next();return x=!0,this._create_token(o.COMMENT,C)}}else if(x&&W==="-"&&(C=this.__patterns.html_comment_end.read(),C))return x=!1,this._create_token(o.COMMENT,C);return null},_.prototype._read_comment=function(W){var C=null;if(W==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var k=O.get_directives(F);k&&k.ignore==="start"&&(F+=O.readIgnored(this._input)),F=F.replace(s.allLineBreaks,`
|
|
`),C=this._create_token(o.BLOCK_COMMENT,F),C.directives=k}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),C=this._create_token(o.COMMENT,F))}return C},_.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var C=this._input.next();return this.has_char_escapes=!1,W==="`"?C+=this._read_string_recursive("`",!0,"${"):C+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(C=j(C)),this._input.peek()===W&&(C+=this._input.next()),C=C.replace(s.allLineBreaks,`
|
|
`),this._create_token(o.STRING,C)}return null},_.prototype._allow_regexp_or_xml=function(W){return W.type===o.RESERVED&&u(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===o.END_EXPR&&W.text===")"&&W.opened.previous.type===o.RESERVED&&u(W.opened.previous.text,["if","while","for"])||u(W.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(W,C){if(W==="/"&&this._allow_regexp_or_xml(C)){for(var F=this._input.next(),k=!1,y=!1;this._input.hasNext()&&(k||y||this._input.peek()!==W)&&!this._input.testChar(s.newline);)F+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===W&&(F+=this._input.next(),F+=this._input.read(s.identifier)),this._create_token(o.STRING,F)}return null},_.prototype._read_xml=function(W,C){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(C)){var F="",k=this.__patterns.xml.read_match();if(k){for(var y=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=y.indexOf("{")===0,J=0;k;){var ae=!!k[1],fe=k[2],ge=!!k[k.length-1]||fe.slice(0,8)==="![CDATA[";if(!ge&&(fe===y||H&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--J:++J),F+=k[0],J<=0)break;k=this.__patterns.xml.read_match()}return k||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(s.allLineBreaks,`
|
|
`),this._create_token(o.STRING,F)}}return null};function j(W){for(var C="",F=0,k=new p(W),y=null;k.hasNext();)if(y=k.match(/([\s]|[^\\]|\\\\)+/g),y&&(C+=y[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")y=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")y=k.match(/u([0-9A-Fa-f]{4})/g);else{C+="\\",k.hasNext()&&(C+=k.next());continue}if(!y)return W;if(F=parseInt(y[1],16),F>126&&F<=255&&y[0].indexOf("x")===0)return W;if(F>=0&&F<32){C+="\\"+y[0];continue}else F===34||F===39||F===92?C+="\\"+String.fromCharCode(F):C+=String.fromCharCode(F)}return C}_.prototype._read_string_recursive=function(W,C,F){var k,y;W==="'"?y=this.__patterns.single_quote:W==='"'?y=this.__patterns.double_quote:W==="`"?y=this.__patterns.template_text:W==="}"&&(y=this.__patterns.template_expression);for(var H=y.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===W||!C&&s.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),J+=this._input.next()):F&&(F==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),F===J&&(W==="`"?J+=this._read_string_recursive("}",C,"`"):J+=this._read_string_recursive("`",C,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=y.read(),H+=J}return H},r.exports.Tokenizer=_,r.exports.TOKEN=o,r.exports.positionable_operators=P.slice(),r.exports.line_starters=h.slice()},function(r){var D=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var g=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(g=this.__input.charAt(p)),g},m.prototype.__match=function(p,g){p.lastIndex=g;var a=p.exec(this.__input);return a&&!(D&&p.sticky)&&(a.index!==g&&(a=null)),a},m.prototype.test=function(p,g){return g=g||0,g+=this.__position,g>=0&&g<this.__input_length?!!this.__match(p,g):!1},m.prototype.testChar=function(p,g){var a=this.peek(g);return p.lastIndex=0,a!==null&&p.test(a)},m.prototype.match=function(p){var g=this.__match(p,this.__position);return g?this.__position+=g[0].length:g=null,g},m.prototype.read=function(p,g,a){var c="",s;return p&&(s=this.match(p),s&&(c+=s[0])),g&&(s||!p)&&(c+=this.readUntil(g,a)),c},m.prototype.readUntil=function(p,g){var a="",c=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(c=s.index,g&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,g){var a=null,c="g";return g&&D&&(c="y"),typeof p=="string"&&p!==""?a=new RegExp(p,c):p&&(a=new RegExp(p.source,c)),a},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var g=this.__position,a=this.readUntilAfter(p);return this.__position=g,a},m.prototype.lookBack=function(p){var g=this.__position-1;return g>=p.length&&this.__input.substring(g-p.length,g).toLowerCase()===p},r.exports.InputScanner=m},function(r,D,m){var p=m(8).InputScanner,g=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 p(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 g(s.START,""),o=null,O=[],S=new a;u.type!==s.EOF;){for(t=this._get_next_token(u,o);this._is_comment(t);)S.add(t),t=this._get_next_token(u,o);S.isEmpty()||(t.comments_before=S,S=new a),t.parent=o,this._is_opening(t)?(O.push(o),o=t):o&&this._is_closing(t,o)&&(t.opened=o,o.closed=t,o=O.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 g(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 p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(p=this.__tokens[m]),p},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 p=m(12).Pattern;function g(a,c){p.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=""}g.prototype=new p,g.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+"]")},g.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},g.prototype.matching=function(a,c){var s=this._create();return s.__set_whitespace_patterns(a,c),s._update(),s},g.prototype._create=function(){return new g(this._input,this)},g.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=g},function(r){function D(m,p){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}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 p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(m),p._update(),p},D.prototype.until=function(m){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(m),p._update(),p},D.prototype.starting_with=function(m){var p=this._create();return p._starting_pattern=this._input.get_regexp(m,!0),p._update(),p},D.prototype.matching=function(m){var p=this._create();return p._match_pattern=this._input.get_regexp(m,!0),p._update(),p},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},r.exports.Pattern=D},function(r){function D(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var g=this.__directive_pattern.exec(m);g;)p[g[1]]=g[2],g=this.__directive_pattern.exec(m);return p},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},function(r,D,m){var p=m(12).Pattern,g={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(c,s){p.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},g),this._excluded=Object.assign({},g),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 p(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 p,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 g)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}],M={};function Y(r){var D=M[r];if(D!==void 0)return D.exports;var m=M[r]={exports:{}};return K[r](m,m.exports,Y),m.exports}var V=Y(0);B=V})();var q=B;!(ne=[],Q=function(){return{js_beautify:q}}.apply(Pe,ne),Q!==void 0&&(wt.exports=Q))})()},"6eGT":function(wt,Pe,U){"use strict";function ne(Q){return null}Pe.a=ne},"746U":function(wt,Pe,U){"use strict";U.d(Pe,"f",function(){return ne}),U.d(Pe,"l",function(){return Q}),U.d(Pe,"k",function(){return B}),U.d(Pe,"j",function(){return q}),U.d(Pe,"g",function(){return K}),U.d(Pe,"m",function(){return M}),U.d(Pe,"h",function(){return Y}),U.d(Pe,"n",function(){return V}),U.d(Pe,"c",function(){return r}),U.d(Pe,"a",function(){return D}),U.d(Pe,"i",function(){return m}),U.d(Pe,"o",function(){return p}),U.d(Pe,"e",function(){return c}),U.d(Pe,"d",function(){return s}),U.d(Pe,"p",function(){return i}),U.d(Pe,"b",function(){return t});function ne(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 q(u){return typeof u=="number"&&!isNaN(u)}function K(u){return u===!0||u===!1}function M(u){return typeof u=="undefined"}function Y(u){return!V(u)}function V(u){return M(u)||u===null}function r(u,o){if(!u)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function D(u){if(V(u))throw new Error("Assertion Failed: argument is undefined or null");return u}function m(u){return typeof u=="function"}function p(u,o){const O=Math.min(u.length,o.length);for(let S=0;S<O;S++)g(u[S],o[S])}function g(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(O){}if(!V(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=[],O=Object.getPrototypeOf(u);for(;Object.prototype!==O;)o=o.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return o}function c(u){const o=[];for(const O of a(u))typeof u[O]=="function"&&o.push(O);return o}function s(u,o){const O=R=>function(){const A=Array.prototype.slice.call(arguments,0);return o(R,A)};let S={};for(const R of u)S[R]=O(R);return S}function i(u){return u===null?void 0:u}function t(u,o="Unreachable"){throw new Error(o)}},"7Cbv":function(wt,Pe,U){"use strict";var ne=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(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(Q)}var q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function K(g){return typeof g=="string"&&q.test(g)}for(var M=K,Y=[],V=0;V<256;++V)Y.push((V+256).toString(16).substr(1));function r(g){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=(Y[g[a+0]]+Y[g[a+1]]+Y[g[a+2]]+Y[g[a+3]]+"-"+Y[g[a+4]]+Y[g[a+5]]+"-"+Y[g[a+6]]+Y[g[a+7]]+"-"+Y[g[a+8]]+Y[g[a+9]]+"-"+Y[g[a+10]]+Y[g[a+11]]+Y[g[a+12]]+Y[g[a+13]]+Y[g[a+14]]+Y[g[a+15]]).toLowerCase();if(!M(c))throw TypeError("Stringified UUID is invalid");return c}var D=r;function m(g,a,c){g=g||{};var s=g.random||(g.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 p=Pe.a=m},"7ahc":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return O});var ne=U("k1fw"),Q=U("0Owb"),B=U("+L6B"),q=U("2/Rp"),K=U("y8nQ"),M=U("Vl3Y"),Y=U("tJVT"),V=U("OaEy"),r=U("2fM7"),D=U("q1tI"),m=U.n(D),p=U("VrN/"),g=U.n(p),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"]};Pe.b=function(S){var R=S.callback,A=S.onCancel,P=Object(D.useState)("python"),w=Object(Y.a)(P,2),E=w[0],h=w[1];function f(x){h(o[x][1])}function T(x){R(x)}return m.a.createElement(M.a,Object(Q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(r.a,{onChange:f},Object.keys(o).map(function(x){return m.a.createElement(t,{key:x,value:x},o[x][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(O,{mode:E})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(q.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function O(S){var R=S.value,A=S.onChange,P=S.mode,w=S.options,E=w===void 0?{}:w,h=Object(D.useRef)(),f=Object(D.useState)(),T=Object(Y.a)(f,2),x=T[0],_=T[1];return Object(D.useEffect)(function(){if(x){function j(W){var C=W.getValue();A&&A(C)}return x.on("change",j),function(){x.off("change",j)}}},[x,A]),Object(D.useEffect)(function(){x&&x.setOption("mode",P)},[x,P]),Object(D.useEffect)(function(){x&&((R!==x.getValue()||R==="")&&setTimeout(function(){x.setValue(R||" ")},300))},[x,R]),Object(D.useEffect)(function(){if(h.current&&!x){var j=g.a.fromTextArea(h.current,Object(ne.a)({mode:P,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));_(j)}},[h.current,x]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:h}))}},"7qnI":function(wt,Pe,U){"use strict";var ne=U("5Dmo"),Q=U("3S7+"),B=U("fWQN"),q=U("mtLc"),K=U("yKVA"),M=U("879j"),Y=U("5NDa"),V=U("5rEg"),r=U("q1tI"),D=U.n(r),m=U("O2Wb"),p=U.n(m),g=V.a.TextArea,a=function(c){Object(K.a)(i,c);var s=Object(M.a)(i);function i(){return Object(B.a)(this,i),s.apply(this,arguments)}return Object(q.a)(i,[{key:"render",value:function(){var u=this,o=this.props,O=o.index,S=o.onAnswerChange,R=o.addChildAnswer,A=o.exerciseIsPublish,P=o.answers,w=o.activeOptionErrorIndex,E=o.flex,h=E===void 0?"0 0 1000px":E;return D.a.createElement("div",{className:p.a.flex},D.a.createElement("div",{className:"".concat(p.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",O+1,"):"),D.a.createElement("div",{className:"".concat(p.a.flex," ").concat(p.a.flex1),style:{flexDirection:"column"}},P.map(function(f,T){var x="".concat(O,"-").concat(T);return D.a.createElement("div",{className:"".concat(p.a.flex," ").concat(p.a.flex1),key:T},D.a.createElement("div",{className:p.a.flex1,style:{flex:h}},D.a.createElement("div",null,D.a.createElement(g,{className:x===w?p.a.error:"",spellCheck:!1,rows:4,value:f||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(T==0?"":"(\u53EF\u9009)"),onChange:function(j){return S(O,T,j.target.value)},style:{minHeight:95}}))),!A&&D.a.createElement(D.a.Fragment,null,T!=0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(p.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswer(O,T)},style:{float:"right"}})),T===0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(p.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswermain(O,T)},style:{float:"right"}})),D.a.createElement(Q.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(p.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return R(O)},style:{float:"right",visibility:T==P.length-1?"":"hidden"}}))))})))}}]),i}(r.Component);Pe.a=a},"815F":function(wt,Pe,U){"use strict";U.d(Pe,"e",function(){return Y}),U.d(Pe,"c",function(){return r}),U.d(Pe,"d",function(){return D}),U.d(Pe,"a",function(){return p}),U.d(Pe,"f",function(){return g}),U.d(Pe,"b",function(){return a});var ne=U("KQm4"),Q=U("VTBJ"),B=U("Ff2n"),q=U("Zm9Q"),K=U("Kwbf"),M=U("OZM5");function Y(c,s){return c!=null?c:s}function V(){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 O=o.key,S=o.children;Object(K.a)(O!=null,"Tree node must have a certain key: [".concat(u).concat(O,"]"));var R=String(O);Object(K.a)(!s.has(R)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(R)),s.set(R,!0),i(S,"".concat(u).concat(R," > "))})}i(c)}function r(c){function s(i){var t=Object(q.a)(i);return t.map(function(u){if(!Object(M.i)(u))return Object(K.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var o=u.key,O=u.props,S=O.children,R=Object(B.a)(O,["children"]),A=Object(Q.a)({key:o},R),P=s(S);return P.length&&(A.children=P),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 O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(S,R){var A=Object(M.h)(O?O.pos:"0",R),P=Y(S.key,A),w=Object(Q.a)(Object(Q.a)({},S),{},{parent:O,pos:A,children:null,data:S,isStart:[].concat(Object(ne.a)(O?O.isStart:[]),[R===0]),isEnd:[].concat(Object(ne.a)(O?O.isEnd:[]),[R===o.length-1])});return t.push(w),s===!0||i.has(P)?w.children=u(S.children||[],w):w.children=[],w})}return u(c),t}function m(c,s,i){var t;i?typeof i=="string"?t=function(O){return O[i]}:typeof i=="function"&&(t=function(O){return i(O)}):t=function(O,S){return Y(O.key,S)};function u(o,O,S){var R=o?o.children:c,A=o?Object(M.h)(S.pos,O):"0";if(o){var P=t(o,A),w={node:o,index:O,pos:A,key:P,parentPos:S.node?S.pos:null,level:S.level+1};s(w)}R&&R.forEach(function(E,h){u(E,h,{node:o,pos:A,level:S?S.level+1:-1})})}u(null)}function p(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,O={},S={},R={posEntities:O,keyEntities:S};return i&&(R=i(R)||R),m(c,function(A){var P=A.node,w=A.index,E=A.pos,h=A.key,f=A.parentPos,T=A.level,x={node:P,index:w,key:h,pos:E,level:T},_=Y(h,E);O[E]=x,S[_]=x,x.parent=O[f],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),t&&t(x,R)},o),u&&u(R),R}function g(c,s){var i=s.expandedKeys,t=s.selectedKeys,u=s.loadedKeys,o=s.loadingKeys,O=s.checkedKeys,S=s.halfCheckedKeys,R=s.dragOverNodeKey,A=s.dropPosition,P=s.keyEntities,w=P[c],E={eventKey:c,expanded:i.indexOf(c)!==-1,selected:t.indexOf(c)!==-1,loaded:u.indexOf(c)!==-1,loading:o.indexOf(c)!==-1,checked:O.indexOf(c)!==-1,halfChecked:S.indexOf(c)!==-1,pos:String(w?w.pos:""),dragOver:R===c&&A===0,dragOverGapTop:R===c&&A===-1,dragOverGapBottom:R===c&&A===1};return E}function a(c){var s=c.data,i=c.expanded,t=c.selected,u=c.checked,o=c.loaded,O=c.loading,S=c.halfChecked,R=c.dragOver,A=c.dragOverGapTop,P=c.dragOverGapBottom,w=c.pos,E=c.active,h=Object(Q.a)(Object(Q.a)({},s),{},{expanded:i,selected:t,checked:u,loaded:o,loading:O,halfChecked:S,dragOver:R,dragOverGapTop:A,dragOverGapBottom:P,pos:w,active:E});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(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";ne.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<ne.modeInfo.length;Q++){var B=ne.modeInfo[Q];B.mimes&&(B.mime=B.mimes[0])}ne.findModeByMIME=function(q){q=q.toLowerCase();for(var K=0;K<ne.modeInfo.length;K++){var M=ne.modeInfo[K];if(M.mime==q)return M;if(M.mimes){for(var Y=0;Y<M.mimes.length;Y++)if(M.mimes[Y]==q)return M}}if(/\+xml$/.test(q))return ne.findModeByMIME("application/xml");if(/\+json$/.test(q))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(q){q=q.toLowerCase();for(var K=0;K<ne.modeInfo.length;K++){var M=ne.modeInfo[K];if(M.ext){for(var Y=0;Y<M.ext.length;Y++)if(M.ext[Y]==q)return M}}},ne.findModeByFileName=function(q){for(var K=0;K<ne.modeInfo.length;K++){var M=ne.modeInfo[K];if(M.file&&M.file.test(q))return M}var Y=q.lastIndexOf("."),V=Y>-1&&q.substring(Y+1,q.length);if(V)return ne.findModeByExtension(V)},ne.findModeByName=function(q){q=q.toLowerCase();for(var K=0;K<ne.modeInfo.length;K++){var M=ne.modeInfo[K];if(M.name.toLowerCase()==q)return M;if(M.alias){for(var Y=0;Y<M.alias.length;Y++)if(M.alias[Y].toLowerCase()==q)return M}}}})},"8HAY":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return K}),U.d(Pe,"b",function(){return M}),U.d(Pe,"d",function(){return Y}),U.d(Pe,"e",function(){return V}),U.d(Pe,"c",function(){return r});var ne=U("MI8n"),Q=U("pmY6"),B=U("3/fG"),q=function(D,m,p,g){function a(c){return c instanceof p?c:new p(function(s){s(c)})}return new(p||(p=Promise))(function(c,s){function i(o){try{u(g.next(o))}catch(O){s(O)}}function t(o){try{u(g.throw(o))}catch(O){s(O)}}function u(o){o.done?c(o.value):a(o.value).then(i,t)}u((g=g.apply(D,m||[])).next())})};class K extends Q.a{constructor(D,m="",p="",g=!0,a){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=m,this._cssClass=p,this._enabled=g,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 q(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class M extends Q.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(D,m){return q(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let p;try{yield this.runAction(D,m)}catch(g){p=g}this._onDidRun.fire({action:D,error:p})})}runAction(D,m){return q(this,void 0,void 0,function*(){yield D.run(m)})}}class Y extends K{constructor(D){super(Y.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}Y.ID="vs.actions.separator";class V{constructor(D,m,p,g){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=m,this.class=g,this._actions=p}get actions(){return this._actions}dispose(){}run(){return q(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(wt,Pe,U){wt.exports={button:"button___1wy9m"}},"9Bee":function(wt,Pe,U){"use strict";var ne=U("DYRE"),Q=U("zeV3"),B=U("+L6B"),q=U("2/Rp"),K=U("k1fw"),M=U("9og8"),Y=U("tJVT"),V=U("WmNS"),r=U.n(V),D=U("q1tI"),m=U.n(D),p=U("vg9a"),g=U("DlQD"),a=U.n(g),c=U("rUJ1");function s(_e,ie){var oe=_e.match(/^(\s+)(?:```)/);if(oe===null)return ie;var ce=oe[1];return ie.split(`
|
|
`).map(function(we){var de=we.match(/^\s+/);if(de===null)return we;var he=Object(Y.a)(de,1),Oe=he[0];return Oe.length>=ce.length?we.slice(ce.length):we}).join(`
|
|
`)}var i=[],t=["<ul>"],u=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){i.length=0,t=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function R(_e,ie,oe,ce){if(ie>=_e.length||_e[ie].level<=oe)return ie;var we=_e[ie];ce.push("<li><a href='#"+we.anchor+"'>"+we.text+"</a>"),ie++;var de=[];return ie=R(_e,ie,we.level,de),de.length>0&&(ce.push("<ul>"),de.forEach(function(he){ce.push(he)}),ce.push("</ul>")),ce.push("</li>"),ie=R(_e,ie,oe,ce),ie}function A(){return R(i,0,0,t),t.push("</ul>"),t.join("")}var P={heading:function(ie){var oe=o.exec(ie);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},fences:function(ie){var oe=this.rules.block.fences.exec(ie);if(oe){var ce=oe[0],we=s(ce,oe[3]||""),de=oe[2]?oe[2].trim():oe[2];if(["latex","katex","math"].indexOf(de)>=0){var he=h(),Oe=we;we=he,f[he]={type:"block",expression:Oe}}return{type:"code",raw:ce,lang:de,text:we}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,h=function(){return"__special_katext_id_".concat(E++,"__")},f={};function T(){return f}function x(){E=0,f={}}function _(_e){return _e=_e.replace(w,function(ie,oe){var ce=h();return f[ce]={type:"inline",expression:oe},ce}),_e}var j=u.listitem;u.listitem=function(_e){return j(_(_e))};var W=u.paragraph;u.paragraph=function(_e){return W(_(_e))};var C=u.tablecell;u.tablecell=function(_e,ie){return C(_(_e),ie)},u.code=function(_e,ie,oe){var ce=(ie||"").match(/\S*/)[0];return ce?["latex","katex","math"].indexOf(ce)>=0?"<p class='editormd-tex'>".concat(_e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ie,'">').concat(oe?_e:Object(c.escape)(_e,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(oe?_e:Object(c.escape)(_e,!0))+"</code></pre>"},u.heading=function(_e,ie,oe){var ce=this.options.headerPrefix+oe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ce,level:ie,text:_e}),"<h"+ie+' id="'+ce+'">'+_e+"</h"+ie+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:P,renderer:u});var F=a.a,k=U("SJMd"),y=U("ulZh"),H=U.n(y),J=U("m3rI"),ae=U("Oy/b"),fe=U("p5ED"),ge=U("ErOA"),Te=U("STEk");/* **********************************
|
|
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 Ue=function(_e,ie){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,ce){oe.__proto__=ce}||function(oe,ce){for(var we in ce)Object.prototype.hasOwnProperty.call(ce,we)&&(oe[we]=ce[we])})(_e,ie)};function Se(_e,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Class extends value "+String(ie)+" is not a constructor or null");function oe(){this.constructor=_e}Ue(_e,ie),_e.prototype=ie===null?Object.create(ie):(oe.prototype=ie.prototype,new oe)}function Le(_e,ie,oe,ce){return new(oe||(oe=Promise))(function(we,de){function he(Ne){try{le(ce.next(Ne))}catch(We){de(We)}}function Oe(Ne){try{le(ce.throw(Ne))}catch(We){de(We)}}function le(Ne){var We;Ne.done?we(Ne.value):(We=Ne.value,We instanceof oe?We:new oe(function(lt){lt(We)})).then(he,Oe)}le((ce=ce.apply(_e,ie||[])).next())})}function ye(_e,ie){var oe,ce,we,de,he={label:0,sent:function(){if(1&we[0])throw we[1];return we[1]},trys:[],ops:[]};return de={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Oe(le){return function(Ne){return function(We){if(oe)throw new TypeError("Generator is already executing.");for(;he;)try{if(oe=1,ce&&(we=2&We[0]?ce.return:We[0]?ce.throw||((we=ce.return)&&we.call(ce),0):ce.next)&&!(we=we.call(ce,We[1])).done)return we;switch(ce=0,we&&(We=[2&We[0],we.value]),We[0]){case 0:case 1:we=We;break;case 4:return he.label++,{value:We[1],done:!1};case 5:he.label++,ce=We[1],We=[0];continue;case 7:We=he.ops.pop(),he.trys.pop();continue;default:if(!(we=he.trys,(we=we.length>0&&we[we.length-1])||We[0]!==6&&We[0]!==2)){he=0;continue}if(We[0]===3&&(!we||We[1]>we[0]&&We[1]<we[3])){he.label=We[1];break}if(We[0]===6&&he.label<we[1]){he.label=we[1],we=We;break}if(we&&he.label<we[2]){he.label=we[2],he.ops.push(We);break}we[2]&&he.ops.pop(),he.trys.pop();continue}We=ie.call(_e,he)}catch(lt){We=[6,lt],ce=0}finally{oe=we=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([le,Ne])}}}var Z=function(){function _e(){}return _e.addKey=function(ie){_e.key=ie},Object.defineProperty(_e,"isLicensed",{get:function(){return!!_e.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(_e.key)},enumerable:!1,configurable:!0}),_e}(),v=function(){function _e(){}return _e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},_e.setAttributes=function(ie,oe){for(var ce=0,we=oe;ce<we.length;ce++){var de=we[ce],he=de[0],Oe=de[1];ie.setAttribute(he,Oe)}},_e.createRect=function(ie,oe,ce){var we=document.createElementNS("http://www.w3.org/2000/svg","rect");return we.setAttribute("width",ie.toString()),we.setAttribute("height",oe.toString()),ce&&_e.setAttributes(we,ce),we},_e.createLine=function(ie,oe,ce,we,de){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",ie.toString()),he.setAttribute("y1",oe.toString()),he.setAttribute("x2",ce.toString()),he.setAttribute("y2",we.toString()),de&&_e.setAttributes(he,de),he},_e.createPolygon=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ce.setAttribute("points",ie),oe&&_e.setAttributes(ce,oe),ce},_e.createCircle=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","circle");return ce.setAttribute("cx",(ie/2).toString()),ce.setAttribute("cy",(ie/2).toString()),ce.setAttribute("r",ie.toString()),oe&&_e.setAttributes(ce,oe),ce},_e.createEllipse=function(ie,oe,ce){var we=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return we.setAttribute("cx",(ie/2).toString()),we.setAttribute("cy",(oe/2).toString()),we.setAttribute("rx",(ie/2).toString()),we.setAttribute("ry",(oe/2).toString()),ce&&_e.setAttributes(we,ce),we},_e.createGroup=function(ie){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return ie&&_e.setAttributes(oe,ie),oe},_e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},_e.createMarker=function(ie,oe,ce,we,de,he,Oe){var le=document.createElementNS("http://www.w3.org/2000/svg","marker");return _e.setAttributes(le,[["id",ie],["orient",oe],["markerWidth",ce.toString()],["markerHeight",we.toString()],["refX",de.toString()],["refY",he.toString()]]),le.appendChild(Oe),le},_e.createText=function(ie){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),ie&&_e.setAttributes(oe,ie),oe},_e.createTSpan=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ce.textContent=ie,oe&&_e.setAttributes(ce,oe),ce},_e.createImage=function(ie){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return ie&&_e.setAttributes(oe,ie),oe},_e.createPoint=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ce.x=ie,ce.y=oe,ce},_e.createPath=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","path");return ce.setAttribute("d",ie),oe&&_e.setAttributes(ce,oe),ce},_e.createElement=function(ie,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg",ie);return oe&&_e.setAttributes(ce,oe),ce},_e.getHollowRectanglePath=function(ie,oe,ce,we,de,he,Oe,le){return"M"+ie+","+oe+"V"+(oe+we)+"H"+(ie+ce)+"V"+oe+"H"+de+"V"+he+"H"+(de+Oe)+"V"+(he+le)+"H"+de+"V"+oe+"Z"},_e}(),L=function(){function _e(ie){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ie+"_"}return Object.defineProperty(_e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(_e.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(_e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),_e.prototype.addClass=function(ie){return this.styleSheet===void 0&&this.addStyleSheet(),ie.name=""+this.classNamePrefix+ie.localName,this.classes.push(ie),this.styleSheet.sheet.insertRule("."+ie.name+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length),ie},_e.prototype.addRule=function(ie){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ie),this.styleSheet.sheet.insertRule(ie.selector+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length)},_e.prototype.addStyleSheet=function(){var ie;this.styleSheet=document.createElement("style"),((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).appendChild(this.styleSheet),this.addRule(new z("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new z("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new z("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ee("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ee("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},_e.prototype.removeStyleSheet=function(){var ie;this.styleSheet&&(((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},_e}(),z=function(_e,ie){this.selector=_e,this.style=ie},ee=function(_e,ie){this.localName=_e,this.style=ie},$=function(){function _e(){this.blocks=[],this.display=""}return _e.prototype.addButtonBlock=function(ie){ie.className=this.blockClassName,ie.buttonClassName=this.buttonClassName,ie.buttonColorsClassName=this.buttonColorsClassName,ie.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ie)},_e.prototype.addElementBlock=function(ie){ie.className===void 0&&(ie.className=this.blockClassName),this.blocks.push(ie)},_e.prototype.getUI=function(){var ie=document.createElement("div");return ie.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ie.style.display=this.display,this.blocks.forEach(function(oe){return ie.appendChild(oe.getUI())}),ie},_e}(),Ee=function(){function _e(){}return _e.prototype.getUI=function(){var ie=document.createElement("div");if(ie.className=this.className,this.minWidth!==void 0&&(ie.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ie.style.justifyContent="flex-start";break;case"center":ie.style.justifyContent="center";break;case"end":ie.style.justifyContent="flex-end"}return ie.style.whiteSpace="nowrap",ie},_e}(),Fe=function(_e){function ie(){var oe=_e!==null&&_e.apply(this,arguments)||this;return oe.buttons=[],oe}return Se(ie,_e),ie.prototype.addButton=function(oe){oe.className=this.buttonClassName,oe.colorsClassName=this.buttonColorsClassName,oe.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(oe)},ie.prototype.getUI=function(){var oe=_e.prototype.getUI.call(this);return this.buttons.forEach(function(ce){return oe.appendChild(ce.getUI())}),oe},ie}(Ee),qe=function(){function _e(ie,oe){this._isActive=!1,this._isHidden=!1,this._icon=ie,this.title=oe,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(_e.prototype,"icon",{get:function(){return this._icon},set:function(ie){this._icon=ie,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"isActive",{get:function(){return this._isActive},set:function(ie){this._isActive=ie,this.adjustClassName()},enumerable:!1,configurable:!0}),_e.prototype.getUI=function(){var ie=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 ie.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},_e.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,"")))},_e.prototype.hide=function(){this._isHidden=!0},_e}(),Ce=function(_e){function ie(){var oe=_e!==null&&_e.apply(this,arguments)||this;return oe.elements=[],oe}return Se(ie,_e),ie.prototype.addElement=function(oe){this.elements.push(oe)},ie.prototype.getUI=function(){var oe=_e.prototype.getUI.call(this);return this.elements.forEach(function(ce){return oe.appendChild(ce)}),oe},ie}(Ee),Me=function(){function _e(ie,oe){this.horizontal=ie,this.vertical=oe}return Object.defineProperty(_e.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),_e.prototype.getVerticalLength=function(ie){return ie/this.ratio},_e.prototype.getHorizontalLength=function(ie){return ie*this.ratio},_e}(),He=function(){function _e(){}return _e.getIcon=function(ie,oe){if(ie>0&&oe>0){var ce=new Me(ie,oe),we=ce.ratio>=1?20:ce.getHorizontalLength(20),de=ce.ratio<1?20:ce.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var Oe=v.createDefs();he.appendChild(Oe);var le=v.createElement("clipPath",[["id","text-bg-clip"]]);Oe.appendChild(le);var Ne=v.createPath(v.getHollowRectanglePath((24-we)/2,(24-de)/2,we,de,(24-we)/2+2,(24-de)/2+2,we-4,de-4));he.appendChild(Ne);var We=v.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(v.createTSpan(ie+":"+oe)),he.appendChild(We);var lt=We.getBBox();v.setAttributes(We,[["x",((24-lt.width)/2).toString()],["y",((24-lt.height)/2-lt.y).toString()]]);var Ct=v.createPath(v.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(lt.width))/2,(24-Math.ceil(lt.height))/2,Math.ceil(lt.width),Math.ceil(lt.height)));return le.appendChild(Ct),v.setAttributes(Ne,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.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>'},_e}(),Ke=function(_e){function ie(oe,ce,we){var de=_e.call(this,oe,ce)||this;return de.isDropdownOpen=!1,de.onClick=de.dropdownButtonClicked,de.dropdownButtons=we,de}return Se(ie,_e),ie.prototype.setupDropdown=function(){var oe=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ce){ce.className=oe.className,ce.colorsClassName=oe.colorsClassName,oe.dropdownBlock.appendChild(ce.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ie.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ie.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ie.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ie.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ie.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ie}(qe),ut=function(){function _e(ie,oe){this.GRIP_SIZE=10,this.color=ie,this.fillColor=oe,this.visual=v.createGroup(),this.visual.appendChild(v.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(v.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return _e.prototype.ownsTarget=function(ie){return ie===this.visual||ie===this.visual.childNodes[0]||ie===this.visual.childNodes[1]},_e.prototype.setCenter=function(ie,oe){this.visual.childNodes.forEach(function(ce){return v.setAttributes(ce,[["cx",ie.toString()],["cy",oe.toString()]])})},_e}(),bt=function(){function _e(ie,oe,ce,we){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ie,this.canvasHeight=oe,this.margin=ce,this.container=we,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(_e.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ie){this._aspectRatio=ie,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.gridContainer&&v.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ie){this._zoomFactor=ie,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),_e.prototype.open=function(){var ie=this;this.cropShadeElement=v.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=v.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var oe=0;oe<this.numberOfGridLines;oe++)this.horizontalGridLines.push(v.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(v.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ce){return ie.gridContainer.appendChild(ce)}),this.verticalGridLines.forEach(function(ce){return ie.gridContainer.appendChild(ce)}),this.cropRectElement=v.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},_e.prototype.setCropRectangle=function(ie){this.cropRect=ie;var oe=Object.assign({},this.cropRect);this.zoomFactor!==1&&(oe.width=this.cropRect.width*this.zoomFactor,oe.height=this.cropRect.height*this.zoomFactor,oe.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-oe.width/2,oe.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-oe.height/2),v.setAttributes(this.cropRectElement,[["x",oe.x.toString()],["y",oe.y.toString()],["width",oe.width.toString()],["height",oe.height.toString()]]);var ce=oe.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(de,he){var Oe=oe.y+ce*(he+1);v.setAttributes(de,[["x1",""+oe.x],["y1",""+Oe],["x2",""+(oe.x+oe.width)],["y2",""+Oe]])});var we=oe.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(de,he){var Oe=oe.x+we*(he+1);v.setAttributes(de,[["x1",""+Oe],["y1",""+oe.y],["x2",""+Oe],["y2",""+(oe.y+oe.height)]])}),v.setAttributes(this.cropShadeElement,[["d",v.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,oe.x,oe.y,oe.width,oe.height)]]),this.topLeftGrip.setCenter(oe.x,oe.y),this.topRightGrip.setCenter(oe.x+oe.width,oe.y),this.bottomLeftGrip.setCenter(oe.x,oe.y+oe.height),this.bottomRightGrip.setCenter(oe.x+oe.width,oe.y+oe.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},_e.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)},_e.prototype.clientToLocalCoordinates=function(ie,oe){var ce=this.container.getBoundingClientRect();return{x:ie-ce.left+this.margin,y:oe-ce.top+this.margin}},_e.prototype.onPointerDown=function(ie){this.container.setPointerCapture(ie.pointerId),this.previousPoint=this.clientToLocalCoordinates(ie.clientX,ie.clientY),this.cropRectElement===ie.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ie.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ie.target)&&(this.activeGrip=this.bottomRightGrip)},_e.prototype.onPointerMove=function(ie){if(this.isMoving)this.move(this.clientToLocalCoordinates(ie.clientX,ie.clientY));else if(this.activeGrip){var oe=this.clientToLocalCoordinates(ie.clientX,ie.clientY);this.resize(oe)}ie.preventDefault()},_e.prototype.onPointerUp=function(ie){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ie.pointerId)},_e.prototype.move=function(ie){var oe=ie.x-this.previousPoint.x,ce=ie.y-this.previousPoint.y;this.zoomFactor!==1&&(oe=-oe/this.zoomFactor,ce=-ce/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+oe),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ce),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ie},_e.prototype.resize=function(ie){var oe=Object.assign({},this.cropRect),ce=ie.x-this.previousPoint.x,we=ie.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:oe.x+ce<this.margin&&(ce=this.margin-oe.x),oe.x+=ce,oe.width=this.cropRect.x+this.cropRect.width-oe.x;break;case this.bottomRightGrip:case this.topRightGrip:oe.width+ce>this.canvasWidth*this.zoomFactor&&(ce=this.canvasWidth*this.zoomFactor-oe.width),oe.width+=ce}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(oe.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ce),oe.height=this.aspectRatio.getVerticalLength(oe.width)):(oe.y+=we,oe.height=this.cropRect.y+this.cropRect.height-oe.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?oe.height=this.aspectRatio.getVerticalLength(oe.width):oe.height+=we}oe.width<10&&(oe.x=this.cropRect.x,oe.width=10),oe.height<10&&(oe.y=this.cropRect.y,oe.height=10),this.previousPoint=ie,oe.x>=this.margin&&oe.y>=this.margin&&oe.x-this.margin+oe.width<=this.canvasWidth&&oe.y-this.margin+oe.height<=this.canvasHeight&&(this.cropRect=oe,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},_e.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ie=this.cropRect.x+this.cropRect.width/2,oe=this.cropRect.y+this.cropRect.height/2,ce=this.aspectRatio.getHorizontalLength(this.cropRect.height),we=this.aspectRatio.getVerticalLength(this.cropRect.width);ce/this.canvasWidth<we/this.canvasHeight?this.cropRect.width=ce:this.cropRect.height=we,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=ie-this.cropRect.width/2,this.cropRect.y=oe-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)}},_e.prototype.getRescaledRect=function(ie,oe,ce,we,de,he){var Oe=ce/ie,le=we/oe;return{x:(de.x-he)*Oe+he,y:(de.y-he)*le+he,width:de.width*Oe,height:de.height*le}},_e.prototype.scaleCanvas=function(ie,oe){var ce=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ie,oe,this.cropRect,this.margin);this.canvasWidth=ie,this.canvasHeight=oe,this.onCropChange&&this.onCropChange(ce),this.setCropRectangle(ce)},_e}(),Lt=function(){function _e(ie){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ie,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(_e.prototype,"angle",{get:function(){return this._angle},set:function(ie){this._angle=ie,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),_e.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},_e.prototype.onPointerDown=function(ie){this.controlContainer.setPointerCapture(ie.pointerId),this.isDragging=!0,this.previousPoint={x:ie.clientX,y:ie.clientY}},_e.prototype.onPointerMove=function(ie){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.previousPoint.x=ie.clientX)},_e.prototype.onPointerUp=function(ie){this.isDragging&&this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ie.pointerId)},_e.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ie=this.angleLabelText.getBBox();v.setAttributes(this.angleLabelElement,[["x",((this.width-ie.width)/2).toString()],["y",(this.height/2).toString()]])}},_e.prototype.positionScaleShape=function(){if(this.scaleShape){var ie=this.scaleShape.transform.baseVal.getItem(0);ie.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ie,0)}},_e.prototype.getVisual=function(){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("width",this.width+"px"),ie.setAttribute("height",this.height+"px"),ie.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ie.style.flexShrink="0",document.body.appendChild(ie);for(var oe="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ce=1;ce<=this.width/5+10;ce++){var we=ce%5==0?this.height/3:this.height/6;oe+="h4v"+-we+"h1v"+we}oe+="v1H0Z",this.scaleShape=v.createPath(oe);var de=v.createTransform();this.scaleShape.transform.baseVal.appendItem(de),ie.appendChild(this.scaleShape),this.angleLabelElement=v.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=v.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=v.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),ie.appendChild(this.angleLabelElement),document.body.removeChild(ie),ie},_e}(),Ft=function(){function _e(){this.naturalSize=!1,this.imageType="image/png"}return _e.prototype.rasterize=function(ie,oe,ce,we,de,he,Oe){var le=this;return new Promise(function(Ne){var We=document.createElement("canvas");We.width=ie.width.baseVal.value-2*we,We.height=ie.height.baseVal.value-2*we;var lt=1,Ct=1;le.naturalSize===!0?(lt=oe.naturalWidth/(ie.width.baseVal.value-2*we)/he,Ct=oe.naturalHeight/(ie.height.baseVal.value-2*we)/Oe,We.width=oe.naturalWidth/he,We.height=oe.naturalHeight/Oe):le.width!==void 0&&le.height!==void 0&&(lt=le.width/ce.width,Ct=le.height/ce.height,We.width*=lt,We.height*=Ct);var Rt=We.getContext("2d");Rt.translate(We.width/2,We.height/2),Rt.rotate(de*Math.PI/180),Rt.scale(he,Oe),Rt.translate(-We.width/2,-We.height/2),Rt.drawImage(oe,0,0,We.width,We.height);var It=document.createElement("canvas");It.width=ce.width*lt,It.height=ce.height*Ct,It.getContext("2d").putImageData(Rt.getImageData((ce.x-we)*lt,(ce.y-we)*Ct,ce.width*lt,ce.height*Ct),0,0),Ne(It.toDataURL(le.imageType,le.imageQuality))})},_e}(),Yt=function(){function _e(ie){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=_e.instanceCounter++,this.styles=new L(this.instanceNo),this.target=ie,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(_e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ie){this._zoomToCropEnabled=ie,ie?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ie){this._gridLines=ie,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ie){this._rotationAngle=ie,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(_e.prototype,"aspectRatio",{get:function(){var ie;return(ie=this._aspectRatio)!==null&&ie!==void 0?ie:this.aspectRatios[0]},set:function(ie){this._aspectRatio=ie},enumerable:!1,configurable:!0}),_e.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},_e.prototype.show=function(){this.showUI(),this.open()},_e.prototype.close=function(ie){ie===void 0&&(ie=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ie||this.closeEventListeners.forEach(function(oe){return oe()}),this._isOpen=!1)},_e.prototype.addRenderEventListener=function(ie){this.renderEventListeners.push(ie)},_e.prototype.removeRenderEventListener=function(ie){this.renderEventListeners.indexOf(ie)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ie),1)},_e.prototype.addCloseEventListener=function(ie){this.closeEventListeners.push(ie)},_e.prototype.removeCloseEventListener=function(ie){this.closeEventListeners.indexOf(ie)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ie),1)},_e.prototype.setupResizeObserver=function(){var ie=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ie.resize(ie.target.clientWidth,ie.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))},_e.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ie=1*this.target.clientWidth/this.target.clientHeight,oe=this.contentDiv.clientWidth/ie>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ie:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ce=oe+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ie;this.resize(oe,ce)}},_e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},_e.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",v.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},_e.prototype.resize=function(ie,oe){this.imageWidth=Math.round(ie),this.imageHeight=Math.round(oe),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()},_e.prototype.setEditingTarget=function(){var ie=document.createElement("canvas");ie.width=this.target.naturalWidth,ie.height=this.target.naturalHeight,ie.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var oe=ie.toDataURL();v.setAttributes(this.editingTarget,[["href",oe]]),this.setEditingTargetSize()},_e.prototype.setTopLeft=function(){var ie=this.target.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=ie.left-oe.left-this.CANVAS_MARGIN,this.top=ie.top-oe.top-this.CANVAS_MARGIN},_e.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=v.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=v.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=v.createGroup(),this.editingTargetRotationScaleContainer=v.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ie=v.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ie);var oe=v.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(oe),this.editingTargetContainer=v.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)},_e.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},_e.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=v.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new bt(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()},_e.prototype.zoomToCrop=function(){if(this.cropRect){var ie=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,oe=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=ie+"px "+oe+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ie+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-oe+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},_e.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)},_e.prototype.cropRectChanged=function(ie){this.cropRect=ie,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},_e.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},_e.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"},_e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},_e.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 ie=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,oe=this.target.offsetTop>ie+this.CANVAS_MARGIN?this.target.offsetTop-(ie+this.CANVAS_MARGIN):0;this.coverDiv.style.top=oe+"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},_e.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},_e.prototype.addTopToolbar=function(){var ie=this;this.topToolbar=new $,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 oe=new Fe;oe.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(oe);var ce=[];this.aspectRatios.forEach(function(Ct){var Rt=new qe(He.getIcon(Ct.horizontal,Ct.vertical),Ct.horizontal===0&&Ct.vertical===0?"FREE":Ct.horizontal+":"+Ct.vertical);Rt.onClick=function(){return ie.ratioButtonClicked(Ct)},ce.push(Rt)}),this.aspectRatioButton=new Ke(He.getIcon(0,0),"Aspect ratio",ce),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,oe.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var we=new qe('<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");we.isActive=this.isGridVisible,we.onClick=function(){ie.isGridVisible=!ie.isGridVisible,we.isActive=ie.isGridVisible},oe.addButton(we);var de=new qe('<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(de.isActive=this.zoomToCropEnabled,de.onClick=function(){ie.zoomToCropEnabled=!ie.zoomToCropEnabled,de.isActive=ie.zoomToCropEnabled},oe.addButton(de),!Z.isLicensed){var he=new Ce;this.topToolbar.addElementBlock(he);var Oe=document.createElement("div");Oe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var le=document.createElement("a");le.style.color="currentColor",le.href="https://markerjs.com/products/cropro",le.target="_blank",le.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>',Oe.appendChild(le),he.addElement(Oe)}var Ne=new Fe;Ne.minWidth=3*this.toolbarHeight+"px",Ne.contentAlign="end",this.topToolbar.addButtonBlock(Ne);var We=new qe('<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");We.onClick=this.startRenderAndClose,Ne.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var lt=new qe('<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");lt.onClick=this.close,Ne.addButton(lt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(lt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},_e.prototype.addBottomToolbar=function(){var ie=this;this.bottomToolbar=new $,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 oe=new Fe;oe.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(oe);var ce=new qe('<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");ce.onClick=this.rotateLeftButtonClicked,oe.addButton(ce);var we=new qe('<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");we.onClick=this.rotateRightButtonClicked,oe.addButton(we);var de=new Ce;de.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(de),this.straightener=new Lt("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(Ne){ie.rotateBy(Ne),ie.straightener.angle=ie.rotationAngle},de.addElement(this.straightener.getUI());var he=new Fe;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var Oe=new qe('<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");Oe.onClick=this.flipHorizontallyButtonClicked,he.addButton(Oe);var le=new qe('<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");le.onClick=this.flipVerticallyButtonClicked,he.addButton(le)},_e.prototype.ratioButtonClicked=function(ie){this.aspectRatio=ie,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},_e.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=He.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},_e.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Me(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},_e.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},_e.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},_e.prototype.restoreState=function(ie){if(ie){var oe=this.cropLayer.getRescaledRect(ie.width,ie.height,this.imageWidth,this.imageHeight,ie.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(oe),this.cropRectChanged(oe),this.flippedHorizontally=ie.flippedHorizontally,this.flippedVertically=ie.flippedVertically,this.applyFlip(),this.rotationAngle=ie.rotationAngle,this.applyRotation()}},_e.prototype.clientToLocalCoordinates=function(ie,oe){var ce=this.cropImage.getBoundingClientRect();return{x:ie-ce.left,y:oe-ce.top}},_e.prototype.onWindowResize=function(){this.positionUI()},_e.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ie=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ie+"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()},_e.prototype.rotateLeftButtonClicked=function(){var ie=this.rotationAngle-90;this.rotationAngle%90!=0&&(ie+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ie)},_e.prototype.rotateRightButtonClicked=function(){var ie=this.rotationAngle+90;this.rotationAngle%90!=0&&(ie-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ie)},_e.prototype.rotateTo=function(ie){ie=(ie=ie>180?ie-360:ie)<=-180?ie+360:ie,this.rotationAngle=ie,this.applyRotation()},_e.prototype.rotateBy=function(ie){this.rotateTo((this.rotationAngle+ie)%360)},_e.prototype.applyRotation=function(){var ie=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var oe=this.editingTargetRotationContainer.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(oe,0);var ce=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ce.width,this.imageHeight/ce.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ie},_e.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},_e.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},_e.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},_e.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var ie,oe;return ye(this,function(ce){switch(ce.label){case 0:return[4,this.render()];case 1:return ie=ce.sent(),oe=this.getState(),this.renderEventListeners.forEach(function(we){return we(ie,oe)}),this.close(!0),[2]}})})},_e.prototype.render=function(){return Le(this,void 0,void 0,function(){var ie;return ye(this,function(oe){switch(oe.label){case 0:return(ie=new Ft).naturalSize=this.renderAtNaturalSize,ie.imageType=this.renderImageType,ie.imageQuality=this.renderImageQuality,ie.width=this.renderWidth,ie.height=this.renderHeight,this.unzoomFromCrop(),v.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ie.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 oe.sent(),[4,ie.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,oe.sent()]}})})},_e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ee("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 ee("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ee("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var ie=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ee("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*ie)+`px;
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
padding: `+ie+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new z("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new z("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ee("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 ee("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ee("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 ee("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
padding: `+ie+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ee("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},_e.instanceCounter=0,_e}(),Xt=U("8hTe"),Je=U.n(Xt),Qe=/<pre[^>]*>/g;function _t(_e){var ie=document.createElement("div");return ie.innerHTML=_e,ie.childNodes.length===0?"":ie.childNodes[0].nodeValue}var xt=Pe.a=function(_e){var ie=_e.value,oe=ie===void 0?"":ie,ce=_e.edit,we=ce===void 0?!1:ce,de=_e.className,he=_e.showTextOnly,Oe=_e.showLines,le=_e.replaces,Ne=_e.zoomImg,We=_e.hasMask,lt=_e.style,Ct=lt===void 0?{}:lt,Rt=_e.stylesPrev,It=Rt===void 0?{}:Rt,qn=String(oe),Vt=Object(D.useRef)(),qt=Object(D.useRef)(),nn=Object(D.useState)(""),On=Object(Y.a)(nn,2),ar=On[0],cr=On[1],Qn=Object(D.useState)("office"),yr=Object(Y.a)(Qn,2),Sr=yr[0],Nn=yr[1],Ar=function(){var Be=new Yt(qt.current);Be.displayMode="popup",Be.addRenderEventListener(function(){var pt=Object(M.a)(r.a.mark(function Ie(xe){var ve;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Vt.current.style.display="none",kt.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe}});case 3:ve=kt.sent,ve!=null&&ve.id&&le(qt.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(ve==null?void 0:ve.id,"?type=").concat(ve.content_type));case 5:case"end":return kt.stop()}},Ie)}));return function(Ie){return pt.apply(this,arguments)}}()),Be.show()},Dn=function(){var Be=new Te.a(qt.current);Be.settings.displayMode="popup",Be.addEventListener("render",function(){var pt=Object(M.a)(r.a.mark(function Ie(xe){var ve;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(Vt.current.style.display="none",!qt.current){kt.next=6;break}return kt.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe.dataUrl}});case 4:ve=kt.sent,ve!=null&&ve.id&&le(qt.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(ve==null?void 0:ve.id,"?type=").concat(ve.content_type));case 6:case"end":return kt.stop()}},Ie)}));return function(Ie){return pt.apply(this,arguments)}}()),Be.show(),window.markerArea=Be},Pn=Object(D.useMemo)(function(){Vt.current&&(Vt.current.style.zIndex=-1);try{var at=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Be=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;qn=qn.replace(at,"("+J.a.API_SERVER+"/api/attachments/").replace(Be,'"'+J.a.API_SERVER+"/api/attachments/").replace(pt,'"'+J.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(Hn){}var Ie=F(qn),xe=T();if(qn.match(/\[TOC\]/)&&(Ie=Ie.replace("<p>[TOC]</p>",A()),O()),Ie=Ie.replace(/(__special_katext_id_\d+__)/g,function(Hn,kt){var ke=xe[kt],dt=ke.type,Re=ke.expression;return Object(ae.renderToString)(_t(Re)||"",{displayMode:dt==="block",throwOnError:!1,output:"html"})}),Ie=Ie.replace(/▁/g,"\u2581\u2581\u2581"),x(),he){var ve=document.createElement("div");return ve.innerHTML=Ie,ve.innerText}return setTimeout(function(){return Lr()},500),Ie},[qn]),Zn=Object(D.useRef)();S.WebkitLineClamp=Oe,Oe&&(Ct=Object(K.a)(Object(K.a)({},Ct),S));function pr(at){var Be=at.target;if(Be.tagName.toUpperCase()==="IMG"){if(Ne){var pt=Be.getAttribute("src");cr(pt),Nn("image")}}else if(Be.tagName.toUpperCase()==="A"){var Ie=Be.getAttribute("href");if(Ie.indexOf("office")>-1)at.preventDefault(),cr(Ie),Nn("office");else if(Ie.indexOf("application/pdf")>-1)at.preventDefault(),cr(Ie),Nn("pdf");else if(Ie.indexOf("text/html")>-1)at.preventDefault(),cr(Ie),Nn("html");else if(Ie.startsWith("#")){at.preventDefault();var xe=document.getElementById(Ie.replace("#",""));xe&&xe.scrollIntoView(!0)}}}var Lr=function(){var Be,pt=(Be=Zn.current)===null||Be===void 0?void 0:Be.querySelectorAll("video");pt==null||pt.forEach(function(Ie){if(Ie.oncontextmenu=function(){return!1},Ie.src.indexOf(".m3u8")>-1&&!Ie.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var xe=new H.a;xe.loadSource(Ie.src),xe.attachMedia(Ie)}}})};Object(D.useEffect)(function(){if(Zn.current&&Pn&&(Pn.match(Qe)&&window.PR.prettyPrint()),Zn.current)return Zn.current.addEventListener("click",pr),function(){Zn.current.removeEventListener("click",pr),x(),O()}},[Pn,Zn.current,pr]);var Or=function(Be){if(!we)return;Be.target.nodeName==="IMG"?(Vt.current.style.zIndex=1,Vt.current.style.display="flex",Vt.current.style.width=Be.target.clientWidth+"px",Vt.current.style.height=Be.target.clientHeight+"px",Vt.current.style.top=Be.target.offsetTop+"px",Vt.current.style.left=Be.target.offsetLeft+"px",qt.current.src=Be.target.getAttribute("src")):Vt.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Zn,style:Object(K.a)({},Ct),className:"".concat(de||""," markdown-body ").concat(Je.a.mdBody),onMouseOver:Or,dangerouslySetInnerHTML:{__html:Pn}}),m.a.createElement("div",{ref:Vt,className:Je.a.button},m.a.createElement(Q.a,null,m.a.createElement(q.a,{onClick:function(){return Ar()}},"\u88C1\u526A"),m.a.createElement(q.a,{onClick:function(){return Dn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:qt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(fe.a,{close:!0,data:ar,type:ar!=null&&ar.length?Sr:"",style:Object(K.a)({},It),onClose:function(){return cr("")}}))}},"9VGf":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return B});var ne=U("q1tI"),Q=U.n(ne);function B(q,K){var M=Object(ne.useRef)();Object(ne.useEffect)(function(){M.current=q}),Object(ne.useEffect)(function(){function Y(){M.current()}if(K!==null){var V=setInterval(Y,K);return function(){return clearInterval(V)}}},[K])}},"9z17":function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return R});var ne=U("g9YV"),Q=U("wCAj"),B=U("5NDa"),q=U("5rEg"),K=U("y8nQ"),M=U("Vl3Y"),Y=U("2qtc"),V=U("kLXV"),r=U("7Kak"),D=U("9yH6"),m=U("9og8"),p=U("tJVT"),g=U("WmNS"),a=U.n(g),c=U("q1tI"),s=U.n(c),i=U("ie49"),t=U.n(i),u=U("HBuW"),o=function(E){var h=E.total,f=E.used,T=E.copy,x=E.canNotCopy,_=E.inPaper,j="";return T>0&&x>0?j="\u5176\u4E2D\u6709".concat(T,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(x,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):T>0&&x===0?j="\u5176\u4E2D\u6709".concat(T,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):T===0&&x>0&&(j="\u5176\u4E2D\u6709".concat(x,"\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(j).concat(_?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},O=function(E){return E?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},S=function(E){var h=E.onCancel,f=E.onOk,T=E.visible,x=E.inPaper,_=E.renderData,j=E.type,W=Object(c.useState)(1),C=Object(p.a)(W,2),F=C[0],k=C[1],y=Object(c.useState)(!1),H=Object(p.a)(y,2),J=H[0],ae=H[1],fe=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,fe?s.a.createElement(V.a,{centered:!0,closable:!0,visible:T,title:"\u63D0\u793A",width:600,confirmLoading:J,onCancel:h,onOk:Object(m.a)(a.a.mark(function ge(){return a.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return ae(!0),Ue.next=3,f(F);case 3:ae(!1);case 4:case"end":return Ue.stop()}},ge)}))},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(Te){return k(Te.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(V.a,{centered:!0,closable:!0,visible:T,title:"\u63D0\u793A",width:600,onCancel:h,onOk:Object(m.a)(a.a.mark(function ge(){return a.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return ae(!0),Ue.next=3,f(0);case 3:ae(!1);case 4:case"end":return Ue.stop()}},ge)}))},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")))},R=function(){var E=Object(c.useState)(!1),h=Object(p.a)(E,2),f=h[0],T=h[1],x=Object(c.useState)(),_=Object(p.a)(x,2),j=_[0],W=_[1],C=function(){return T(!1)},F=function(){var k=Object(m.a)(a.a.mark(function y(H){var J;return a.a.wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return fe.next=2,Object(u.p)(H);case 2:if(J=fe.sent,!("status"in J)){fe.next=5;break}return fe.abrupt("return",!1);case 5:if(!(J.repeat_shixun_num===0)){fe.next=7;break}return fe.abrupt("return",!1);case 7:return W(J),T(!0),fe.abrupt("return",!0);case 10:case"end":return fe.stop()}},y)}));return function(H){return k.apply(this,arguments)}}();return[f,C,j,F]},A=function(E){var h=M.a.useForm(),f=Object(p.a)(h,1),T=f[0],x=Object(c.useState)(!1),_=Object(p.a)(x,2),j=_[0],W=_[1],C=E.onCancel,F=E.onOk,k=E.visible,y=E.inPaper,H=y===void 0?!1:y,J=E.renderData,ae=E.type,fe=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(Le,ye){return s.a.createElement(s.a.Fragment,null,s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye.stage_shixun_id:ye.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(M.a.Item,{name:["".concat(ae==="subject"?ye==null?void 0:ye.stage_shixun_id:ye.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(q.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Le,ye){return s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye.stage_shixun_id:ye.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(Le,ye){return s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye.stage_shixun_id:ye.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]),ge=Object(c.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Le,ye){return s.a.createElement(s.a.Fragment,null,s.a.createElement("span",null,Le),s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye==null?void 0:ye.stage_shixun_id:ye.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(q.a,{type:"hidden"})),s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye==null?void 0:ye.stage_shixun_id:ye.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(q.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Le,ye){return s.a.createElement(s.a.Fragment,null,s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?ye==null?void 0:ye.stage_shixun_id:ye.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(M.a.Item,{name:["".concat(ae==="subject"?ye==null?void 0:ye.stage_shixun_id:ye.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(q.a,{type:"hidden"})))}}]},[H]),Te=Object(c.useMemo)(function(){return o({total:J==null?void 0:J.total_num,used:J==null?void 0:J.repeat_shixun_num,copy:J==null?void 0:J.can_copy_num,canNotCopy:J==null?void 0:J.no_copy_num,inPaper:H})},[J,H]),Ue=Object(c.useMemo)(function(){return O(H)},[H]);return s.a.createElement(V.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:k,confirmLoading:j,onOk:Object(m.a)(a.a.mark(function Se(){var Le,ye;return a.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return W(!0),Le=T.getFieldsValue(),ye=Object.keys(Le).map(function(L){return{id:parseInt(L),is_use:Le[L].is_use,is_copy:Le[L].is_copy}}),v.next=5,F(ye);case 5:W(!1);case 6:case"end":return v.stop()}},Se)})),onCancel:C,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},s.a.createElement(M.a,{form:T,preserve:!1},s.a.createElement("div",{className:t.a.brief},Te),(J==null?void 0:J.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},Ue.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:fe,className:t.a.antdTable,dataSource:J==null?void 0:J.can_copy_list,rowKey:ae==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(J==null?void 0:J.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},Ue.irreproducible),s.a.createElement(Q.a,{columns:ge,className:t.a.antdTable,dataSource:J==null?void 0:J.no_copy_list,rowKey:ae==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(J==null?void 0:J.no_use_list.length)>0&&(J==null?void 0:J.no_use_list.map(function(Se){return s.a.createElement("div",{key:ae==="subject"?Se.stage_shixun_id:Se.id},s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?Se==null?void 0:Se.stage_shixun_id:Se.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(q.a,{type:"hidden"})),s.a.createElement(M.a.Item,{name:["".concat(ae==="subject"?Se==null?void 0:Se.stage_shixun_id:Se.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(q.a,{type:"hidden"})))}))))},P=function(E){var h=E.modalType;return h==="multiple"?s.a.createElement(A,E):s.a.createElement(S,E)};Pe.a=P},BU3w:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return M});var ne=U("MNnm"),Q="rc-util-key";function B(Y){if(Y.attachTo)return Y.attachTo;var V=document.querySelector("head");return V||document.body}function q(Y){var V,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var D=document.createElement("style");if((V=r.csp)===null||V===void 0?void 0:V.nonce){var m;D.nonce=(m=r.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=Y;var p=B(r),g=p.firstChild;return r.prepend&&p.prepend?p.prepend(D):r.prepend&&g?p.insertBefore(D,g):p.appendChild(D),D}var K=new Map;function M(Y,V){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=B(r);if(!K.has(D)){var m=q("",r),p=m.parentNode;K.set(D,p),p.removeChild(m)}var g=Array.from(K.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===V});if(g){var a,c;if(((a=r.csp)===null||a===void 0?void 0:a.nonce)&&g.nonce!==((c=r.csp)===null||c===void 0?void 0:c.nonce)){var s;g.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return g.innerHTML!==Y&&(g.innerHTML=Y),g}var i=q(Y,r);return i[Q]=V,i}},Bd2K:function(wt,Pe,U){(function(ne){ne(U("VrN/"),U("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,D,m){if(m!=ne.Init&&m&&r.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(g){return M(g)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(g){return q(g)}),r.addKeyMap(p)});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 q(r){if(r.getOption("disableInput"))return ne.Pass;for(var D=r.listSelections(),m=[],p=r.getOption("autoCloseTags"),g=0;g<D.length;g++){if(!D[g].empty())return ne.Pass;var a=D[g].head,c=r.getTokenAt(a),s=ne.innerMode(r.getMode(),c.state),i=s.state,t=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(i),u=t&&t.name;if(!u)return ne.Pass;var o=s.mode.configuration=="html",O=typeof p=="object"&&p.dontCloseTags||o&&Q,S=typeof p=="object"&&p.indentTags||o&&B;c.end>a.ch&&(u=u.slice(0,u.length-c.end+a.ch));var R=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||O&&Y(O,R)>-1||V(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i)||[],u,a,!0))return ne.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&Y(A,u)>-1){m[g]={text:"/>",newPos:ne.Pos(a.line,a.ch+2)};continue}var P=S&&Y(S,R)>-1;m[g]={indent:P,text:">"+(P?`
|
|
|
|
`:"")+"</"+u+">",newPos:P?ne.Pos(a.line+1,0):ne.Pos(a.line,a.ch+1)}}for(var w=typeof p=="object"&&p.dontIndentOnAutoClose,g=D.length-1;g>=0;g--){var E=m[g];r.replaceRange(E.text,D[g].head,D[g].anchor,"+insert");var h=r.listSelections().slice(0);h[g]={head:E.newPos,anchor:E.newPos},r.setSelections(h),!w&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}function K(r,D){for(var m=r.listSelections(),p=[],g=D?"/":"</",a=r.getOption("autoCloseTags"),c=typeof a=="object"&&a.dontIndentOnSlash,s=0;s<m.length;s++){if(!m[s].empty())return ne.Pass;var i=m[s].head,t=r.getTokenAt(i),u=ne.innerMode(r.getMode(),t.state),o=u.state;if(D&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return ne.Pass;var O,S=u.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(S&&u.mode.name=="javascript")O=g+"script";else if(S&&u.mode.name=="css")O=g+"style";else{var R=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(o);if(!R||R.length&&V(r,R,R[R.length-1],i))return ne.Pass;O=g+R[R.length-1]}r.getLine(i.line).charAt(t.end)!=">"&&(O+=">"),p[s]=O}if(r.replaceSelections(p),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 M(r){return r.getOption("disableInput")?ne.Pass:K(r,!0)}ne.commands.closeTag=function(r){return K(r)};function Y(r,D){if(r.indexOf)return r.indexOf(D);for(var m=0,p=r.length;m<p;++m)if(r[m]==D)return m;return-1}function V(r,D,m,p,g){if(!ne.scanForClosingTag)return!1;var a=Math.min(r.lastLine()+1,p.line+500),c=ne.scanForClosingTag(r,p,null,a);if(!c||c.tag!=m)return!1;for(var s=g?1:0,i=D.length-1;i>=0&&D[i]==m;i--)++s;p=c.to;for(var i=1;i<s;i++){var t=ne.scanForClosingTag(r,p,null,a);if(!t||t.tag!=m)return!1;p=t.to}return!0}})},BjJ7:function(wt,Pe,U){"use strict";U.d(Pe,"d",function(){return Q}),U.d(Pe,"c",function(){return B}),U.d(Pe,"e",function(){return q}),U.d(Pe,"b",function(){return K}),U.d(Pe,"a",function(){return Y});var ne=U("m3rI");function Q(V){var r=!0;if(V.length>0){for(var D=0;D<V.length;D++)if(V[D].compile_success==0||!V[D].compile_success){r=!1;break}}else r=!1;return r}function B(V){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<V.length;m++){var p=V[m],g=r?"".concat(r,"/").concat(p.name):"".concat(p.name);D.push({title:p.name,isLeaf:!(p.type==="tree"),key:g})}return D}function q(V,r,D){for(var m=0;m<V.length;m++){var p=V[m];if(p.key===r){p.children=D;break}p.children&&q(p.children,r,D)}return V}function K(V,r,D){var m;return function(){var p=this,g=arguments,a=function(){m=null,D||V.apply(p,g)},c=D&&!m;clearTimeout(m),m=setTimeout(a,r),c&&V.apply(p,g)}}var M=!0,Y=ne.a.API_SERVER},"C+DQ":function(wt,Pe,U){},"C/vA":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return ne});function ne(Q){const B=this;let q=!1,K;return function(){return q||(q=!0,K=Q.apply(B,arguments)),K}}},"Cg/j":function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return ne}),U.d(Pe,"a",function(){return Q}),U.d(Pe,"c",function(){return q}),U.d(Pe,"d",function(){return K});var ne;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function Y(V){return V[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=Y})(ne||(ne={}));const Q=q("instantiationService");function B(M,Y,V,r){Y[ne.DI_TARGET]===Y?Y[ne.DI_DEPENDENCIES].push({id:M,index:V,optional:r}):(Y[ne.DI_DEPENDENCIES]=[{id:M,index:V,optional:r}],Y[ne.DI_TARGET]=Y)}function q(M){if(ne.serviceIds.has(M))return ne.serviceIds.get(M);const Y=function(V,r,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B(Y,V,D,!1)};return Y.toString=()=>M,ne.serviceIds.set(M,Y),Y}function K(M){return function(Y,V,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");B(M,Y,r,!0)}}},DlQD:function(wt,Pe,U){(function(ne,Q){wt.exports=Q()})(this,function(){"use strict";function ne(oe,ce){for(var we=0;we<ce.length;we++){var de=ce[we];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(oe,de.key,de)}}function Q(oe,ce,we){return ce&&ne(oe.prototype,ce),we&&ne(oe,we),oe}function B(oe,ce){if(!oe)return;if(typeof oe=="string")return q(oe,ce);var we=Object.prototype.toString.call(oe).slice(8,-1);if(we==="Object"&&oe.constructor&&(we=oe.constructor.name),we==="Map"||we==="Set")return Array.from(oe);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return q(oe,ce)}function q(oe,ce){(ce==null||ce>oe.length)&&(ce=oe.length);for(var we=0,de=new Array(ce);we<ce;we++)de[we]=oe[we];return de}function K(oe,ce){var we;if(typeof Symbol=="undefined"||oe[Symbol.iterator]==null){if(Array.isArray(oe)||(we=B(oe))||ce&&oe&&typeof oe.length=="number"){we&&(oe=we);var de=0;return function(){return de>=oe.length?{done:!0}:{done:!1,value:oe[de++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return we=oe[Symbol.iterator](),we.next.bind(we)}function M(oe,ce){return ce={exports:{}},oe(ce,ce.exports),ce.exports}var Y=M(function(oe){function ce(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function we(de){oe.exports.defaults=de}oe.exports={defaults:ce(),getDefaults:ce,changeDefaults:we}}),V=Y.defaults,r=Y.getDefaults,D=Y.changeDefaults,m=/[&<>"']/,p=/[&<>"']/g,g=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(ce){return c[ce]};function i(oe,ce){if(ce){if(m.test(oe))return oe.replace(p,s)}else if(g.test(oe))return oe.replace(a,s);return oe}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(oe){return oe.replace(t,function(ce,we){return we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""})}var o=/(^|[^\[])\^/g;function O(oe,ce){oe=oe.source||oe,ce=ce||"";var we={replace:function(he,Oe){return Oe=Oe.source||Oe,Oe=Oe.replace(o,"$1"),oe=oe.replace(he,Oe),we},getRegex:function(){return new RegExp(oe,ce)}};return we}var S=/[^\w:]/g,R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(oe,ce,we){if(oe){var de;try{de=decodeURIComponent(u(we)).replace(S,"").toLowerCase()}catch(he){return null}if(de.indexOf("javascript:")===0||de.indexOf("vbscript:")===0||de.indexOf("data:")===0)return null}ce&&!R.test(we)&&(we=f(ce,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(he){return null}return we}var P={},w=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(oe,ce){P[" "+oe]||(w.test(oe)?P[" "+oe]=oe+"/":P[" "+oe]=j(oe,"/",!0)),oe=P[" "+oe];var we=oe.indexOf(":")===-1;return ce.substring(0,2)==="//"?we?ce:oe.replace(E,"$1")+ce:ce.charAt(0)==="/"?we?ce:oe.replace(h,"$1")+ce:oe+ce}var T={exec:function(){}};function x(oe){for(var ce=1,we,de;ce<arguments.length;ce++){we=arguments[ce];for(de in we)Object.prototype.hasOwnProperty.call(we,de)&&(oe[de]=we[de])}return oe}function _(oe,ce){var we=oe.replace(/\|/g,function(Oe,le,Ne){for(var We=!1,lt=le;--lt>=0&&Ne[lt]==="\\";)We=!We;return We?"|":" |"}),de=we.split(/ \|/),he=0;if(de.length>ce)de.splice(ce);else for(;de.length<ce;)de.push("");for(;he<de.length;he++)de[he]=de[he].trim().replace(/\\\|/g,"|");return de}function j(oe,ce,we){var de=oe.length;if(de===0)return"";for(var he=0;he<de;){var Oe=oe.charAt(de-he-1);if(Oe===ce&&!we)he++;else if(Oe!==ce&&we)he++;else break}return oe.substr(0,de-he)}function W(oe,ce){if(oe.indexOf(ce[1])===-1)return-1;for(var we=oe.length,de=0,he=0;he<we;he++)if(oe[he]==="\\")he++;else if(oe[he]===ce[0])de++;else if(oe[he]===ce[1]&&(de--,de<0))return he;return-1}function C(oe){oe&&oe.sanitize&&!oe.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:O,cleanUrl:A,resolveUrl:f,noopTest:T,merge:x,splitCells:_,rtrim:j,findClosingBracket:W,checkSanitizeDeprecation:C},k=Y.defaults,y=F.rtrim,H=F.splitCells,J=F.escape,ae=F.findClosingBracket;function fe(oe,ce,we){var de=ce.href,he=ce.title?J(ce.title):null,Oe=oe[1].replace(/\\([\[\]])/g,"$1");return oe[0].charAt(0)!=="!"?{type:"link",raw:we,href:de,title:he,text:Oe}:{type:"image",raw:we,href:de,title:he,text:J(Oe)}}function ge(oe,ce){var we=oe.match(/^(\s+)(?:```)/);if(we===null)return ce;var de=we[1];return ce.split(`
|
|
`).map(function(he){var Oe=he.match(/^\s+/);if(Oe===null)return he;var le=Oe[0];return le.length>=de.length?he.slice(de.length):he}).join(`
|
|
`)}var Te=function(){function oe(we){this.options=we||k}var ce=oe.prototype;return ce.space=function(de){var he=this.rules.block.newline.exec(de);if(he)return he[0].length>1?{type:"space",raw:he[0]}:{raw:`
|
|
`}},ce.code=function(de,he){var Oe=this.rules.block.code.exec(de);if(Oe){var le=he[he.length-1];if(le&&le.type==="paragraph")return{raw:Oe[0],text:Oe[0].trimRight()};var Ne=Oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:Oe[0],codeBlockStyle:"indented",text:this.options.pedantic?Ne:y(Ne,`
|
|
`)}}},ce.fences=function(de){var he=this.rules.block.fences.exec(de);if(he){var Oe=he[0],le=ge(Oe,he[3]||"");return{type:"code",raw:Oe,lang:he[2]?he[2].trim():he[2],text:le}}},ce.heading=function(de){var he=this.rules.block.heading.exec(de);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},ce.nptable=function(de){var he=this.rules.block.nptable.exec(de);if(he){var Oe={type:"table",header:H(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
|
|
`):[],raw:he[0]};if(Oe.header.length===Oe.align.length){var le=Oe.align.length,Ne;for(Ne=0;Ne<le;Ne++)/^ *-+: *$/.test(Oe.align[Ne])?Oe.align[Ne]="right":/^ *:-+: *$/.test(Oe.align[Ne])?Oe.align[Ne]="center":/^ *:-+ *$/.test(Oe.align[Ne])?Oe.align[Ne]="left":Oe.align[Ne]=null;for(le=Oe.cells.length,Ne=0;Ne<le;Ne++)Oe.cells[Ne]=H(Oe.cells[Ne],Oe.header.length);return Oe}}},ce.hr=function(de){var he=this.rules.block.hr.exec(de);if(he)return{type:"hr",raw:he[0]}},ce.blockquote=function(de){var he=this.rules.block.blockquote.exec(de);if(he){var Oe=he[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:he[0],text:Oe}}},ce.list=function(de){var he=this.rules.block.list.exec(de);if(he){for(var Oe=he[0],le=he[2],Ne=le.length>1,We=le[le.length-1]===")",lt={type:"list",raw:Oe,ordered:Ne,start:Ne?+le.slice(0,-1):"",loose:!1,items:[]},Ct=he[0].match(this.rules.block.item),Rt=!1,It,qn,Vt,qt,nn,On,ar,cr=Ct.length,Qn=0;Qn<cr;Qn++)It=Ct[Qn],Oe=It,qn=It.length,It=It.replace(/^ *([*+-]|\d+[.)]) */,""),~It.indexOf(`
|
|
`)&&(qn-=It.length,It=this.options.pedantic?It.replace(/^ {1,4}/gm,""):It.replace(new RegExp("^ {1,"+qn+"}","gm"),"")),Qn!==cr-1&&(Vt=this.rules.block.bullet.exec(Ct[Qn+1])[0],(Ne?Vt.length===1||!We&&Vt[Vt.length-1]===")":Vt.length>1||this.options.smartLists&&Vt!==le)&&(qt=Ct.slice(Qn+1).join(`
|
|
`),lt.raw=lt.raw.substring(0,lt.raw.length-qt.length),Qn=cr-1)),nn=Rt||/\n\n(?!\s*$)/.test(It),Qn!==cr-1&&(Rt=It.charAt(It.length-1)===`
|
|
`,nn||(nn=Rt)),nn&&(lt.loose=!0),On=/^\[[ xX]\] /.test(It),ar=void 0,On&&(ar=It[1]!==" ",It=It.replace(/^\[[ xX]\] +/,"")),lt.items.push({type:"list_item",raw:Oe,task:On,checked:ar,loose:nn,text:It});return lt}},ce.html=function(de){var he=this.rules.block.html.exec(de);if(he)return{type:this.options.sanitize?"paragraph":"html",raw:he[0],pre:!this.options.sanitizer&&(he[1]==="pre"||he[1]==="script"||he[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):J(he[0]):he[0]}},ce.def=function(de){var he=this.rules.block.def.exec(de);if(he){he[3]&&(he[3]=he[3].substring(1,he[3].length-1));var Oe=he[1].toLowerCase().replace(/\s+/g," ");return{tag:Oe,raw:he[0],href:he[2],title:he[3]}}},ce.table=function(de){var he=this.rules.block.table.exec(de);if(he){var Oe={type:"table",header:H(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
|
|
`):[]};if(Oe.header.length===Oe.align.length){Oe.raw=he[0];var le=Oe.align.length,Ne;for(Ne=0;Ne<le;Ne++)/^ *-+: *$/.test(Oe.align[Ne])?Oe.align[Ne]="right":/^ *:-+: *$/.test(Oe.align[Ne])?Oe.align[Ne]="center":/^ *:-+ *$/.test(Oe.align[Ne])?Oe.align[Ne]="left":Oe.align[Ne]=null;for(le=Oe.cells.length,Ne=0;Ne<le;Ne++)Oe.cells[Ne]=H(Oe.cells[Ne].replace(/^ *\| *| *\| *$/g,""),Oe.header.length);return Oe}}},ce.lheading=function(de){var he=this.rules.block.lheading.exec(de);if(he)return{type:"heading",raw:he[0],depth:he[2].charAt(0)==="="?1:2,text:he[1]}},ce.paragraph=function(de){var he=this.rules.block.paragraph.exec(de);if(he)return{type:"paragraph",raw:he[0],text:he[1].charAt(he[1].length-1)===`
|
|
`?he[1].slice(0,-1):he[1]}},ce.text=function(de,he){var Oe=this.rules.block.text.exec(de);if(Oe){var le=he[he.length-1];return le&&le.type==="text"?{raw:Oe[0],text:Oe[0]}:{type:"text",raw:Oe[0],text:Oe[0]}}},ce.escape=function(de){var he=this.rules.inline.escape.exec(de);if(he)return{type:"escape",raw:he[0],text:J(he[1])}},ce.tag=function(de,he,Oe){var le=this.rules.inline.tag.exec(de);if(le)return!he&&/^<a /i.test(le[0])?he=!0:he&&/^<\/a>/i.test(le[0])&&(he=!1),!Oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?Oe=!0:Oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(Oe=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:he,inRawBlock:Oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):J(le[0]):le[0]}},ce.link=function(de){var he=this.rules.inline.link.exec(de);if(he){var Oe=ae(he[2],"()");if(Oe>-1){var le=he[0].indexOf("!")===0?5:4,Ne=le+he[1].length+Oe;he[2]=he[2].substring(0,Oe),he[0]=he[0].substring(0,Ne).trim(),he[3]=""}var We=he[2],lt="";if(this.options.pedantic){var Ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);Ct?(We=Ct[1],lt=Ct[3]):lt=""}else lt=he[3]?he[3].slice(1,-1):"";We=We.trim().replace(/^<([\s\S]*)>$/,"$1");var Rt=fe(he,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:lt&<.replace(this.rules.inline._escapes,"$1")},he[0]);return Rt}},ce.reflink=function(de,he){var Oe;if((Oe=this.rules.inline.reflink.exec(de))||(Oe=this.rules.inline.nolink.exec(de))){var le=(Oe[2]||Oe[1]).replace(/\s+/g," ");if(le=he[le.toLowerCase()],!le||!le.href){var Ne=Oe[0].charAt(0);return{type:"text",raw:Ne,text:Ne}}var We=fe(Oe,le,Oe[0]);return We}},ce.strong=function(de,he,Oe){Oe===void 0&&(Oe="");var le=this.rules.inline.strong.start.exec(de);if(le&&(!le[1]||le[1]&&(Oe===""||this.rules.inline.punctuation.exec(Oe)))){he=he.slice(-1*de.length);var Ne=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ne.lastIndex=0;for(var We;(le=Ne.exec(he))!=null;)if(We=this.rules.inline.strong.middle.exec(he.slice(0,le.index+3)),We)return{type:"strong",raw:de.slice(0,We[0].length),text:de.slice(2,We[0].length-2)}}},ce.em=function(de,he,Oe){Oe===void 0&&(Oe="");var le=this.rules.inline.em.start.exec(de);if(le&&(!le[1]||le[1]&&(Oe===""||this.rules.inline.punctuation.exec(Oe)))){he=he.slice(-1*de.length);var Ne=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ne.lastIndex=0;for(var We;(le=Ne.exec(he))!=null;)if(We=this.rules.inline.em.middle.exec(he.slice(0,le.index+2)),We)return{type:"em",raw:de.slice(0,We[0].length),text:de.slice(1,We[0].length-1)}}},ce.codespan=function(de){var he=this.rules.inline.code.exec(de);if(he){var Oe=he[2].replace(/\n/g," "),le=/[^ ]/.test(Oe),Ne=Oe.startsWith(" ")&&Oe.endsWith(" ");return le&&Ne&&(Oe=Oe.substring(1,Oe.length-1)),Oe=J(Oe,!0),{type:"codespan",raw:he[0],text:Oe}}},ce.br=function(de){var he=this.rules.inline.br.exec(de);if(he)return{type:"br",raw:he[0]}},ce.del=function(de){var he=this.rules.inline.del.exec(de);if(he)return{type:"del",raw:he[0],text:he[1]}},ce.autolink=function(de,he){var Oe=this.rules.inline.autolink.exec(de);if(Oe){var le,Ne;return Oe[2]==="@"?(le=J(this.options.mangle?he(Oe[1]):Oe[1]),Ne="mailto:"+le):(le=J(Oe[1]),Ne=le),{type:"link",raw:Oe[0],text:le,href:Ne,tokens:[{type:"text",raw:le,text:le}]}}},ce.url=function(de,he){var Oe;if(Oe=this.rules.inline.url.exec(de)){var le,Ne;if(Oe[2]==="@")le=J(this.options.mangle?he(Oe[0]):Oe[0]),Ne="mailto:"+le;else{var We;do We=Oe[0],Oe[0]=this.rules.inline._backpedal.exec(Oe[0])[0];while(We!==Oe[0]);le=J(Oe[0]),Oe[1]==="www."?Ne="http://"+le:Ne=le}return{type:"link",raw:Oe[0],text:le,href:Ne,tokens:[{type:"text",raw:le,text:le}]}}},ce.inlineText=function(de,he,Oe){var le=this.rules.inline.text.exec(de);if(le){var Ne;return he?Ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):J(le[0]):le[0]:Ne=J(this.options.smartypants?Oe(le[0]):le[0]),{type:"text",raw:le[0],text:Ne}}},oe}(),Ue=F.noopTest,Se=F.edit,Le=F.merge,ye={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:Ue,table:Ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Se(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Se(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Se(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Se(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Se(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Se(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Le({},ye),ye.gfm=Le({},ye.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*|$)"}),ye.gfm.nptable=Se(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Se(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Le({},ye.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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:Ue,paragraph:Se(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ue,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:Ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Z.punctuation=Se(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=Se(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=Se(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=Se(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=Se(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=Se(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=Se(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=Se(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=Se(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=Se(Z._blockSkip,"g").getRegex(),Z.overlapSkip=Se(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._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])?)+(?![-_])/,Z.autolink=Se(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=Se(Z.tag).replace("comment",ye._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=Se(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=Se(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=Se(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=Le({},Z),Z.pedantic=Le({},Z.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:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=Le({},Z.normal,{escape:Se(Z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Z.gfm.url=Se(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex(),Z.breaks=Le({},Z.gfm,{br:Se(Z.br).replace("{2,}","*").getRegex(),text:Se(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var v={block:ye,inline:Z},L=Y.defaults,z=v.block,ee=v.inline;function $(oe){return oe.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 Ee(oe){var ce="",we,de,he=oe.length;for(we=0;we<he;we++)de=oe.charCodeAt(we),Math.random()>.5&&(de="x"+de.toString(16)),ce+="&#"+de+";";return ce}var Fe=function(){function oe(we){this.tokens=[],this.tokens.links=Object.create(null),this.options=we||L,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var de={block:z.normal,inline:ee.normal};this.options.pedantic?(de.block=z.pedantic,de.inline=ee.pedantic):this.options.gfm&&(de.block=z.gfm,this.options.breaks?de.inline=ee.breaks:de.inline=ee.gfm),this.tokenizer.rules=de}oe.lex=function(de,he){var Oe=new oe(he);return Oe.lex(de)};var ce=oe.prototype;return ce.lex=function(de){return de=de.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(de,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(de,he,Oe){he===void 0&&(he=[]),Oe===void 0&&(Oe=!0),de=de.replace(/^ +$/gm,"");for(var le,Ne,We,lt;de;){if(le=this.tokenizer.space(de)){de=de.substring(le.raw.length),le.type&&he.push(le);continue}if(le=this.tokenizer.code(de,he)){de=de.substring(le.raw.length),le.type?he.push(le):(lt=he[he.length-1],lt.raw+=`
|
|
`+le.raw,lt.text+=`
|
|
`+le.text);continue}if(le=this.tokenizer.fences(de)){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.heading(de)){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.nptable(de)){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.hr(de)){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.blockquote(de)){de=de.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],Oe),he.push(le);continue}if(le=this.tokenizer.list(de)){for(de=de.substring(le.raw.length),We=le.items.length,Ne=0;Ne<We;Ne++)le.items[Ne].tokens=this.blockTokens(le.items[Ne].text,[],!1);he.push(le);continue}if(le=this.tokenizer.html(de)){de=de.substring(le.raw.length),he.push(le);continue}if(Oe&&(le=this.tokenizer.def(de))){de=de.substring(le.raw.length),this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(de)){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.lheading(de)){de=de.substring(le.raw.length),he.push(le);continue}if(Oe&&(le=this.tokenizer.paragraph(de))){de=de.substring(le.raw.length),he.push(le);continue}if(le=this.tokenizer.text(de,he)){de=de.substring(le.raw.length),le.type?he.push(le):(lt=he[he.length-1],lt.raw+=`
|
|
`+le.raw,lt.text+=`
|
|
`+le.text);continue}if(de){var Ct="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return he},ce.inline=function(de){var he,Oe,le,Ne,We,lt,Ct=de.length;for(he=0;he<Ct;he++){lt=de[he];switch(lt.type){case"paragraph":case"text":case"heading":{lt.tokens=[],this.inlineTokens(lt.text,lt.tokens);break}case"table":{for(lt.tokens={header:[],cells:[]},Ne=lt.header.length,Oe=0;Oe<Ne;Oe++)lt.tokens.header[Oe]=[],this.inlineTokens(lt.header[Oe],lt.tokens.header[Oe]);for(Ne=lt.cells.length,Oe=0;Oe<Ne;Oe++)for(We=lt.cells[Oe],lt.tokens.cells[Oe]=[],le=0;le<We.length;le++)lt.tokens.cells[Oe][le]=[],this.inlineTokens(We[le],lt.tokens.cells[Oe][le]);break}case"blockquote":{this.inline(lt.tokens);break}case"list":{for(Ne=lt.items.length,Oe=0;Oe<Ne;Oe++)this.inline(lt.items[Oe].tokens);break}}}return de},ce.inlineTokens=function(de,he,Oe,le,Ne){he===void 0&&(he=[]),Oe===void 0&&(Oe=!1),le===void 0&&(le=!1),Ne===void 0&&(Ne="");var We,lt=de,Ct;if(this.tokens.links){var Rt=Object.keys(this.tokens.links);if(Rt.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(lt))!=null;)Rt.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(lt=lt.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(lt))!=null;)lt=lt.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;de;){if(We=this.tokenizer.escape(de)){de=de.substring(We.raw.length),he.push(We);continue}if(We=this.tokenizer.tag(de,Oe,le)){de=de.substring(We.raw.length),Oe=We.inLink,le=We.inRawBlock,he.push(We);continue}if(We=this.tokenizer.link(de)){de=de.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,le)),he.push(We);continue}if(We=this.tokenizer.reflink(de,this.tokens.links)){de=de.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,le)),he.push(We);continue}if(We=this.tokenizer.strong(de,lt,Ne)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],Oe,le),he.push(We);continue}if(We=this.tokenizer.em(de,lt,Ne)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],Oe,le),he.push(We);continue}if(We=this.tokenizer.codespan(de)){de=de.substring(We.raw.length),he.push(We);continue}if(We=this.tokenizer.br(de)){de=de.substring(We.raw.length),he.push(We);continue}if(We=this.tokenizer.del(de)){de=de.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],Oe,le),he.push(We);continue}if(We=this.tokenizer.autolink(de,Ee)){de=de.substring(We.raw.length),he.push(We);continue}if(!Oe&&(We=this.tokenizer.url(de,Ee))){de=de.substring(We.raw.length),he.push(We);continue}if(We=this.tokenizer.inlineText(de,le,$)){de=de.substring(We.raw.length),Ne=We.raw.slice(-1),he.push(We);continue}if(de){var It="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return he},Q(oe,null,[{key:"rules",get:function(){return{block:z,inline:ee}}}]),oe}(),qe=Y.defaults,Ce=F.cleanUrl,Me=F.escape,He=function(){function oe(we){this.options=we||qe}var ce=oe.prototype;return ce.code=function(de,he,Oe){var le=(he||"").match(/\S*/)[0];if(this.options.highlight){var Ne=this.options.highlight(de,le);Ne!=null&&Ne!==de&&(Oe=!0,de=Ne)}return le?'<pre><code class="'+this.options.langPrefix+Me(le,!0)+'">'+(Oe?de:Me(de,!0))+`</code></pre>
|
|
`:"<pre><code>"+(Oe?de:Me(de,!0))+`</code></pre>
|
|
`},ce.blockquote=function(de){return`<blockquote>
|
|
`+de+`</blockquote>
|
|
`},ce.html=function(de){return de},ce.heading=function(de,he,Oe,le){return this.options.headerIds?"<h"+he+' id="'+this.options.headerPrefix+le.slug(Oe)+'">'+de+"</h"+he+`>
|
|
`:"<h"+he+">"+de+"</h"+he+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(de,he,Oe){var le=he?"ol":"ul",Ne=he&&Oe!==1?' start="'+Oe+'"':"";return"<"+le+Ne+`>
|
|
`+de+"</"+le+`>
|
|
`},ce.listitem=function(de){return"<li>"+de+`</li>
|
|
`},ce.checkbox=function(de){return"<input "+(de?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(de){return"<p>"+de+`</p>
|
|
`},ce.table=function(de,he){return he&&(he="<tbody>"+he+"</tbody>"),`<table>
|
|
<thead>
|
|
`+de+`</thead>
|
|
`+he+`</table>
|
|
`},ce.tablerow=function(de){return`<tr>
|
|
`+de+`</tr>
|
|
`},ce.tablecell=function(de,he){var Oe=he.header?"th":"td",le=he.align?"<"+Oe+' align="'+he.align+'">':"<"+Oe+">";return le+de+"</"+Oe+`>
|
|
`},ce.strong=function(de){return"<strong>"+de+"</strong>"},ce.em=function(de){return"<em>"+de+"</em>"},ce.codespan=function(de){return"<code>"+de+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(de){return"<del>"+de+"</del>"},ce.link=function(de,he,Oe){if(de=Ce(this.options.sanitize,this.options.baseUrl,de),de===null)return Oe;var le='<a href="'+Me(de)+'"';return he&&(le+=' title="'+he+'"'),le+=">"+Oe+"</a>",le},ce.image=function(de,he,Oe){if(de=Ce(this.options.sanitize,this.options.baseUrl,de),de===null)return Oe;var le='<img src="'+de+'" alt="'+Oe+'"';return he&&(le+=' title="'+he+'"'),le+=this.options.xhtml?"/>":">",le},ce.text=function(de){return de},oe}(),Ke=function(){function oe(){}var ce=oe.prototype;return ce.strong=function(de){return de},ce.em=function(de){return de},ce.codespan=function(de){return de},ce.del=function(de){return de},ce.html=function(de){return de},ce.text=function(de){return de},ce.link=function(de,he,Oe){return""+Oe},ce.image=function(de,he,Oe){return""+Oe},ce.br=function(){return""},oe}(),ut=function(){function oe(){this.seen={}}var ce=oe.prototype;return ce.slug=function(de){var he=de.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(he)){var Oe=he;do this.seen[Oe]++,he=Oe+"-"+this.seen[Oe];while(this.seen.hasOwnProperty(he))}return this.seen[he]=0,he},oe}(),bt=Y.defaults,Lt=F.unescape,Ft=function(){function oe(we){this.options=we||bt,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new ut}oe.parse=function(de,he){var Oe=new oe(he);return Oe.parse(de)};var ce=oe.prototype;return ce.parse=function(de,he){he===void 0&&(he=!0);var Oe="",le,Ne,We,lt,Ct,Rt,It,qn,Vt,qt,nn,On,ar,cr,Qn,yr,Sr,Nn,Ar=de.length;for(le=0;le<Ar;le++){qt=de[le];switch(qt.type){case"space":continue;case"hr":{Oe+=this.renderer.hr();continue}case"heading":{Oe+=this.renderer.heading(this.parseInline(qt.tokens),qt.depth,Lt(this.parseInline(qt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Oe+=this.renderer.code(qt.text,qt.lang,qt.escaped);continue}case"table":{for(qn="",It="",lt=qt.header.length,Ne=0;Ne<lt;Ne++)It+=this.renderer.tablecell(this.parseInline(qt.tokens.header[Ne]),{header:!0,align:qt.align[Ne]});for(qn+=this.renderer.tablerow(It),Vt="",lt=qt.cells.length,Ne=0;Ne<lt;Ne++){for(Rt=qt.tokens.cells[Ne],It="",Ct=Rt.length,We=0;We<Ct;We++)It+=this.renderer.tablecell(this.parseInline(Rt[We]),{header:!1,align:qt.align[We]});Vt+=this.renderer.tablerow(It)}Oe+=this.renderer.table(qn,Vt);continue}case"blockquote":{Vt=this.parse(qt.tokens),Oe+=this.renderer.blockquote(Vt);continue}case"list":{for(nn=qt.ordered,On=qt.start,ar=qt.loose,lt=qt.items.length,Vt="",Ne=0;Ne<lt;Ne++)Qn=qt.items[Ne],yr=Qn.checked,Sr=Qn.task,cr="",Qn.task&&(Nn=this.renderer.checkbox(yr),ar?Qn.tokens.length>0&&Qn.tokens[0].type==="text"?(Qn.tokens[0].text=Nn+" "+Qn.tokens[0].text,Qn.tokens[0].tokens&&Qn.tokens[0].tokens.length>0&&Qn.tokens[0].tokens[0].type==="text"&&(Qn.tokens[0].tokens[0].text=Nn+" "+Qn.tokens[0].tokens[0].text)):Qn.tokens.unshift({type:"text",text:Nn}):cr+=Nn),cr+=this.parse(Qn.tokens,ar),Vt+=this.renderer.listitem(cr,Sr,yr);Oe+=this.renderer.list(Vt,nn,On);continue}case"html":{Oe+=this.renderer.html(qt.text);continue}case"paragraph":{Oe+=this.renderer.paragraph(this.parseInline(qt.tokens));continue}case"text":{for(Vt=qt.tokens?this.parseInline(qt.tokens):qt.text;le+1<Ar&&de[le+1].type==="text";)qt=de[++le],Vt+=`
|
|
`+(qt.tokens?this.parseInline(qt.tokens):qt.text);Oe+=he?this.renderer.paragraph(Vt):Vt;continue}default:{var Dn='Token with "'+qt.type+'" type was not found.';if(this.options.silent){console.error(Dn);return}else throw new Error(Dn)}}}return Oe},ce.parseInline=function(de,he){he=he||this.renderer;var Oe="",le,Ne,We=de.length;for(le=0;le<We;le++){Ne=de[le];switch(Ne.type){case"escape":{Oe+=he.text(Ne.text);break}case"html":{Oe+=he.html(Ne.text);break}case"link":{Oe+=he.link(Ne.href,Ne.title,this.parseInline(Ne.tokens,he));break}case"image":{Oe+=he.image(Ne.href,Ne.title,Ne.text);break}case"strong":{Oe+=he.strong(this.parseInline(Ne.tokens,he));break}case"em":{Oe+=he.em(this.parseInline(Ne.tokens,he));break}case"codespan":{Oe+=he.codespan(Ne.text);break}case"br":{Oe+=he.br();break}case"del":{Oe+=he.del(this.parseInline(Ne.tokens,he));break}case"text":{Oe+=he.text(Ne.text);break}default:{var lt='Token with "'+Ne.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return Oe},oe}(),Yt=F.merge,Xt=F.checkSanitizeDeprecation,Je=F.escape,Qe=Y.getDefaults,_t=Y.changeDefaults,xt=Y.defaults;function _e(oe,ce,we){if(typeof oe=="undefined"||oe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof oe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(oe)+", string expected");if(typeof ce=="function"&&(we=ce,ce=null),ce=Yt({},_e.defaults,ce||{}),Xt(ce),we){var de=ce.highlight,he;try{he=Fe.lex(oe,ce)}catch(We){return we(We)}var Oe=function(lt){var Ct;if(!lt)try{Ct=Ft.parse(he,ce)}catch(Rt){lt=Rt}return ce.highlight=de,lt?we(lt):we(null,Ct)};if(!de||de.length<3)return Oe();if(delete ce.highlight,!he.length)return Oe();var le=0;_e.walkTokens(he,function(We){We.type==="code"&&(le++,setTimeout(function(){de(We.text,We.lang,function(lt,Ct){if(lt)return Oe(lt);Ct!=null&&Ct!==We.text&&(We.text=Ct,We.escaped=!0),le--,le===0&&Oe()})},0))}),le===0&&Oe();return}try{var Ne=Fe.lex(oe,ce);return ce.walkTokens&&_e.walkTokens(Ne,ce.walkTokens),Ft.parse(Ne,ce)}catch(We){if(We.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Je(We.message+"",!0)+"</pre>";throw We}}_e.options=_e.setOptions=function(oe){return Yt(_e.defaults,oe),_t(_e.defaults),_e},_e.getDefaults=Qe,_e.defaults=xt,_e.use=function(oe){var ce=Yt({},oe);if(oe.renderer&&function(){var de=_e.defaults.renderer||new He,he=function(Ne){var We=de[Ne];de[Ne]=function(){for(var lt=arguments.length,Ct=new Array(lt),Rt=0;Rt<lt;Rt++)Ct[Rt]=arguments[Rt];var It=oe.renderer[Ne].apply(de,Ct);return It===!1&&(It=We.apply(de,Ct)),It}};for(var Oe in oe.renderer)he(Oe);ce.renderer=de}(),oe.tokenizer&&function(){var de=_e.defaults.tokenizer||new Te,he=function(Ne){var We=de[Ne];de[Ne]=function(){for(var lt=arguments.length,Ct=new Array(lt),Rt=0;Rt<lt;Rt++)Ct[Rt]=arguments[Rt];var It=oe.tokenizer[Ne].apply(de,Ct);return It===!1&&(It=We.apply(de,Ct)),It}};for(var Oe in oe.tokenizer)he(Oe);ce.tokenizer=de}(),oe.walkTokens){var we=_e.defaults.walkTokens;ce.walkTokens=function(de){oe.walkTokens(de),we&&we(de)}}_e.setOptions(ce)},_e.walkTokens=function(oe,ce){for(var we=K(oe),de;!(de=we()).done;){var he=de.value;ce(he);switch(he.type){case"table":{for(var Oe=K(he.tokens.header),le;!(le=Oe()).done;){var Ne=le.value;_e.walkTokens(Ne,ce)}for(var We=K(he.tokens.cells),lt;!(lt=We()).done;)for(var Ct=lt.value,Rt=K(Ct),It;!(It=Rt()).done;){var qn=It.value;_e.walkTokens(qn,ce)}break}case"list":{_e.walkTokens(he.items,ce);break}default:he.tokens&&_e.walkTokens(he.tokens,ce)}}},_e.Parser=Ft,_e.parser=Ft.parse,_e.Renderer=He,_e.TextRenderer=Ke,_e.Lexer=Fe,_e.lexer=Fe.lex,_e.Tokenizer=Te,_e.Slugger=ut,_e.parse=_e;var ie=_e;return ie})},ELLl:function(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},B=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(c,s,i){i&&i!=ne.Init&&(c.removeKeyMap(K),c.state.closeBrackets=null),s&&(M(q(s,"pairs")),c.state.closeBrackets=s,c.addKeyMap(K))});function q(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 M(c){for(var s=0;s<c.length;s++){var i=c.charAt(s),t="'"+i+"'";K[t]||(K[t]=Y(i))}}M(Q.pairs+"`");function Y(c){return function(s){return p(s,c)}}function V(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=V(c);if(!s||c.getOption("disableInput"))return ne.Pass;for(var i=q(s,"pairs"),t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return ne.Pass;var o=g(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return ne.Pass}for(var u=t.length-1;u>=0;u--){var O=t[u].head;c.replaceRange("",B(O.line,O.ch-1),B(O.line,O.ch+1),"+delete")}}function D(c){var s=V(c),i=s&&q(s,"explode");if(!i||c.getOption("disableInput"))return ne.Pass;for(var t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return ne.Pass;var o=g(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return ne.Pass}c.operation(function(){var O=c.lineSeparator()||`
|
|
`;c.replaceSelection(O+O,null),c.execCommand("goCharLeft"),t=c.listSelections();for(var S=0;S<t.length;S++){var R=t[S].head.line;c.indentLine(R,null,!0),c.indentLine(R+1,null,!0)}})}function m(c){var s=ne.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 p(c,s){var i=V(c);if(!i||c.getOption("disableInput"))return ne.Pass;var t=q(i,"pairs"),u=t.indexOf(s);if(u==-1)return ne.Pass;for(var o=q(i,"closeBefore"),O=q(i,"triples"),S=t.charAt(u+1)==s,R=c.listSelections(),A=u%2==0,P,w=0;w<R.length;w++){var E=R[w],h=E.head,f,T=c.getRange(h,B(h.line,h.ch+1));if(A&&!E.empty())f="surround";else if((S||!A)&&T==s)S&&a(c,h)?f="both":O.indexOf(s)>=0&&c.getRange(h,B(h.line,h.ch+3))==s+s+s?f="skipThree":f="skip";else if(S&&h.ch>1&&O.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 ne.Pass;f="addFour"}else if(S){var x=h.ch==0?" ":c.getRange(B(h.line,h.ch-1),h);if(!ne.isWordChar(T)&&x!=s&&!ne.isWordChar(x))f="both";else return ne.Pass}else if(A&&(T.length===0||/\s/.test(T)||o.indexOf(T)>-1))f="both";else return ne.Pass;if(!P)P=f;else if(P!=f)return ne.Pass}var _=u%2?t.charAt(u-1):s,j=u%2?s:t.charAt(u+1);c.operation(function(){if(P=="skip")c.execCommand("goCharRight");else if(P=="skipThree")for(var W=0;W<3;W++)c.execCommand("goCharRight");else if(P=="surround"){for(var C=c.getSelections(),W=0;W<C.length;W++)C[W]=_+C[W]+j;c.replaceSelections(C,"around"),C=c.listSelections().slice();for(var W=0;W<C.length;W++)C[W]=m(C[W]);c.setSelections(C)}else P=="both"?(c.replaceSelection(_+j,null),c.triggerElectric(_+j),c.execCommand("goCharLeft")):P=="addFour"&&(c.replaceSelection(_+_+_+_,"before"),c.execCommand("goCharRight"))})}function g(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(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return ne});function ne(Q,B){if(!Q)throw new Error(B?`Assertion failed (${B})`:"Assertion Failed")}},GfqC:function(wt,Pe,U){"use strict";var ne=U("q1tI"),Q=U.n(ne),B=U("TSYQ"),q=U.n(B);function K(F,k){var y="cannot "+F.method+" "+F.action+" "+k.status+"'",H=new Error(y);return H.status=k.status,H.method=F.method,H.url=F.action,H}function M(F){var k=F.responseText||F.response;if(!k)return k;try{return JSON.parse(k)}catch(y){return k}}function Y(F){var k=new XMLHttpRequest;F.onProgress&&k.upload&&(k.upload.onprogress=function(ae){ae.total>0&&(ae.percent=ae.loaded/ae.total*100),F.onProgress(ae)});var y=new FormData;F.data&&Object.keys(F.data).forEach(function(J){var ae=F.data[J];if(Array.isArray(ae)){ae.forEach(function(fe){y.append(J+"[]",fe)});return}y.append(J,F.data[J])}),F.file instanceof Blob?y.append(F.filename,F.file,F.file.name):y.append(F.filename,F.file),k.onerror=function(ae){F.onError(ae)},k.onload=function(){return k.status<200||k.status>=300?F.onError(K(F,k),M(k)):F.onSuccess(M(k),k)},k.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var H=F.headers||{};return H["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(J){H[J]!==null&&k.setRequestHeader(J,H[J])}),k.send(y),{abort:function(){k.abort()}}}var V=+new Date,r=0;function D(){return"rc-upload-"+V+"-"+ ++r}function m(F,k){return F.indexOf(k,F.length-k.length)!==-1}var p=function(F,k){if(F&&k){var y=Array.isArray(k)?k:k.split(","),H=F.name||"",J=F.type||"",ae=J.replace(/\/.*$/,"");return y.some(function(fe){var ge=fe.trim();return ge.charAt(0)==="."?m(H.toLowerCase(),ge.toLowerCase()):/\/\*$/.test(ge)?ae===ge.replace(/\/.*$/,""):J===ge})}return!0};function g(F,k){var y=F.createReader(),H=[];function J(){y.readEntries(function(ae){var fe=Array.prototype.slice.apply(ae);H=H.concat(fe);var ge=!fe.length;ge?k(H):J()})}J()}var a=function(k,y,H){var J=function ae(fe,ge){ge=ge||"",fe.isFile?fe.file(function(Te){H(Te)&&(fe.fullPath&&!Te.webkitRelativePath&&(Object.defineProperties(Te,{webkitRelativePath:{writable:!0}}),Te.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Te,{webkitRelativePath:{writable:!1}})),y([Te]))}):fe.isDirectory&&g(fe,function(Te){Te.forEach(function(Ue){ae(Ue,""+ge+fe.name+"/")})})};k.forEach(function(ae){J(ae.webkitGetAsEntry())})},c=a,s=Object.assign||function(F){for(var k=1;k<arguments.length;k++){var y=arguments[k];for(var H in y)Object.prototype.hasOwnProperty.call(y,H)&&(F[H]=y[H])}return F},i=function(){function F(k,y){var H=[],J=!0,ae=!1,fe=void 0;try{for(var ge=k[Symbol.iterator](),Te;!(J=(Te=ge.next()).done)&&!(H.push(Te.value),y&&H.length===y);J=!0);}catch(Ue){ae=!0,fe=Ue}finally{try{!J&&ge.return&&ge.return()}finally{if(ae)throw fe}}return H}return function(k,y){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return F(k,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function F(k,y){for(var H=0;H<y.length;H++){var J=y[H];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(k,J.key,J)}}return function(k,y,H){return y&&F(k.prototype,y),H&&F(k,H),k}}();function u(F,k,y){return k in F?Object.defineProperty(F,k,{value:y,enumerable:!0,configurable:!0,writable:!0}):F[k]=y,F}function o(F,k){var y={};for(var H in F){if(k.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(F,H))continue;y[H]=F[H]}return y}function O(F,k){if(!(F instanceof k))throw new TypeError("Cannot call a class as a function")}function S(F,k){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:F}function R(F,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);F.prototype=Object.create(k&&k.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(F,k):F.__proto__=k)}var A=function(k){return Object.keys(k).reduce(function(y,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(y[H]=k[H]),y},{})},P=function(F){R(k,F);function k(){var y,H,J,ae;O(this,k);for(var fe=arguments.length,ge=Array(fe),Te=0;Te<fe;Te++)ge[Te]=arguments[Te];return ae=(H=(J=S(this,(y=k.__proto__||Object.getPrototypeOf(k)).call.apply(y,[this].concat(ge))),J),J.state={uid:D()},J.reqs={},J.onChange=function(Ue){var Se=Ue.target.files;J.uploadFiles(Se),J.reset()},J.onClick=function(Ue){var Se=J.fileInput;if(!Se)return;var Le=J.props,ye=Le.children,Z=Le.onClick;ye&&ye.type==="button"&&(Se.parentNode.focus(),Se.parentNode.querySelector("button").blur()),Se.click(),Z&&Z(Ue)},J.onKeyDown=function(Ue){Ue.key==="Enter"&&J.onClick()},J.onFileDrop=function(Ue){var Se=J.props.multiple;if(Ue.preventDefault(),Ue.type==="dragover")return;if(J.props.directory)c(Array.prototype.slice.call(Ue.dataTransfer.items),J.uploadFiles,function(ye){return p(ye,J.props.accept)});else{var Le=Array.prototype.slice.call(Ue.dataTransfer.files).filter(function(ye){return p(ye,J.props.accept)});Se===!1&&(Le=Le.slice(0,1)),J.uploadFiles(Le)}},J.uploadFiles=function(Ue){var Se=Array.prototype.slice.call(Ue);Se.map(function(Le){return Le.uid=D(),Le}).forEach(function(Le){J.upload(Le,Se)})},J.saveFileInput=function(Ue){J.fileInput=Ue},H),S(J,ae)}return t(k,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,J){var ae=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return ae.post(H)},0);var ge=fe.beforeUpload(H,J);ge&&ge.then?ge.then(function(Te){var Ue=Object.prototype.toString.call(Te);return Ue==="[object File]"||Ue==="[object Blob]"?ae.post(Te):ae.post(H)}).catch(function(Te){console.log(Te)}):ge!==!1&&setTimeout(function(){return ae.post(H)},0);return}},{key:"post",value:function(H){var J=this;if(!this._isMounted)return;var ae=this.props,fe=ae.onStart,ge=ae.onProgress,Te=ae.transformFile,Ue=Te===void 0?function(Se){return Se}:Te;new Promise(function(Se){var Le=ae.action;return typeof Le=="function"&&(Le=Le(H)),Se(Le)}).then(function(Se){var Le=H.uid,ye=ae.customRequest||Y,Z=Promise.resolve(Ue(H)).then(function(v){var L=ae.data;return typeof L=="function"&&(L=L(v)),Promise.all([v,L])}).catch(function(v){console.error(v)});Z.then(function(v){var L=i(v,2),z=L[0],ee=L[1],$={action:Se,filename:ae.name,data:ee,file:z,headers:ae.headers,withCredentials:ae.withCredentials,method:ae.method||"post",onProgress:ge?function(Ee){ge(Ee,H)}:null,onSuccess:function(Fe,qe){delete J.reqs[Le],ae.onSuccess(Fe,H,qe)},onError:function(Fe,qe){delete J.reqs[Le],ae.onError(Fe,qe,H)}};fe(H),J.reqs[Le]=ye($)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(H){var J=this.reqs;if(H){var ae=H;H&&H.uid&&(ae=H.uid),J[ae]&&J[ae].abort&&J[ae].abort(),delete J[ae]}else Object.keys(J).forEach(function(fe){J[fe]&&J[fe].abort&&J[fe].abort(),delete J[fe]})}},{key:"render",value:function(){var H,J=this.props,ae=J.component,fe=J.prefixCls,ge=J.className,Te=J.disabled,Ue=J.id,Se=J.style,Le=J.multiple,ye=J.accept,Z=J.children,v=J.directory,L=J.openFileDialogOnClick,z=J.onMouseEnter,ee=J.onMouseLeave,$=o(J,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ee=q()((H={},u(H,fe,!0),u(H,fe+"-disabled",Te),u(H,ge,ge),H)),Fe=Te?{}:{onClick:L?this.onClick:function(){},onKeyDown:L?this.onKeyDown:function(){},onMouseEnter:z,onMouseLeave:ee,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Q.a.createElement(ae,s({},Fe,{className:Ee,role:"button",style:Se}),Q.a.createElement("input",s({},A($),{id:Ue,type:"file",ref:this.saveFileInput,onClick:function(Ce){return Ce.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ye,directory:v?"directory":null,webkitdirectory:v?"webkitdirectory":null,multiple:Le,onChange:this.onChange})),Z)}}]),k}(ne.Component),w=P,E=Object.assign||function(F){for(var k=1;k<arguments.length;k++){var y=arguments[k];for(var H in y)Object.prototype.hasOwnProperty.call(y,H)&&(F[H]=y[H])}return F},h=function(){function F(k,y){for(var H=0;H<y.length;H++){var J=y[H];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(k,J.key,J)}}return function(k,y,H){return y&&F(k.prototype,y),H&&F(k,H),k}}();function f(F,k){if(!(F instanceof k))throw new TypeError("Cannot call a class as a function")}function T(F,k){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:F}function x(F,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);F.prototype=Object.create(k&&k.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(F,k):F.__proto__=k)}function _(){}var j=function(F){x(k,F);function k(){var y,H,J,ae;f(this,k);for(var fe=arguments.length,ge=Array(fe),Te=0;Te<fe;Te++)ge[Te]=arguments[Te];return ae=(H=(J=T(this,(y=k.__proto__||Object.getPrototypeOf(k)).call.apply(y,[this].concat(ge))),J),J.saveUploader=function(Ue){J.uploader=Ue},H),T(J,ae)}return h(k,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return Q.a.createElement(w,E({},this.props,{ref:this.saveUploader}))}}]),k}(ne.Component);j.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 W=j,C=Pe.a=W},HmJG:function(wt,Pe,U){},IBYe:function(wt,Pe,U){"use strict";function ne(Q){return null}Pe.a=ne},JYp7:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return ne});var ne;(function(Q){function B(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}Q.is=B;const q=Object.freeze([]);function K(){return q}Q.empty=K;function*M(o){yield o}Q.single=M;function Y(o){return o||q}Q.from=Y;function V(o){return!o||o[Symbol.iterator]().next().done===!0}Q.isEmpty=V;function r(o){return o[Symbol.iterator]().next().value}Q.first=r;function D(o,O){for(const S of o)if(O(S))return!0;return!1}Q.some=D;function m(o,O){for(const S of o)if(O(S))return S;return}Q.find=m;function*p(o,O){for(const S of o)O(S)&&(yield S)}Q.filter=p;function*g(o,O){let S=0;for(const R of o)yield O(R,S++)}Q.map=g;function*a(...o){for(const O of o)for(const S of O)yield S}Q.concat=a;function*c(o){for(const O of o)for(const S of O)yield S}Q.concatNested=c;function s(o,O,S){let R=S;for(const A of o)R=O(R,A);return R}Q.reduce=s;function*i(o,O,S=o.length){for(O<0&&(O+=o.length),S<0?S+=o.length:S>o.length&&(S=o.length);O<S;O++)yield o[O]}Q.slice=i;function t(o,O=Number.POSITIVE_INFINITY){const S=[];if(O===0)return[S,o];const R=o[Symbol.iterator]();for(let A=0;A<O;A++){const P=R.next();if(P.done)return[S,Q.empty()];S.push(P.value)}return[S,{[Symbol.iterator](){return R}}]}Q.consume=t;function u(o,O,S=(R,A)=>R===A){const R=o[Symbol.iterator](),A=O[Symbol.iterator]();for(;;){const P=R.next(),w=A.next();if(P.done!==w.done)return!1;if(P.done)return!0;if(!S(P.value,w.value))return!1}}Q.equals=u})(ne||(ne={}))},LYsE:function(wt,Pe,U){"use strict";var ne=U("9og8"),Q=U("giR+"),B=U("fyUT"),q=U("2qtc"),K=U("kLXV"),M=U("/zsF"),Y=U("PArb"),V=U("14J3"),r=U("BMrR"),D=U("+L6B"),m=U("2/Rp"),p=U("k1fw"),g=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+"),O=U("5NDa"),S=U("5rEg"),R=U("jCWc"),A=U("kPKH"),P=U("BoS7"),w=U("Sdc0"),E=U("7Kak"),h=U("9yH6"),f=U("sRBo"),T=U("kaz8"),x=U("miYZ"),_=U("tsqr"),j=U("oBTY"),W=U("PpiC"),C=U("Ty5D"),F=U("9kvl"),k=U("V0Rq"),y=U("Ot1p"),H=U("kqOp"),J=U("7qnI"),ae=U("1vsH"),fe=U("YJx+"),ge=U.n(fe),Te=U("9Bee"),Ue=U("u2Z1"),Se=["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"],Le="\u2581",ye=function(Be,pt){var Ie=Be.problemset,xe=Be.globalSetting,ve=Be.exercise,Hn=Be.loading,kt=Be.dispatch,ke=Be.editData,dt=Be.editKey,Re=Be.setEditKey,an=Re===void 0?function(){}:Re,hr=Be.cancelAdd,mr=hr===void 0?function(){}:hr,Kn=Be.addCallback,Wt=Kn===void 0?function(){}:Kn,dr=Be.reload,ht=dr===void 0?function(){}:dr,Un=Be.setIsClaer,yn=Un===void 0?function(){}:Un,un=Object(W.a)(Be,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),Qt=Object(i.useState)(""),Ln=Object(a.a)(Qt,2),hn=Ln[0],en=Ln[1],Ut=Object(i.useState)(""),Kt=Object(a.a)(Ut,2),sr=Kt[0],or=Kt[1],Fn=Object(i.useState)([]),bn=Object(a.a)(Fn,2),Bt=bn[0],$t=bn[1],Gt=Object(i.useState)(""),Dt=Object(a.a)(Gt,2),er=Dt[0],An=Dt[1],fn=Object(i.useState)(),Vn=Object(a.a)(fn,2),dn=Vn[0],_n=Vn[1],tn=Object(i.useState)(!1),kn=Object(a.a)(tn,2),tr=kn[0],nr=kn[1],wn=Object(i.useState)(),Mn=Object(a.a)(wn,2),cn=Mn[0],lr=Mn[1],Xn=Object(i.useState)(0),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)(!1),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useState)(!1),vn=Object(a.a)(Cn,2),Zt=vn[0],St=vn[1],Mt=Object(i.useState)([]),Nt=Object(a.a)(Mt,2),At=Nt[0],zt=Nt[1],on=Object(i.useState)(1),sn=Object(a.a)(on,2),ft=sn[0],rt=sn[1],Ye=Object(i.useState)(!1),et=Object(a.a)(Ye,2),Ge=et[0],ot=et[1],tt=Object(i.useRef)(!1),mt=Object(C.i)(),Tt=Object(i.useState)([]),gt=Object(a.a)(Tt,2),Pt=gt[0],vt=gt[1],Et=function(Jn){vt([].concat(Object(j.a)(Pt),[Object(p.a)({},Jn)]))};Object(i.useEffect)(function(){if(tt.current)return;if(!(ke!=null&&ke.question_title)){En(!0),en(""),_n(!1),lr(2),$t([]),An(""),nr(!1);return}en(ke==null?void 0:ke.question_title),_n(ke==null?void 0:ke.is_ordered),rt(ke==null?void 0:ke.difficulty),ot(!(ke!=null&&ke.repeat_answer)),lr(ke==null?void 0:ke.question_score);var Er=ke==null?void 0:ke.standard_answer.map(function(Jn){return Jn.answer_text});$t(Object(j.a)(Er)),zt(ke.tag_discipline_ids),or(ke==null?void 0:ke.analysis)},[ke,Rn]),Object(i.useEffect)(function(){nr(!1),Rn&&Er();function Er(){return Jn.apply(this,arguments)}function Jn(){return Jn=Object(ne.a)(s.a.mark(function xr(){var br,wr,Ur;return s.a.wrap(function(Fr){for(;;)switch(Fr.prev=Fr.next){case 0:return Fr.next=2,Object(k.I)({sub_discipline_id:(br=ve.editData)===null||br===void 0||((wr=br.exercise)===null||wr===void 0)?void 0:wr.sub_discipline_id});case 2:Ur=Fr.sent,vt(Ur.tag_disciplines);case 4:case"end":return Fr.stop()}},xr)})),Jn.apply(this,arguments)}},[Rn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Jt,isEdit:Rn}}),Object(i.useEffect)(function(){var Er,Jn=ve!=null&&(Er=ve.tagDisciplineData)!==null&&Er!==void 0&&Er.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];vt(Jn)},[ve.tagDisciplineData]);var ln=function(Jn){(Jn==null?void 0:Jn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),En(!1),an(-1),tt.current=!1,ht())},Jt=function(){var Er=Object(ne.a)(s.a.mark(function Jn(){var xr,br,wr,Ur,Vr,Fr,kr;return s.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(xr=[],br=!1,St(!0),Bt.forEach(function(Si,Zr){xr.push({choice_id:Zr+1,answer_text:[]}),Si.forEach(function(ei,yi){xr[Zr].answer_text.push(ei),(!ei||!Object(ae.eb)(ei,1e4))&&(An("".concat(Zr,"-").concat(yi)),_.b.info(ei?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),br=!0)})}),!br){Kr.next=7;break}return St(!1),Kr.abrupt("return",!1);case 7:if(tt.current=!0,!ke.question_id){Kr.next=19;break}if(!((ke==null?void 0:ke.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(ne.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,kt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:ft,is_cover:1,repeat_answer:!Ge,analysis:sr}});case 2:wr=fi.sent,ln(wr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}(),onCancel:function(){var Si=Object(ne.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,kt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:ft,repeat_answer:!Ge,analysis:sr}});case 2:wr=fi.sent,ln(wr);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,kt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:ft,repeat_answer:!Ge,analysis:sr}});case 15:wr=Kr.sent,ln(wr);case 17:Kr.next=23;break;case 19:return Kr.next=21,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:ke==null?void 0:ke.insert_id,categoryId:mt.categoryId,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:xr,tag_discipline_ids:At,sub_discipline_id:(Fr=ve.editData)===null||Fr===void 0||((kr=Fr.exercise)===null||kr===void 0)?void 0:kr.sub_discipline_id,difficulty:ft,repeat_answer:!Ge,analysis:sr}});case 21:wr=Kr.sent,ln(wr);case 23:return St(!1),Kr.abrupt("return",{name:hn,analysis:sr,standard_answers:xr,is_ordered:dn});case 25:case"end":return Kr.stop()}},Jn)}));return function(){return Er.apply(this,arguments)}}(),fr=function(Jn,xr,br){var wr=Bt.slice();if(xr&&wr.splice(Jn,xr),br&&tr||!ke.question_id)for(var Ur=0;Ur<br;Ur++)wr.splice(Jn+Ur,0,[""]);Gn(wr==null?void 0:wr.length),nr(!0),console.log(wr,"newStandardAnswers"),$t(wr)},jn=function(Jn,xr,br){An("");var wr=Bt.slice();wr[Jn][xr]=br,$t(wr)},Wn=function(Jn){var xr=Bt.slice();xr[Jn]=[].concat(Object(j.a)(xr[Jn]),[""]),$t(xr)},jt=function(Jn,xr){var br=Bt.slice();if(!br[Jn][xr]){br[Jn]=br[Jn].filter(function(wr,Ur){return Ur!==xr}),$t(br);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:ge.a.modal,onOk:function(){br[Jn]=br[Jn].filter(function(Ur,Vr){return Vr!==xr}),$t(br)}})},pn=function(Jn){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:ge.a.modal,onOk:function(){var br=0;en(hn.replace(/\▁/g,function(wr){return br++,br-1===Jn?"":wr})),setTimeout(function(){var wr=Bt.slice();wr=Bt.filter(function(Ur,Vr){return Jn!==Vr}),$t(wr)},500)}})},In=function(){},zn=function(){var Jn,xr,br,wr,Ur,Vr;return console.log(Bt,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:ge.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:hn,onChange:function(kr){return en(kr)},showNullButton:((Jn=ve.editData)===null||Jn===void 0||((xr=Jn.exercise)===null||xr===void 0)?void 0:xr.exercise_status)===1,deleteEmptyDisabled:!(((br=ve.editData)===null||br===void 0||((wr=br.exercise)===null||wr===void 0)?void 0:wr.exercise_status)===1)||Zt,onPlaceholderChange:fr})),t.a.createElement("div",{className:"mt20"},Bt.map(function(Fr,kr){var Ti,Kr;return t.a.createElement(J.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:er,onAnswerChange:jn,addChildAnswer:Wn,deleteChildAnswer:jt,deleteChildAnswermain:pn})})),t.a.createElement("div",{className:"mt20"},Bt.length>1&&t.a.createElement("span",null,t.a.createElement(T.a,{checked:dn,onChange:function(kr){return _n(kr.target.checked)},className:"".concat(ge.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ge.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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:sr,onChange:function(kr){return or(kr)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:cn,max:1e4,min:0,onChange:function(kr){lr(kr)}})," ","\u5206 \xA0"," ",!!cn&&!!gr&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(cn/gr).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:ft,onChange:function(kr){rt(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:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{value:At,selectvalues:ke==null?void 0:ke.tag_discipline_ids,onChange:zt,subId:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:Pt,onAddKnowledgeFinish:Et})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(w.a,{checked:Ge,onChange:function(kr){ot(kr)}}))),t.a.createElement("aside",{className:"tr"},(dt!==-1||ke.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){mr(),En(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Jt()}},"\u4FDD\u5B58")))},mn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Er){var Jn,xr;return(ve==null||((Jn=ve.editData)===null||Jn===void 0||((xr=Jn.exercise)===null||xr===void 0))?void 0:xr.exercise_status)===1?Er:Er.id!=="del"&&Er.id!=="add"}),Ir=function(){var Er=Object(ne.a)(s.a.mark(function Jn(xr){return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:if(!(dt!==-1)){wr.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),wr.abrupt("return");case 3:wr.t0=xr.id,wr.next=wr.t0==="del"?6:wr.t0==="up"||wr.t0==="down"?8:wr.t0==="edit"?12:wr.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(ne.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(k.n)({id:ke.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},mt)});case 3:case"end":return kr.stop()}},Vr)}))()}}),wr.abrupt("break",17);case 8:return wr.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:ke.question_id,opr:xr.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},mt)}),wr.abrupt("break",17);case 12:return an(ke.dragKey),En(!0),wr.abrupt("break",17);case 15:return Wt({key:ke.key,insert_id:ke==null?void 0:ke.question_id,question_type:3}),wr.abrupt("break",17);case 17:case"end":return wr.stop()}},Jn)}));return function(xr){return Er.apply(this,arguments)}}(),jr=function(){var Jn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(ke!=null&&ke.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ke.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ke.question_score,"\u5206\uFF09")),ke!=null&&ke.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ke.key,"."),t.a.createElement(Te.a,{value:ke.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ke.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:ke.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},ke==null||((Jn=ke.standard_answer)===null||Jn===void 0)?void 0:Jn.map(function(xr,br){return t.a.createElement(r.a,{key:br,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",xr.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},xr.answer_text.map(function(wr,Ur){return t.a.createElement(A.a,{span:24,key:Ur},t.a.createElement(S.a,{key:br,checked:ke.standard_answer.includes(br),disabled:!0,value:wr}))}))))})),t.a.createElement("div",{className:ge.a.action},!ke.hideAction&&mn.map(function(xr,br){return xr.id==="up"&&ke.key===1||xr.id==="down"&&ke.key===ke.len?null:t.a.createElement(o.a,{key:br,placement:"bottom",title:xr.name},t.a.createElement("span",{onClick:function(){return Ir(xr)},className:xr.icon}))})))};return t.a.createElement("section",{className:ge.a.wrap},!Rn&&jr(),Rn&&zn())},Z=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.exercise,xe=at.globalSetting;return{problemset:Be,globalSetting:xe,exercise:Ie,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ye)),v=["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"],L=function(Be,pt){var Ie=Be.problemset,xe=Be.globalSetting,ve=Be.exercise,Hn=Be.loading,kt=Be.dispatch,ke=Be.onRef,dt=ke===void 0?function(){}:ke,Re=Be.editData,an=Be.editKey,hr=Be.setEditKey,mr=hr===void 0?function(){}:hr,Kn=Be.cancelAdd,Wt=Kn===void 0?function(){}:Kn,dr=Be.reload,ht=dr===void 0?function(){}:dr,Un=Be.addCallback,yn=Un===void 0?function(){}:Un,un=Be.setIsClaer,Qt=un===void 0?function(){}:un,Ln=Object(W.a)(Be,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),hn=Object(i.useState)(),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(""),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(!1),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)(),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)([]),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)([]),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(1),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)(""),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Zt=Object(i.useRef)(!1),St=function(Ye){Mn([].concat(Object(j.a)(wn),[Object(p.a)({},Ye)]))},Mt=Object(C.i)();Object(i.useEffect)(function(){if(Zt.current)return;if(!(Re!=null&&Re.question_choices)){Dt(!0),bn(""),Vn(2),Kt("");return}_r(!(Re!=null&&Re.repeat_answer)),bn(Re==null?void 0:Re.question_title),Vn(Re==null?void 0:Re.question_score),vr(Re==null?void 0:Re.difficulty),Kt(Re.standard_answer[0]+""),kn(Re.tag_discipline_ids),vn(Re==null?void 0:Re.analysis)},[Re,Gt]),Object(i.useEffect)(function(){Gt&&rt();function rt(){return Ye.apply(this,arguments)}function Ye(){return Ye=Object(ne.a)(s.a.mark(function et(){var Ge,ot,tt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(k.I)({sub_discipline_id:(Ge=ve.editData)===null||Ge===void 0||((ot=Ge.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id});case 2:tt=Tt.sent,Mn(tt.tag_disciplines);case 4:case"end":return Tt.stop()}},et)})),Ye.apply(this,arguments)}},[Gt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:At,isEdit:Gt}}),Object(i.useEffect)(function(){var rt,Ye=ve!=null&&(rt=ve.tagDisciplineData)!==null&&rt!==void 0&&rt.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Mn(Ye)},[ve.tagDisciplineData]);var Nt=function(Ye){(Ye==null?void 0:Ye.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Dt(!1),mr(-1),Zt.current=!1,ht())},At=function(){var rt=Object(ne.a)(s.a.mark(function Ye(){var et,Ge,ot,tt,mt,Tt;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(Fn){Pt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Pt.abrupt("return",!1);case 3:if(Ut){Pt.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Pt.abrupt("return",!1);case 6:if(et=[{choice_text:"\u6B63\u786E",is_answer:Ut==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Ut==="2"?2:0}],Zt.current=!0,!Re.question_id){Pt.next=19;break}if(!((Re==null?void 0:Re.is_my)===1)){Pt.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 vt=Object(ne.a)(s.a.mark(function ln(){var Jt,fr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:et.map(function(jt){return jt.choice_text}),standard_answers:et.filter(function(jt){return jt.is_answer}).map(function(jt){return jt.is_answer}),tag_discipline_ids:tn,sub_discipline_id:(Jt=ve.editData)===null||Jt===void 0||((fr=Jt.exercise)===null||fr===void 0)?void 0:fr.sub_discipline_id,difficulty:Xn,is_cover:1,repeat_answer:!Bn,analysis:Cn}});case 2:Ge=Wn.sent,Nt(Ge);case 4:case"end":return Wn.stop()}},ln)}));function Et(){return vt.apply(this,arguments)}return Et}(),onCancel:function(){var vt=Object(ne.a)(s.a.mark(function ln(){var Jt,fr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:et.map(function(jt){return jt.choice_text}),standard_answers:et.filter(function(jt){return jt.is_answer}).map(function(jt){return jt.is_answer}),tag_discipline_ids:tn,sub_discipline_id:(Jt=ve.editData)===null||Jt===void 0||((fr=Jt.exercise)===null||fr===void 0)?void 0:fr.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 2:Ge=Wn.sent,Nt(Ge);case 4:case"end":return Wn.stop()}},ln)}));function Et(){return vt.apply(this,arguments)}return Et}()}),Pt.next=17;break;case 13:return Pt.next=15,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Fn,question_type:2,question_score:fn,question_choices:et.map(function(vt){return vt.choice_text}),standard_answers:et.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:tn,sub_discipline_id:(ot=ve.editData)===null||ot===void 0||((tt=ot.exercise)===null||tt===void 0)?void 0:tt.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 15:Ge=Pt.sent,Nt(Ge);case 17:Pt.next=23;break;case 19:return Pt.next=21,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:Mt.categoryId,question_title:Fn,question_type:2,question_score:fn,question_choices:et.map(function(vt){return vt.choice_text}),standard_answers:et.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:tn,sub_discipline_id:(mt=ve.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Cn}});case 21:Ge=Pt.sent,Nt(Ge);case 23:return Pt.abrupt("return",{name:Fn,choices:et});case 24:case"end":return Pt.stop()}},Ye)}));return function(){return rt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(rt){var Ye,et;return(ve==null||((Ye=ve.editData)===null||Ye===void 0||((et=Ye.exercise)===null||et===void 0))?void 0:et.exercise_status)===1?rt:rt.id!=="del"&&rt.id!=="add"}),on=function(){var rt=Object(ne.a)(s.a.mark(function Ye(et){return s.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(!(an!==-1)){ot.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ot.abrupt("return");case 3:ot.t0=et.id,ot.next=ot.t0==="del"?6:ot.t0==="up"||ot.t0==="down"?8:ot.t0==="edit"?12:ot.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(ne.a)(s.a.mark(function mt(){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(k.n)({id:Re.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},Mt)});case 3:case"end":return gt.stop()}},mt)}))()}}),ot.abrupt("break",17);case 8:return ot.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:et.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},Mt)}),ot.abrupt("break",17);case 12:return mr(Re.dragKey),Dt(!0),ot.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:2}),ot.abrupt("break",17);case 17:case"end":return ot.stop()}},Ye)}));return function(et){return rt.apply(this,arguments)}}(),sn=function(){var Ye;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Te.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:Re.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},Re==null||((Ye=Re.question_choices)===null||Ye===void 0)?void 0:Ye.map(function(et,Ge){return t.a.createElement(h.a,{key:Ge,checked:Re.standard_answer.includes(Ge+1),disabled:!0},v[Ge],"."," ",t.a.createElement("span",{className:"c-black font14"},et.choice_text))})),t.a.createElement("div",{className:ge.a.action},!Re.hideAction&&zt.map(function(et,Ge){return et.id==="up"&&Re.key===1||et.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:Ge,placement:"bottom",title:et.name},t.a.createElement("span",{onClick:function(){return on(et)},className:et.icon}))})))},ft=function(){var Ye,et;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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fn,onChange:function(ot){return bn(ot)}}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ge.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:Ut,onChange:function(ot){return Kt(ot.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(ge.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:ge.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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Cn,onChange:function(ot){return vn(ot)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:fn,max:1e4,min:0,onChange:function(ot){Vn(ot)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Xn,onChange:function(ot){vr(ot.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:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{value:tn,selectvalues:Re==null?void 0:Re.tag_discipline_ids,onChange:kn,subId:(Ye=ve.editData)===null||Ye===void 0||((et=Ye.exercise)===null||et===void 0)?void 0:et.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:St})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(w.a,{checked:Bn,onChange:function(ot){_r(ot)}}))),t.a.createElement("aside",{className:"tr"},(an!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Wt(),Dt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){At()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ge.a.wrap},!Gt&&sn(),Gt&&ft())},z=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.exercise,xe=at.globalSetting;return{problemset:Be,globalSetting:xe,exercise:Ie,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(L)),ee=["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"],$=Object(i.forwardRef)(function(at,Be){var pt=at.problemset,Ie=at.globalSetting,xe=at.exercise,ve=at.loading,Hn=at.dispatch,kt=at.onRef,ke=kt===void 0?function(){}:kt,dt=at.editData,Re=at.cancelAdd,an=Re===void 0?function(){}:Re,hr=at.editKey,mr=at.setEditKey,Kn=mr===void 0?function(){}:mr,Wt=at.setIsClaer,dr=Wt===void 0?function(){}:Wt,ht=at.addCallback,Un=ht===void 0?function(Tt){}:ht,yn=at.reload,un=yn===void 0?function(){}:yn,Qt=Object(W.a)(at,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Ln=Object(i.useState)([]),hn=Object(a.a)(Ln,2),en=hn[0],Ut=hn[1],Kt=Object(i.useState)(),sr=Object(a.a)(Kt,2),or=sr[0],Fn=sr[1],bn=Object(i.useState)([]),Bt=Object(a.a)(bn,2),$t=Bt[0],Gt=Bt[1],Dt=Object(i.useState)(""),er=Object(a.a)(Dt,2),An=er[0],fn=er[1],Vn=Object(i.useState)(),dn=Object(a.a)(Vn,2),_n=dn[0],tn=dn[1],kn=Object(i.useState)(!1),tr=Object(a.a)(kn,2),nr=tr[0],wn=tr[1],Mn=Object(i.useState)([]),cn=Object(a.a)(Mn,2),lr=cn[0],Xn=cn[1],vr=Object(i.useState)(1),gr=Object(a.a)(vr,2),Gn=gr[0],Bn=gr[1],_r=Object(i.useState)(!1),Rn=Object(a.a)(_r,2),En=Rn[0],Cn=Rn[1],vn=Object(i.useState)(""),Zt=Object(a.a)(vn,2),St=Zt[0],Mt=Zt[1],Nt=Object(i.useState)([]),At=Object(a.a)(Nt,2),zt=At[0],on=At[1],sn=Object(i.useRef)(!1),ft=function(gt){on([].concat(Object(j.a)(zt),[Object(p.a)({},gt)]))},rt=Object(C.i)();Object(i.useEffect)(function(){Ut(["","","",""])},[]),Object(i.useEffect)(function(){if(sn.current)return;if(!(dt!=null&&dt.question_choices)){wn(!0),fn(""),tn(5),Ut(["","","",""]),Gt([]);return}fn(dt==null?void 0:dt.question_title),tn(dt==null?void 0:dt.question_score),Cn(!(dt!=null&&dt.repeat_answer)),Bn(dt==null?void 0:dt.difficulty),Ut(dt==null?void 0:dt.question_choices.map(function(gt){return gt.choice_text}));var Tt=[];dt==null||dt.standard_answer.map(function(gt,Pt){Tt.push(gt-1)}),Gt(Tt),Xn(dt.tag_discipline_ids),Mt(dt==null?void 0:dt.analysis)},[dt,nr]),Object(i.useEffect)(function(){nr&&Tt();function Tt(){return gt.apply(this,arguments)}function gt(){return gt=Object(ne.a)(s.a.mark(function Pt(){var vt,Et,ln;return s.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return fr.next=2,Object(k.I)({sub_discipline_id:(vt=xe.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0)?void 0:Et.sub_discipline_id});case 2:ln=fr.sent,on(ln.tag_disciplines);case 4:case"end":return fr.stop()}},Pt)})),gt.apply(this,arguments)}},[nr]),Object(i.useImperativeHandle)(Be,function(){return{onSave:et,isEdit:nr}}),Object(i.useEffect)(function(){var Tt,gt=xe!=null&&(Tt=xe.tagDisciplineData)!==null&&Tt!==void 0&&Tt.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];on(gt)},[xe.tagDisciplineData]);var Ye=function(gt){(gt==null?void 0:gt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Kn(-1),sn.current=!1,un())},et=function(){var Tt=Object(ne.a)(s.a.mark(function gt(){var Pt,vt,Et,ln,Jt,fr,jn;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(An){jt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),jt.abrupt("return",!1);case 3:if(Pt=en.findIndex(function(pn){return!pn}),!(Pt>-1)){jt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ee[Pt]," \u9009\u9879\u7684\u5185\u5BB9")),jt.abrupt("return",!1);case 7:if($t.length){jt.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"),jt.abrupt("return",!1);case 10:if(!($t.length<1)){jt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),jt.abrupt("return",!1);case 13:if(vt=en.map(function(pn,In){return{choice_text:pn,is_answer:$t.includes(In)?In+1:0}}),sn.current=!0,!dt.question_id){jt.next=26;break}if(!((dt==null?void 0:dt.is_my)===1)){jt.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 pn=Object(ne.a)(s.a.mark(function zn(){var mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Hn({type:"exercise/editExerciseQuestion",payload:{id:dt.question_id,question_title:An,question_type:1,question_score:_n,question_choices:vt.map(function(Jn){return Jn.choice_text}),standard_answers:vt.filter(function(Jn){return Jn.is_answer}).map(function(Jn){return Jn.is_answer}),tag_discipline_ids:lr,sub_discipline_id:(mn=xe.editData)===null||mn===void 0||((Ir=mn.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:Gn,is_cover:1,repeat_answer:!En,analysis:St}});case 2:Et=Er.sent,Ye(Et);case 4:case"end":return Er.stop()}},zn)}));function In(){return pn.apply(this,arguments)}return In}(),onCancel:function(){var pn=Object(ne.a)(s.a.mark(function zn(){var mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Hn({type:"exercise/editExerciseQuestion",payload:{id:dt.question_id,question_title:An,question_type:1,question_score:_n,question_choices:vt.map(function(Jn){return Jn.choice_text}),standard_answers:vt.filter(function(Jn){return Jn.is_answer}).map(function(Jn){return Jn.is_answer}),tag_discipline_ids:lr,sub_discipline_id:(mn=xe.editData)===null||mn===void 0||((Ir=mn.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 2:Et=Er.sent,Ye(Et);case 4:case"end":return Er.stop()}},zn)}));function In(){return pn.apply(this,arguments)}return In}()}),jt.next=24;break;case 20:return jt.next=22,Hn({type:"exercise/editExerciseQuestion",payload:{id:dt.question_id,question_title:An,question_type:1,question_score:_n,question_choices:vt.map(function(pn){return pn.choice_text}),standard_answers:vt.filter(function(pn){return pn.is_answer}).map(function(pn){return pn.is_answer}),tag_discipline_ids:lr,sub_discipline_id:(ln=xe.editData)===null||ln===void 0||((Jt=ln.exercise)===null||Jt===void 0)?void 0:Jt.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 22:Et=jt.sent,Ye(Et);case 24:jt.next=30;break;case 26:return jt.next=28,Hn({type:"exercise/addExerciseQuestion",payload:{insert_id:dt==null?void 0:dt.insert_id,categoryId:rt.categoryId,question_title:An,question_type:1,question_score:_n,question_choices:vt.map(function(pn){return pn.choice_text}),standard_answers:vt.filter(function(pn){return pn.is_answer}).map(function(pn){return pn.is_answer}),tag_discipline_ids:lr,sub_discipline_id:(fr=xe.editData)===null||fr===void 0||((jn=fr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:Gn,repeat_answer:!En,analysis:St}});case 28:Et=jt.sent,Ye(Et);case 30:case"end":return jt.stop()}},gt)}));return function(){return Tt.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(Tt){var gt,Pt;return(xe==null||((gt=xe.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0))?void 0:Pt.exercise_status)===1?Tt:Tt.id!=="del"&&Tt.id!=="add"}),ot=function(){var Tt=Object(ne.a)(s.a.mark(function gt(Pt){return s.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!(hr!==-1)){Et.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Et.abrupt("return");case 3:Et.t0=Pt.id,Et.next=Et.t0==="del"?6:Et.t0==="up"||Et.t0==="down"?8:Et.t0==="edit"?12:Et.t0==="add"?15:17;break;case 6:return 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(ne.a)(s.a.mark(function Jt(){return s.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return jn.next=2,Object(k.n)({id:dt.question_id});case 2:Hn({type:"exercise/editExercise",payload:Object(p.a)({},rt)});case 3:case"end":return jn.stop()}},Jt)}))()}}),Et.abrupt("break",17);case 8:return Et.next=10,Hn({type:"exercise/exeriseMoveUpDown",payload:{id:dt.question_id,opr:Pt.id}});case 10:return Hn({type:"exercise/editExercise",payload:Object(p.a)({},rt)}),Et.abrupt("break",17);case 12:return Kn(dt.dragKey),wn(!0),Et.abrupt("break",17);case 15:return Un({key:dt.key,insert_id:dt==null?void 0:dt.question_id,question_type:1}),Et.abrupt("break",17);case 17:case"end":return Et.stop()}},gt)}));return function(Pt){return Tt.apply(this,arguments)}}(),tt=function(){var gt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(dt!=null&&dt.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},dt.key,"\u3001\u591A\u9009\u9898"),"\uFF08",dt.question_score,"\u5206\uFF09")),dt!=null&&dt.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},dt.key,"."),t.a.createElement(Te.a,{value:dt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",dt.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:dt.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},dt==null||((gt=dt.question_choices)===null||gt===void 0)?void 0:gt.map(function(Pt,vt){return t.a.createElement(r.a,{key:vt},t.a.createElement(A.a,null,t.a.createElement(T.a,{key:vt,checked:dt.standard_answer.includes(vt+1),disabled:!0},ee[vt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:Pt.choice_text}))))})),t.a.createElement("div",{className:ge.a.action},!dt.hideAction&&Ge.map(function(Pt,vt){return Pt.id==="up"&&dt.key===1||Pt.id==="down"&&dt.key===dt.len?null:t.a.createElement(o.a,{key:vt,placement:"bottom",title:Pt.name},t.a.createElement("span",{onClick:function(){return ot(Pt)},className:Pt.icon}))})))},mt=function(){var gt,Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:An,onChange:function(Et){return fn(Et)}}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ge.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),en.map(function(vt,Et){var ln,Jt;return t.a.createElement("div",{className:ge.a.choiceWrap,key:Et},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ge.a.answer," ").concat($t.includes(Et)?ge.a.activeAnswer:""),onClick:function(){$t.includes(Et)?Gt($t.filter(function(jn){return jn!==Et})):Gt([].concat(Object(j.a)($t),[Et]))}},ee[Et])),t.a.createElement("div",{className:ge.a.editorWrap},or===Et?t.a.createElement(y.a,{id:"single-question-option-".concat(Et),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:vt,onChange:function(jn){en[Et]=jn,Ut(en)}}):t.a.createElement("div",{className:ge.a.htmlWrap,onClick:function(){return Fn(Et)}},t.a.createElement(Te.a,{value:vt}))),((ln=xe.editData)===null||ln===void 0||((Jt=ln.exercise)===null||Jt===void 0)?void 0:Jt.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Et>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ge.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ut(en.filter(function(jn,Wn){return Wn!==Et}))}})),Et<7&&Et===en.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ge.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ut([].concat(Object(j.a)(en),[""]))}}))))}),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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:St,onChange:function(Et){return Mt(Et)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:_n,max:1e4,min:0,onChange:function(Et){tn(Et)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Gn,onChange:function(Et){Bn(Et.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:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{value:lr,selectvalues:dt==null?void 0:dt.tag_discipline_ids,onChange:Xn,subId:(gt=xe.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,knowledgeOptions:zt,onAddKnowledgeFinish:ft})),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(w.a,{checked:En,onChange:function(Et){Cn(Et)}}))),t.a.createElement("aside",{className:"tr"},(hr!==-1||dt.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){an(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){et()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ge.a.wrap},!nr&&tt(),nr&&mt())}),Ee=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.exercise,xe=at.globalSetting;return{problemset:Be,globalSetting:xe,exercise:Ie,loading:pt.effects}},null,null,{forwardRef:!0})($),Fe=U("55Ip"),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"],Ce=function(Be,pt){var Ie=Be.problemset,xe=Be.globalSetting,ve=Be.exercise,Hn=Be.loading,kt=Be.dispatch,ke=Be.editData,dt=Be.cancelAdd,Re=dt===void 0?function(){}:dt,an=Be.editKey,hr=Be.setEditKey,mr=hr===void 0?function(){}:hr,Kn=Be.addCallback,Wt=Kn===void 0?function(){}:Kn,dr=Be.reload,ht=dr===void 0?function(){}:dr,Un=Be.setIsClaer,yn=Un===void 0?function(){}:Un,un=Object(W.a)(Be,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),Qt=Object(i.useState)(""),Ln=Object(a.a)(Qt,2),hn=Ln[0],en=Ln[1],Ut=Object(i.useState)(""),Kt=Object(a.a)(Ut,2),sr=Kt[0],or=Kt[1],Fn=Object(i.useState)(""),bn=Object(a.a)(Fn,2),Bt=bn[0],$t=bn[1],Gt=Object(i.useState)([]),Dt=Object(a.a)(Gt,2),er=Dt[0],An=Dt[1],fn=Object(i.useState)(""),Vn=Object(a.a)(fn,2),dn=Vn[0],_n=Vn[1],tn=Object(i.useState)(),kn=Object(a.a)(tn,2),tr=kn[0],nr=kn[1],wn=Object(i.useState)(!1),Mn=Object(a.a)(wn,2),cn=Mn[0],lr=Mn[1],Xn=Object(i.useState)([]),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)(!1),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useState)(!1),vn=Object(a.a)(Cn,2),Zt=vn[0],St=vn[1],Mt=Object(C.i)(),Nt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Ye;if(Nt.current)return;ke.edit&&(En(!0),or(""),en(""),Gn([])),en(ke.shixun_name),or(ke.question_title);var et=[];(Ye=ke.shixun)===null||Ye===void 0||Ye.map(function(Ge){et.push(Ge.challenge_score)}),Gn(et)},[ke]),Object(i.useEffect)(function(){lr(!1)},[Rn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:zt,isEdit:Rn}});var At=function(et){(et==null?void 0:et.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),En(!1),mr(-1),Nt.current=!1,ht())},zt=function(){var Ye=Object(ne.a)(s.a.mark(function et(){var Ge,ot,tt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(Ge=[],ot=!1,!ot){Tt.next=4;break}return Tt.abrupt("return",!1);case 4:if(Nt.current=!0,St(!0),!ke.question_id){Tt.next=12;break}return Tt.next=9,kt({type:"exercise/editExerciseQuestion",payload:{id:ke.question_id,question_title:sr,shixun_name:hn,shixun_id:ke.shixun_id,question_type:5,question_scores:gr}});case 9:tt=Tt.sent,Tt.next=15;break;case 12:return Tt.next=14,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:ke==null?void 0:ke.insert_id,categoryId:Mt.categoryId,question_title:sr,shixun_name:hn,shixun_id:ke.shixun_id,question_type:5,question_scores:gr,is_copy:ke.is_copy}});case 14:tt=Tt.sent;case 15:return At(tt),St(!1),Tt.abrupt("return",{name:sr,analysis:Bt,standard_answers:Ge,is_ordered:tr});case 18:case"end":return Tt.stop()}},et)}));return function(){return Ye.apply(this,arguments)}}(),on=function(){var et;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:hn,onChange:function(ot){en(ot.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(y.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:sr,onChange:function(ot){or(ot)}})),t.a.createElement("div",{className:"mt20"},(et=ke.shixun)===null||et===void 0?void 0:et.map(function(Ge,ot){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},ot+1,".",Ge.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:gr[ot],onChange:function(mt){gr[ot]=mt,Gn(gr),console.log("srore:L",gr[ot])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},er.length>1&&t.a.createElement("span",null,t.a.createElement(T.a,{checked:tr,onChange:function(ot){return nr(ot.target.checked)},className:"".concat(ge.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ge.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"},(an!==-1||!(ke!=null&&ke.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),En(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Zt,className:"ml20",type:"primary",onClick:function(){zt()}},"\u4FDD\u5B58")))},sn=[{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(Ye){var et,Ge;return(ve==null||((et=ve.editData)===null||et===void 0||((Ge=et.exercise)===null||Ge===void 0))?void 0:Ge.exercise_status)===1?Ye:Ye.id!=="del"&&Ye.id!=="add"}),ft=function(){var Ye=Object(ne.a)(s.a.mark(function et(Ge){return s.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(!(an!==-1)){tt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),tt.abrupt("return");case 3:tt.t0=Ge.id,tt.next=tt.t0==="del"?6:tt.t0==="up"||tt.t0==="down"?8:tt.t0==="edit"?12:tt.t0==="add"?15:17;break;case 6:return 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(ne.a)(s.a.mark(function Tt(){return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(k.n)({id:ke.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},Mt)});case 3:case"end":return Pt.stop()}},Tt)}))()}}),tt.abrupt("break",17);case 8:return tt.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:ke.question_id,opr:Ge.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},Mt)}),tt.abrupt("break",17);case 12:return mr(ke.dragKey),En(!0),tt.abrupt("break",17);case 15:return kt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:ke.key,insert_id:ke==null?void 0:ke.question_id,question_type:5}}}),tt.abrupt("break",17);case 17:case"end":return tt.stop()}},et)}));return function(Ge){return Ye.apply(this,arguments)}}(),rt=function(){var et,Ge;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(ke!=null&&ke.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ke.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",ke.question_score,"\u5206\uFF09")),ke!=null&&ke.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ke.key,"."),t.a.createElement(Te.a,{value:ke.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ke.question_score,"\u5206\uFF09"),!!((et=ke.schools)!==null&&et!==void 0&&et.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(Te.a,{value:ke.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Ge=ke.shixun)===null||Ge===void 0?void 0:Ge.map(function(ot,tt){return t.a.createElement("div",{key:tt},"\u7B2C",tt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},ot.challenge_name)," ",t.a.createElement("span",{className:"ml10"},ot.challenge_score," \u5206"))}),t.a.createElement("div",{className:ge.a.action},t.a.createElement(Fe.a,{target:"_blank",to:"/shixuns/".concat(ke.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!ke.hideAction&&sn.map(function(ot,tt){return ot.id==="up"&&ke.key===1||ot.id==="down"&&ke.key===ke.len?null:t.a.createElement(o.a,{key:tt,placement:"bottom",title:ot.name},t.a.createElement("span",{onClick:function(){return ft(ot)},className:ot.icon}))})))};return t.a.createElement("section",{className:ge.a.wrap},!Rn&&rt(),Rn&&on())},Me=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.globalSetting,xe=at.exercise;return{problemset:Be,globalSetting:Ie,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ce)),He=["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"],Ke=function(Be,pt){var Ie=Be.problemset,xe=Be.exercise,ve=Be.globalSetting,Hn=Be.loading,kt=Be.dispatch,ke=Be.onRef,dt=ke===void 0?function(){}:ke,Re=Be.editData,an=Be.cancelAdd,hr=an===void 0?function(){}:an,mr=Be.editKey,Kn=Be.setEditKey,Wt=Kn===void 0?function(){}:Kn,dr=Be.setIsClaer,ht=dr===void 0?function(){}:dr,Un=Be.reload,yn=Un===void 0?function(){}:Un,un=Be.addCallback,Qt=un===void 0?function(Pt){}:un,Ln=Object(W.a)(Be,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),hn=Object(i.useState)([]),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)([]),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)(""),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)([]),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(!1),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useState)(1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)(!1),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Zt=Object(i.useState)(""),St=Object(a.a)(Zt,2),Mt=St[0],Nt=St[1],At=Object(C.i)(),zt=Object(i.useRef)(null),on=Object(i.useRef)(!1),sn=Object(i.useState)([]),ft=Object(a.a)(sn,2),rt=ft[0],Ye=ft[1],et=function(vt){Ye([].concat(Object(j.a)(rt),[Object(p.a)({},vt)]))};Object(i.useEffect)(function(){Kt(["","","",""])},[]),Object(i.useEffect)(function(){if(on.current)return;if(!(Re!=null&&Re.question_choices)){vr(!0),Vn(""),kn(5),Kt(["","","",""]),Dt([]);return}Vn(Re==null?void 0:Re.question_title),kn(Re==null?void 0:Re.question_score),vn(!(Re!=null&&Re.repeat_answer)),Nt(Re==null?void 0:Re.analysis),_r(Re==null?void 0:Re.difficulty),Kt(Re==null?void 0:Re.question_choices.map(function(vt){return vt.choice_text}));var Pt=[];Re==null||Re.standard_answer.map(function(vt,Et){Pt.push(vt-1)}),Mn(Re.tag_discipline_ids),Dt(Pt)},[Re,Xn]),Object(i.useEffect)(function(){Xn&&Pt();function Pt(){return vt.apply(this,arguments)}function vt(){return vt=Object(ne.a)(s.a.mark(function Et(){var ln,Jt,fr;return s.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Object(k.I)({sub_discipline_id:(ln=xe.editData)===null||ln===void 0||((Jt=ln.exercise)===null||Jt===void 0)?void 0:Jt.sub_discipline_id});case 2:fr=Wn.sent,Ye(fr.tag_disciplines);case 4:case"end":return Wn.stop()}},Et)})),vt.apply(this,arguments)}},[Xn]),Object(i.useEffect)(function(){var Pt,vt=xe!=null&&(Pt=xe.tagDisciplineData)!==null&&Pt!==void 0&&Pt.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];Ye(vt)},[xe.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:ot,isEdit:Xn}});var Ge=function(vt){(vt==null?void 0:vt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),vr(!1),Wt(-1),on.current=!1,yn())},ot=function(){var Pt=Object(ne.a)(s.a.mark(function vt(){var Et,ln,Jt,fr,jn,Wn,jt;return s.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(fn){In.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),In.abrupt("return",!1);case 3:if(Et=Ut.findIndex(function(zn){return!zn}),!(Et>-1)){In.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(He[Et]," \u9009\u9879\u7684\u5185\u5BB9")),In.abrupt("return",!1);case 7:if(Gt.length){In.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"),In.abrupt("return",!1);case 10:if(!(Gt.length<1)){In.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),In.abrupt("return",!1);case 13:if(ln=Ut.map(function(zn,mn){return{choice_text:zn,is_answer:Gt.includes(mn)?mn+1:0}}),on.current=!0,!Re.question_id){In.next=26;break}if(!((Re==null?void 0:Re.is_my)===1)){In.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 zn=Object(ne.a)(s.a.mark(function Ir(){var jr,Er;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:tn,question_choices:ln.map(function(br){return br.choice_text}),standard_answers:ln.filter(function(br){return br.is_answer}).map(function(br){return br.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(jr=xe.editData)===null||jr===void 0||((Er=jr.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Bn,is_cover:1,repeat_answer:!Cn,analysis:Mt}});case 2:Jt=xr.sent,Ge(Jt);case 4:case"end":return xr.stop()}},Ir)}));function mn(){return zn.apply(this,arguments)}return mn}(),onCancel:function(){var zn=Object(ne.a)(s.a.mark(function Ir(){var jr,Er;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:tn,question_choices:ln.map(function(br){return br.choice_text}),standard_answers:ln.filter(function(br){return br.is_answer}).map(function(br){return br.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(jr=xe.editData)===null||jr===void 0||((Er=jr.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:Mt}});case 2:Jt=xr.sent,Ge(Jt);case 4:case"end":return xr.stop()}},Ir)}));function mn(){return zn.apply(this,arguments)}return mn}()}),In.next=24;break;case 20:return In.next=22,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:fn,question_type:1,question_score:tn,question_choices:ln.map(function(zn){return zn.choice_text}),standard_answers:ln.filter(function(zn){return zn.is_answer}).map(function(zn){return zn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(fr=xe.editData)===null||fr===void 0||((jn=fr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:Mt}});case 22:Jt=In.sent,Ge(Jt);case 24:In.next=30;break;case 26:return In.next=28,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:At.categoryId,question_title:fn,question_type:1,question_score:tn,question_choices:ln.map(function(zn){return zn.choice_text}),standard_answers:ln.filter(function(zn){return zn.is_answer}).map(function(zn){return zn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(Wn=xe.editData)===null||Wn===void 0||((jt=Wn.exercise)===null||jt===void 0)?void 0:jt.sub_discipline_id,difficulty:Bn,repeat_answer:!Cn,analysis:Mt}});case 28:Jt=In.sent,Ge(Jt);case 30:case"end":return In.stop()}},vt)}));return function(){return Pt.apply(this,arguments)}}(),tt=[{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 vt,Et;return(xe==null||((vt=xe.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0))?void 0:Et.exercise_status)===1?Pt:Pt.id!=="del"&&Pt.id!=="add"}),mt=function(){var Pt=Object(ne.a)(s.a.mark(function vt(Et){return s.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(!(mr!==-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=Et.id,Jt.next=Jt.t0==="del"?6:Jt.t0==="up"||Jt.t0==="down"?8:Jt.t0==="edit"?12:Jt.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(ne.a)(s.a.mark(function jn(){return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(k.n)({id:Re.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},At)});case 3:case"end":return jt.stop()}},jn)}))()}}),Jt.abrupt("break",17);case 8:return Jt.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:Et.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},At)}),Jt.abrupt("break",17);case 12:return Wt(Re.dragKey),vr(!0),Jt.abrupt("break",17);case 15:return Qt({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:0}),Jt.abrupt("break",17);case 17:case"end":return Jt.stop()}},vt)}));return function(Et){return Pt.apply(this,arguments)}}(),Tt=function(){var vt;return t.a.createElement("aside",{ref:zt},t.a.createElement("div",{className:ge.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Te.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:Re.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},Re==null||((vt=Re.question_choices)===null||vt===void 0)?void 0:vt.map(function(Et,ln){return t.a.createElement(r.a,{key:ln},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:ln,checked:Re.standard_answer.includes(ln+1),disabled:!0},He[ln],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:Et.choice_text}))))})),t.a.createElement("div",{className:ge.a.action},!Re.hideAction&&tt.map(function(Et,ln){return Et.id==="up"&&Re.key===1||Et.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:ln,placement:"bottom",title:Et.name},t.a.createElement("span",{onClick:function(){return mt(Et)},className:Et.icon}))})))},gt=function(){var vt,Et;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:fn,onChange:function(Jt){return Vn(Jt)}}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ge.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ut.map(function(ln,Jt){var fr,jn;return t.a.createElement("div",{className:ge.a.choiceWrap,key:Jt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ge.a.answer," ").concat(Gt.includes(Jt)?ge.a.activeAnswer:""),onClick:function(){Gt.includes(Jt)?Dt(Gt.filter(function(jt){return jt!==Jt})):Dt([].concat(Object(j.a)(Gt),[Jt]))}},He[Jt])),t.a.createElement("div",{className:ge.a.editorWrap},Fn===Jt?t.a.createElement(y.a,{id:"single-question-option-".concat(Jt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ln,onChange:function(jt){Ut[Jt]=jt,Kt(Ut)}}):t.a.createElement("div",{className:ge.a.htmlWrap,onClick:function(){return bn(Jt)}},t.a.createElement(Te.a,{value:ln}))),((fr=xe.editData)===null||fr===void 0||((jn=fr.exercise)===null||jn===void 0)?void 0:jn.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Jt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ge.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Kt(Ut.filter(function(jt,pn){return pn!==Jt}))}})),Jt<7&&Jt===Ut.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ge.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Kt([].concat(Object(j.a)(Ut),[""]))}}))))}),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:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mt,onChange:function(Jt){return Nt(Jt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:tn,max:1e4,min:0,onChange:function(Jt){kn(Jt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Bn,onChange:function(Jt){_r(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("div",{className:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{selectvalues:Re==null?void 0:Re.tag_discipline_ids,value:wn,onChange:Mn,subId:(vt=xe.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0)?void 0:Et.sub_discipline_id,knowledgeOptions:rt,onAddKnowledgeFinish:et})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(w.a,{checked:Cn,onChange:function(Jt){vn(Jt)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),vr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ot()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ge.a.wrap},!Xn&&Tt(),Xn&>())},ut=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.globalSetting,xe=at.exercise;return{problemset:Be,globalSetting:Ie,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ke)),bt=U("Z9P2"),Lt=["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"],Ft=function(Be,pt){var Ie=Be.problemset,xe=Be.exercise,ve=Be.globalSetting,Hn=Be.loading,kt=Be.dispatch,ke=Be.onRef,dt=ke===void 0?function(){}:ke,Re=Be.editData,an=Be.cancelAdd,hr=an===void 0?function(){}:an,mr=Be.editKey,Kn=Be.setEditKey,Wt=Kn===void 0?function(){}:Kn,dr=Be.reload,ht=dr===void 0?function(){}:dr,Un=Be.addCallback,yn=Un===void 0?function(){}:Un,un=Be.setIsClaer,Qt=un===void 0?function(){}:un,Ln=Object(W.a)(Be,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),hn=Object(i.useState)(""),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(""),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(""),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)(),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(!1),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)([]),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(1),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)([[],[]]),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Zt=Object(i.useRef)(!1),St=Object(C.i)(),Mt=Object(i.useState)([]),Nt=Object(a.a)(Mt,2),At=Nt[0],zt=Nt[1],on=function(tt){zt([].concat(Object(j.a)(At),[Object(p.a)({},tt)]))};Object(i.useEffect)(function(){var ot;if(Zt.current)return;if(!(Re!=null&&Re.question_title)){kn(!0),Kt(""),Dt(""),Vn(10);return}_r(!(Re!=null&&Re.repeat_answer)),Kt(Re==null?void 0:Re.question_title),Dt(Re==null||((ot=Re.standard_answer)===null||ot===void 0)?void 0:ot[0]),Vn(Re==null?void 0:Re.question_score),Mn(Re.tag_discipline_ids),vr(Re==null?void 0:Re.difficulty),bn(Re==null?void 0:Re.analysis),vn([Re==null?void 0:Re.normal_keywords,Re==null?void 0:Re.main_keywords])},[Ie.editData,tn]),Object(i.useEffect)(function(){var ot,tt=xe!=null&&(ot=xe.tagDisciplineData)!==null&&ot!==void 0&&ot.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];zt(tt)},[xe.tagDisciplineData]),Object(i.useEffect)(function(){tn&&ot();function ot(){return tt.apply(this,arguments)}function tt(){return tt=Object(ne.a)(s.a.mark(function mt(){var Tt,gt,Pt;return s.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(k.I)({sub_discipline_id:(Tt=xe.editData)===null||Tt===void 0||((gt=Tt.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id});case 2:Pt=Et.sent,zt(Pt.tag_disciplines);case 4:case"end":return Et.stop()}},mt)})),tt.apply(this,arguments)}},[tn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:ft,isEdit:tn}});var sn=function(tt){(tt==null?void 0:tt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),kn(!1),Wt(-1),Zt.current=!1,ht())},ft=function(){var ot=Object(ne.a)(s.a.mark(function tt(){var mt,Tt,gt,Pt,vt,Et,ln;return s.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(Ut){fr.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),fr.abrupt("return",!1);case 3:if(mt=Cn[0],Tt=Cn[1],Zt.current=!0,!Re.question_id){fr.next=17;break}if(!((Re==null?void 0:Re.is_my)===1)){fr.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 jn=Object(ne.a)(s.a.mark(function jt(){var pn,In;return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Ut,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(pn=xe.editData)===null||pn===void 0||((In=pn.exercise)===null||In===void 0)?void 0:In.sub_discipline_id,difficulty:Xn,is_cover:1,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 2:gt=mn.sent,sn(gt);case 4:case"end":return mn.stop()}},jt)}));function Wn(){return jn.apply(this,arguments)}return Wn}(),onCancel:function(){var jn=Object(ne.a)(s.a.mark(function jt(){var pn,In;return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Ut,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(pn=xe.editData)===null||pn===void 0||((In=pn.exercise)===null||In===void 0)?void 0:In.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 2:gt=mn.sent,sn(gt);case 4:case"end":return mn.stop()}},jt)}));function Wn(){return jn.apply(this,arguments)}return Wn}()}),fr.next=15;break;case 11:return fr.next=13,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:Ut,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(Pt=xe.editData)===null||Pt===void 0||((vt=Pt.exercise)===null||vt===void 0)?void 0:vt.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 13:gt=fr.sent,sn(gt);case 15:fr.next=21;break;case 17:return fr.next=19,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:St.categoryId,exercise_bank_id:St.categoryId,question_title:Ut,question_type:4,question_score:fn,standard_answers:[Gt],tag_discipline_ids:wn,sub_discipline_id:(Et=xe.editData)===null||Et===void 0||((ln=Et.exercise)===null||ln===void 0)?void 0:ln.sub_discipline_id,difficulty:Xn,repeat_answer:!Bn,analysis:Fn,normal_keywords:mt,main_keywords:Tt}});case 19:gt=fr.sent,sn(gt);case 21:return fr.abrupt("return",{name:Ut,answer_texts:[Gt],analysis:Fn,normal_keywords:mt,main_keywords:Tt});case 22:case"end":return fr.stop()}},tt)}));return function(){return ot.apply(this,arguments)}}(),rt=function(){var tt,mt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.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(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ut,onChange:function(gt){return Kt(gt)}}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(y.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Gt,onChange:function(gt){return Dt(gt)}}),t.a.createElement(bt.a,{value:Cn,onChange:vn}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Fn,onChange:function(gt){return bn(gt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:fn,max:1e4,min:0,onChange:function(gt){Vn(gt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Xn,onChange:function(gt){vr(gt.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:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{value:wn,selectvalues:Re==null?void 0:Re.tag_discipline_ids,onChange:Mn,subId:(tt=xe.editData)===null||tt===void 0||((mt=tt.exercise)===null||mt===void 0)?void 0:mt.sub_discipline_id,knowledgeOptions:At,onAddKnowledgeFinish:on})),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(w.a,{checked:Bn,onChange:function(gt){_r(gt)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),kn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ft()}},"\u4FDD\u5B58")))},Ye=[{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(ot){var tt,mt;return(xe==null||((tt=xe.editData)===null||tt===void 0||((mt=tt.exercise)===null||mt===void 0))?void 0:mt.exercise_status)===1?ot:ot.id!=="del"&&ot.id!=="add"}),et=function(){var ot=Object(ne.a)(s.a.mark(function tt(mt){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!(mr!==-1)){gt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),gt.abrupt("return");case 3:gt.t0=mt.id,gt.next=gt.t0==="del"?6:gt.t0==="up"||gt.t0==="down"?8:gt.t0==="edit"?12:gt.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(ne.a)(s.a.mark(function vt(){return s.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(k.n)({id:Re.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},St)});case 3:case"end":return ln.stop()}},vt)}))()}}),gt.abrupt("break",17);case 8:return gt.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:mt.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},St)}),gt.abrupt("break",17);case 12:return Wt(Re.dragKey),kn(!0),gt.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:4}),gt.abrupt("break",17);case 17:case"end":return gt.stop()}},tt)}));return function(mt){return ot.apply(this,arguments)}}(),Ge=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Te.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:Re.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(Te.a,{value:Gt||""})),t.a.createElement("div",{className:ge.a.action},!Re.hideAction&&Ye.map(function(tt,mt){return tt.id==="up"&&Re.key===1||tt.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:mt,placement:"bottom",title:tt.name},t.a.createElement("span",{onClick:function(){return et(tt)},className:tt.icon}))})))};return t.a.createElement("section",{className:ge.a.wrap},!tn&&Ge(),tn&&rt())},Yt=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.exercise,xe=at.globalSetting;return{problemset:Be,globalSetting:xe,exercise:Ie,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ft)),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"],Je=function(Be,pt){var Ie=Be.problemset,xe=Be.exercise,ve=Be.globalSetting,Hn=Be.loading,kt=Be.dispatch,ke=Be.onRef,dt=ke===void 0?function(){}:ke,Re=Be.editData,an=Be.cancelAdd,hr=an===void 0?function(){}:an,mr=Be.editKey,Kn=Be.setEditKey,Wt=Kn===void 0?function(){}:Kn,dr=Be.addCallback,ht=dr===void 0?function(){}:dr,Un=Be.setIsClaer,yn=Un===void 0?function(){}:Un,un=Object(W.a)(Be,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),Qt=Object(i.useState)([]),Ln=Object(a.a)(Qt,2),hn=Ln[0],en=Ln[1],Ut=Object(i.useState)(),Kt=Object(a.a)(Ut,2),sr=Kt[0],or=Kt[1],Fn=Object(i.useState)([]),bn=Object(a.a)(Fn,2),Bt=bn[0],$t=bn[1],Gt=Object(i.useState)(""),Dt=Object(a.a)(Gt,2),er=Dt[0],An=Dt[1],fn=Object(i.useState)(5),Vn=Object(a.a)(fn,2),dn=Vn[0],_n=Vn[1],tn=Object(i.useState)(!1),kn=Object(a.a)(tn,2),tr=kn[0],nr=kn[1],wn=Object(C.g)(),Mn=Object(C.i)();Object(i.useEffect)(function(){en(["","","",""])},[]),Object(i.useEffect)(function(){if(!(Re!=null&&Re.question_choices)){nr(!0),An(""),_n(5),en(["","","",""]),$t([]);return}An(Re==null?void 0:Re.question_title),_n(Re==null?void 0:Re.question_score),en(Re==null?void 0:Re.question_choices.map(function(Bn){return Bn.choice_text}));var Gn=[];Re==null||Re.standard_answer.map(function(Bn,_r){Gn.push(Bn-1)}),$t(Gn)},[Re]),Object(i.useImperativeHandle)(pt,function(){return{onSave:cn,isEdit:tr}});var cn=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(){var _r,Rn,En;return s.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(er){vn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),vn.abrupt("return",!1);case 3:if(_r=hn.findIndex(function(Zt){return!Zt}),!(_r>-1)){vn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Xt[_r]," \u9009\u9879\u7684\u5185\u5BB9")),vn.abrupt("return",!1);case 7:if(Bt.length){vn.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"),vn.abrupt("return",!1);case 10:if(!(Bt.length<1)){vn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),vn.abrupt("return",!1);case 13:if(Rn=hn.map(function(Zt,St){return{choice_text:Zt,is_answer:Bt.includes(St)?St+1:0}}),!Re.question_id){vn.next=20;break}return vn.next=17,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:er,question_type:1,question_score:dn,question_choices:Rn.map(function(Zt){return Zt.choice_text}),standard_answers:Rn.filter(function(Zt){return Zt.is_answer}).map(function(Zt){return Zt.is_answer})}});case 17:En=vn.sent,vn.next=23;break;case 20:return vn.next=22,kt({type:"exercise/addExerciseQuestion",payload:{insert_id:Re==null?void 0:Re.insert_id,categoryId:Mn.categoryId,question_title:er,question_type:1,question_score:"5.0",question_choices:Rn.map(function(Zt){return Zt.choice_text}),standard_answers:Rn.filter(function(Zt){return Zt.is_answer}).map(function(Zt){return Zt.is_answer})}});case 22:En=vn.sent;case 23:En.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),nr(!1),kt({type:"exercise/editExercise",payload:Object(p.a)({},Mn)}));case 24:case"end":return vn.stop()}},Bn)}));return function(){return Gn.apply(this,arguments)}}(),lr=[{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(Gn){var Bn,_r;return(xe==null||((Bn=xe.editData)===null||Bn===void 0||((_r=Bn.exercise)===null||_r===void 0))?void 0:_r.exercise_status)===1?Gn:Gn.id!=="del"&&Gn.id!=="add"}),Xn=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(_r){return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(!(mr!==-1)){En.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),En.abrupt("return");case 3:En.t0=_r.id,En.next=En.t0==="del"?6:En.t0==="up"||En.t0==="down"?8:En.t0==="edit"?12:En.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(ne.a)(s.a.mark(function vn(){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(k.n)({id:Re.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},Mn)});case 3:case"end":return St.stop()}},vn)}))()}}),En.abrupt("break",16);case 8:return En.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:_r.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},Mn)}),En.abrupt("break",16);case 12:return wn.push("/problems/".concat(Re==null?void 0:Re.hack_identifier,"/edit?type=exercises&express_id=").concat(Mn.categoryId,"&question_id=").concat(Re==null?void 0:Re.question_id,"&score=").concat(Re==null?void 0:Re.question_score,"&exercise=true&callback_url=").concat(location.pathname)),En.abrupt("break",16);case 14:return ht({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:6}),En.abrupt("break",16);case 16:case"end":return En.stop()}},Bn)}));return function(_r){return Gn.apply(this,arguments)}}(),vr=function(){var Gn=Object(ne.a)(s.a.mark(function Bn(_r){var Rn;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return _r.preventDefault(),Cn.next=3,Object(k.Y)({id:Re==null?void 0:Re.hack_identifier});case 3:Rn=Cn.sent,Rn.status===0&&Object(ae.S)("/myproblems/".concat(Rn==null?void 0:Rn.identifier));case 5:case"end":return Cn.stop()}},Bn)}));return function(_r){return Gn.apply(this,arguments)}}(),gr=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Te.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:Re.question_title})),t.a.createElement("div",{className:ge.a.questionChoices},t.a.createElement(Te.a,{value:Re.description||""})),t.a.createElement("div",{className:ge.a.action},!Re.hideAction&&lr.map(function(Bn,_r){return Bn.id==="up"&&Re.key===1||Bn.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:_r,placement:"bottom",title:Bn.name},t.a.createElement("span",{onClick:function(){return Xn(Bn)},className:Bn.icon}))})))};return t.a.createElement("section",{className:ge.a.wrap},gr())},Qe=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.globalSetting,xe=at.exercise;return{problemset:Be,globalSetting:Ie,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Je)),_t=U("LvDl"),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"],_e=function(Be,pt){var Ie=Be.problemset,xe=Be.exercise,ve=Be.globalSetting,Hn=Be.loading,kt=Be.dispatch,ke=Be.onRef,dt=ke===void 0?function(){}:ke,Re=Be.editData,an=Be.cancelAdd,hr=an===void 0?function(){}:an,mr=Be.editKey,Kn=Be.setEditKey,Wt=Kn===void 0?function(){}:Kn,dr=Be.setIsClaer,ht=dr===void 0?function(){}:dr,Un=Be.addCallback,yn=Un===void 0?function(ft){}:Un,un=Be.reload,Qt=un===void 0?function(){}:un,Ln=Object(W.a)(Be,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),hn=Object(i.useState)([]),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(!1),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(!0),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)(1),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(!1),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)([]),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(C.i)(),lr=Object(i.useRef)(null),Xn=Object(i.useState)(""),vr=Object(a.a)(Xn,2),gr=vr[0],Gn=vr[1],Bn=Object(i.useState)([]),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=Object(i.useRef)(!1),vn=function(rt){Mn([].concat(Object(j.a)(wn),[Object(p.a)({},rt)]))};Object(i.useEffect)(function(){var ft;if(Cn.current)return;if(!(Re!=null&&Re.question_title)){bn(!0),Gn("");return}Gn(Re==null?void 0:Re.question_title),kn(!(Re!=null&&Re.repeat_answer)),Vn(Re==null?void 0:Re.difficulty),Kt(Re.tag_discipline_ids);var rt=Re==null||((ft=Re.sub_exercise_questions)===null||ft===void 0)?void 0:ft.map(function(Ye){var et,Ge,ot;return Object(p.a)(Object(p.a)({},Ye),{},{id:Ye.question_id,name:Ye.question_title,open:!1,score:Ye.question_score,qusList:Ye==null||((et=Ye.question_choices)===null||et===void 0)?void 0:et.map(function(tt){return tt.choice_text}),activeQusEditor:null,qusAnswer:(Ge=[Ye==null||((ot=Ye.question_choices)===null||ot===void 0)?void 0:ot.findIndex(function(tt){return tt.standard_boolean})])===null||Ge===void 0?void 0:Ge.filter(function(tt){return tt!==-1})})});En(rt)},[Re,Fn]),Object(i.useEffect)(function(){Fn&&ft();function ft(){return rt.apply(this,arguments)}function rt(){return rt=Object(ne.a)(s.a.mark(function Ye(){var et,Ge,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(k.I)({sub_discipline_id:(et=xe.editData)===null||et===void 0||((Ge=et.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id});case 2:ot=mt.sent,Mn(ot.tag_disciplines);case 4:case"end":return mt.stop()}},Ye)})),rt.apply(this,arguments)}},[Fn]),Object(i.useEffect)(function(){var ft,rt=xe!=null&&(ft=xe.tagDisciplineData)!==null&&ft!==void 0&&ft.tag_disciplines&&Array.isArray(xe.tagDisciplineData.tag_disciplines)?xe.tagDisciplineData.tag_disciplines:[];Mn(rt)},[xe.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:St,isEdit:Fn}});var Zt=function(rt){(rt==null?void 0:rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),bn(!1),Wt(-1),Cn.current=!1,Qt())},St=function(){var ft=Object(ne.a)(s.a.mark(function rt(){var Ye,et,Ge,ot,tt,mt,Tt,gt;return s.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(gr){vt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),vt.abrupt("return",!1);case 3:if(!(Rn.length===0)){vt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),vt.abrupt("return",!1);case 6:Ye=0;case 7:if(!(Ye<Rn.length)){vt.next=25;break}if(Ge=Rn[Ye],Ge!=null&&Ge.name){vt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Ye+1,"\u5C0F\u9898\u9898\u5E72")),vt.abrupt("return",!1);case 12:if(Ge!=null&&Ge.score){vt.next=15;break}return _.b.info("\u7B2C".concat(Ye+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),vt.abrupt("return",!1);case 15:if(ot=Ge==null||((et=Ge.qusList)===null||et===void 0)?void 0:et.findIndex(function(Et){return!Et}),!(ot>-1)){vt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Ye+1,"\u5C0F\u9898").concat(xt[ot],"\u9009\u9879\u7684\u5185\u5BB9")),vt.abrupt("return",!1);case 19:if(Ge!=null&&Ge.qusAnswer.length){vt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Ye+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),vt.abrupt("return",!1);case 22:Ye++,vt.next=7;break;case 25:if(tt=Rn.map(function(Et){var ln;return{id:Et.id>1?Et.id:null,question_title:Et.name,question_type:1,question_choices:Et.qusList,question_score:Et.score,standard_answers:[((ln=Et.qusAnswer)===null||ln===void 0?void 0:ln[0])+1]}}),Cn.current=!0,!Re.question_id){vt.next=36;break}if(!((Re==null?void 0:Re.is_my)===1)){vt.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 Et=Object(ne.a)(s.a.mark(function Jt(){var fr,jn;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:tt,tag_discipline_ids:Ut,sub_discipline_id:(fr=xe.editData)===null||fr===void 0||((jn=fr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:fn,is_cover:1,repeat_answer:!tn}});case 2:mt=jt.sent,Zt(mt);case 4:case"end":return jt.stop()}},Jt)}));function ln(){return Et.apply(this,arguments)}return ln}(),onCancel:function(){var Et=Object(ne.a)(s.a.mark(function Jt(){var fr,jn;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:tt,tag_discipline_ids:Ut,sub_discipline_id:(fr=xe.editData)===null||fr===void 0||((jn=fr.exercise)===null||jn===void 0)?void 0:jn.sub_discipline_id,difficulty:fn,repeat_answer:!tn}});case 2:mt=jt.sent,Zt(mt);case 4:case"end":return jt.stop()}},Jt)}));function ln(){return Et.apply(this,arguments)}return ln}()}),vt.next=36;break;case 32:return vt.next=34,kt({type:"exercise/editExerciseQuestion",payload:{id:Re.question_id,question_title:gr,question_type:7,sub_questions:tt,tag_discipline_ids:Ut,sub_discipline_id:(Tt=xe.editData)===null||Tt===void 0||((gt=Tt.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id,difficulty:fn,repeat_answer:!tn}});case 34:mt=vt.sent,Zt(mt);case 36:case"end":return vt.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}(),Mt=[{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(ft){var rt,Ye;return(xe==null||((rt=xe.editData)===null||rt===void 0||((Ye=rt.exercise)===null||Ye===void 0))?void 0:Ye.exercise_status)===1?ft:ft.id!=="del"&&ft.id!=="add"}),Nt=function(){var ft=Object(ne.a)(s.a.mark(function rt(Ye){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=Ye.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(ne.a)(s.a.mark(function tt(){return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(k.n)({id:Re.question_id});case 2:kt({type:"exercise/editExercise",payload:Object(p.a)({},cn)});case 3:case"end":return Tt.stop()}},tt)}))()}}),Ge.abrupt("break",17);case 8:return Ge.next=10,kt({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:Ye.id}});case 10:return kt({type:"exercise/editExercise",payload:Object(p.a)({},cn)}),Ge.abrupt("break",17);case 12:return Wt(Re.dragKey),bn(!0),Ge.abrupt("break",17);case 15:return yn({key:Re.key,insert_id:Re==null?void 0:Re.question_id,question_type:0}),Ge.abrupt("break",17);case 17:case"end":return Ge.stop()}},rt)}));return function(Ye){return ft.apply(this,arguments)}}(),At=function(){var rt;return t.a.createElement("aside",{ref:lr},t.a.createElement("div",{className:ge.a.questionType},!(Re!=null&&Re.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Re.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",Re.question_score,"\u5206\uFF09")),Re!=null&&Re.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,"."),t.a.createElement(Te.a,{value:Re.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",Re==null?void 0:Re.sub_q_count,"\u5C0F\u9898\uFF0C",Re.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:Re.question_title})),t.a.createElement("div",{style:{display:Gt?"block":"none"},className:ge.a.questionChoices},Re==null||((rt=Re.sub_exercise_questions)===null||rt===void 0)?void 0:rt.map(function(Ye,et){var Ge;return t.a.createElement("div",{key:et},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Re.key,".",et+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(Te.a,{value:Ye.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ye.question_score,"\u5206\uFF09")),Ye==null||((Ge=Ye.question_choices)===null||Ge===void 0)?void 0:Ge.map(function(ot,tt){return t.a.createElement(r.a,{key:tt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:tt,checked:Ye.standard_answer.includes(tt+1),disabled:!0},xt[tt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:ot.choice_text}))))}))})),t.a.createElement("div",{className:ge.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Dt(!Gt)},style:{}},Gt?"\u6536\u8D77":"\u5C55\u5F00"),!Re.hideAction&&Mt.map(function(Ye,et){return Ye.id==="up"&&Re.key===1||Ye.id==="down"&&Re.key===Re.len?null:t.a.createElement(o.a,{key:et,placement:"bottom",title:Ye.name},t.a.createElement("span",{onClick:function(){return Nt(Ye)},className:Ye.icon}))})))},zt=function(){var rt,Ye;return t.a.createElement("aside",null,t.a.createElement("div",{className:ge.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:ge.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gr,onChange:function(Ge){return Gn(Ge)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",Rn==null?void 0:Rn.length),Rn==null?void 0:Rn.map(function(et,Ge){var ot;return t.a.createElement("div",{className:ge.a.fold,key:et.id},t.a.createElement("div",{onClick:function(){return sn("open",Ge)},className:ge.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:et.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(mt){mt.stopPropagation(),sn("delete",Ge)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:et.open?"block":"none"}},t.a.createElement(y.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:et==null?void 0:et.name,onChange:function(mt){return sn("value",Ge,mt)}}),t.a.createElement("p",{className:ge.a.titleWrap},t.a.createElement("span",{className:ge.a.required},"*"),t.a.createElement("span",{className:ge.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ge.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),et==null||((ot=et.qusList)===null||ot===void 0)?void 0:ot.map(function(tt,mt){var Tt,gt;return t.a.createElement("div",{className:ge.a.choiceWrap,key:mt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ge.a.answer," ").concat(et!=null&&(Tt=et.qusAnswer)!==null&&Tt!==void 0&&Tt.includes(mt)?ge.a.activeAnswer:""),onClick:function(){return sn("answer",Ge,mt)}},xt[mt])),t.a.createElement("div",{className:ge.a.editorWrap},(et==null?void 0:et.activeQusEditor)===mt?t.a.createElement(y.a,{id:"single-question-option-".concat(mt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tt,onChange:function(vt){return sn("details",Ge,vt)}}):t.a.createElement("div",{className:ge.a.htmlWrap,onClick:function(){return sn("edit",Ge,mt)}},t.a.createElement(Te.a,{value:tt}))),mt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ge.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return sn("deleteQus",Ge,mt)}})),mt<7&&mt===(et==null||((gt=et.qusList)===null||gt===void 0)?void 0:gt.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ge.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return sn("addQus",Ge)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:et.score,max:1e4,min:0,onChange:function(mt){return sn("score",Ge,mt)}})," ","\u5206")))}),Rn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:on},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:ge.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:fn,onChange:function(Ge){Vn(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:ge.a.titleWrap},t.a.createElement("span",{className:"".concat(ge.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ge.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(Ue.a,{selectvalues:Re==null?void 0:Re.tag_discipline_ids,value:Ut,onChange:Kt,subId:(rt=xe.editData)===null||rt===void 0||((Ye=rt.exercise)===null||Ye===void 0)?void 0:Ye.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:vn}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Re.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),bn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){St()}},"\u4FDD\u5B58")))},on=function(){var rt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};En(Rn.concat(rt))},sn=function(rt,Ye,et){var Ge=Object(_t.cloneDeep)(Rn);if(rt==="open"&&(Ge[Ye].open=!Ge[Ye].open),rt==="delete"&&Ge.splice(Ye,1),rt==="value"&&(Ge[Ye].name=et),rt==="answer"&&(Ge[Ye].qusAnswer=[et]),rt==="edit"&&(Ge[Ye].activeQusEditor=et),rt==="details"&&(Ge[Ye].qusList[Ge[Ye].activeQusEditor]=et),rt==="addQus"&&(Ge[Ye].qusList=Ge[Ye].qusList.concat("")),rt==="deleteQus"){var ot;Ge[Ye].qusList=Ge[Ye].qusList.filter(function(tt,mt){return mt!==et}),Ge[Ye].qusAnswer=(ot=Ge[Ye].qusAnswer)===null||ot===void 0?void 0:ot.filter(function(tt){return tt!==et})}rt==="analysis"&&(Ge[Ye].analysis=et),rt==="score"&&(Ge[Ye].score=et),En(Ge)};return t.a.createElement("section",{className:ge.a.wrap},!Fn&&At(),Fn&&zt())},ie=Object(F.a)(function(at){var Be=at.problemset,pt=at.loading,Ie=at.globalSetting,xe=at.exercise;return{problemset:Be,globalSetting:Ie,exercise:xe,loading:pt.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(_e)),oe=U("ngQI"),ce=U("loLm"),we=U.n(ce),de=U("ErOA"),he=U("vCeJ"),Oe=U("Nog9"),le=U.n(Oe),Ne=U("hQp1"),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"],lt=function(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.cancelAdd,kt=Hn===void 0?function(){}:Hn,ke=Be.editKey,dt=Be.setEditKey,Re=dt===void 0?function(){}:dt,an=Be.reload,hr=an===void 0?function(){}:an,mr=Be.addCallback,Kn=mr===void 0?function(Ye){}:mr,Wt=Object(i.useState)([]),dr=Object(a.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(i.useState)(),un=Object(a.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(i.useState)([]),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(""),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)([]),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(!1),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)(1),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(!1),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useState)(""),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(C.i)(),En=Object(i.useRef)(null),Cn=Object(i.useRef)(!1),vn=Object(i.useState)([]),Zt=Object(a.a)(vn,2),St=Zt[0],Mt=Zt[1],Nt=function(et){Mt([].concat(Object(j.a)(St),[Object(p.a)({},et)]))};Object(i.useEffect)(function(){Un(["","","",""])},[]),Object(i.useEffect)(function(){if(Cn.current)return;if(!(ve!=null&&ve.question_choices)){kn(!0),bn(""),Dt(5),Un(["","","",""]),Kt([]);return}bn(ve==null?void 0:ve.question_title),Dt(ve==null?void 0:ve.question_score),vr(!(ve!=null&&ve.repeat_answer)),_r(ve==null?void 0:ve.analysis),Mn(ve==null?void 0:ve.difficulty),Un(ve==null?void 0:ve.question_choices.map(function(et){return et.choice_text}));var Ye=[];ve==null||ve.standard_answer.map(function(et,Ge){Ye.push(et-1)}),Vn(ve.tag_discipline_ids),Kt(Ye)},[ve,tn]),Object(i.useEffect)(function(){tn&&Ye();function Ye(){return et.apply(this,arguments)}function et(){return et=Object(ne.a)(s.a.mark(function Ge(){var ot,tt,mt;return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(k.I)({sub_discipline_id:(ot=Ie.editData)===null||ot===void 0||((tt=ot.exercise)===null||tt===void 0)?void 0:tt.sub_discipline_id});case 2:mt=gt.sent,Mt(mt.tag_disciplines);case 4:case"end":return gt.stop()}},Ge)})),et.apply(this,arguments)}},[tn]),Object(i.useEffect)(function(){var Ye,et=Ie!=null&&(Ye=Ie.tagDisciplineData)!==null&&Ye!==void 0&&Ye.tag_disciplines&&Array.isArray(Ie.tagDisciplineData.tag_disciplines)?Ie.tagDisciplineData.tag_disciplines:[];Mt(et)},[Ie.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:zt,isEdit:tn}});var At=function(et){(et==null?void 0:et.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),kn(!1),Re(-1),Cn.current=!1,hr())},zt=function(){var Ye=Object(ne.a)(s.a.mark(function et(){var Ge,ot,tt,mt,Tt,gt,Pt;return s.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(Fn){Et.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Et.abrupt("return",!1);case 3:if(Ge=ht.findIndex(function(ln){return!ln}),!(Ge>-1)){Et.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(We[Ge]," \u9009\u9879\u7684\u5185\u5BB9")),Et.abrupt("return",!1);case 7:if(Ut.length){Et.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"),Et.abrupt("return",!1);case 10:if(!(Ut.length<1)){Et.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Et.abrupt("return",!1);case 13:if(ot=ht.map(function(ln,Jt){return{choice_text:ln,is_answer:Ut.includes(Jt)?1:0}}),Cn.current=!0,!ve.question_id){Et.next=22;break}return Et.next=18,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Rn.id,question_id:ve.question_id,name:Fn,item_type:Ut.length>1?Ne.a.Multiple:Ne.a.Single,question_score:Gt,choices:ot,tag_discipline_ids:fn,sub_discipline_id:(mt=Ie.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:wn,repeat_answer:!Xn,analysis:Bn}});case 18:tt=Et.sent,At(tt),Et.next=26;break;case 22:return Et.next=24,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:Rn.id,name:Fn,item_type:Ut.length>1?Ne.a.Multiple:Ne.a.Single,question_score:Gt,choices:ot,tag_discipline_ids:fn,sub_discipline_id:(gt=Ie.editData)===null||gt===void 0||((Pt=gt.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,difficulty:wn,repeat_answer:!Xn,analysis:Bn}});case 24:tt=Et.sent,At(tt);case 26:case"end":return Et.stop()}},et)}));return function(){return Ye.apply(this,arguments)}}(),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"}],sn=function(){var Ye=Object(ne.a)(s.a.mark(function et(Ge){return s.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(!(ke!==-1)){tt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),tt.abrupt("return");case 3:tt.t0=Ge.id,tt.next=tt.t0==="del"?6:tt.t0==="edit"?8:tt.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(ne.a)(s.a.mark(function Tt(){return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(he.g)({exam_id:Rn.id,question_id:ve.question_id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Rn)});case 3:case"end":return Pt.stop()}},Tt)}))()}}),tt.abrupt("break",13);case 8:return Re(ve.dragKey),kn(!0),tt.abrupt("break",13);case 11:return Kn({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),tt.abrupt("break",13);case 13:case"end":return tt.stop()}},et)}));return function(Ge){return Ye.apply(this,arguments)}}(),ft=function(){var et;return t.a.createElement("aside",{ref:En},t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{className:le.a.questionChoices},ve==null||((et=ve.question_choices)===null||et===void 0)?void 0:et.map(function(Ge,ot){return t.a.createElement(r.a,{key:ot},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:ot,checked:ve.standard_answer.includes(ot+1),disabled:!0},We[ot],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:Ge.choice_text}))))})),t.a.createElement("div",{className:le.a.action},!ve.hideAction&&on.map(function(Ge,ot){return t.a.createElement(o.a,{key:ot,placement:"bottom",title:Ge.name},t.a.createElement("span",{onClick:function(){return sn(Ge)},className:Ge.icon}))})))},rt=function(){var et,Ge;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fn,onChange:function(tt){return bn(tt)}}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ht.map(function(ot,tt){return t.a.createElement("div",{className:le.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(le.a.answer," ").concat(Ut.includes(tt)?le.a.activeAnswer:""),onClick:function(){Ut.includes(tt)?Kt(function(Tt){return Tt.filter(function(gt){return gt!==tt})}):Kt(function(Tt){return[].concat(Object(j.a)(Tt),[tt])})}},We[tt])),t.a.createElement("div",{className:le.a.editorWrap},Qt===tt?t.a.createElement(y.a,{id:"single-question-option-".concat(tt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ot,onChange:function(Tt){ht[tt]=Tt,Un(ht)}}):t.a.createElement("div",{className:le.a.htmlWrap,onClick:function(){return Ln(tt)}},t.a.createElement(Te.a,{value:ot}))),t.a.createElement(t.a.Fragment,null,tt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Un(ht.filter(function(Tt,gt){return gt!==tt}))}})),tt<7&&tt===ht.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Un([].concat(Object(j.a)(ht),[""]))}}))))}),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:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Bn,onChange:function(tt){return _r(tt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Gt,max:1e4,min:0,onChange:function(tt){Dt(tt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:wn,onChange:function(tt){Mn(tt.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:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:fn,onChange:Vn,subId:(et=Ie.editData)===null||et===void 0||((Ge=et.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id,knowledgeOptions:St,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(w.a,{checked:Xn,onChange:function(tt){vr(tt)}}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){kt(),kn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){zt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:le.a.wrap},!tn&&ft(),tn&&rt())},Ct=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(lt)),Rt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],It=Object(i.forwardRef)(function(at,Be){var pt=at.newExercisePaper,Ie=at.dispatch,xe=at.editData,ve=at.cancelAdd,Hn=ve===void 0?function(){}:ve,kt=at.editKey,ke=at.setEditKey,dt=ke===void 0?function(){}:ke,Re=at.addCallback,an=Re===void 0?function(ft){}:Re,hr=at.reload,mr=hr===void 0?function(){}:hr,Kn=Object(i.useState)([]),Wt=Object(a.a)(Kn,2),dr=Wt[0],ht=Wt[1],Un=Object(i.useState)(),yn=Object(a.a)(Un,2),un=yn[0],Qt=yn[1],Ln=Object(i.useState)([]),hn=Object(a.a)(Ln,2),en=hn[0],Ut=hn[1],Kt=Object(i.useState)(""),sr=Object(a.a)(Kt,2),or=sr[0],Fn=sr[1],bn=Object(i.useState)(),Bt=Object(a.a)(bn,2),$t=Bt[0],Gt=Bt[1],Dt=Object(i.useState)(!1),er=Object(a.a)(Dt,2),An=er[0],fn=er[1],Vn=Object(i.useState)([]),dn=Object(a.a)(Vn,2),_n=dn[0],tn=dn[1],kn=Object(i.useState)(1),tr=Object(a.a)(kn,2),nr=tr[0],wn=tr[1],Mn=Object(i.useState)(!1),cn=Object(a.a)(Mn,2),lr=cn[0],Xn=cn[1],vr=Object(i.useState)(""),gr=Object(a.a)(vr,2),Gn=gr[0],Bn=gr[1],_r=Object(i.useState)([]),Rn=Object(a.a)(_r,2),En=Rn[0],Cn=Rn[1],vn=Object(i.useRef)(!1),Zt=function(rt){Cn([].concat(Object(j.a)(En),[Object(p.a)({},rt)]))},St=Object(C.i)();Object(i.useEffect)(function(){ht(["","","",""])},[]),Object(i.useEffect)(function(){if(vn.current)return;if(!(xe!=null&&xe.question_choices)){fn(!0),Fn(""),Gt(5),ht(["","","",""]),Ut([]);return}Fn(xe==null?void 0:xe.question_title),Gt(xe==null?void 0:xe.question_score),Xn(!(xe!=null&&xe.repeat_answer)),wn(xe==null?void 0:xe.difficulty),ht(xe==null?void 0:xe.question_choices.map(function(rt){return rt.choice_text}));var ft=[];xe==null||xe.standard_answer.map(function(rt,Ye){ft.push(rt-1)}),Ut(ft),tn(xe.tag_discipline_ids),Bn(xe==null?void 0:xe.analysis)},[xe,An]),Object(i.useEffect)(function(){An&&ft();function ft(){return rt.apply(this,arguments)}function rt(){return rt=Object(ne.a)(s.a.mark(function Ye(){var et,Ge,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(k.I)({sub_discipline_id:(et=pt.editData)===null||et===void 0||((Ge=et.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id});case 2:ot=mt.sent,Cn(ot.tag_disciplines);case 4:case"end":return mt.stop()}},Ye)})),rt.apply(this,arguments)}},[An]),Object(i.useImperativeHandle)(Be,function(){return{onSave:Nt,isEdit:An}}),Object(i.useEffect)(function(){var ft,rt=pt!=null&&(ft=pt.tagDisciplineData)!==null&&ft!==void 0&&ft.tag_disciplines&&Array.isArray(pt.tagDisciplineData.tag_disciplines)?pt.tagDisciplineData.tag_disciplines:[];Cn(rt)},[pt.tagDisciplineData]);var Mt=function(rt){(rt==null?void 0:rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),fn(!1),dt(-1),vn.current=!1,mr())},Nt=function(){var ft=Object(ne.a)(s.a.mark(function rt(){var Ye,et,Ge,ot,tt,mt,Tt;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(or){Pt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pt.abrupt("return",!1);case 3:if(Ye=dr.findIndex(function(vt){return!vt}),!(Ye>-1)){Pt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Rt[Ye]," \u9009\u9879\u7684\u5185\u5BB9")),Pt.abrupt("return",!1);case 7:if(en.length){Pt.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"),Pt.abrupt("return",!1);case 10:if(!(en.length<1)){Pt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pt.abrupt("return",!1);case 13:if(et=dr.map(function(vt,Et){return{choice_text:vt,is_answer:en.includes(Et)?1:0}}),vn.current=!0,!xe.question_id){Pt.next=22;break}return Pt.next=18,Ie({type:"newExercisePaper/editExerciseQuestion",payload:{id:St.id,question_id:xe.question_id,name:or,item_type:en.length>1?Ne.a.Multiple:Ne.a.Single,question_score:$t,choices:et,tag_discipline_ids:_n,sub_discipline_id:(ot=pt.editData)===null||ot===void 0||((tt=ot.exercise)===null||tt===void 0)?void 0:tt.sub_discipline_id,difficulty:nr,repeat_answer:!lr,analysis:Gn}});case 18:Ge=Pt.sent,Mt(Ge),Pt.next=26;break;case 22:return Pt.next=24,Ie({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:xe==null?void 0:xe.insert_id,id:St.id,name:or,item_type:en.length>1?Ne.a.Multiple:Ne.a.Single,question_score:$t,choices:et,tag_discipline_ids:_n,sub_discipline_id:(mt=pt.editData)===null||mt===void 0||((Tt=mt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:nr,repeat_answer:!lr,analysis:Gn}});case 24:Ge=Pt.sent,Mt(Ge);case 26:case"end":return Pt.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}(),At=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],zt=function(){var ft=Object(ne.a)(s.a.mark(function rt(Ye){return s.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(!(kt!==-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=Ye.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(ne.a)(s.a.mark(function tt(){return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(he.g)({question_id:xe.question_id,exam_id:St.id});case 2:Ie({type:"newExercisePaper/editExercise",payload:Object(p.a)({},St)});case 3:case"end":return Tt.stop()}},tt)}))()}}),Ge.abrupt("break",13);case 8:return dt(xe.dragKey),fn(!0),Ge.abrupt("break",13);case 11:return an({key:xe.key,insert_id:xe==null?void 0:xe.question_id,question_type:1}),Ge.abrupt("break",13);case 13:case"end":return Ge.stop()}},rt)}));return function(Ye){return ft.apply(this,arguments)}}(),on=function(){var rt;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.a.questionType},!(xe!=null&&xe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u591A\u9009\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09")),xe!=null&&xe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},xe.key,"."),t.a.createElement(Te.a,{value:xe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",xe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(Te.a,{value:xe.question_title})),t.a.createElement("div",{className:le.a.questionChoices},xe==null||((rt=xe.question_choices)===null||rt===void 0)?void 0:rt.map(function(Ye,et){return t.a.createElement(r.a,{key:et},t.a.createElement(A.a,null,t.a.createElement(T.a,{key:et,checked:xe.standard_answer.includes(et+1),disabled:!0},Rt[et],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:Ye.choice_text}))))})),t.a.createElement("div",{className:le.a.action},!xe.hideAction&&At.map(function(Ye,et){return t.a.createElement(o.a,{key:et,placement:"bottom",title:Ye.name},t.a.createElement("span",{onClick:function(){return zt(Ye)},className:Ye.icon}))})))},sn=function(){var rt,Ye;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:or,onChange:function(Ge){return Fn(Ge)}}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),dr.map(function(et,Ge){var ot,tt;return t.a.createElement("div",{className:le.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(le.a.answer," ").concat(en.includes(Ge)?le.a.activeAnswer:""),onClick:function(){en.includes(Ge)?Ut(en.filter(function(Tt){return Tt!==Ge})):Ut([].concat(Object(j.a)(en),[Ge]))}},Rt[Ge])),t.a.createElement("div",{className:le.a.editorWrap},un===Ge?t.a.createElement(y.a,{id:"single-question-option-".concat(Ge),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:et,onChange:function(Tt){dr[Ge]=Tt,ht(dr)}}):t.a.createElement("div",{className:le.a.htmlWrap,onClick:function(){return Qt(Ge)}},t.a.createElement(Te.a,{value:et}))),((ot=pt.editData)===null||ot===void 0||((tt=ot.exercise)===null||tt===void 0)?void 0:tt.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(le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return ht(dr.filter(function(Tt,gt){return gt!==Ge}))}})),Ge<7&&Ge===dr.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ht([].concat(Object(j.a)(dr),[""]))}}))))}),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:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gn,onChange:function(Ge){return Bn(Ge)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:$t,max:1e4,min:0,onChange:function(Ge){Gt(Ge)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:nr,onChange:function(Ge){wn(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:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{value:_n,selectvalues:xe==null?void 0:xe.tag_discipline_ids,onChange:tn,subId:(rt=pt.editData)===null||rt===void 0||((Ye=rt.exercise)===null||Ye===void 0)?void 0:Ye.sub_discipline_id,knowledgeOptions:En,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(w.a,{checked:lr,onChange:function(Ge){Xn(Ge)}}))),t.a.createElement("aside",{className:"tr"},(kt!==-1||xe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Hn(),fn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Nt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:le.a.wrap},!An&&on(),An&&sn())}),qn=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(It),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(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.editKey,kt=Be.setEditKey,ke=kt===void 0?function(){}:kt,dt=Be.cancelAdd,Re=dt===void 0?function(){}:dt,an=Be.reload,hr=an===void 0?function(){}:an,mr=Be.addCallback,Kn=mr===void 0?function(){}:mr,Wt=Object(i.useState)(),dr=Object(a.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(i.useState)(""),un=Object(a.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(i.useState)(!1),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)([]),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)([]),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(1),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)(!1),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(""),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useRef)(!1),Gn=function(Mt){Vn([].concat(Object(j.a)(fn),[Object(p.a)({},Mt)]))},Bn=Object(C.i)();Object(i.useEffect)(function(){if(gr.current)return;if(!(ve!=null&&ve.question_choices)){Kt(!0),Ln(""),bn(2),Un("");return}Mn(!(ve!=null&&ve.repeat_answer)),Ln(ve==null?void 0:ve.question_title),bn(ve==null?void 0:ve.question_score),kn(ve==null?void 0:ve.difficulty),Un(ve.standard_answer[0]+""),Dt(ve.tag_discipline_ids),vr(ve==null?void 0:ve.analysis)},[ve,Ut]),Object(i.useEffect)(function(){Ut&&St();function St(){return Mt.apply(this,arguments)}function Mt(){return Mt=Object(ne.a)(s.a.mark(function Nt(){var At,zt,on;return s.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(k.I)({sub_discipline_id:(At=Ie.editData)===null||At===void 0||((zt=At.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id});case 2:on=ft.sent,Vn(on.tag_disciplines);case 4:case"end":return ft.stop()}},Nt)})),Mt.apply(this,arguments)}},[Ut]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Rn,isEdit:Ut}}),Object(i.useEffect)(function(){var St,Mt=Ie!=null&&(St=Ie.tagDisciplineData)!==null&&St!==void 0&&St.tag_disciplines&&Array.isArray(Ie.tagDisciplineData.tag_disciplines)?Ie.tagDisciplineData.tag_disciplines:[];Vn(Mt)},[Ie.tagDisciplineData]);var _r=function(Mt){(Mt==null?void 0:Mt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Kt(!1),ke(-1),gr.current=!1,hr())},Rn=function(){var St=Object(ne.a)(s.a.mark(function Mt(){var Nt,At,zt,on,sn,ft;return s.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:if(Qt){Ye.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ye.abrupt("return",!1);case 3:if(ht){Ye.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ye.abrupt("return",!1);case 6:if(Nt=[{choice_text:"\u6B63\u786E",is_answer:ht==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ht==="2"?1:0}],gr.current=!0,!ve.question_id){Ye.next=15;break}return Ye.next=11,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Bn.id,question_id:ve.question_id,name:Qt,item_type:Ne.a.Judge,question_score:Fn,choices:Nt,tag_discipline_ids:Gt,sub_discipline_id:(zt=Ie.editData)===null||zt===void 0||((on=zt.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:tn,repeat_answer:!wn,analysis:Xn}});case 11:At=Ye.sent,_r(At),Ye.next=19;break;case 15:return Ye.next=17,xe({type:"newExercisePaper/addExerciseQuestion",payload:{id:Bn.id,insert_id:ve==null?void 0:ve.insert_id,name:Qt,item_type:Ne.a.Judge,question_score:Fn,choices:Nt,tag_discipline_ids:Gt,sub_discipline_id:(sn=Ie.editData)===null||sn===void 0||((ft=sn.exercise)===null||ft===void 0)?void 0:ft.sub_discipline_id,difficulty:tn,repeat_answer:!wn,analysis:Xn}});case 17:At=Ye.sent,_r(At);case 19:return Ye.abrupt("return",{name:Qt,choices:Nt});case 20:case"end":return Ye.stop()}},Mt)}));return function(){return St.apply(this,arguments)}}(),En=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Cn=function(){var St=Object(ne.a)(s.a.mark(function Mt(Nt){return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(!(Hn!==-1)){zt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),zt.abrupt("return");case 3:zt.t0=Nt.id,zt.next=zt.t0==="del"?6:zt.t0==="edit"?8:zt.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(ne.a)(s.a.mark(function sn(){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.next=2,Object(he.g)({question_id:ve.question_id,exam_id:Bn.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Bn)});case 3:case"end":return rt.stop()}},sn)}))()}}),zt.abrupt("break",13);case 8:return ke(ve.dragKey),Kt(!0),zt.abrupt("break",13);case 11:return Kn({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),zt.abrupt("break",13);case 13:case"end":return zt.stop()}},Mt)}));return function(Nt){return St.apply(this,arguments)}}(),vn=function(){var Mt;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{className:le.a.questionChoices},ve==null||((Mt=ve.question_choices)===null||Mt===void 0)?void 0:Mt.map(function(Nt,At){return t.a.createElement(h.a,{key:At,checked:ve.standard_answer.includes(At+1),disabled:!0},Vt[At],"."," ",t.a.createElement("span",{className:"c-black font14"},Nt.choice_text))})),t.a.createElement("div",{className:le.a.action},!ve.hideAction&&En.map(function(Nt,At){return t.a.createElement(o.a,{key:At,placement:"bottom",title:Nt.name},t.a.createElement("span",{onClick:function(){return Cn(Nt)},className:Nt.icon}))})))},Zt=function(){var Mt,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:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Qt,onChange:function(zt){return Ln(zt)}}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:ht,onChange:function(zt){return Un(zt.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(le.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:le.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:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Xn,onChange:function(zt){return vr(zt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Fn,max:1e4,min:0,onChange:function(zt){bn(zt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:tn,onChange:function(zt){kn(zt.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:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{value:Gt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Dt,subId:(Mt=Ie.editData)===null||Mt===void 0||((Nt=Mt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,knowledgeOptions:fn,onAddKnowledgeFinish:Gn})),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(w.a,{checked:wn,onChange:function(zt){Mn(zt)}}))),t.a.createElement("aside",{className:"tr"},(Hn!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),Kt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Rn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:le.a.wrap},!Ut&&vn(),Ut&&Zt())},nn=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(qt)),On=function(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.editKey,kt=Be.setEditKey,ke=kt===void 0?function(){}:kt,dt=Be.cancelAdd,Re=dt===void 0?function(){}:dt,an=Be.addCallback,hr=an===void 0?function(){}:an,mr=Be.reload,Kn=mr===void 0?function(){}:mr,Wt=Object(i.useState)(""),dr=Object(a.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(i.useState)(""),un=Object(a.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(i.useState)([]),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(""),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)(!1),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)(0),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)(!1),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useState)(!1),Gn=Object(a.a)(gr,2),Bn=Gn[0],_r=Gn[1],Rn=Object(i.useState)([]),En=Object(a.a)(Rn,2),Cn=En[0],vn=En[1],Zt=Object(i.useState)(1),St=Object(a.a)(Zt,2),Mt=St[0],Nt=St[1],At=Object(i.useState)(!1),zt=Object(a.a)(At,2),on=zt[0],sn=zt[1],ft=Object(i.useRef)(!1),rt=Object(C.i)(),Ye=Object(i.useState)([]),et=Object(a.a)(Ye,2),Ge=et[0],ot=et[1],tt=function(pn){ot([].concat(Object(j.a)(Ge),[Object(p.a)({},pn)]))};Object(i.useEffect)(function(){if(ft.current)return;if(!(ve!=null&&ve.question_title)){vr(!0),Un(""),Dt(!1),kn(2),Kt([]),bn(""),Vn(!1);return}Un(ve==null?void 0:ve.question_title),Dt(ve==null?void 0:ve.is_ordered),Nt(ve==null?void 0:ve.difficulty),sn(!(ve!=null&&ve.repeat_answer)),kn(ve==null?void 0:ve.question_score);var jt=ve==null?void 0:ve.standard_answer.map(function(pn){return pn.answer_text});Kt(Object(j.a)(jt)),vn(ve.tag_discipline_ids),Ln(ve==null?void 0:ve.analysis)},[ve,Xn]),Object(i.useEffect)(function(){Vn(!1),Xn&&jt();function jt(){return pn.apply(this,arguments)}function pn(){return pn=Object(ne.a)(s.a.mark(function In(){var zn,mn,Ir;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Object(k.I)({sub_discipline_id:(zn=Ie.editData)===null||zn===void 0||((mn=zn.exercise)===null||mn===void 0)?void 0:mn.sub_discipline_id});case 2:Ir=Er.sent,ot(Ir.tag_disciplines);case 4:case"end":return Er.stop()}},In)})),pn.apply(this,arguments)}},[Xn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Tt,isEdit:Xn}}),Object(i.useEffect)(function(){var jt,pn=Ie!=null&&(jt=Ie.tagDisciplineData)!==null&&jt!==void 0&&jt.tag_disciplines&&Array.isArray(Ie.tagDisciplineData.tag_disciplines)?Ie.tagDisciplineData.tag_disciplines:[];ot(pn)},[Ie.tagDisciplineData]);var mt=function(pn){(pn==null?void 0:pn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),vr(!1),ke(-1),ft.current=!1,Kn())},Tt=function(){var jt=Object(ne.a)(s.a.mark(function pn(){var In,zn,mn,Ir,jr,Er,Jn;return s.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:if(In=[],zn=!1,_r(!0),Ut.forEach(function(wr,Ur){In.push({position:Ur+1,answer_text:[]}),wr.forEach(function(Vr,Fr){In[Ur].answer_text.push(Vr),(!Vr||!Object(ae.eb)(Vr,1e4))&&(bn("".concat(Ur,"-").concat(Fr)),_.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),zn=!0)})}),!zn){br.next=7;break}return _r(!1),br.abrupt("return",!1);case 7:if(ft.current=!0,!ve.question_id){br.next=15;break}return br.next=11,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:rt.id,question_id:ve.question_id,name:ht,item_type:3,question_score:tn,is_ordered:Gt,standard_answers:In,tag_discipline_ids:Cn,sub_discipline_id:(Ir=Ie.editData)===null||Ir===void 0||((jr=Ir.exercise)===null||jr===void 0)?void 0:jr.sub_discipline_id,difficulty:Mt,repeat_answer:!on,analysis:Qt}});case 11:mn=br.sent,mt(mn),br.next=19;break;case 15:return br.next=17,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:rt.id,name:ht,item_type:3,question_score:tn,is_ordered:Gt,standard_answers:In,tag_discipline_ids:Cn,sub_discipline_id:(Er=Ie.editData)===null||Er===void 0||((Jn=Er.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:Mt,repeat_answer:!on,analysis:Qt}});case 17:mn=br.sent,mt(mn);case 19:return _r(!1),br.abrupt("return",{name:ht,analysis:Qt,standard_answers:In,is_ordered:Gt});case 21:case"end":return br.stop()}},pn)}));return function(){return jt.apply(this,arguments)}}(),gt=function(pn,In,zn){var mn=Ut.slice();if(In&&mn.splice(pn,In),zn&&fn||!ve.question_id)for(var Ir=0;Ir<zn;Ir++)mn.splice(pn+Ir,0,[""]);Mn(mn==null?void 0:mn.length),Vn(!0),Kt(mn)},Pt=function(pn,In,zn){bn("");var mn=Ut.slice();mn[pn][In]=zn,Kt(mn)},vt=function(pn){var In=Ut.slice();In[pn]=[].concat(Object(j.a)(In[pn]),[""]),Kt(In)},Et=function(pn,In){var zn=Ut.slice();if(!zn[pn][In]){zn[pn]=zn[pn].filter(function(mn,Ir){return Ir!==In}),Kt(zn);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:le.a.modal,onOk:function(){zn[pn]=zn[pn].filter(function(Ir,jr){return jr!==In}),Kt(zn)}})},ln=function(pn){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:le.a.modal,onOk:function(){var zn=0;Un(ht.replace(/\▁/g,function(mn){return zn++,zn-1===pn?"":mn})),setTimeout(function(){var mn=Ut.slice();mn=Ut.filter(function(Ir,jr){return pn!==jr}),Kt(mn)},500)}})},Jt=function(){var pn,In;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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:ht,onChange:function(mn){return Un(mn)},showNullButton:!0,deleteEmptyDisabled:Bn,onPlaceholderChange:gt})),t.a.createElement("div",{className:"mt20"},Ut.map(function(zn,mn){return t.a.createElement(J.a,{key:mn,answers:zn,index:mn,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:Fn,onAnswerChange:Pt,addChildAnswer:vt,deleteChildAnswer:Et,deleteChildAnswermain:ln})})),t.a.createElement("div",{className:"mt20"},Ut.length>1&&t.a.createElement("span",null,t.a.createElement(T.a,{checked:Gt,onChange:function(mn){return Dt(mn.target.checked)},className:"".concat(le.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(le.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:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Qt,onChange:function(mn){return Ln(mn)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:tn,max:1e4,min:0,onChange:function(mn){kn(mn)}})," ","\u5206 \xA0"," ",!!tn&&!!wn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(tn/wn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Mt,onChange:function(mn){Nt(mn.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:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{value:Cn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:vn,subId:(pn=Ie.editData)===null||pn===void 0||((In=pn.exercise)===null||In===void 0)?void 0:In.sub_discipline_id,knowledgeOptions:Ge,onAddKnowledgeFinish:tt})),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(w.a,{checked:on,onChange:function(mn){sn(mn)}}))),t.a.createElement("aside",{className:"tr"},(Hn!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Re(),vr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Tt()}},"\u4FDD\u5B58")))},fr=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],jn=function(){var jt=Object(ne.a)(s.a.mark(function pn(In){return s.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:if(!(Hn!==-1)){mn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),mn.abrupt("return");case 3:mn.t0=In.id,mn.next=mn.t0==="del"?6:mn.t0==="edit"?8:mn.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(ne.a)(s.a.mark(function jr(){return s.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(he.g)({question_id:ve.question_id,exam_id:rt.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},rt)});case 3:case"end":return Jn.stop()}},jr)}))()}}),mn.abrupt("break",13);case 8:return ke(ve.dragKey),vr(!0),mn.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),mn.abrupt("break",13);case 13:case"end":return mn.stop()}},pn)}));return function(In){return jt.apply(this,arguments)}}(),Wn=function(){var pn;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{className:le.a.questionChoices},ve==null||((pn=ve.standard_answer)===null||pn===void 0)?void 0:pn.map(function(In,zn){return t.a.createElement(r.a,{key:zn,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",In.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},In.answer_text.map(function(mn,Ir){return t.a.createElement(A.a,{span:24,key:Ir},t.a.createElement(S.a,{key:zn,checked:ve.standard_answer.includes(zn),disabled:!0,value:mn}))}))))})),t.a.createElement("div",{className:le.a.action},!ve.hideAction&&fr.map(function(In,zn){return In.id==="up"&&ve.key===1||In.id==="down"&&ve.key===ve.len?null:t.a.createElement(o.a,{key:zn,placement:"bottom",title:In.name},t.a.createElement("span",{onClick:function(){return jn(In)},className:In.icon}))})))};return t.a.createElement("section",{className:le.a.wrap},!Xn&&Wn(),Xn&&Jt())},ar=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(On)),cr=function(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.cancelAdd,kt=Hn===void 0?function(){}:Hn,ke=Be.editKey,dt=Be.setEditKey,Re=dt===void 0?function(){}:dt,an=Be.reload,hr=an===void 0?function(){}:an,mr=Be.addCallback,Kn=mr===void 0?function(){}:mr,Wt=Object(i.useState)(""),dr=Object(a.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(i.useState)(""),un=Object(a.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(i.useState)(""),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(!1),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)([]),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(i.useState)(1),_n=Object(a.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(i.useState)(!1),nr=Object(a.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(i.useState)([[],[]]),lr=Object(a.a)(cn,2),Xn=lr[0],vr=lr[1],gr=Object(i.useRef)(!1),Gn=Object(C.i)(),Bn=Object(i.useState)([]),_r=Object(a.a)(Bn,2),Rn=_r[0],En=_r[1],Cn=function(on){En([].concat(Object(j.a)(Rn),[Object(p.a)({},on)]))};Object(i.useEffect)(function(){var zt;if(gr.current)return;if(!(ve!=null&&ve.question_title)){Dt(!0),Un(""),Kt(""),bn(10);return}Mn(!(ve!=null&&ve.repeat_answer)),Un(ve==null?void 0:ve.question_title),Kt(ve==null||((zt=ve.standard_answer)===null||zt===void 0)?void 0:zt[0]),bn(ve==null?void 0:ve.question_score),Vn(ve.tag_discipline_ids),kn(ve==null?void 0:ve.difficulty),Ln(ve==null?void 0:ve.analysis),vr([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Ie.editData,Gt]),Object(i.useEffect)(function(){var zt,on=Ie!=null&&(zt=Ie.tagDisciplineData)!==null&&zt!==void 0&&zt.tag_disciplines&&Array.isArray(Ie.tagDisciplineData.tag_disciplines)?Ie.tagDisciplineData.tag_disciplines:[];En(on)},[Ie.tagDisciplineData]),Object(i.useEffect)(function(){Gt&&zt();function zt(){return on.apply(this,arguments)}function on(){return on=Object(ne.a)(s.a.mark(function sn(){var ft,rt,Ye;return s.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return Ge.next=2,Object(k.I)({sub_discipline_id:(ft=Ie.editData)===null||ft===void 0||((rt=ft.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id});case 2:Ye=Ge.sent,En(Ye.tag_disciplines);case 4:case"end":return Ge.stop()}},sn)})),on.apply(this,arguments)}},[Gt]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Zt,isEdit:Gt}});var vn=function(on){(on==null?void 0:on.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Dt(!1),Re(-1),gr.current=!1,hr())},Zt=function(){var zt=Object(ne.a)(s.a.mark(function on(){var sn,ft,rt,Ye,et,Ge,ot;return s.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(ht){mt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),mt.abrupt("return",!1);case 3:if(sn=Xn[0],ft=Xn[1],gr.current=!0,!ve.question_id){mt.next=13;break}return mt.next=9,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:Gn.id,question_id:ve.question_id,name:ht,item_type:4,question_score:Fn,answer_texts:[Ut],tag_discipline_ids:fn,sub_discipline_id:(Ye=Ie.editData)===null||Ye===void 0||((et=Ye.exercise)===null||et===void 0)?void 0:et.sub_discipline_id,difficulty:tn,repeat_answer:!wn,analysis:Qt,normal_keywords:sn,main_keywords:ft}});case 9:rt=mt.sent,vn(rt),mt.next=17;break;case 13:return mt.next=15,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:Gn.id,name:ht,item_type:4,question_score:Fn,answer_texts:[Ut],tag_discipline_ids:fn,sub_discipline_id:(Ge=Ie.editData)===null||Ge===void 0||((ot=Ge.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id,difficulty:tn,repeat_answer:!wn,analysis:Qt,normal_keywords:sn,main_keywords:ft}});case 15:rt=mt.sent,vn(rt);case 17:return mt.abrupt("return",{name:ht,answer_texts:[Ut],analysis:Qt,normal_keywords:sn,main_keywords:ft});case 18:case"end":return mt.stop()}},on)}));return function(){return zt.apply(this,arguments)}}(),St=function(){var on,sn;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ht,onChange:function(rt){return Un(rt)}}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(y.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Ut,onChange:function(rt){return Kt(rt)}}),t.a.createElement(bt.a,{value:Xn,onChange:vr}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Qt,onChange:function(rt){return Ln(rt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Fn,max:1e4,min:0,onChange:function(rt){bn(rt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:tn,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("p",{className:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{value:fn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Vn,subId:(on=Ie.editData)===null||on===void 0||((sn=on.exercise)===null||sn===void 0)?void 0:sn.sub_discipline_id,knowledgeOptions:Rn,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(w.a,{checked:wn,onChange:function(rt){Mn(rt)}}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){kt(),Dt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Zt()}},"\u4FDD\u5B58")))},Mt=[{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"}],Nt=function(){var zt=Object(ne.a)(s.a.mark(function on(sn){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(ke!==-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=sn.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(ne.a)(s.a.mark(function et(){return s.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(he.g)({question_id:ve.question_id,exam_id:Gn.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Gn)});case 3:case"end":return ot.stop()}},et)}))()}}),rt.abrupt("break",17);case 8:return rt.next=10,xe({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:sn.id}});case 10:return xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Gn)}),rt.abrupt("break",17);case 12:return Re(ve.dragKey),Dt(!0),rt.abrupt("break",17);case 15:return Kn({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),rt.abrupt("break",17);case 17:case"end":return rt.stop()}},on)}));return function(sn){return zt.apply(this,arguments)}}(),At=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{className:le.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(Te.a,{value:Ut||""})),t.a.createElement("div",{className:le.a.action},!ve.hideAction&&Mt.map(function(on,sn){return t.a.createElement(o.a,{key:sn,placement:"bottom",title:on.name},t.a.createElement("span",{onClick:function(){return Nt(on)},className:on.icon}))})))};return t.a.createElement("section",{className:le.a.wrap},!Gt&&At(),Gt&&St())},Qn=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(cr)),yr=function(Be,pt){var Ie=Be.dispatch,xe=Be.editData,ve=Be.cancelAdd,Hn=ve===void 0?function(){}:ve,kt=Be.editKey,ke=Be.setEditKey,dt=ke===void 0?function(){}:ke,Re=Be.reload,an=Re===void 0?function(){}:Re,hr=Object(i.useState)(""),mr=Object(a.a)(hr,2),Kn=mr[0],Wt=mr[1],dr=Object(i.useState)(""),ht=Object(a.a)(dr,2),Un=ht[0],yn=ht[1],un=Object(i.useState)(""),Qt=Object(a.a)(un,2),Ln=Qt[0],hn=Qt[1],en=Object(i.useState)([]),Ut=Object(a.a)(en,2),Kt=Ut[0],sr=Ut[1],or=Object(i.useState)(),Fn=Object(a.a)(or,2),bn=Fn[0],Bt=Fn[1],$t=Object(i.useState)(!1),Gt=Object(a.a)($t,2),Dt=Gt[0],er=Gt[1],An=Object(i.useState)([]),fn=Object(a.a)(An,2),Vn=fn[0],dn=fn[1],_n=Object(i.useState)(!1),tn=Object(a.a)(_n,2),kn=tn[0],tr=tn[1],nr=Object(i.useState)(!1),wn=Object(a.a)(nr,2),Mn=wn[0],cn=wn[1],lr=Object(C.i)(),Xn=Object(i.useRef)(!1);Object(i.useEffect)(function(){var En;if(Xn.current)return;xe.edit&&(tr(!0),yn(""),Wt(""),dn([])),Wt(xe.shixun_name),yn(xe.question_title);var Cn=[];(En=xe.shixun)===null||En===void 0||En.map(function(vn){Cn.push(vn.challenge_score)}),dn(Cn)},[xe]),Object(i.useEffect)(function(){er(!1)},[kn]),Object(i.useImperativeHandle)(pt,function(){return{onSave:gr,isEdit:kn}});var vr=function(Cn){(Cn==null?void 0:Cn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),tr(!1),dt(-1),Xn.current=!1,an())},gr=function(){var En=Object(ne.a)(s.a.mark(function Cn(){var vn,Zt,St;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(vn=[],Zt=!1,!Zt){Nt.next=4;break}return Nt.abrupt("return",!1);case 4:if(Xn.current=!0,cn(!0),!xe.question_id){Nt.next=12;break}return Nt.next=9,Ie({type:"newExercisePaper/editExerciseQuestion",payload:{id:lr.id,question_id:xe.question_id,name:Un,shixun_name:Kn,shixun_id:xe.shixun_id,item_type:5,question_scores:Vn}});case 9:St=Nt.sent,Nt.next=15;break;case 12:return Nt.next=14,Ie({type:"newExercisePaper/addExerciseQuestion",payload:{id:lr.id,insert_id:xe==null?void 0:xe.insert_id,name:Un,shixun_name:Kn,shixun_id:xe.shixun_id,item_type:5,question_scores:Vn,is_copy:xe.is_copy}});case 14:St=Nt.sent;case 15:return vr(St),cn(!1),Nt.abrupt("return",{name:Un,analysis:Ln,standard_answers:vn,is_ordered:bn});case 18:case"end":return Nt.stop()}},Cn)}));return function(){return En.apply(this,arguments)}}(),Gn=function(){var Cn;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:Kn,onChange:function(Zt){Wt(Zt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(y.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Un,onChange:function(Zt){yn(Zt)}})),t.a.createElement("div",{className:"mt20"},(Cn=xe.shixun)===null||Cn===void 0?void 0:Cn.map(function(vn,Zt){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},Zt+1,".",vn.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Vn[Zt],onChange:function(Mt){Vn[Zt]=Mt,dn(Vn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Kt.length>1&&t.a.createElement("span",null,t.a.createElement(T.a,{checked:bn,onChange:function(Zt){return Bt(Zt.target.checked)},className:"".concat(le.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(le.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"},(kt!==-1||!(xe!=null&&xe.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){Hn(),tr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Mn,className:"ml20",type:"primary",onClick:function(){gr()}},"\u4FDD\u5B58")))},Bn=[{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"}],_r=function(){var En=Object(ne.a)(s.a.mark(function Cn(vn){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!(kt!==-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=vn.id,St.next=St.t0==="del"?6:St.t0==="edit"?8:St.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(ne.a)(s.a.mark(function Nt(){return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(he.g)({question_id:xe.question_id,exam_id:lr.id});case 2:Ie({type:"newExercisePaper/editExercise",payload:Object(p.a)({},lr)});case 3:case"end":return zt.stop()}},Nt)}))()}}),St.abrupt("break",13);case 8:return dt(xe.dragKey),tr(!0),St.abrupt("break",13);case 11:return Ie({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:xe.key,insert_id:xe==null?void 0:xe.question_id,question_type:5}}}),St.abrupt("break",13);case 13:case"end":return St.stop()}},Cn)}));return function(vn){return En.apply(this,arguments)}}(),Rn=function(){var Cn,vn;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.a.questionType},!(xe!=null&&xe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09")),xe!=null&&xe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},xe.key,"."),t.a.createElement(Te.a,{value:xe.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",xe.question_score,"\u5206\uFF09"),!!((Cn=xe.schools)!==null&&Cn!==void 0&&Cn.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(Te.a,{value:xe.shixun_name})),t.a.createElement("div",{className:"mt30"}),(vn=xe.shixun)===null||vn===void 0?void 0:vn.map(function(Zt,St){return t.a.createElement("div",{key:St},"\u7B2C",St+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},Zt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},Zt.challenge_score," \u5206"))}),t.a.createElement("div",{className:le.a.action},t.a.createElement(Fe.a,{target:"_blank",to:"/shixuns/".concat(xe.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!xe.hideAction&&Bn.map(function(Zt,St){return t.a.createElement(o.a,{key:St,placement:"bottom",title:Zt.name},t.a.createElement("span",{onClick:function(){return _r(Zt)},className:Zt.icon}))})))};return t.a.createElement("section",{className:le.a.wrap},!kn&&Rn(),kn&&Gn())},Sr=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(yr)),Nn=["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(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.editKey,kt=Be.addCallback,ke=kt===void 0?function(){}:kt,dt=Object(i.useState)([]),Re=Object(a.a)(dt,2),an=Re[0],hr=Re[1],mr=Object(i.useState)(),Kn=Object(a.a)(mr,2),Wt=Kn[0],dr=Kn[1],ht=Object(i.useState)([]),Un=Object(a.a)(ht,2),yn=Un[0],un=Un[1],Qt=Object(i.useState)(""),Ln=Object(a.a)(Qt,2),hn=Ln[0],en=Ln[1],Ut=Object(i.useState)(5),Kt=Object(a.a)(Ut,2),sr=Kt[0],or=Kt[1],Fn=Object(i.useState)(!1),bn=Object(a.a)(Fn,2),Bt=bn[0],$t=bn[1],Gt=Object(C.i)();Object(i.useEffect)(function(){hr(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){$t(!0),en(""),or(5),hr(["","","",""]),un([]);return}en(ve==null?void 0:ve.question_title),or(ve==null?void 0:ve.question_score),hr(ve==null?void 0:ve.question_choices.map(function(_n){return _n.choice_text}));var dn=[];ve==null||ve.standard_answer.map(function(_n,tn){dn.push(_n-1)}),un(dn)},[ve]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Dt,isEdit:Bt}});var Dt=function(){var dn=Object(ne.a)(s.a.mark(function _n(){var tn,kn,tr;return s.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(hn){wn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),wn.abrupt("return",!1);case 3:if(tn=an.findIndex(function(Mn){return!Mn}),!(tn>-1)){wn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Nn[tn]," \u9009\u9879\u7684\u5185\u5BB9")),wn.abrupt("return",!1);case 7:if(yn.length){wn.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"),wn.abrupt("return",!1);case 10:if(!(yn.length<1)){wn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),wn.abrupt("return",!1);case 13:if(kn=an.map(function(Mn,cn){return{choice_text:Mn,is_answer:yn.includes(cn)?cn+1:0}}),!ve.question_id){wn.next=20;break}return wn.next=17,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:hn,question_type:1,question_score:sr,question_choices:kn.map(function(Mn){return Mn.choice_text}),standard_answers:kn.filter(function(Mn){return Mn.is_answer}).map(function(Mn){return Mn.is_answer})}});case 17:tr=wn.sent,wn.next=23;break;case 20:return wn.next=22,xe({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:Gt.categoryId,question_title:hn,question_type:1,question_score:"5.0",question_choices:kn.map(function(Mn){return Mn.choice_text}),standard_answers:kn.filter(function(Mn){return Mn.is_answer}).map(function(Mn){return Mn.is_answer})}});case 22:tr=wn.sent;case 23:tr.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),$t(!1),xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Gt)}));case 24:case"end":return wn.stop()}},_n)}));return function(){return dn.apply(this,arguments)}}(),er=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],An=function(){var dn=Object(ne.a)(s.a.mark(function _n(tn){return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:if(!(Hn!==-1)){tr.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),tr.abrupt("return");case 3:tr.t0=tn.id,tr.next=tr.t0==="del"?6:tr.t0==="edit"?8:tr.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(ne.a)(s.a.mark(function wn(){return s.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(he.g)({exam_id:Gt.id,question_id:ve.question_id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},Gt)});case 3:case"end":return cn.stop()}},wn)}))()}}),tr.abrupt("break",12);case 8:return F.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(Gt.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)),tr.abrupt("break",12);case 10:return ke({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),tr.abrupt("break",12);case 12:case"end":return tr.stop()}},_n)}));return function(tn){return dn.apply(this,arguments)}}(),fn=function(){var dn=Object(ne.a)(s.a.mark(function _n(tn){var kn;return s.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return tn.preventDefault(),nr.next=3,Object(k.Y)({id:ve==null?void 0:ve.hack_identifier});case 3:kn=nr.sent,kn.status===0&&Object(ae.S)("/myproblems/".concat(kn==null?void 0:kn.identifier));case 5:case"end":return nr.stop()}},_n)}));return function(tn){return dn.apply(this,arguments)}}(),Vn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{className:le.a.questionChoices},t.a.createElement(Te.a,{value:ve.description||""})),t.a.createElement("div",{className:le.a.action},!ve.hideAction&&er.map(function(_n,tn){return t.a.createElement(o.a,{key:tn,placement:"bottom",title:_n.name},t.a.createElement("span",{onClick:function(){return An(_n)},className:_n.icon}))})))};return t.a.createElement("section",{className:le.a.wrap},Vn())},Dn=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ar)),Pn=["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"],Zn=function(Be,pt){var Ie=Be.newExercisePaper,xe=Be.dispatch,ve=Be.editData,Hn=Be.cancelAdd,kt=Hn===void 0?function(){}:Hn,ke=Be.editKey,dt=Be.setEditKey,Re=dt===void 0?function(){}:dt,an=Be.addCallback,hr=an===void 0?function(Zt){}:an,mr=Be.reload,Kn=mr===void 0?function(){}:mr,Wt=Object(i.useState)([]),dr=Object(a.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(i.useState)(!1),un=Object(a.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(i.useState)(!0),en=Object(a.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(i.useState)(1),or=Object(a.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(i.useState)(!1),$t=Object(a.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(i.useState)([]),An=Object(a.a)(er,2),fn=An[0],Vn=An[1],dn=Object(C.i)(),_n=Object(i.useRef)(null),tn=Object(i.useState)(""),kn=Object(a.a)(tn,2),tr=kn[0],nr=kn[1],wn=Object(i.useState)([]),Mn=Object(a.a)(wn,2),cn=Mn[0],lr=Mn[1],Xn=Object(i.useRef)(!1),vr=function(St){Vn([].concat(Object(j.a)(fn),[Object(p.a)({},St)]))};Object(i.useEffect)(function(){var Zt;if(Xn.current)return;if(!(ve!=null&&ve.question_title)){Ln(!0),nr("");return}nr(ve==null?void 0:ve.question_title),Dt(!(ve!=null&&ve.repeat_answer)),bn(ve==null?void 0:ve.difficulty),Un(ve.tag_discipline_ids);var St=ve==null||((Zt=ve.sub_exercise_questions)===null||Zt===void 0)?void 0:Zt.map(function(Mt){return Object(p.a)(Object(p.a)({},Mt),{},{id:Mt.question_id,name:Mt.question_title,open:!1,question_score:Mt.question_score,choices:Mt==null?void 0:Mt.question_choices.map(function(Nt){return{choice_text:Nt.choice_text,is_answer:Nt.standard_boolean?1:0}}),activeQusEditor:null})});lr(St)},[ve,Qt]),Object(i.useEffect)(function(){Qt&&Zt();function Zt(){return St.apply(this,arguments)}function St(){return St=Object(ne.a)(s.a.mark(function Mt(){var Nt,At,zt;return s.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(k.I)({sub_discipline_id:(Nt=Ie.editData)===null||Nt===void 0||((At=Nt.exercise)===null||At===void 0)?void 0:At.sub_discipline_id});case 2:zt=sn.sent,Vn(zt.tag_disciplines);case 4:case"end":return sn.stop()}},Mt)})),St.apply(this,arguments)}},[Qt]),Object(i.useEffect)(function(){var Zt,St=Ie!=null&&(Zt=Ie.tagDisciplineData)!==null&&Zt!==void 0&&Zt.tag_disciplines&&Array.isArray(Ie.tagDisciplineData.tag_disciplines)?Ie.tagDisciplineData.tag_disciplines:[];Vn(St)},[Ie.tagDisciplineData]),Object(i.useImperativeHandle)(pt,function(){return{onSave:Gn,isEdit:Qt}});var gr=function(St){(St==null?void 0:St.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ln(!1),Re(-1),Xn.current=!1,Kn())},Gn=function(){var Zt=Object(ne.a)(s.a.mark(function St(){var Mt,Nt,At,zt,on,sn,ft,rt,Ye,et,Ge;return s.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(tr){tt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),tt.abrupt("return",!1);case 3:if(!(cn.length===0)){tt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),tt.abrupt("return",!1);case 6:Mt=0;case 7:if(!(Mt<cn.length)){tt.next=25;break}if(At=cn[Mt],At!=null&&At.name){tt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Mt+1,"\u5C0F\u9898\u9898\u5E72")),tt.abrupt("return",!1);case 12:if(At!=null&&At.question_score){tt.next=15;break}return _.b.info("\u7B2C".concat(Mt+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),tt.abrupt("return",!1);case 15:if(zt=At==null||((Nt=At.choices)===null||Nt===void 0)?void 0:Nt.findIndex(function(mt){return!mt}),!(zt>-1)){tt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Mt+1,"\u5C0F\u9898").concat(Pn[zt],"\u9009\u9879\u7684\u5185\u5BB9")),tt.abrupt("return",!1);case 19:if(!(At.choices.findIndex(function(mt){return mt.is_answer===1})===-1)){tt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Mt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),tt.abrupt("return",!1);case 22:Mt++,tt.next=7;break;case 25:if(on=cn.map(function(mt){return{id:mt.id>1?mt.id:null,name:mt.name,item_type:Ne.a.Single,choices:mt.choices,question_score:mt.question_score}}),Xn.current=!0,!ve.question_id){tt.next=34;break}return tt.next=30,xe({type:"newExercisePaper/editExerciseQuestion",payload:{id:dn.id,question_id:ve.question_id,name:tr,item_type:Ne.a.Combine,sub_item_banks:on,tag_discipline_ids:ht,sub_discipline_id:(ft=Ie.editData)===null||ft===void 0||((rt=ft.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:Fn,repeat_answer:!Gt}});case 30:sn=tt.sent,gr(sn),tt.next=38;break;case 34:return tt.next=36,xe({type:"newExercisePaper/addExerciseQuestion",payload:{id:dn.id,insert_id:ve==null?void 0:ve.insert_id,name:tr,item_type:Ne.a.Combine,tag_discipline_ids:ht,sub_discipline_id:(Ye=Ie.editData)===null||Ye===void 0||((et=Ye.exercise)===null||et===void 0)?void 0:et.sub_discipline_id,difficulty:Fn,repeat_answer:!Gt,sub_item_banks:on}});case 36:sn=tt.sent,((Ge=sn)===null||Ge===void 0?void 0:Ge.status)===0&&(Re(-1),_.b.success("\u4FDD\u5B58\u6210\u529F"),Ln(!1),xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},dn)}));case 38:case"end":return tt.stop()}},St)}));return function(){return Zt.apply(this,arguments)}}(),Bn=[{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"}],_r=function(){var Zt=Object(ne.a)(s.a.mark(function St(Mt){return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(ke!==-1)){At.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),At.abrupt("return");case 3:At.t0=Mt.id,At.next=At.t0==="del"?6:At.t0==="edit"?8:At.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(ne.a)(s.a.mark(function on(){return s.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(he.g)({question_id:ve.question_id,exam_id:dn.id});case 2:xe({type:"newExercisePaper/editExercise",payload:Object(p.a)({},dn)});case 3:case"end":return ft.stop()}},on)}))()}}),At.abrupt("break",13);case 8:return Re(ve.dragKey),Ln(!0),At.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Ne.a.Single}),At.abrupt("break",13);case 13:case"end":return At.stop()}},St)}));return function(Mt){return Zt.apply(this,arguments)}}(),Rn=function(){var St;return t.a.createElement("aside",{ref:_n},t.a.createElement("div",{className:le.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(Te.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(Te.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:Ut?"block":"none"},className:le.a.questionChoices},ve==null||((St=ve.sub_exercise_questions)===null||St===void 0)?void 0:St.map(function(Mt,Nt){var At;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"},ve.key,".",Nt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(Te.a,{value:Mt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Mt.question_score,"\u5206\uFF09")),Mt==null||((At=Mt.question_choices)===null||At===void 0)?void 0:At.map(function(zt,on){return t.a.createElement(r.a,{key:on},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:on,checked:zt.standard_boolean,disabled:!0},Pn[on],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(Te.a,{value:zt.choice_text}))))}))})),t.a.createElement("div",{className:le.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Kt(!Ut)},style:{}},Ut?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Bn.map(function(Mt,Nt){return t.a.createElement(o.a,{key:Nt,placement:"bottom",title:Mt.name},t.a.createElement("span",{onClick:function(){return _r(Mt)},className:Mt.icon}))})))},En=function(){var St,Mt;return t.a.createElement("aside",null,t.a.createElement("div",{className:le.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:le.a.wrap,style:{padding:0}},t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(y.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:tr,onChange:function(At){return nr(At)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",cn==null?void 0:cn.length),cn==null?void 0:cn.map(function(Nt,At){var zt;return t.a.createElement("div",{className:le.a.fold,key:Nt.id},t.a.createElement("div",{onClick:function(){return vn("open",At)},className:le.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",At+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(sn){sn.stopPropagation(),vn("delete",At)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Nt.open?"block":"none"}},t.a.createElement(y.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Nt==null?void 0:Nt.name,onChange:function(sn){return vn("value",At,sn)}}),t.a.createElement("p",{className:le.a.titleWrap},t.a.createElement("span",{className:le.a.required},"*"),t.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Nt==null||((zt=Nt.choices)===null||zt===void 0)?void 0:zt.map(function(on,sn){var ft;return t.a.createElement("div",{className:le.a.choiceWrap,key:sn},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(le.a.answer," ").concat(on.is_answer===1?le.a.activeAnswer:""),onClick:function(){return vn("answer",At,sn)}},Pn[sn])),t.a.createElement("div",{className:le.a.editorWrap},(Nt==null?void 0:Nt.activeQusEditor)===sn?t.a.createElement(y.a,{id:"single-question-option-".concat(sn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:on.choice_text,onChange:function(Ye){return vn("details",At,Ye)}}):t.a.createElement("div",{className:le.a.htmlWrap,onClick:function(){return vn("edit",At,sn)}},t.a.createElement(Te.a,{value:on.choice_text}))),sn>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return vn("deleteQus",At,sn)}})),sn<7&&sn===(Nt==null||((ft=Nt.choices)===null||ft===void 0)?void 0:ft.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return vn("addQus",At)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Nt.question_score,max:1e4,min:0,onChange:function(sn){return vn("score",At,sn)}}),"\u5206")))}),cn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:Cn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:le.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Fn,onChange:function(At){bn(At.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:le.a.titleWrap},t.a.createElement("span",{className:"".concat(le.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:le.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(Ue.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:ht,onChange:Un,subId:(St=Ie.editData)===null||St===void 0||((Mt=St.exercise)===null||Mt===void 0)?void 0:Mt.sub_discipline_id,knowledgeOptions:fn,onAddKnowledgeFinish:vr}))),t.a.createElement("aside",{className:"tr"},(ke!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){kt(),Ln(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Gn()}},"\u4FDD\u5B58")))},Cn=function(){var St={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};lr(cn.concat(St))},vn=function(St,Mt,Nt){var At=Object(_t.cloneDeep)(cn);St==="open"&&(At[Mt].open=!At[Mt].open),St==="delete"&&At.splice(Mt,1),St==="value"&&(At[Mt].name=Nt),St==="answer"&&At[Mt].choices.forEach(function(zt,on){zt.is_answer=Nt===on?1:0}),St==="edit"&&(At[Mt].activeQusEditor=Nt),St==="details"&&(At[Mt].choices[At[Mt].activeQusEditor].choice_text=Nt),St==="addQus"&&(At[Mt].choices=At[Mt].choices.concat({choice_text:"",is_answer:0})),St==="deleteQus"&&(At[Mt].choices=At[Mt].choices.filter(function(zt,on){return on!==Nt})),St==="analysis"&&(At[Mt].analysis=Nt),St==="score"&&(At[Mt].question_score=Nt),lr(At)};return t.a.createElement("section",{className:le.a.wrap},!Qt&&Rn(),Qt&&En())},pr=Object(F.a)(function(at){var Be=at.newExercisePaper;return{newExercisePaper:Be}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Zn)),Lr=function(Be){var pt=Be.data,Ie=Be.isDragDisabled,xe=Ie===void 0?!1:Ie,ve=Be.editorProps,Hn=ve===void 0?{}:ve,kt=Be.onDragEnd,ke=kt===void 0?function(){}:kt,dt=Be.dispatch,Re=Be.markBtnVisible,an=Re===void 0?!1:Re,hr=Be.batchScore,mr=hr===void 0?[]:hr,Kn=Be.reload,Wt=Kn===void 0?function(){}:Kn,dr=Be.inNewPaperLibrary,ht=dr===void 0?!1:dr,Un=Object(i.useRef)(),yn=Object(C.i)(),un=function(){var Bt,$t,Gt,Dt,er,An,fn,Vn,dn,_n,tn,kn,tr,nr,wn,Mn,cn=[{name:"\u5355\u9009\u9898",type:0,count:pt==null||((Bt=pt.exercise_types)===null||Bt===void 0)?void 0:Bt.q_singles,score:pt==null||(($t=pt.exercise_types)===null||$t===void 0)?void 0:$t.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:pt==null||((Gt=pt.exercise_types)===null||Gt===void 0)?void 0:Gt.q_doubles,score:pt==null||((Dt=pt.exercise_types)===null||Dt===void 0)?void 0:Dt.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:pt==null||((er=pt.exercise_types)===null||er===void 0)?void 0:er.q_judges,score:pt==null||((An=pt.exercise_types)===null||An===void 0)?void 0:An.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:pt==null||((fn=pt.exercise_types)===null||fn===void 0)?void 0:fn.q_nulls,score:pt==null||((Vn=pt.exercise_types)===null||Vn===void 0)?void 0:Vn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:pt==null||((dn=pt.exercise_types)===null||dn===void 0)?void 0:dn.q_mains,score:pt==null||((_n=pt.exercise_types)===null||_n===void 0)?void 0:_n.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:pt==null||((tn=pt.exercise_types)===null||tn===void 0)?void 0:tn.q_shixuns,score:pt==null||((kn=pt.exercise_types)===null||kn===void 0)?void 0:kn.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:pt==null||((tr=pt.exercise_types)===null||tr===void 0)?void 0:tr.q_pros,score:pt==null||((nr=pt.exercise_types)===null||nr===void 0)?void 0:nr.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:pt==null||((wn=pt.exercise_types)===null||wn===void 0)?void 0:wn.q_combinations,score:pt==null||((Mn=pt.exercise_types)===null||Mn===void 0)?void 0:Mn.q_combination_scores,items:[]}];return cn},Qt=function(Bt,$t,Gt){var Dt=Array.from(Bt),er=Dt.splice($t,1),An=Object(a.a)(er,1),fn=An[0];return Dt.splice(Gt,0,fn),Dt},Ln=function(Bt,$t,Gt){if(!Bt.destination)return;var Dt=Qt($t,Bt.source.index,Bt.destination.index);ht?ke(Bt,Dt,Gt):ke(Dt,Gt)},hn=function(Bt){dt({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Bt}})},en=function(Bt,$t){if($t===0)return ht?t.a.createElement(Ct,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(ut,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===1)return ht?t.a.createElement(qn,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(Ee,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===2)return ht?t.a.createElement(nn,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(z,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===3)return ht?t.a.createElement(ar,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(Z,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===4)return ht?t.a.createElement(Qn,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(Yt,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===5)return ht?t.a.createElement(Sr,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(Me,Object(g.a)({reload:Wt,editData:Bt},Bt));if($t===6)return ht?t.a.createElement(Dn,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(Qe,Object(g.a)({editData:Bt},Bt));if($t===7)return ht?t.a.createElement(pr,Object(g.a)({reload:Wt,editData:Bt},Bt)):t.a.createElement(ie,Object(g.a)({reload:Wt,editData:Bt},Bt))},Ut=function(Bt,$t,Gt){return t.a.createElement(oe.a,{onDragEnd:function(er){return Ln(er,Bt,$t)}},t.a.createElement(oe.c,{droppableId:"droppable"},function(Dt,er){return t.a.createElement("div",Object(g.a)({ref:Dt.innerRef},Dt.droppableProps,{style:{width:"100%"}}),Bt==null?void 0:Bt.map(function(An,fn){var Vn,dn=Object(p.a)(Object(p.a)({},An),{},{key:fn+1,hideAction:!0,isPreview:!0,dragKey:$t+"-"+fn},Hn);return t.a.createElement(oe.b,{key:dn==null?void 0:dn.question_id,draggableId:dn==null||((Vn=dn.question_id)===null||Vn===void 0)?void 0:Vn.toString(),index:fn,isDragDisabled:xe},function(_n,tn){return t.a.createElement("aside",Object(g.a)({ref:_n.innerRef},_n.draggableProps,_n.dragHandleProps),t.a.createElement("div",{className:we.a.posWarp,id:dn.dragKey},en(dn,$t),an&&t.a.createElement(r.a,{className:we.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return hn({value:dn,type:$t})}},dn!=null&&dn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement(Y.a,null),!xe&&t.a.createElement("div",{className:we.a.pos},t.a.createElement("div",{className:we.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Kt=function(Bt){var $t=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Gt=["","\u5341","\u767E","\u5343","\u4E07"];Bt=parseInt(Bt);var Dt=function(Vn){for(var dn=Vn.toString().split("").reverse(),_n="",tn=0;tn<dn.length;tn++)_n=(tn==0&&dn[tn]==0||tn>0&&dn[tn]==0&&dn[tn-1]==0?"":$t[dn[tn]]+(dn[tn]==0?Gt[0]:Gt[tn]))+_n;return _n},er=Math.floor(Bt/1e4),An=Bt%1e4;return An.toString().length<4&&(An="0"+An),er?Dt(er)+"\u4E07"+Dt(An):Dt(Bt)},sr=function(Bt){var $t={\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 $t[Bt]||0},or=function(Bt,$t){Un.current=sr($t),K.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,$t==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":$t,"\uFF1A"),t.a.createElement(B.a,{min:1,defaultValue:Un.current,onChange:function(Dt){Un.current=Dt}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),$t==="\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 Gt=Object(ne.a)(s.a.mark(function er(){var An,fn;return s.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(!ht){dn.next=6;break}return dn.next=3,Object(he.t)(yn.id,{question_type:Bt,score:Un.current});case 3:return An=dn.sent,An.status===0&&Wt(),dn.abrupt("return");case 6:return dn.next=8,Object(de.a)("/api/exercises/".concat(yn.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Bt,score:Un.current}});case 8:fn=dn.sent,fn.status!==-1&&Wt();case 10:case"end":return dn.stop()}},er)}));function Dt(){return Gt.apply(this,arguments)}return Dt}()})},Fn=function(){var Bt,$t=un();pt==null||((Bt=pt.exercise_questions)===null||Bt===void 0)||Bt.forEach(function(Dt,er){if(Dt.question_type===0){var An,fn;(An=$t[Dt.question_type])===null||An===void 0||((fn=An.items)===null||fn===void 0)||fn.push(Dt)}if(Dt.question_type===1){var Vn,dn;(Vn=$t[Dt.question_type])===null||Vn===void 0||((dn=Vn.items)===null||dn===void 0)||dn.push(Dt)}if(Dt.question_type===2){var _n,tn;(_n=$t[Dt.question_type])===null||_n===void 0||((tn=_n.items)===null||tn===void 0)||tn.push(Dt)}if(Dt.question_type===3){var kn,tr;(kn=$t[Dt.question_type])===null||kn===void 0||((tr=kn.items)===null||tr===void 0)||tr.push(Dt)}if(Dt.question_type===4){var nr,wn;(nr=$t[Dt.question_type])===null||nr===void 0||((wn=nr.items)===null||wn===void 0)||wn.push(Dt)}if(Dt.question_type===5){var Mn,cn;(Mn=$t[Dt.question_type])===null||Mn===void 0||((cn=Mn.items)===null||cn===void 0)||cn.push(Dt)}if(Dt.question_type===6){var lr,Xn;(lr=$t[Dt.question_type])===null||lr===void 0||((Xn=lr.items)===null||Xn===void 0)||Xn.push(Dt)}if(Dt.question_type===7){var vr,gr;(vr=$t[Dt.question_type])===null||vr===void 0||((gr=vr.items)===null||gr===void 0)||gr.push(Dt)}});var Gt=pt==null?void 0:pt.map(function(Dt,er){return t.a.createElement(t.a.Fragment,{key:er},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Kt(er+1),"\u3001",Dt.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Dt.count,"\u9898",(Dt==null?void 0:Dt.question_type)===7?"\uFF0C\u5305\u542B".concat(Dt.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Dt.score,"\u5206\uFF09"),(mr==null?void 0:mr.includes(Dt==null?void 0:Dt.name))&&t.a.createElement(m.a,{onClick:function(){return or(Dt==null?void 0:Dt.question_type,Dt==null?void 0:Dt.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),Ut(Dt.items,Dt==null?void 0:Dt.question_type,Dt==null?void 0:Dt.name))});return Gt};return t.a.createElement("div",null," ",Fn()," ")},Or=Pe.a=Object(F.a)()(Lr)},LdHM:function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return o}),U.d(Pe,"a",function(){return S});var ne=U("1OyB"),Q=U("vuIU"),B=U("Ji7U"),q=U("LK+K"),K=U("q1tI"),M=U("rePB"),Y=U("Ff2n"),V=U("ODXe"),r=U("4IlW"),D=U("bX4T"),m=U("YrtM"),p=U("TSYQ"),g=U.n(p),a=U("+nKL"),c=U("8OUc"),s=function(H,J){var ae=H.prefixCls,fe=H.id,ge=H.flattenOptions,Te=H.childrenAsData,Ue=H.values,Se=H.searchValue,Le=H.multiple,ye=H.defaultActiveFirstOption,Z=H.height,v=H.itemHeight,L=H.notFoundContent,z=H.open,ee=H.menuItemSelectedIcon,$=H.virtual,Ee=H.onSelect,Fe=H.onToggleOpen,qe=H.onActiveValue,Ce=H.onScroll,Me=H.onMouseEnter,He="".concat(ae,"-item"),Ke=Object(m.a)(function(){return ge},[z,ge],function(ie,oe){return oe[0]&&ie[1]!==oe[1]}),ut=K.useRef(null),bt=function(oe){oe.preventDefault()},Lt=function(oe){ut.current&&ut.current.scrollTo({index:oe})},Ft=function(oe){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,we=Ke.length,de=0;de<we;de+=1){var he=(oe+de*ce+we)%we,Oe=Ke[he],le=Oe.group,Ne=Oe.data;if(!le&&!Ne.disabled)return he}return-1},Yt=K.useState(function(){return Ft(0)}),Xt=Object(V.a)(Yt,2),Je=Xt[0],Qe=Xt[1],_t=function(oe){Qe(oe);var ce=Ke[oe];if(!ce){qe(null,-1);return}qe(ce.data.value,oe)};K.useEffect(function(){_t(ye!==!1?Ft(0):-1)},[Ke.length,Se]),K.useEffect(function(){var ie=setTimeout(function(){if(!Le&&z&&Ue.size===1){var oe=Array.from(Ue)[0],ce=Ke.findIndex(function(we){var de=we.data;return de.value===oe});_t(ce),Lt(ce)}});return function(){return clearTimeout(ie)}},[z]);var xt=function(oe){oe!==void 0&&Ee(oe,{selected:!Ue.has(oe)}),Le||Fe(!1)};if(K.useImperativeHandle(J,function(){return{onKeyDown:function(oe){var ce=oe.which;switch(ce){case r.a.UP:case r.a.DOWN:{var we=0;if(ce===r.a.UP?we=-1:ce===r.a.DOWN&&(we=1),we!==0){var de=Ft(Je+we,we);Lt(de),_t(de)}break}case r.a.ENTER:{var he=Ke[Je];he&&!he.data.disabled?xt(he.data.value):xt(void 0),z&&oe.preventDefault();break}case r.a.ESC:Fe(!1)}},onKeyUp:function(){},scrollTo:function(oe){Lt(oe)}}}),Ke.length===0)return K.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(He,"-empty"),onMouseDown:bt},L);function _e(ie){var oe=Ke[ie];if(!oe)return null;var ce=oe.data||{},we=ce.value,de=ce.label,he=ce.children,Oe=Object(D.a)(ce,!0),le=Te?he:de;return oe?K.createElement("div",Object.assign({"aria-label":typeof le=="string"?le:null},Oe,{key:ie,role:"option",id:"".concat(fe,"_list_").concat(ie),"aria-selected":Ue.has(we)}),we):null}return K.createElement(K.Fragment,null,K.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},_e(Je-1),_e(Je),_e(Je+1)),K.createElement(a.a,{itemKey:"key",ref:ut,data:Ke,height:Z,itemHeight:v,fullHeight:!1,onMouseDown:bt,onScroll:Ce,virtual:$,onMouseEnter:Me},function(ie,oe){var ce,we=ie.group,de=ie.groupOption,he=ie.data,Oe=he.label,le=he.key;if(we)return K.createElement("div",{className:g()(He,"".concat(He,"-group"))},Oe!==void 0?Oe:le);var Ne=he.disabled,We=he.value,lt=he.title,Ct=he.children,Rt=he.style,It=he.className,qn=Object(Y.a)(he,["disabled","value","title","children","style","className"]),Vt=Ue.has(We),qt="".concat(He,"-option"),nn=g()(He,qt,It,(ce={},Object(M.a)(ce,"".concat(qt,"-grouped"),de),Object(M.a)(ce,"".concat(qt,"-active"),Je===oe&&!Ne),Object(M.a)(ce,"".concat(qt,"-disabled"),Ne),Object(M.a)(ce,"".concat(qt,"-selected"),Vt),ce)),On=Te?Ct:Oe,ar=!ee||typeof ee=="function"||Vt;return K.createElement("div",Object.assign({},qn,{"aria-selected":Vt,className:nn,title:lt,onMouseMove:function(){if(Je===oe||Ne)return;_t(oe)},onClick:function(){Ne||xt(We)},style:Rt}),K.createElement("div",{className:"".concat(qt,"-content")},On||We),K.isValidElement(ee)||Vt,ar&&K.createElement(c.a,{className:"".concat(He,"-option-state"),customizeIcon:ee,customizeIconProps:{isSelected:Vt}},Vt?"\u2713":null))}))},i=K.forwardRef(s);i.displayName="OptionList";var t=i,u=function(){return null};u.isSelectOption=!0;var o=u,O=function(){return null};O.isSelectOptGroup=!0;var S=O,R=U("VTBJ"),A=U("Zm9Q");function P(y){var H=y.key,J=y.props,ae=J.children,fe=J.value,ge=Object(Y.a)(J,["children","value"]);return Object(R.a)({key:H,value:fe!==void 0?fe:H,children:ae},ge)}function w(y){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(y).map(function(J,ae){if(!K.isValidElement(J)||!J.type)return null;var fe=J.type.isSelectOptGroup,ge=J.key,Te=J.props,Ue=Te.children,Se=Object(Y.a)(Te,["children"]);return H||!fe?P(J):Object(R.a)(Object(R.a)({key:"__RC_SELECT_GRP__".concat(ge===null?ae:ge,"__"),label:ge},Se),{},{options:w(Ue)})}).filter(function(J){return J})}var E=U("2Qr1"),h=U("qNPg"),f=U("U8pU"),T=U("Kwbf"),x=U("WKfj");function _(y){var H=y.mode,J=y.options,ae=y.children,fe=y.backfill,ge=y.allowClear,Te=y.placeholder,Ue=y.getInputElement,Se=y.showSearch,Le=y.onSearch,ye=y.defaultOpen,Z=y.autoFocus,v=y.labelInValue,L=y.value,z=y.inputValue,ee=y.optionLabelProp,$=H==="multiple"||H==="tags",Ee=Se!==void 0?Se:$||H==="combobox",Fe=J||w(ae);if(Object(T.a)(H!=="tags"||Fe.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var qe=Fe.some(function(He){return He.options?He.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(T.a)(!qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(H!=="combobox"||!ee,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(H==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(T.a)(H==="combobox"||!Ue,"`getInputElement` only work with `combobox` mode."),Object(T.b)(H!=="combobox"||!Ue||!ge||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!Ee&&H!=="combobox"&&H!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ye||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),L!=null){var Ce=Object(x.d)(L);Object(T.a)(!v||Ce.every(function(He){return Object(f.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!$||Array.isArray(L),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Me=null;Object(A.a)(ae).some(function(He){if(!K.isValidElement(He)||!He.type)return!1;var Ke=He.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var ut=Object(A.a)(He.props.children).every(function(bt){return!K.isValidElement(bt)||!He.type||bt.type.isSelectOption?!0:(Me=bt.type,!1)});return!ut}return Me=Ke,!0}),Me&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Me.displayName||Me.name||Me,"`.")),Object(T.a)(z===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=_,W=Object(h.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:w,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:j,fillOptionsWithMissingValue:E.a}),C=function(y){Object(B.a)(J,y);var H=Object(q.a)(J);function J(){var ae;return Object(ne.a)(this,J),ae=H.apply(this,arguments),ae.selectRef=K.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(Q.a)(J,[{key:"render",value:function(){return K.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),J}(K.Component);C.Option=o,C.OptGroup=S;var F=C,k=Pe.c=F},M8RZ:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return r});var ne=U("fWQN"),Q=U("mtLc"),B=U("yKVA"),q=U("879j"),K=U("q1tI"),M=U.n(K),Y=U("i8i4"),V=U.n(Y),r=function(D){Object(B.a)(p,D);var m=Object(q.a)(p);function p(g){var a;Object(ne.a)(this,p),a=m.call(this,g);var c=window.document;return a.node=c.createElement("div"),c.body.appendChild(a.node),a}return Object(Q.a)(p,[{key:"render",value:function(){var a=this.props.children;return Object(Y.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(M.a.Component)},MI8n:function(wt,Pe,U){"use strict";U.d(Pe,"c",function(){return K}),U.d(Pe,"b",function(){return r}),U.d(Pe,"e",function(){return D}),U.d(Pe,"a",function(){return m}),U.d(Pe,"d",function(){return p}),U.d(Pe,"f",function(){return g});var ne=U("/cxE"),Q=U("pmY6"),B=U("24hK"),q=U("5Y4S"),K;(function(a){a.None=()=>Q.a.None;function c(_){return(j,W=null,C)=>{let F=!1,k;return k=_(y=>F?void 0:(k?k.dispose():F=!0,j.call(W,y)),null,C),F&&k.dispose(),k}}a.once=c;function s(_,j){return S((W,C=null,F)=>_(k=>W.call(C,j(k)),null,F))}a.map=s;function i(_,j){return S((W,C=null,F)=>_(k=>{j(k),W.call(C,k)},null,F))}a.forEach=i;function t(_,j){return S((W,C=null,F)=>_(k=>j(k)&&W.call(C,k),null,F))}a.filter=t;function u(_){return _}a.signal=u;function o(..._){return(j,W=null,C)=>Object(Q.e)(..._.map(F=>F(k=>j.call(W,k),null,C)))}a.any=o;function O(_,j,W){let C=W;return s(_,F=>(C=j(C,F),C))}a.reduce=O;function S(_){let j;const W=new r({onFirstListenerAdd(){j=_(W.fire,W)},onLastListenerRemove(){j.dispose()}});return W.event}function R(_,j,W=100,C=!1,F){let k,y,H,J=0;const ae=new r({leakWarningThreshold:F,onFirstListenerAdd(){k=_(fe=>{J++,y=j(y,fe),C&&!H&&(ae.fire(y),y=void 0),clearTimeout(H),H=setTimeout(()=>{const ge=y;y=void 0,H=void 0,(!C||J>1)&&ae.fire(ge),J=0},W)})},onLastListenerRemove(){k.dispose()}});return ae.event}a.debounce=R;function A(_,j=(W,C)=>W===C){let W=!0,C;return t(_,F=>{const k=W||!j(F,C);return W=!1,C=F,k})}a.latch=A;function P(_,j){return[a.filter(_,j),a.filter(_,W=>!j(W))]}a.split=P;function w(_,j=!1,W=[]){let C=W.slice(),F=_(H=>{C?C.push(H):y.fire(H)});const k=()=>{C&&C.forEach(H=>y.fire(H)),C=null},y=new r({onFirstListenerAdd(){F||(F=_(H=>y.fire(H)))},onFirstListenerDidAdd(){C&&(j?setTimeout(k):k())},onLastListenerRemove(){F&&F.dispose(),F=null}});return y.event}a.buffer=w;class E{constructor(_){this.event=_}map(_){return new E(s(this.event,_))}forEach(_){return new E(i(this.event,_))}filter(_){return new E(t(this.event,_))}reduce(_,j){return new E(O(this.event,_,j))}latch(){return new E(A(this.event))}debounce(_,j=100,W=!1,C){return new E(R(this.event,_,j,W,C))}on(_,j,W){return this.event(_,j,W)}once(_,j,W){return c(this.event)(_,j,W)}}function h(_){return new E(_)}a.chain=h;function f(_,j,W=C=>C){const C=(...H)=>y.fire(W(...H)),F=()=>_.on(j,C),k=()=>_.removeListener(j,C),y=new r({onFirstListenerAdd:F,onLastListenerRemove:k});return y.event}a.fromNodeEventEmitter=f;function T(_,j,W=C=>C){const C=(...H)=>y.fire(W(...H)),F=()=>_.addEventListener(j,C),k=()=>_.removeEventListener(j,C),y=new r({onFirstListenerAdd:F,onLastListenerRemove:k});return y.event}a.fromDOMEventEmitter=T;function x(_){return new Promise(j=>c(_)(j))}a.toPromise=x})(K||(K={}));class M{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${M._idPool++}`}start(a){this._stopWatch=new q.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}}}M._idPool=0;let Y=-1;class V{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=Y;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,O]of this._stacks)(!t||u<O)&&(t=o,u=O);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=Y>0?new V(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((c=this._options)===null||c===void 0?void 0:c._profName)?new M(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),O=Object(Q.i)(()=>{if(o&&o(),!this._disposed&&(u(),this._options&&this._options.onLastListenerRemove)){const S=this._listeners&&!this._listeners.isEmpty();S||this._options.onLastListenerRemove(this)}});return s instanceof Q.b?s.add(O):Array.isArray(s)&&s.push(O),O}),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(ne.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 p{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 g{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(wt,Pe,U){"use strict";(function(ne,Q){U.d(Pe,"b",function(){return s}),U.d(Pe,"i",function(){return o}),U.d(Pe,"f",function(){return O}),U.d(Pe,"d",function(){return S}),U.d(Pe,"g",function(){return R}),U.d(Pe,"h",function(){return A}),U.d(Pe,"c",function(){return P}),U.d(Pe,"k",function(){return w}),U.d(Pe,"j",function(){return E}),U.d(Pe,"a",function(){return h}),U.d(Pe,"e",function(){return x});var B;const q="en";let K=!1,M=!1,Y=!1,V=!1,r=!1,D=!1,m=!1,p,g=q,a,c;const s=typeof self=="object"?self:typeof ne=="object"?ne:{};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,M=c.indexOf("Macintosh")>=0,m=(c.indexOf("Macintosh")>=0||c.indexOf("iPad")>=0||c.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Y=c.indexOf("Linux")>=0,D=!0,p=navigator.language,g=p;else if(typeof i=="object"){K=i.platform==="win32",M=i.platform==="darwin",Y=i.platform==="linux",V=Y&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,p=q,g=q;const _=i.env.VSCODE_NLS_CONFIG;if(_)try{const j=JSON.parse(_),W=j.availableLanguages["*"];p=j.locale,g=W||q,a=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let u=0;M?u=1:K?u=3:Y&&(u=2);const o=K,O=M,S=Y,R=r,A=D,P=m,w=c,E=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let W=[];s.addEventListener("message",F=>{if(F.data&&F.data.vscodeSetImmediateId)for(let k=0,y=W.length;k<y;k++){const H=W[k];if(H.id===F.data.vscodeSetImmediateId){W.splice(k,1),H.callback();return}}});let C=0;return F=>{const k=++C;W.push({id:k,callback:F}),s.postMessage({vscodeSetImmediateId:k},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const j=Promise.resolve();return W=>j.then(W)}(),h=M||m?2:K?1:3;let f=!0,T=!1;function x(){if(!T){T=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const j=new Uint16Array(_.buffer);f=j[0]===(2<<8)+1}return f}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(wt,Pe,U){"use strict";U.d(Pe,"C",function(){return ne}),U.d(Pe,"v",function(){return B}),U.d(Pe,"s",function(){return q}),U.d(Pe,"t",function(){return K}),U.d(Pe,"U",function(){return M}),U.d(Pe,"J",function(){return Y}),U.d(Pe,"O",function(){return V}),U.d(Pe,"p",function(){return r}),U.d(Pe,"T",function(){return D}),U.d(Pe,"q",function(){return m}),U.d(Pe,"N",function(){return p}),U.d(Pe,"M",function(){return g}),U.d(Pe,"Q",function(){return a}),U.d(Pe,"u",function(){return c}),U.d(Pe,"x",function(){return s}),U.d(Pe,"I",function(){return i}),U.d(Pe,"f",function(){return t}),U.d(Pe,"h",function(){return u}),U.d(Pe,"g",function(){return o}),U.d(Pe,"i",function(){return O}),U.d(Pe,"G",function(){return S}),U.d(Pe,"H",function(){return R}),U.d(Pe,"r",function(){return A}),U.d(Pe,"R",function(){return P}),U.d(Pe,"d",function(){return w}),U.d(Pe,"e",function(){return E}),U.d(Pe,"E",function(){return h}),U.d(Pe,"F",function(){return f}),U.d(Pe,"j",function(){return T}),U.d(Pe,"z",function(){return x}),U.d(Pe,"K",function(){return j}),U.d(Pe,"L",function(){return W}),U.d(Pe,"m",function(){return F}),U.d(Pe,"k",function(){return y}),U.d(Pe,"A",function(){return J}),U.d(Pe,"a",function(){return ae}),U.d(Pe,"n",function(){return fe}),U.d(Pe,"l",function(){return ge}),U.d(Pe,"D",function(){return Te}),U.d(Pe,"B",function(){return Ue}),U.d(Pe,"b",function(){return Se}),U.d(Pe,"S",function(){return Le}),U.d(Pe,"o",function(){return ye}),U.d(Pe,"P",function(){return Z}),U.d(Pe,"w",function(){return v}),U.d(Pe,"c",function(){return L}),U.d(Pe,"y",function(){return $});function ne(Ce){return!Ce||typeof Ce!="string"?!0:Ce.trim().length===0}const Q=/{(\d+)}/g;function B(Ce,...Me){return Me.length===0?Ce:Ce.replace(Q,function(He,Ke){const ut=parseInt(Ke,10);return isNaN(ut)||ut<0||ut>=Me.length?He:Me[ut]})}function q(Ce){return Ce.replace(/[<>&]/g,function(Me){switch(Me){case"<":return"<";case">":return">";case"&":return"&";default:return Me}})}function K(Ce){return Ce.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(Ce,Me=" "){const He=Y(Ce,Me);return V(He,Me)}function Y(Ce,Me){if(!Ce||!Me)return Ce;const He=Me.length;if(He===0||Ce.length===0)return Ce;let Ke=0;for(;Ce.indexOf(Me,Ke)===Ke;)Ke=Ke+He;return Ce.substring(Ke)}function V(Ce,Me){if(!Ce||!Me)return Ce;const He=Me.length,Ke=Ce.length;if(He===0||Ke===0)return Ce;let ut=Ke,bt=-1;for(;!(bt=Ce.lastIndexOf(Me,ut-1),bt===-1||bt+He!==ut);){if(bt===0)return"";ut=bt}return Ce.substring(0,ut)}function r(Ce){return Ce.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(Ce){return Ce.replace(/\*/g,"")}function m(Ce,Me,He={}){if(!Ce)throw new Error("Cannot create regex from empty string");Me||(Ce=K(Ce)),He.wholeWord&&(/\B/.test(Ce.charAt(0))||(Ce="\\b"+Ce),/\B/.test(Ce.charAt(Ce.length-1))||(Ce=Ce+"\\b"));let Ke="";return He.global&&(Ke+="g"),He.matchCase||(Ke+="i"),He.multiline&&(Ke+="m"),He.unicode&&(Ke+="u"),new RegExp(Ce,Ke)}function p(Ce){if(Ce.source==="^"||Ce.source==="^$"||Ce.source==="$"||Ce.source==="^\\s*$")return!1;const Me=Ce.exec("");return!!(Me&&Ce.lastIndex===0)}function g(Ce){return(Ce.global?"g":"")+(Ce.ignoreCase?"i":"")+(Ce.multiline?"m":"")+(Ce.unicode?"u":"")}function a(Ce){return Ce.split(/\r\n|\r|\n/)}function c(Ce){for(let Me=0,He=Ce.length;Me<He;Me++){const Ke=Ce.charCodeAt(Me);if(Ke!==32&&Ke!==9)return Me}return-1}function s(Ce,Me=0,He=Ce.length){for(let Ke=Me;Ke<He;Ke++){const ut=Ce.charCodeAt(Ke);if(ut!==32&&ut!==9)return Ce.substring(Me,Ke)}return Ce.substring(Me,He)}function i(Ce,Me=Ce.length-1){for(let He=Me;He>=0;He--){const Ke=Ce.charCodeAt(He);if(Ke!==32&&Ke!==9)return He}return-1}function t(Ce,Me){return Ce<Me?-1:Ce>Me?1:0}function u(Ce,Me,He=0,Ke=Ce.length,ut=0,bt=Me.length){for(;He<Ke&&ut<bt;He++,ut++){let Yt=Ce.charCodeAt(He),Xt=Me.charCodeAt(ut);if(Yt<Xt)return-1;if(Yt>Xt)return 1}const Lt=Ke-He,Ft=bt-ut;return Lt<Ft?-1:Lt>Ft?1:0}function o(Ce,Me){return O(Ce,Me,0,Ce.length,0,Me.length)}function O(Ce,Me,He=0,Ke=Ce.length,ut=0,bt=Me.length){for(;He<Ke&&ut<bt;He++,ut++){let Yt=Ce.charCodeAt(He),Xt=Me.charCodeAt(ut);if(Yt===Xt)continue;if(Yt>=128||Xt>=128)return u(Ce.toLowerCase(),Me.toLowerCase(),He,Ke,ut,bt);S(Yt)&&(Yt-=32),S(Xt)&&(Xt-=32);const Je=Yt-Xt;if(Je===0)continue;return Je}const Lt=Ke-He,Ft=bt-ut;return Lt<Ft?-1:Lt>Ft?1:0}function S(Ce){return Ce>=97&&Ce<=122}function R(Ce){return Ce>=65&&Ce<=90}function A(Ce,Me){return Ce.length===Me.length&&O(Ce,Me)===0}function P(Ce,Me){const He=Me.length;return Me.length>Ce.length?!1:O(Ce,Me,0,He)===0}function w(Ce,Me){let He,Ke=Math.min(Ce.length,Me.length);for(He=0;He<Ke;He++)if(Ce.charCodeAt(He)!==Me.charCodeAt(He))return He;return Ke}function E(Ce,Me){let He,Ke=Math.min(Ce.length,Me.length);const ut=Ce.length-1,bt=Me.length-1;for(He=0;He<Ke;He++)if(Ce.charCodeAt(ut-He)!==Me.charCodeAt(bt-He))return He;return Ke}function h(Ce){return 55296<=Ce&&Ce<=56319}function f(Ce){return 56320<=Ce&&Ce<=57343}function T(Ce,Me){return(Ce-55296<<10)+(Me-56320)+65536}function x(Ce,Me,He){const Ke=Ce.charCodeAt(He);if(h(Ke)&&He+1<Me){const ut=Ce.charCodeAt(He+1);if(f(ut))return T(Ke,ut)}return Ke}function _(Ce,Me){const He=Ce.charCodeAt(Me-1);if(f(He)&&Me>1){const Ke=Ce.charCodeAt(Me-2);if(h(Ke))return T(Ke,He)}return He}function j(Ce,Me){const He=z.getInstance(),Ke=Me,ut=Ce.length,bt=x(Ce,ut,Me);Me+=bt>=65536?2:1;let Lt=He.getGraphemeBreakType(bt);for(;Me<ut;){const Ft=x(Ce,ut,Me),Yt=He.getGraphemeBreakType(Ft);if(L(Lt,Yt))break;Me+=Ft>=65536?2:1,Lt=Yt}return Me-Ke}function W(Ce,Me){const He=z.getInstance(),Ke=Me,ut=_(Ce,Me);Me-=ut>=65536?2:1;let bt=He.getGraphemeBreakType(ut);for(;Me>0;){const Lt=_(Ce,Me),Ft=He.getGraphemeBreakType(Lt);if(L(Ft,bt))break;Me-=Lt>=65536?2:1,bt=Ft}return Ke-Me}const C=/(?:[\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(Ce){return C.test(Ce)}const k=/(?:[\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 y(Ce){return k.test(Ce)}const H=/^[\t\n\r\x20-\x7E]*$/;function J(Ce){return H.test(Ce)}const ae=/[\u2028\u2029]/;function fe(Ce){return ae.test(Ce)}function ge(Ce){for(let Me=0,He=Ce.length;Me<He;Me++)if(Te(Ce.charCodeAt(Me)))return!0;return!1}function Te(Ce){return Ce=+Ce,Ce>=11904&&Ce<=55215||Ce>=63744&&Ce<=64255||Ce>=65281&&Ce<=65374}function Ue(Ce){return Ce>=127462&&Ce<=127487||Ce===8986||Ce===8987||Ce===9200||Ce===9203||Ce>=9728&&Ce<=10175||Ce===11088||Ce===11093||Ce>=127744&&Ce<=128591||Ce>=128640&&Ce<=128764||Ce>=128992&&Ce<=129003||Ce>=129280&&Ce<=129535||Ce>=129648&&Ce<=129750}const Se=String.fromCharCode(65279);function Le(Ce){return!!(Ce&&Ce.length>0&&Ce.charCodeAt(0)===65279)}function ye(Ce,Me=!1){return Ce?(Me&&(Ce=Ce.replace(/\\./g,"")),Ce.toLowerCase()!==Ce):!1}function Z(Ce){const Me=90-65+1;return Ce=Ce%(2*Me),Ce<Me?String.fromCharCode(97+Ce):String.fromCharCode(65+Ce-Me)}function v(Ce){const Me=z.getInstance();return Me.getGraphemeBreakType(Ce)}function L(Ce,Me){return Ce===0?Me!==5&&Me!==7:Ce===2&&Me===3?!1:Ce===4||Ce===2||Ce===3||(Me===4||Me===2||Me===3)?!0:Ce===8&&(Me===8||Me===9||Me===11||Me===12)||((Ce===11||Ce===9)&&(Me===9||Me===10)||((Ce===12||Ce===10)&&Me===10||(Me===5||Me===13||(Me===7||(Ce===1||Ce===13&&Me===14)))))?!1:!(Ce===6&&Me===6)}class z{constructor(){this._data=ee()}static getInstance(){return z._INSTANCE||(z._INSTANCE=new z),z._INSTANCE}getGraphemeBreakType(Ce){if(Ce<32)return Ce===10?3:Ce===13?2:4;if(Ce<127)return 0;const Me=this._data,He=Me.length/3;let Ke=1;for(;Ke<=He;)if(Ce<Me[3*Ke])Ke=2*Ke;else if(Ce>Me[3*Ke+1])Ke=2*Ke+1;else return Me[3*Ke+2];return 0}}z._INSTANCE=null;function ee(){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 $(Ce,Me){if(Ce===0)return 0;const He=Ee(Ce,Me);if(He!==void 0)return He;const Ke=_(Me,Ce);return Ce-=Fe(Ke),Ce}function Ee(Ce,Me){let He=_(Me,Ce);for(Ce-=Fe(He);qe(He)||He===65039||He===8419;){if(Ce===0)return;He=_(Me,Ce),Ce-=Fe(He)}if(!Ue(He))return;if(Ce>=0){const Ke=_(Me,Ce);Ke===8205&&(Ce-=Fe(Ke))}return Ce}function Fe(Ce){return Ce>=65536?2:1}function qe(Ce){return 127995<=Ce&&Ce<=127999}},NLgs:function(wt,Pe,U){"use strict";U.d(Pe,"e",function(){return i}),U.d(Pe,"f",function(){return t}),U.d(Pe,"d",function(){return o}),U.d(Pe,"c",function(){return O}),U.d(Pe,"a",function(){return S}),U.d(Pe,"b",function(){return R});var ne=U("miYZ"),Q=U("tsqr"),B=U("9og8"),q=U("2qtc"),K=U("kLXV"),M=U("WmNS"),Y=U.n(M),V=U("q1tI"),r=U.n(V),D=U("9kvl"),m=U("xKgJ"),p=U("1vsH"),g=U("RCxd"),a=U("yTi+"),c=U.n(a),s=U("m3rI"),i=function(P){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(t(P)&&u(w))},t=function(P){return Object(m.p)()?!0:(P({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},u=function(){var P,w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(D.c)()._store.getState(),h=E.user;return(P=h.userInfo)!==null&&P!==void 0&&P.profile_completed?!0:(K.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:w?"\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)},o=function(){var P,w=Object(D.c)()._store.getState(),E=w.user;return(P=E.userInfo)!==null&&P!==void 0&&P.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(p.S)("/account/certification")}}),!1)},O=function(){var P;if(Object(m.a)())return!0;var w=Object(D.c)()._store.getState(),E=w.user,h=w.globalSetting;return 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\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:s.a.IMG_SERVER+(h==null||((P=h.setting)===null||P===void 0)?void 0:P.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},S=function(P,w){var E;if(P)return!0;var h=Object(D.c)()._store.getState(),f=h.user,T=h.globalSetting;return K.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,w||"\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:s.a.IMG_SERVER+(T==null||((E=T.setting)===null||E===void 0)?void 0:E.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},R=function(P){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(D.c)()._store.getState(),h=E.shixunsDetail.detail;return(h==null?void 0:h.public)===2||(h==null?void 0:h.public)===1||(h==null?void 0:h.shixun_status)===3?(K.a.info({centered:!0,icon:r.a.createElement(g.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",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",w,"\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):(h==null?void 0:h.shixun_status)===2?(K.a.confirm({centered:!0,icon:r.a.createElement(g.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",w,"\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(g.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 T=Object(B.a)(Y.a.mark(function _(){var j;return Y.a.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,P({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=C.sent,j.status!==401&&(Q.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),P({type:"shixunsDetail/getShixunsDetail",payload:{id:h==null?void 0:h.identifier}}),P({type:"practiceSetting/getCommonData",payload:{id:h==null?void 0:h.identifier}}));case 4:case"end":return C.stop()}},_)}));function x(){return T.apply(this,arguments)}return x}()})}}),!0):!1}},Nog9:function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___FKAcC",flex_space_between:"flex_space_between___1W0sn",flex_box_vertical_center:"flex_box_vertical_center___1ZtTo",flex_box_center_end:"flex_box_center_end___3Rjsx",flex_box_column:"flex_box_column___3qWVQ",wrap:"wrap___K2ugW",modal:"modal___3Jrop",titleWrap:"titleWrap___2PdmB",required:"required___XbmpK",title:"title___1w-JF",colorGray:"colorGray___2hKRg",choiceWrap:"choiceWrap___3oJpR",answer:"answer___1Kugg",activeAnswer:"activeAnswer___3MPrD",deleteIcon:"deleteIcon___2j8_2",addIcon:"addIcon___2lm8T",editorWrap:"editorWrap___1f48O",htmlWrap:"htmlWrap___2gSXb",radio:"radio___1S16G",color333:"color333___3rZXR",color999:"color999___2xzRf",questionType:"questionType___2l_WF",questionChoices:"questionChoices___hYMa9",action:"action___1DPov",difficult:"difficult___1CZwg",fold:"fold___2FQQU",head:"head___2Es3Y"}},NvD2:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return M});var ne=U("Kwbf");function Q(Y,V){var r=new Set;return Y.forEach(function(D){V.has(D)||r.add(D)}),r}function B(Y){var V=Y||{},r=V.disabled,D=V.disableCheckbox,m=V.checkable;return!!(r||D)||m===!1}function q(Y,V,r,D){for(var m=new Set(Y),p=new Set,g=0;g<=r;g+=1){var a=V.get(g)||new Set;a.forEach(function(t){var u=t.key,o=t.node,O=t.children,S=O===void 0?[]:O;m.has(u)&&!D(o)&&S.filter(function(R){return!D(R.node)}).forEach(function(R){m.add(R.key)})})}for(var c=new Set,s=r;s>=0;s-=1){var i=V.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 O=!0,S=!1;(u.children||[]).filter(function(R){return!D(R.node)}).forEach(function(R){var A=R.key,P=m.has(A);O&&!P&&(O=!1),!S&&(P||p.has(A))&&(S=!0)}),O&&m.add(u.key),S&&p.add(u.key),c.add(u.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Q(p,m))}}function K(Y,V,r,D,m){for(var p=new Set(Y),g=new Set(V),a=0;a<=D;a+=1){var c=r.get(a)||new Set;c.forEach(function(u){var o=u.key,O=u.node,S=u.children,R=S===void 0?[]:S;!p.has(o)&&!g.has(o)&&!m(O)&&R.filter(function(A){return!m(A.node)}).forEach(function(A){p.delete(A.key)})})}g=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,O=u.node;if(m(O)||!u.parent||s.has(u.parent.key))return;if(m(u.parent.node)){s.add(o.key);return}var S=!0,R=!1;(o.children||[]).filter(function(A){return!m(A.node)}).forEach(function(A){var P=A.key,w=p.has(P);S&&!w&&(S=!1),!R&&(w||g.has(P))&&(R=!0)}),S||p.delete(o.key),R&&g.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Q(g,p))}}function M(Y,V,r,D){var m=[],p;D?p=D:p=B;var g=new Set(Y.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(ne.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return V===!0?s=q(g,a,c,p):s=K(g,V.halfCheckedKeys,a,c,p),s}},O2Wb:function(wt,Pe,U){wt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return D}),U.d(Pe,"a",function(){return m}),U.d(Pe,"k",function(){return p}),U.d(Pe,"h",function(){return g}),U.d(Pe,"i",function(){return a}),U.d(Pe,"g",function(){return c}),U.d(Pe,"c",function(){return s}),U.d(Pe,"d",function(){return i}),U.d(Pe,"j",function(){return o}),U.d(Pe,"e",function(){return O}),U.d(Pe,"f",function(){return S});var ne=U("KQm4"),Q=U("U8pU"),B=U("Ff2n"),q=U("q1tI"),K=U.n(q),M=U("Kwbf"),Y=U("WaYH"),V=.25,r=2;function D(R,A){var P=R.slice(),w=P.indexOf(A);return w>=0&&P.splice(w,1),P}function m(R,A){var P=R.slice();return P.indexOf(A)===-1&&P.push(A),P}function p(R){return R.split("-")}function g(R,A){return"".concat(R,"-").concat(A)}function a(R){return R&&R.type&&R.type.isTreeNode}function c(R,A){var P=[R],w=A[R];function E(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(f){var T=f.key,x=f.children;P.push(T),E(x)})}return E(w.children),P}function s(R,A){var P=R.clientY,w=A.selectHandle.getBoundingClientRect(),E=w.top,h=w.bottom,f=w.height,T=Math.max(f*V,r);return P<=E+T?-1:P>=h-T?1:0}function i(R,A){if(!R)return;var P=A.multiple;return P?R.slice():R.length?[R[0]]:R}var t=function(A){return A};function u(R,A){if(!R)return[];var P=A||{},w=P.processProps,E=w===void 0?t:w,h=Array.isArray(R)?R:[R];return h.map(function(f){var T=f.children,x=Object(B.a)(f,["children"]),_=u(T,A);return K.a.createElement(Y.a,Object.assign({},E(x)),_)})}function o(R){if(!R)return null;var A;if(Array.isArray(R))A={checkedKeys:R,halfCheckedKeys:void 0};else if(Object(Q.a)(R)==="object")A={checkedKeys:R.checked||void 0,halfCheckedKeys:R.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function O(R,A){var P=new Set;function w(E){if(P.has(E))return;var h=A[E];if(!h)return;P.add(E);var f=h.parent,T=h.node;if(T.disabled)return;f&&w(f.key)}return(R||[]).forEach(function(E){w(E)}),Object(ne.a)(P)}function S(R){var A={};return Object.keys(R).forEach(function(P){(P.startsWith("data-")||P.startsWith("aria-"))&&(A[P]=R[P])}),A}},Ot1p:function(wt,Pe,U){"use strict";var ne=U("2qtc"),Q=U("kLXV"),B=U("rAM+"),q=U("miYZ"),K=U("tsqr"),M=U("9og8"),Y=U("tJVT"),V=U("jrin"),r=U("WmNS"),D=U.n(r),m=U("q1tI"),p=U.n(m),g=U("VrN/"),a=U.n(g),c=U("bdgK"),s=U("p77/"),i=U("Bd2K"),t=U("ELLl"),u=U("19Vz"),o=U("lZu9"),O=U("+NIl"),S=U("kSUc"),R=U("9Bee"),A=function(Ne){var We=Ne.value,lt=We===void 0?"":We,Ct=Ne.className,Rt=Ne.showTextOnly,It=Ne.showLines,qn=Ne.style,Vt=qn===void 0?{}:qn,qt=Object(m.useMemo)(function(){return""},[lt]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:qt}}))},P=U("0Owb"),w=U("dejd"),E=U("C+DQ"),h=U("1vsH"),f=U("m3rI"),T=[{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 x(Ne){var We=Ne.onActionCallback,lt=Ne.title,Ct=Ne.icon,Rt=Ne.actionName,It=Ne.className,qn=It===void 0?"":It,Vt=Ne.children;function qt(){We(Rt)}return p.a.createElement("a",{title:lt,className:qn,onClick:qt},p.a.createElement("i",{className:"md-iconfont ".concat(Ct)}),Vt)}var _=function(Ne){var We=Ne.watch,lt=Ne.showNullButton,Ct=Ne.onActionCallback,Rt=Ne.fullScreen,It=Ne.insertTemp,qn=Ne.hidetoolBar,Vt=Ne.uuid,qt=Ne.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(Vt,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var nn=[].concat(T,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!qn&&nn.map(function(On,ar){return p.a.createElement("li",{key:ar},On.actionName?p.a.createElement(x,Object(P.a)({},On,{onActionCallback:Ct})):p.a.createElement("span",{className:"v-line"}))}),lt?p.a.createElement("li",null,p.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ct},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,It&&p.a.createElement("li",null,p.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(It),onActionCallback:Ct},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(x,{icon:"".concat(Rt?"icon-shrink":"icon-enlarge"),title:Rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ct})))},j=U("M8RZ"),W=U("+L6B"),C=U("2/Rp"),F=U("y8nQ"),k=U("Vl3Y"),y=U("5NDa"),H=U("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Ne){var We=Ne.callback,lt=Ne.onCancel;function Ct(Rt){We(Rt)}return p.a.createElement(k.a,Object(P.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ct}),p.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(H.a,null)),p.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(H.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},fe=U("7ahc"),ge=U("HmJG"),Te=U("BjJ7"),Ue=k.a.useForm,Se={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ye=function(Ne){var We=Ne.callback,lt=Ne.onCancel,Ct=Ue(),Rt=Object(Y.a)(Ct,1),It=Rt[0];function qn(nn){We(nn)}function Vt(nn,On){if(nn.status===-1){K.b.error(nn.message);return}It.setFieldsValue({src:"/api/attachments/".concat(nn.id),type:On.type})}function qt(nn){var On=nn.target.files[0];v(On,Vt)}return p.a.createElement(k.a,Object(P.a)({form:It},Le,{className:"upload-image-panel",onFinish:qn}),p.a.createElement(k.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(k.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(H.a,{style:Se})),p.a.createElement(Z,{onFileChange:qt}))),p.a.createElement(k.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(H.a,{style:{width:264}})),p.a.createElement(k.a.Item,{style:{textAlign:"right"}},p.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function Z(Ne){var We=Ne.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:We}))}function v(Ne,We){if(!Ne)throw new String("\u6CA1\u6709\u6587\u4EF6");var lt=new FormData;lt.append("editormd-image-file",Ne),lt.append("file_param_name","editormd-image-file"),lt.append("byxhr","true");var Ct=new window.XMLHttpRequest;Ct.withCredentials=!0,Ct.addEventListener("load",function(Rt){We(JSON.parse(Rt.target.responseText),Ne)},!1),Ct.addEventListener("error",function(Rt){console.error(Rt)},!1),Ct.open("POST","".concat(Te.a,"/api/attachments.json")),Ct.send(lt)}var L=U("giR+"),z=U("fyUT"),ee=U("7Kak"),$=U("9yH6"),Ee=$.a.Group,Fe={margin:"0 8px"},qe=function(Ne){var We=Ne.callback,lt=Ne.onCancel;function Ct(Rt){We(Rt)}return p.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ct},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Fe},"\u884C\u6570"),p.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(z.a,null)),p.a.createElement("span",{style:Fe},"\u5217\u6570"),p.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(z.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(k.a.Item,{name:"align"},p.a.createElement(Ee,null,p.a.createElement($.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement($.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement($.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement($.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(C.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},Ce=U("ErOA"),Me=U("7Cbv"),He="link",Ke="upload-image",ut="code-block",bt="add-table",Lt="------------",Ft={default:Lt,left:":".concat(Lt),center:":".concat(Lt,":"),right:"".concat(Lt,":")},Yt=U("9VGf"),Xt,Je;function Qe(){}var _t=0,xt=1e4,_e="\u2581",ie=`
|
|
**\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 oe(Ne){return/^\d+$/.test(Ne)?"".concat(Ne,"px"):Ne}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,we=ce?"Cmd":"Ctrl",de=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],he=(Xt={},Object(V.a)(Xt,we+"-B","bold"),Object(V.a)(Xt,we+"-I","italic"),Xt),Oe=(Je={},Object(V.a)(Je,He,"\u6DFB\u52A0\u94FE\u63A5"),Object(V.a)(Je,ut,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(V.a)(Je,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(V.a)(Je,bt,"\u6DFB\u52A0\u8868\u683C"),Je),le=Pe.a=function(Ne){var We=Ne.defaultValue,lt=We===void 0?"":We,Ct=Ne.onChange,Rt=Ne.width,It=Rt===void 0?"100%":Rt,qn=Ne.height,Vt=qn===void 0?400:qn,qt=Ne.miniToolbar,nn=qt===void 0?!1:qt,On=Ne.isFocus,ar=On===void 0?!1:On,cr=Ne.watch,Qn=Ne.insertTemp,yr=Ne.mode,Sr=yr===void 0?"markdown":yr,Nn=Ne.id,Ar=Nn===void 0?"markdown-editor-id":Nn,Dn=Ne.showResizeBar,Pn=Dn===void 0?!1:Dn,Zn=Ne.noStorage,pr=Zn===void 0?!1:Zn,Lr=Ne.showNullButton,Or=Lr===void 0?!1:Lr,at=Ne.hidetoolBar,Be=at===void 0?!1:at,pt=Ne.fullScreen,Ie=pt===void 0?!1:pt,xe=Ne.onBlur,ve=Ne.onCMBeforeChange,Hn=Ne.onFullScreen,kt=Ne.className,ke=kt===void 0?"":kt,dt=Ne.disablePaste,Re=dt===void 0?!1:dt,an=Ne.placeholder,hr=an===void 0?"":an,mr=Ne.values,Kn=mr===void 0?"":mr,Wt=Object(m.useState)(null),dr=Object(Y.a)(Wt,2),ht=dr[0],Un=dr[1],yn=Object(m.useState)(lt),un=Object(Y.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(m.useState)(cr),en=Object(Y.a)(hn,2),Ut=en[0],Kt=en[1],sr=Object(m.useState)(Ie),or=Object(Y.a)(sr,2),Fn=or[0],bn=or[1],Bt=Object(m.useState)(""),$t=Object(Y.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=Object(m.useState)(0),An=Object(Y.a)(er,2),fn=An[0],Vn=An[1],dn=Object(m.useState)(Vt),_n=Object(Y.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(m.useState)(!1),nr=Object(Y.a)(tr,2),wn=nr[0],Mn=nr[1],cn=Object(m.useRef)(Object(Me.a)()),lr=Object(m.useRef)(!1),Xn=Object(m.useRef)(),vr=Object(m.useRef)(),gr=Object(m.useRef)(),Gn=Object(m.useRef)(),Bn=Object(m.useRef)(),_r=function(){var ft=Object(M.a)(D.a.mark(function rt(){var Ye,et;return D.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(Ce.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:cn.current}});case 2:et=ot.sent,et!=null&&(Ye=et.attachments)!==null&&Ye!==void 0&&Ye.length&&(console.log("cm:",ht,vr),et.attachments.map(function(tt){tt.content_type.indexOf("image")>-1?ht.replaceSelection(".concat(tt.content_type,")")):tt.content_type.indexOf("video")>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):tt.content_type.indexOf("pdf")>-1?ht.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(tt.id,"?type=").concat(tt.content_type,'&disposition=inline" target="_blank">').concat(tt.name,"</a>")):ht.replaceSelection("[".concat(tt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(tt.id,"?type=").concat(tt.content_type,")"))}));case 4:case"end":return ot.stop()}},rt)}));return function(){return ft.apply(this,arguments)}}();Object(m.useEffect)(function(){Ln(Kn),ht==null||ht.setValue(Kn)},[Kn]),Object(m.useEffect)(function(){Hn==null||Hn(Fn)},[Fn]),Object(m.useEffect)(function(){if(vr.current){var ft=a.a.fromTextArea(vr.current,{mode:Sr,lineNumbers:!nn,lineWrapping:!0,value:lt,autoCloseTags:!0,autoCloseBrackets:!0});ar&&ft.focus();function rt(Ye,et){if(Re){et.preventDefault();return}var Ge=et.clipboardData;if(Ge){var ot=Ge.types.toString(),tt=Ge.items;if(ot==="Files"||Ge.types.indexOf("Files")>-1){if(et.preventDefault(),Sr=="stex")return;try{var mt,Tt=tt[1];((mt=tt[0])===null||mt===void 0?void 0:mt.kind)==="file"&&(Tt=tt[0]);var gt=Tt.getAsFile(),Pt=gt.name.split(".").pop();v(gt,function(vt){if(vt.id){var Et,ln,Jt;(gt==null||((Et=gt.type)===null||Et===void 0)?void 0:Et.indexOf("image"))>-1?ft.replaceSelection(".concat(vt.content_type,")")):(gt==null||((ln=gt.type)===null||ln===void 0)?void 0:ln.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(gt==null||((Jt=gt.type)===null||Jt===void 0)?void 0:Jt.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):de.includes(Pt)?ft.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):ft.replaceSelection("[".concat(gt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})}catch(vt){K.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",rt),ft.on("dragleave",function(Ye,et){gr.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(Ye,et){gr.current.classList.add("mouse-hover-md")}),ft.on("drop",function(Ye,et){gr.current.classList.add("mouse-hover-md");var Ge;if(Ge=et.dataTransfer.files,Ge.length>0){et.preventDefault(),et.stopPropagation();for(var ot=function(Tt){var gt=Ge[Tt],Pt=gt.name.split(".").pop();v(gt,function(vt){if(vt.id){var Et,ln,Jt;(gt==null||((Et=gt.type)===null||Et===void 0)?void 0:Et.indexOf("image"))>-1?ft.replaceSelection(".concat(vt.content_type,")")):(gt==null||((ln=gt.type)===null||ln===void 0)?void 0:ln.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(gt==null||((Jt=gt.type)===null||Jt===void 0)?void 0:Jt.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):de.includes(Pt)?ft.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):ft.replaceSelection("[".concat(gt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})},tt=0;tt<Ge.length;tt++)ot(tt)}}),Un(ft),function(){ft.off("paste",rt)}}},[]);var Rn=Object(m.useCallback)(function(){if(gr.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[tn,gr,Fn]);Object(m.useEffect)(function(){function ft(){var Ye=new c.default(function(et){var Ge=Object(B.a)(et),ot;try{for(Ge.s();!(ot=Ge.n()).done;){var tt=ot.value;(tt.target.offsetHeight>0||tt.target.offsetWidth>0)&&(Rn(),ht.setSize("100%","100%"),ht.refresh())}}catch(mt){Ge.e(mt)}finally{Ge.f()}});return Ye.observe(vr.current.parentElement),Ye}if(ht){var rt=ft();return function(){rt.unobserve(vr.current.parentElement)}}},[ht,Rn]),Object(m.useEffect)(function(){if(ht){for(var ft=[],rt=function(){var tt=et[Ye];Ge=Object(Y.a)(tt,2);var mt=Ge[0],Tt=Ge[1],gt=Object(V.a)({},mt,function(){En(Tt)});ft.push(gt),ht.addKeyMap(gt)},Ye=0,et=Object.entries(he);Ye<et.length;Ye++){var Ge;rt()}return Xn.current=setInterval(function(){lr.current&&_r()},4e3),function(){clearInterval(Xn.current);var ot=Object(B.a)(ft),tt;try{for(ot.s();!(tt=ot.n()).done;){var mt=tt.value;ht.removeKeyMap(mt)}}catch(Tt){ot.e(Tt)}finally{ot.f()}}}},[ht]),Object(m.useEffect)(function(){Ie!==Fn&&bn(Ie)},[Ie]),Object(Yt.a)(function(){if(!pr&&fn>0){var ft=new Date().getTime(),rt=window.sessionStorage.getItem(Ar);ft>=fn+xt&&(!rt||rt!==Qt)&&(window.sessionStorage.setItem(Ar,Qt),Mn(!0))}},xt),Object(m.useEffect)(function(){Kt(cr)},[ht,cr]),Object(m.useEffect)(function(){ht&&(ar&&ht.focus())},[ht,ar]),Object(m.useEffect)(function(){if(Ut&&ht){var ft=ht.getScrollerElement();function rt(Ye){var et=Ye.target;if(Bn.current){var Ge=et.scrollTop/et.scrollHeight;Bn.current.scrollTop=Bn.current.scrollHeight*Ge}}return ft.addEventListener("scroll",rt),function(){ft.removeEventListener("scroll",rt)}}},[ht,Ut]),Object(m.useEffect)(function(){if(ht&&ve){function ft(rt,Ye){ve(rt,Ye)}return ht.on("beforeChange",ft),function(){ht.off("beforeChange",ft)}}},[ht,ve]),Object(m.useEffect)(function(){if(ht&&xe){function ft(){xe(ht.getValue())}return ht.on("blur",ft),function(){ht.off("blur",ft)}}},[ht,xe]),Object(m.useEffect)(function(){if(ht){function ft(rt){var Ye=rt.getValue();Ln(Ye),Vn(new Date().getTime()),rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ct&&Ct(Ye)}return ht.on("change",ft),function(){ht.off("change",ft)}}},[ht,Ct]),Object(m.useEffect)(function(){ht&&(lt==null?(ht.setValue(""),Ln("")):lt!==ht.getValue()&&(ht.setValue(lt),Ln(lt),ht.setCursor(ht.lineCount(),0)))},[ht,lt]);var En=Object(m.useCallback)(function(ft){var rt=ht.getCursor(),Ye=ht.getSelection(),et=Ye.split(`
|
|
`);switch(ft){case"bold":return ht.replaceSelection("**"+Ye+"**"),Ye===""&&ht.setCursor(rt.line,rt.ch+2),ht.focus();case"italic":return ht.replaceSelection("*"+Ye+"*"),Ye===""&&ht.setCursor(rt.line,rt.ch+1),ht.focus();case"code":return ht.replaceSelection("`"+Ye+"`"),Ye===""&&ht.setCursor(rt.line,rt.ch+1),ht.focus();case"inline-latex":return ht.replaceSelection("`$$"+Ye+"$$`"),Ye===""&&ht.setCursor(rt.line,rt.ch+3),ht.focus();case"latex":return ht.replaceSelection("```latex\n"+Ye+"\n```"),ht.setCursor(rt.line+1,Ye.length+1),ht.focus();case"line-break":return ht.replaceSelection(`<br/>
|
|
`),ht.focus();case"list-ul":return Ye===""?ht.replaceSelection("- "+Ye):ht.replaceSelection(et.map(function(Ge){return Ge===""?"":"- ".concat(Ge)}).join(`
|
|
`)),ht.focus();case"list-ol":return Ye===""?ht.replaceSelection("1. "+Ye):ht.replaceSelection(et.map(function(Ge,ot){return Ge===""?"":"".concat(ot+1,". ").concat(Ge)}).join(`
|
|
`)),ht.focus();case"add-null-ch":return Ye===""&&ht.setCursor(rt.line,rt.ch+1),ht.replaceSelection(_e),ht.focus();case"inster-template-1":return Ye===""&&ht.setCursor(rt.line,rt.ch),ht.replaceSelection(ie),ht.focus();case"eraser":return ht.setValue(""),ht.focus();case"trigger-watch":return Kt(!Ut),ht.focus();case"trigger-full-screen":return bn(!Fn),ht.focus();case He:Dt(He);return;case ut:Dt(ut);return;case Ke:Dt(Ke);return;case bt:Dt(bt);return;default:throw new Error}},[ht,Ut,Fn]),Cn=Object(m.useCallback)(function(ft){Dt("");switch(Gt){case He:var rt=ft.title,Ye=ft.link;return ht.replaceSelection("[".concat(rt,"](").concat(Ye,")")),ht.focus();case ut:var et=ft.language,Ge=ft.content;return ht.replaceSelection(["```"+et,Ge,"```"].join(`
|
|
`)),ht.focus();case Ke:var ot=ft.src,tt=ft.alt;return tt?ht.replaceSelection(".concat(ot,' "').concat(tt,'" )')):ht.replaceSelection("")),ht.focus();case bt:for(var mt=ft.row,Tt=ft.col,gt=ft.align,Pt=`
|
|
`,vt=0;vt<mt;vt++){for(var Et=[],ln=[],Jt=0;Jt<Tt;Jt++)vt===1&&ln.push(Ft[gt]),Et.push(" ");vt===1&&(Pt+="| ".concat(ln.join(" | "),` |
|
|
`)),Pt+="| ".concat(Et.join(Tt===1?"":" | "),` |
|
|
`)}return ht.replaceSelection(Pt+`
|
|
`),ht.focus();default:throw new Error}},[ht,Gt]),vn=Object(m.useMemo)(function(){switch(Gt){case He:return p.a.createElement(ae,{callback:Cn,onCancel:Zt});case ut:return p.a.createElement(fe.b,{callback:Cn,onCancel:Zt});case Ke:return p.a.createElement(ye,{callback:Cn,onCancel:Zt});case bt:return p.a.createElement(qe,{callback:Cn,onCancel:Zt});default:return null}},[Gt]);function Zt(){Dt("")}Object(m.useEffect)(function(){if(Gn.current){var ft=Gn.current,rt=!1,Ye=0;function et(tt){rt=!0,Ye=tt.pageY}function Ge(){rt=!1}function ot(tt){if(rt){var mt=tt.pageY-Ye;mt<0&&(mt=0),mt>300&&(mt=300);var Tt=Vt+mt+"px";kn(Tt)}}return ft.addEventListener("mousedown",et),document.addEventListener("mousemove",ot),document.addEventListener("mouseup",Ge),function(){ft.removeEventListener("mousedown",et),document.removeEventListener("mousemove",ot),document.removeEventListener("mouseup",Ge)}}},[ht,Gn]),Object(m.useEffect)(function(){kn(Vt)},[Vt]);var St=oe(It),Mt=oe(tn),Nt={width:St,height:Mt},At=Object(m.useMemo)(function(){if(fn){var ft=new Date(fn),rt=ft.getHours(),Ye=ft.getMinutes(),et=ft.getSeconds();return rt=rt<10?"0"+rt:rt,Ye=Ye<10?"0"+Ye:Ye,et=et<10?"0"+et:et,"".concat(rt,":").concat(Ye,":").concat(et)}return 0},[fn]);function zt(){window.sessionStorage.removeItem(Ar),Mn(!1),Vn(0)}function on(){Mn(!1),Vn(0),ht.setValue(window.sessionStorage.getItem(Ar))}function sn(ft,rt){var Ye=ht.getValue();Ye=Ye.replace(ft,rt),Ln(Ye),ht==null||ht.setValue(Ye)}return p.a.createElement(m.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:gr},p.a.createElement("div",{className:"markdown-editor-container ".concat(ke," ").concat(Ut?"on-preview":""," ").concat(nn?"mini":""," ").concat(Fn?"full-screen":""),style:Nt},p.a.createElement(_,{insertTemp:Qn,watch:Ut,fullScreen:Fn,showNullButton:Or,onActionCallback:En,hidetoolBar:Be,uuid:cn.current,setOpenPhones:function(){lr.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:vr,placeholder:hr})),Ut?p.a.createElement("div",{ref:Bn,className:"preview-container"},Sr==="stex"&&p.a.createElement(A,{value:Qt}),Sr!=="stex"&&p.a.createElement(R.a,{edit:!0,value:Qt,replaces:sn})):null))),Pn?p.a.createElement("a",{ref:Gn,className:"editor-resize"}):null,p.a.createElement(j.a,null,Oe[Gt]?p.a.createElement(Q.a,{centered:!0,title:Oe[Gt],visible:!0,onCancel:Zt,footer:null,className:"markdown-popup-form"},vn):null))}},Pxm8:function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___3O17H",flex_space_between:"flex_space_between___1PCIj",flex_box_vertical_center:"flex_box_vertical_center___3W4zT",flex_box_center_end:"flex_box_center_end___3TSxu",flex_box_column:"flex_box_column___3pTiU",bg:"bg___3XbLP",title:"title___3HsI1",titleLeft:"titleLeft___3MQGG",titleRight:"titleRight___2RPg2",formWrap:"formWrap___3LmMJ"}},RxwV:function(wt,Pe,U){"use strict";var ne=U("q1tI"),Q=U("uciX"),B=U("2W6z"),q=U.n(B),K=U("4IlW"),M=U("uK0f"),Y=U.n(M);function V(Se,Le){if(Se===Le)return!0;if(!Se||!Le)return!1;var ye=Se.length;if(Le.length!==ye)return!1;for(var Z=0;Z<ye;Z++)if(Se[Z]!==Le[Z])return!1;return!0}function r(Se){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(ye){return typeof ye}:r=function(ye){return ye&&typeof Symbol=="function"&&ye.constructor===Symbol&&ye!==Symbol.prototype?"symbol":typeof ye},r(Se)}function D(Se,Le){if(!(Se instanceof Le))throw new TypeError("Cannot call a class as a function")}function m(Se,Le){for(var ye=0;ye<Le.length;ye++){var Z=Le[ye];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(Se,Z.key,Z)}}function p(Se,Le,ye){return Le&&m(Se.prototype,Le),ye&&m(Se,ye),Se}function g(Se,Le){if(typeof Le!="function"&&Le!==null)throw new TypeError("Super expression must either be null or a function");Se.prototype=Object.create(Le&&Le.prototype,{constructor:{value:Se,writable:!0,configurable:!0}}),Le&&a(Se,Le)}function a(Se,Le){return a=Object.setPrototypeOf||function(Z,v){return Z.__proto__=v,Z},a(Se,Le)}function c(Se){var Le=t();return function(){var ye=u(Se),Z;if(Le){var v=u(this).constructor;Z=Reflect.construct(ye,arguments,v)}else Z=ye.apply(this,arguments);return s(this,Z)}}function s(Se,Le){return Le&&(r(Le)==="object"||typeof Le=="function")?Le:i(Se)}function i(Se){if(Se===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Se}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(Se){return!1}}function u(Se){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(ye){return ye.__proto__||Object.getPrototypeOf(ye)},u(Se)}var o=function(){var Se=function(Le){g(Z,Le);var ye=c(Z);function Z(){var v;return D(this,Z),v=ye.apply(this,arguments),v.menuItems={},v.saveMenuItem=function(L){return function(z){v.menuItems[L]=z}},v}return p(Z,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(L){!L.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(L){var z=this.props,ee=z.fieldNames,$=z.defaultFieldNames;return ee[L]||$[L]}},{key:"getOption",value:function(L,z){var ee=this.props,$=ee.prefixCls,Ee=ee.expandTrigger,Fe=ee.expandIcon,qe=ee.loadingIcon,Ce=this.props.onSelect.bind(this,L,z),Me=this.props.onItemDoubleClick.bind(this,L,z),He={onClick:Ce,onDoubleClick:Me},Ke="".concat($,"-menu-item"),ut=null,bt=L[this.getFieldName("children")]&&L[this.getFieldName("children")].length>0;(bt||L.isLeaf===!1)&&(Ke+=" ".concat($,"-menu-item-expand"),L.loading||(ut=ne.createElement("span",{className:"".concat($,"-menu-item-expand-icon")},Fe))),Ee==="hover"&&(bt||L.isLeaf===!1)&&(He={onMouseEnter:this.delayOnSelect.bind(this,Ce),onMouseLeave:this.delayOnSelect.bind(this),onClick:Ce}),this.isActiveOption(L,z)&&(Ke+=" ".concat($,"-menu-item-active"),He.ref=this.saveMenuItem(z)),L.disabled&&(Ke+=" ".concat($,"-menu-item-disabled"));var Lt=null;L.loading&&(Ke+=" ".concat($,"-menu-item-loading"),Lt=qe||null);var Ft="";return"title"in L?Ft=L.title:typeof L[this.getFieldName("label")]=="string"&&(Ft=L[this.getFieldName("label")]),ne.createElement("li",Object.assign({key:L[this.getFieldName("value")],className:Ke,title:Ft},He,{role:"menuitem",onMouseDown:function(Xt){return Xt.preventDefault()}}),L[this.getFieldName("label")],ut,Lt)}},{key:"getActiveOptions",value:function(L){var z=this,ee=this.props.options,$=L||this.props.activeValue;return Y()(ee,function(Ee,Fe){return Ee[z.getFieldName("value")]===$[Fe]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var L=this,z=this.props.options,ee=this.getActiveOptions().map(function($){return $[L.getFieldName("children")]}).filter(function($){return!!$});return ee.unshift(z),ee}},{key:"delayOnSelect",value:function(L){for(var z=this,ee=arguments.length,$=new Array(ee>1?ee-1:0),Ee=1;Ee<ee;Ee++)$[Ee-1]=arguments[Ee];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof L=="function"&&(this.delayTimer=window.setTimeout(function(){L($),z.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var L=this.getShowOptions().length,z=0;z<L;z++){var ee=this.menuItems[z];ee&&ee.parentElement&&(ee.parentElement.scrollTop=ee.offsetTop)}}},{key:"isActiveOption",value:function(L,z){var ee=this.props.activeValue,$=ee===void 0?[]:ee;return $[z]===L[this.getFieldName("value")]}},{key:"render",value:function(){var L=this,z=this.props,ee=z.prefixCls,$=z.dropdownMenuColumnStyle;return ne.createElement("div",null,this.getShowOptions().map(function(Ee,Fe){return ne.createElement("ul",{className:"".concat(ee,"-menu"),key:Fe,style:$},Ee.map(function(qe){return L.getOption(qe,Fe)}))}))}}]),Z}(ne.Component);return Se.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},Se}(),O=o,S={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},R=S;function A(Se){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(ye){return typeof ye}:A=function(ye){return ye&&typeof Symbol=="function"&&ye.constructor===Symbol&&ye!==Symbol.prototype?"symbol":typeof ye},A(Se)}function P(Se,Le){if(Se==null)return{};var ye=w(Se,Le),Z,v;if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(Se);for(v=0;v<L.length;v++){if(Z=L[v],Le.indexOf(Z)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(Se,Z))continue;ye[Z]=Se[Z]}}return ye}function w(Se,Le){if(Se==null)return{};var ye={},Z=Object.keys(Se),v,L;for(L=0;L<Z.length;L++){if(v=Z[L],Le.indexOf(v)>=0)continue;ye[v]=Se[v]}return ye}function E(Se){return x(Se)||T(Se)||f(Se)||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(Se,Le){if(!Se)return;if(typeof Se=="string")return _(Se,Le);var ye=Object.prototype.toString.call(Se).slice(8,-1);if(ye==="Object"&&Se.constructor&&(ye=Se.constructor.name),ye==="Map"||ye==="Set")return Array.from(Se);if(ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ye))return _(Se,Le)}function T(Se){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(Se))return Array.from(Se)}function x(Se){if(Array.isArray(Se))return _(Se)}function _(Se,Le){(Le==null||Le>Se.length)&&(Le=Se.length);for(var ye=0,Z=new Array(Le);ye<Le;ye++)Z[ye]=Se[ye];return Z}function j(Se,Le){if(!(Se instanceof Le))throw new TypeError("Cannot call a class as a function")}function W(Se,Le){for(var ye=0;ye<Le.length;ye++){var Z=Le[ye];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(Se,Z.key,Z)}}function C(Se,Le,ye){return Le&&W(Se.prototype,Le),ye&&W(Se,ye),Se}function F(Se,Le){if(typeof Le!="function"&&Le!==null)throw new TypeError("Super expression must either be null or a function");Se.prototype=Object.create(Le&&Le.prototype,{constructor:{value:Se,writable:!0,configurable:!0}}),Le&&k(Se,Le)}function k(Se,Le){return k=Object.setPrototypeOf||function(Z,v){return Z.__proto__=v,Z},k(Se,Le)}function y(Se){var Le=ae();return function(){var ye=fe(Se),Z;if(Le){var v=fe(this).constructor;Z=Reflect.construct(ye,arguments,v)}else Z=ye.apply(this,arguments);return H(this,Z)}}function H(Se,Le){return Le&&(A(Le)==="object"||typeof Le=="function")?Le:J(Se)}function J(Se){if(Se===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Se}function ae(){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(Se){return!1}}function fe(Se){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(ye){return ye.__proto__||Object.getPrototypeOf(ye)},fe(Se)}var ge=function(){var Se=function(Le){F(Z,Le);var ye=y(Z);function Z(v){var L;j(this,Z),L=ye.call(this,v),L.setPopupVisible=function(ee){var $=L.state.value;"popupVisible"in L.props||L.setState({popupVisible:ee}),ee&&!L.state.popupVisible&&L.setState({activeValue:$}),L.props.onPopupVisibleChange(ee)},L.handleChange=function(ee,$,Ee){var Fe=$.visible;(Ee.type!=="keydown"||Ee.keyCode===K.a.ENTER)&&(L.props.onChange(ee.map(function(qe){return qe[L.getFieldName("value")]}),ee),L.setPopupVisible(Fe))},L.handlePopupVisibleChange=function(ee){L.setPopupVisible(ee)},L.handleMenuSelect=function(ee,$,Ee){var Fe=L.trigger.getRootDomNode();Fe&&Fe.focus&&Fe.focus();var qe=L.props,Ce=qe.changeOnSelect,Me=qe.loadData,He=qe.expandTrigger;if(!ee||ee.disabled)return;var Ke=L.state.activeValue;Ke=Ke.slice(0,$+1),Ke[$]=ee[L.getFieldName("value")];var ut=L.getActiveOptions(Ke);if(ee.isLeaf===!1&&!ee[L.getFieldName("children")]&&Me){Ce&&L.handleChange(ut,{visible:!0},Ee),L.setState({activeValue:Ke}),Me(ut);return}var bt={};!ee[L.getFieldName("children")]||!ee[L.getFieldName("children")].length?(L.handleChange(ut,{visible:!1},Ee),bt.value=Ke):Ce&&(Ee.type==="click"||Ee.type==="keydown")&&(He==="hover"?L.handleChange(ut,{visible:!1},Ee):L.handleChange(ut,{visible:!0},Ee),bt.value=Ke),bt.activeValue=Ke,("value"in L.props||Ee.type==="keydown"&&Ee.keyCode!==K.a.ENTER)&&delete bt.value,L.setState(bt)},L.handleItemDoubleClick=function(){var ee=L.props.changeOnSelect;ee&&L.setPopupVisible(!1)},L.handleKeyDown=function(ee){var $=L.props.children;if($&&$.props.onKeyDown){$.props.onKeyDown(ee);return}var Ee=E(L.state.activeValue),Fe=Ee.length-1<0?0:Ee.length-1,qe=L.getCurrentLevelOptions(),Ce=qe.map(function(ut){return ut[L.getFieldName("value")]}).indexOf(Ee[Fe]);if(ee.keyCode!==K.a.DOWN&&ee.keyCode!==K.a.UP&&ee.keyCode!==K.a.LEFT&&ee.keyCode!==K.a.RIGHT&&ee.keyCode!==K.a.ENTER&&ee.keyCode!==K.a.SPACE&&ee.keyCode!==K.a.BACKSPACE&&ee.keyCode!==K.a.ESC&&ee.keyCode!==K.a.TAB)return;if(!L.state.popupVisible&&ee.keyCode!==K.a.BACKSPACE&&ee.keyCode!==K.a.LEFT&&ee.keyCode!==K.a.RIGHT&&ee.keyCode!==K.a.ESC&&ee.keyCode!==K.a.TAB){L.setPopupVisible(!0);return}if(ee.keyCode===K.a.DOWN||ee.keyCode===K.a.UP){ee.preventDefault();var Me=Ce;Me!==-1?ee.keyCode===K.a.DOWN?(Me+=1,Me=Me>=qe.length?0:Me):(Me-=1,Me=Me<0?qe.length-1:Me):Me=0,Ee[Fe]=qe[Me][L.getFieldName("value")]}else if(ee.keyCode===K.a.LEFT||ee.keyCode===K.a.BACKSPACE)ee.preventDefault(),Ee.splice(Ee.length-1,1);else if(ee.keyCode===K.a.RIGHT)ee.preventDefault(),qe[Ce]&&qe[Ce][L.getFieldName("children")]&&Ee.push(qe[Ce][L.getFieldName("children")][0][L.getFieldName("value")]);else if(ee.keyCode===K.a.ESC||ee.keyCode===K.a.TAB){L.setPopupVisible(!1);return}(!Ee||Ee.length===0)&&L.setPopupVisible(!1);var He=L.getActiveOptions(Ee),Ke=He[He.length-1];L.handleMenuSelect(Ke,He.length-1,ee),L.props.onKeyDown&&L.props.onKeyDown(ee)},L.saveTrigger=function(ee){L.trigger=ee};var z=[];return"value"in v?z=v.value||[]:"defaultValue"in v&&(z=v.defaultValue||[]),q()(!("filedNames"in v),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),L.state={popupVisible:v.popupVisible,activeValue:z,value:z,prevProps:v},L.defaultFieldNames={label:"label",value:"value",children:"children"},L}return C(Z,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(L){var z=this.defaultFieldNames,ee=this.props,$=ee.fieldNames,Ee=ee.filedNames;return"filedNames"in this.props?Ee[L]||z[L]:$[L]||z[L]}},{key:"getFieldNames",value:function(){var L=this.props,z=L.fieldNames,ee=L.filedNames;return"filedNames"in this.props?ee:z}},{key:"getCurrentLevelOptions",value:function(){var L=this,z=this.props.options,ee=z===void 0?[]:z,$=this.state.activeValue,Ee=$===void 0?[]:$,Fe=Y()(ee,function(qe,Ce){return qe[L.getFieldName("value")]===Ee[Ce]},{childrenKeyName:this.getFieldName("children")});return Fe[Fe.length-2]?Fe[Fe.length-2][this.getFieldName("children")]:E(ee).filter(function(qe){return!qe.disabled})}},{key:"getActiveOptions",value:function(L){var z=this;return Y()(this.props.options||[],function(ee,$){return ee[z.getFieldName("value")]===L[$]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var L=this.props,z=L.prefixCls,ee=L.transitionName,$=L.popupClassName,Ee=L.options,Fe=Ee===void 0?[]:Ee,qe=L.disabled,Ce=L.builtinPlacements,Me=L.popupPlacement,He=L.children,Ke=L.dropdownRender,ut=P(L,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),bt=ne.createElement("div",null),Lt="";Fe&&Fe.length>0?bt=ne.createElement(O,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Lt=" ".concat(z,"-menus-empty");var Ft=bt;return Ke&&(Ft=Ke(bt)),ne.createElement(Q.a,Object.assign({ref:this.saveTrigger},ut,{popupPlacement:Me,builtinPlacements:Ce,popupTransitionName:ee,action:qe?[]:["click"],popupVisible:qe?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(z,"-menus"),popupClassName:$+Lt,popup:Ft}),ne.cloneElement(He,{onKeyDown:this.handleKeyDown,tabIndex:qe?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(L,z){var ee=z.prevProps,$=ee===void 0?{}:ee,Ee={prevProps:L};return"value"in L&&!V($.value,L.value)&&(Ee.value=L.value||[],"loadData"in L||(Ee.activeValue=L.value||[])),"popupVisible"in L&&(Ee.popupVisible=L.popupVisible),Ee}}]),Z}(ne.Component);return Se.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:R,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},Se}(),Te=ge,Ue=Pe.a=Te},"SA+Z":function(wt,Pe,U){var ne=U("wTVA"),Q=U("EbDI"),B=U("ZhPi"),q=U("wkBT");function K(M){return ne(M)||Q(M)||B(M)||q()}wt.exports=K,wt.exports.__esModule=!0,wt.exports.default=wt.exports},SJMd:function(wt,Pe){/**
|
|
* @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,ne,Q,B=!1,q,K;window.PR_SHOULD_USE_CONTINUATION=!0;var M,Y;(function(){var V=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"],p=[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"],g=[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"],O=[p,a,g,s,i,t,u,o],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,R="str",A="kwd",P="com",w="typ",E="lit",h="pun",f="pln",T="tag",x="dec",_="src",j="atn",W="atv",C="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Ee){for(var Fe=0,qe=!1,Ce=!1,Me=0,He=Ee.length;Me<He;++Me){var Ke=Ee[Me];if(Ke.ignoreCase)Ce=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){qe=!0,Ce=!1;break}}var ut={b:8,t:9,n:10,v:11,f:12,r:13};function bt(Je){var Qe=Je.charCodeAt(0);if(Qe!==92)return Qe;var _t=Je.charAt(1);return Qe=ut[_t],Qe||("0"<=_t&&_t<="7"?parseInt(Je.substring(1),8):_t==="u"||_t==="x"?parseInt(Je.substring(2),16):Je.charCodeAt(1))}function Lt(Je){if(Je<32)return(Je<16?"\\x0":"\\x")+Je.toString(16);var Qe=String.fromCharCode(Je);return Qe==="\\"||Qe==="-"||Qe==="]"||Qe==="^"?"\\"+Qe:Qe}function Ft(Je){var Qe=Je.substring(1,Je.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")),_t=[],xt=Qe[0]==="^",_e=["["];xt&&_e.push("^");for(var ie=xt?1:0,oe=Qe.length;ie<oe;++ie){var ce=Qe[ie];if(/\\[bdsw]/i.test(ce))_e.push(ce);else{var we=bt(ce),de;ie+2<oe&&Qe[ie+1]==="-"?(de=bt(Qe[ie+2]),ie+=2):de=we,_t.push([we,de]),de<65||we>122||(de<65||we>90||_t.push([Math.max(65,we)|32,Math.min(de,90)|32]),de<97||we>122||_t.push([Math.max(97,we)&~32,Math.min(de,122)&~32]))}}_t.sort(function(Ne,We){return Ne[0]-We[0]||We[1]-Ne[1]});for(var he=[],Oe=[],ie=0;ie<_t.length;++ie){var le=_t[ie];le[0]<=Oe[1]+1?Oe[1]=Math.max(Oe[1],le[1]):he.push(Oe=le)}for(var ie=0;ie<he.length;++ie){var le=he[ie];_e.push(Lt(le[0])),le[1]>le[0]&&(le[1]+1>le[0]&&_e.push("-"),_e.push(Lt(le[1])))}return _e.push("]"),_e.join("")}function Yt(Je){for(var Qe=Je.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")),_t=Qe.length,xt=[],_e=0,ie=0;_e<_t;++_e){var oe=Qe[_e];if(oe==="(")++ie;else if(oe.charAt(0)==="\\"){var ce=+oe.substring(1);ce&&(ce<=ie?xt[ce]=-1:Qe[_e]=Lt(ce))}}for(var _e=1;_e<xt.length;++_e)xt[_e]===-1&&(xt[_e]=++Fe);for(var _e=0,ie=0;_e<_t;++_e){var oe=Qe[_e];if(oe==="(")++ie,xt[ie]||(Qe[_e]="(?:");else if(oe.charAt(0)==="\\"){var ce=+oe.substring(1);ce&&ce<=ie&&(Qe[_e]="\\"+xt[ce])}}for(var _e=0;_e<_t;++_e)Qe[_e]==="^"&&Qe[_e+1]!=="^"&&(Qe[_e]="");if(Je.ignoreCase&&qe)for(var _e=0;_e<_t;++_e){var oe=Qe[_e],we=oe.charAt(0);oe.length>=2&&we==="["?Qe[_e]=Ft(oe):we!=="\\"&&(Qe[_e]=oe.replace(/[a-zA-Z]/g,function(Oe){var le=Oe.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Qe.join("")}for(var Xt=[],Me=0,He=Ee.length;Me<He;++Me){var Ke=Ee[Me];if(Ke.global||Ke.multiline)throw new Error(""+Ke);Xt.push("(?:"+Yt(Ke)+")")}return new RegExp(Xt.join("|"),Ce?"gi":"g")}function y(Ee,Fe){var qe=/(?:^|\s)nocode(?:\s|$)/,Ce=[],Me=0,He=[],Ke=0;function ut(bt){var Lt=bt.nodeType;if(Lt==1){if(qe.test(bt.className))return;for(var Ft=bt.firstChild;Ft;Ft=Ft.nextSibling)ut(Ft);var Yt=bt.nodeName.toLowerCase();(Yt==="br"||Yt==="li")&&(Ce[Ke]=`
|
|
`,He[Ke<<1]=Me++,He[Ke++<<1|1]=bt)}else if(Lt==3||Lt==4){var Xt=bt.nodeValue;Xt.length&&(Fe?Xt=Xt.replace(/\r\n?/g,`
|
|
`):Xt=Xt.replace(/[ \t\r\n]+/g," "),Ce[Ke]=Xt,He[Ke<<1]=Me,Me+=Xt.length,He[Ke++<<1|1]=bt)}}return ut(Ee),{sourceCode:Ce.join("").replace(/\n$/,""),spans:He}}function H(Ee,Fe,qe,Ce,Me){if(!qe)return;var He={sourceNode:Ee,pre:1,langExtension:null,numberLines:null,sourceCode:qe,spans:null,basePos:Fe,decorations:null};Ce(He),Me.push.apply(Me,He.decorations)}var J=/\S/;function ae(Ee){for(var Fe=void 0,qe=Ee.firstChild;qe;qe=qe.nextSibling){var Ce=qe.nodeType;Fe=Ce===1?Fe?Ee:qe:Ce===3&&J.test(qe.nodeValue)?Ee:Fe}return Fe===Ee?void 0:Fe}function fe(Ee,Fe){var qe={},Ce;(function(){for(var Ke=Ee.concat(Fe),ut=[],bt={},Lt=0,Ft=Ke.length;Lt<Ft;++Lt){var Yt=Ke[Lt],Xt=Yt[3];if(Xt)for(var Je=Xt.length;--Je>=0;)qe[Xt.charAt(Je)]=Yt;var Qe=Yt[1],_t=""+Qe;bt.hasOwnProperty(_t)||(ut.push(Qe),bt[_t]=null)}ut.push(/[\0-\uffff]/),Ce=k(ut)})();var Me=Fe.length,He=function(Ke){for(var ut=Ke.sourceCode,bt=Ke.basePos,Lt=Ke.sourceNode,Ft=[bt,f],Yt=0,Xt=ut.match(Ce)||[],Je={},Qe=0,_t=Xt.length;Qe<_t;++Qe){var xt=Xt[Qe],_e=Je[xt],ie=void 0,oe;if(typeof _e=="string")oe=!1;else{var ce=qe[xt.charAt(0)];if(ce)ie=xt.match(ce[1]),_e=ce[0];else{for(var we=0;we<Me;++we)if(ce=Fe[we],ie=xt.match(ce[1]),ie){_e=ce[0];break}ie||(_e=f)}oe=_e.length>=5&&_e.substring(0,5)==="lang-",oe&&!(ie&&typeof ie[1]=="string")&&(oe=!1,_e=_),oe||(Je[xt]=_e)}var de=Yt;if(Yt+=xt.length,!oe)Ft.push(bt+de,_e);else{var he=ie[1],Oe=xt.indexOf(he),le=Oe+he.length;ie[2]&&(le=xt.length-ie[2].length,Oe=le-he.length);var Ne=_e.substring(5);H(Lt,bt+de,xt.substring(0,Oe),He,Ft),H(Lt,bt+de+Oe,he,Z(Ne,he),Ft),H(Lt,bt+de+le,xt.substring(le),He,Ft)}}Ke.decorations=Ft};return He}function ge(Ee){var Fe=[],qe=[];Ee.tripleQuotedStrings?Fe.push([R,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ee.multiLineStrings?Fe.push([R,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([R,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ee.verbatimStrings&&qe.push([R,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ce=Ee.hashComments;Ce&&(Ee.cStyleComments?(Ce>1?Fe.push([P,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([P,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),qe.push([R,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([P,/^#[^\r\n]*/,null,"#"])),Ee.cStyleComments&&(qe.push([P,/^\/\/[^\r\n]*/,null]),qe.push([P,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Me=Ee.regexLiterals;if(Me){var He=Me>1?"":`
|
|
\r`,Ke=He?".":"[\\S\\s]",ut="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";qe.push(["lang-regex",RegExp("^"+F+"("+ut+")")])}var bt=Ee.types;bt&&qe.push([w,bt]);var Lt=(""+Ee.keywords).replace(/^ | $/g,"");Lt.length&&qe.push([A,new RegExp("^(?:"+Lt.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Ft="^.[^\\s\\w.$@'\"`/\\\\]*";return Ee.regexLiterals&&(Ft+="(?!s*/)"),qe.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[h,new RegExp(Ft),null]),fe(Fe,qe)}var Te=ge({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(Ee,Fe,qe){for(var Ce=/(?:^|\s)nocode(?:\s|$)/,Me=/\r\n?|\n/,He=Ee.ownerDocument,Ke=He.createElement("li");Ee.firstChild;)Ke.appendChild(Ee.firstChild);var ut=[Ke];function bt(Qe){var _t=Qe.nodeType;if(_t==1&&!Ce.test(Qe.className))if(Qe.nodeName==="br")Lt(Qe),Qe.parentNode&&Qe.parentNode.removeChild(Qe);else for(var xt=Qe.firstChild;xt;xt=xt.nextSibling)bt(xt);else if((_t==3||_t==4)&&qe){var _e=Qe.nodeValue,ie=_e.match(Me);if(ie){var oe=_e.substring(0,ie.index);Qe.nodeValue=oe;var ce=_e.substring(ie.index+ie[0].length);if(ce){var we=Qe.parentNode;we.insertBefore(He.createTextNode(ce),Qe.nextSibling)}Lt(Qe),oe||Qe.parentNode.removeChild(Qe)}}}function Lt(Qe){for(;!Qe.nextSibling;)if(Qe=Qe.parentNode,!Qe)return;function _t(ie,oe){var ce=oe?ie.cloneNode(!1):ie,we=ie.parentNode;if(we){var de=_t(we,1),he=ie.nextSibling;de.appendChild(ce);for(var Oe=he;Oe;Oe=he)he=Oe.nextSibling,de.appendChild(Oe)}return ce}for(var xt=_t(Qe.nextSibling,0),_e;(_e=xt.parentNode)&&_e.nodeType===1;)xt=_e;ut.push(xt)}for(var Ft=0;Ft<ut.length;++Ft)bt(ut[Ft]);Fe===(Fe|0)&&ut[0].setAttribute("value",Fe);var Yt=He.createElement("ol");Yt.className="linenums";for(var Xt=Math.max(0,Fe-1|0)||0,Ft=0,Je=ut.length;Ft<Je;++Ft)Ke=ut[Ft],Ke.className="L"+(Ft+Xt)%10,Ke.firstChild||Ke.appendChild(He.createTextNode("\xA0")),Yt.appendChild(Ke);Ee.appendChild(Yt)}function Se(Ee){var Fe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Fe=Fe&&+Fe[1]<=8;var qe=/\n/g,Ce=Ee.sourceCode,Me=Ce.length,He=0,Ke=Ee.spans,ut=Ke.length,bt=0,Lt=Ee.decorations,Ft=Lt.length,Yt=0;Lt[Ft]=Me;var Xt,Je;for(Je=Xt=0;Je<Ft;)Lt[Je]!==Lt[Je+2]?(Lt[Xt++]=Lt[Je++],Lt[Xt++]=Lt[Je++]):Je+=2;for(Ft=Xt,Je=Xt=0;Je<Ft;){for(var Qe=Lt[Je],_t=Lt[Je+1],xt=Je+2;xt+2<=Ft&&Lt[xt+1]===_t;)xt+=2;Lt[Xt++]=Qe,Lt[Xt++]=_t,Je=xt}Ft=Lt.length=Xt;var _e=Ee.sourceNode,ie="";_e&&(ie=_e.style.display,_e.style.display="none");try{for(var oe=null;bt<ut;){var ce=Ke[bt],we=Ke[bt+2]||Me,de=Lt[Yt+2]||Me,xt=Math.min(we,de),he=Ke[bt+1],Oe;if(he.nodeType!==1&&(Oe=Ce.substring(He,xt))){Fe&&(Oe=Oe.replace(qe,"\r")),he.nodeValue=Oe;var le=he.ownerDocument,Ne=le.createElement("span");Ne.className=Lt[Yt+1];var We=he.parentNode;We.replaceChild(Ne,he),Ne.appendChild(he),He<we&&(Ke[bt+1]=he=le.createTextNode(Ce.substring(xt,we)),We.insertBefore(he,Ne.nextSibling))}He=xt,He>=we&&(bt+=2),He>=de&&(Yt+=2)}}finally{_e&&(_e.style.display=ie)}}var Le={};function ye(Ee,Fe){for(var qe=Fe.length;--qe>=0;){var Ce=Fe[qe];Le.hasOwnProperty(Ce)?V.console&&console.warn("cannot override language handler %s",Ce):Le[Ce]=Ee}}function Z(Ee,Fe){return Ee&&Le.hasOwnProperty(Ee)||(Ee=/^\s*</.test(Fe)?"default-markup":"default-code"),Le[Ee]}ye(Te,["default-code"]),ye(fe([],[[f,/^[^<?]+/],[x,/^<!\w[^>]*(?:>|$)/],[P,/^<\!--[\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"]),ye(fe([[f,/^[\s]+/,null,` \r
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!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"]),ye(fe([],[[W,/^[\s\S]+/]]),["uq.val"]),ye(ge({keywords:p,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),ye(ge({keywords:"null,true,false"}),["json"]),ye(ge({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),ye(ge({keywords:g,cStyleComments:!0}),["java"]),ye(ge({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(ge({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(ge({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(ge({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(ge({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(ge({keywords:c,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(fe([],[[R,/^[\s\S]+/]]),["regex"]);function v(Ee){var Fe=Ee.langExtension;try{var qe=y(Ee.sourceNode,Ee.pre),Ce=qe.sourceCode;Ee.sourceCode=Ce,Ee.spans=qe.spans,Ee.basePos=0,Z(Fe,Ce)(Ee),Se(Ee)}catch(Me){V.console&&console.log(Me&&Me.stack||Me)}}function L(Ee,Fe,qe){var Ce=qe||!1,Me=Fe||null,He=document.createElement("div");He.innerHTML="<pre>"+Ee+"</pre>",He=He.firstChild,Ce&&Ue(He,Ce,!0);var Ke={langExtension:Me,numberLines:Ce,sourceNode:He,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return v(Ke),He.innerHTML}function z(Ee,Fe){var qe=Fe||document.body,Ce=qe.ownerDocument||document;function Me(ce){return qe.getElementsByTagName(ce)}for(var He=[Me("pre"),Me("code"),Me("xmp")],Ke=[],ut=0;ut<He.length;++ut)for(var bt=0,Lt=He[ut].length;bt<Lt;++bt)Ke.push(He[ut][bt]);He=null;var Ft=Date;Ft.now||(Ft={now:function(){return+new Date}});var Yt=0,Xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Je=/\bprettyprint\b/,Qe=/\bprettyprinted\b/,_t=/pre|xmp/i,xt=/^code$/i,_e=/^(?:pre|code|xmp)$/i,ie={};function oe(){for(var ce=V.PR_SHOULD_USE_CONTINUATION?Ft.now()+250:Infinity;Yt<Ke.length&&Ft.now()<ce;Yt++){for(var we=Ke[Yt],de=ie,he=we;he=he.previousSibling;){var Oe=he.nodeType,le=(Oe===7||Oe===8)&&he.nodeValue;if(le?!/^\??prettify\b/.test(le):Oe!==3||/\S/.test(he.nodeValue))break;if(le){de={},le.replace(/\b(\w+)=([\w:.%+-]+)/g,function(cr,Qn,yr){de[Qn]=yr});break}}var Ne=we.className;if((de!==ie||Je.test(Ne))&&!Qe.test(Ne)){for(var We=!1,lt=we.parentNode;lt;lt=lt.parentNode){var Ct=lt.tagName;if(_e.test(Ct)&<.className&&Je.test(lt.className)){We=!0;break}}if(!We){we.className+=" prettyprinted";var Rt=de.lang;if(!Rt){Rt=Ne.match(Xt);var It;!Rt&&(It=ae(we))&&xt.test(It.tagName)&&(Rt=It.className.match(Xt)),Rt&&(Rt=Rt[1])}var qn;if(_t.test(we.tagName))qn=1;else{var Vt=we.currentStyle,qt=Ce.defaultView,nn=Vt?Vt.whiteSpace:qt&&qt.getComputedStyle?qt.getComputedStyle(we,null).getPropertyValue("white-space"):0;qn=nn&&nn.substring(0,3)==="pre"}var On=de.linenums;(On=On==="true"||+On)||(On=Ne.match(/\blinenums\b(?::(\d+))?/),On=On?On[1]&&On[1].length?+On[1]:!0:!1),On&&Ue(we,On,qn);var ar={langExtension:Rt,sourceNode:we,numberLines:On,pre:qn,sourceCode:null,basePos:null,spans:null,decorations:null};v(ar)}}}Yt<Ke.length?V.setTimeout(oe,250):typeof Ee=="function"&&Ee()}oe()}var ee=V.PR={createSimpleLexer:fe,registerLangHandler:ye,sourceDecorator:ge,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:W,PR_COMMENT:P,PR_DECLARATION:x,PR_KEYWORD:A,PR_LITERAL:E,PR_NOCODE:C,PR_PLAIN:f,PR_PUNCTUATION:h,PR_SOURCE:_,PR_STRING:R,PR_TAG:T,PR_TYPE:w,prettyPrintOne:B?V.prettyPrintOne=L:M=L,prettyPrint:Y=B?V.prettyPrint=z:Y=z},$=V.define;typeof $=="function"&&$.amd&&$("google-code-prettify",[],function(){return ee})})()},STEk:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return ye});/*! *****************************************************************************
|
|
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 ne=function(Z,v){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,z){L.__proto__=z}||function(L,z){for(var ee in z)Object.prototype.hasOwnProperty.call(z,ee)&&(L[ee]=z[ee])})(Z,v)};function Q(Z,v){function L(){this.constructor=Z}ne(Z,v),Z.prototype=v===null?Object.create(v):(L.prototype=v.prototype,new L)}function B(Z,v,L,z){return new(L||(L=Promise))(function(ee,$){function Ee(Ce){try{qe(z.next(Ce))}catch(Me){$(Me)}}function Fe(Ce){try{qe(z.throw(Ce))}catch(Me){$(Me)}}function qe(Ce){var Me;Ce.done?ee(Ce.value):(Me=Ce.value,Me instanceof L?Me:new L(function(He){He(Me)})).then(Ee,Fe)}qe((z=z.apply(Z,v||[])).next())})}function q(Z,v){var L,z,ee,$,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return $={next:Fe(0),throw:Fe(1),return:Fe(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function Fe(qe){return function(Ce){return function(Me){if(L)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(L=1,z&&(ee=2&Me[0]?z.return:Me[0]?z.throw||((ee=z.return)&&ee.call(z),0):z.next)&&!(ee=ee.call(z,Me[1])).done)return ee;switch(z=0,ee&&(Me=[2&Me[0],ee.value]),Me[0]){case 0:case 1:ee=Me;break;case 4:return Ee.label++,{value:Me[1],done:!1};case 5:Ee.label++,z=Me[1],Me=[0];continue;case 7:Me=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Me[0]!==6&&Me[0]!==2)){Ee=0;continue}if(Me[0]===3&&(!ee||Me[1]>ee[0]&&Me[1]<ee[3])){Ee.label=Me[1];break}if(Me[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Me;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Me);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Me=v.call(Z,Ee)}catch(He){Me=[6,He],z=0}finally{L=ee=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([qe,Ce])}}}function K(){for(var Z=0,v=0,L=arguments.length;v<L;v++)Z+=arguments[v].length;var z=Array(Z),ee=0;for(v=0;v<L;v++)for(var $=arguments[v],Ee=0,Fe=$.length;Ee<Fe;Ee++,ee++)z[ee]=$[Ee];return z}var M=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(v,L){for(var z=0,ee=L;z<ee.length;z++){var $=ee[z],Ee=$[0],Fe=$[1];v.setAttribute(Ee,Fe)}},Z.createRect=function(v,L,z){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",v.toString()),ee.setAttribute("height",L.toString()),z&&Z.setAttributes(ee,z),ee},Z.createLine=function(v,L,z,ee,$){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",v.toString()),Ee.setAttribute("y1",L.toString()),Ee.setAttribute("x2",z.toString()),Ee.setAttribute("y2",ee.toString()),$&&Z.setAttributes(Ee,$),Ee},Z.createPolygon=function(v,L){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",v),L&&Z.setAttributes(z,L),z},Z.createCircle=function(v,L){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(v/2).toString()),z.setAttribute("cy",(v/2).toString()),z.setAttribute("r",v.toString()),L&&Z.setAttributes(z,L),z},Z.createEllipse=function(v,L,z){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(v/2).toString()),ee.setAttribute("cy",(L/2).toString()),ee.setAttribute("rx",(v/2).toString()),ee.setAttribute("ry",(L/2).toString()),z&&Z.setAttributes(ee,z),ee},Z.createGroup=function(v){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&Z.setAttributes(L,v),L},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(v,L,z,ee,$,Ee,Fe){var qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(qe,[["id",v],["orient",L],["markerWidth",z.toString()],["markerHeight",ee.toString()],["refX",$.toString()],["refY",Ee.toString()]]),qe.appendChild(Fe),qe},Z.createText=function(v){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),v&&Z.setAttributes(L,v),L},Z.createTSpan=function(v,L){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=v,L&&Z.setAttributes(z,L),z},Z.createImage=function(v){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&Z.setAttributes(L,v),L},Z.createPoint=function(v,L){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=v,z.y=L,z},Z.createPath=function(v,L){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",v),L&&Z.setAttributes(z,L),z},Z}(),Y=function(){function Z(){}return Z.addKey=function(v){Z.key=v},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),V=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(v,L,z){var ee=this;return new Promise(function($){var Ee=z!==void 0?z:document.createElement("canvas");v===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Fe=document.createElementNS("http://www.w3.org/2000/svg","svg");Fe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Fe.setAttribute("width",L.width.baseVal.valueAsString),Fe.setAttribute("height",L.height.baseVal.valueAsString),Fe.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),Fe.innerHTML=L.innerHTML,ee.naturalSize===!0?(Fe.width.baseVal.value=v.naturalWidth,Fe.height.baseVal.value=v.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Fe.width.baseVal.value=ee.width,Fe.height.baseVal.value=ee.height),Ee.width=Fe.width.baseVal.value,Ee.height=Fe.height.baseVal.value;var qe=Fe.outerHTML,Ce=Ee.getContext("2d");ee.markersOnly!==!0&&Ce.drawImage(v,0,0,Ee.width,Ee.height);var Me=window.URL,He=new Image(Ee.width,Ee.height);He.setAttribute("crossOrigin","anonymous");var Ke=new Blob([qe],{type:"image/svg+xml"}),ut=Me.createObjectURL(Ke);He.onload=function(){Ce.drawImage(He,0,0),Me.revokeObjectURL(ut);var bt=Ee.toDataURL(ee.imageType,ee.imageQuality);$(bt)},He.src=ut})},Z}(),r=function(){},D=function(){function Z(v){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},Z.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new m("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new m("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new m("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new p("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new p("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Z.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),m=function(Z,v){this.selector=Z,this.style=v},p=function(Z,v){this.localName=Z,this.style=v},g=function(){function Z(v,L,z,ee,$){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=v,this.displayMode=L,this.markerItems=z,this.uiStyleSettings=ee,this.styles=$,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(v){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Ee=document.createElement("div");Ee.className=""+L.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",$.typeName),Ee.innerHTML=$.icon,Ee.addEventListener("click",function(){L.markerToolbarButtonClicked(Ee,$)}),L.buttons.push(Ee),L.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},Z.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},Z.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<v||L===v&&this.markerButtons.length-1===v?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===v&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},Z.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")},Z.prototype.resetButtonStyles=function(){var v=this;this.buttons.forEach(function(L){L.className=L.className.replace(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:v.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(v,L,z){var ee=this,$=document.createElement("div");switch($.className=""+this.toolbarButtonStyleClass.name,$.innerHTML=L,$.setAttribute("data-action",z),$.addEventListener("click",function(){ee.actionToolbarButtonClicked($,z)}),z){case"select":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":$.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":$.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":$.style.fill=this.uiStyleSettings.closeButtonColor}v.appendChild($),this.buttons.push($)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("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 p("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var v=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new m("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new m("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Z.prototype.markerToolbarButtonClicked=function(v,L){this.setActiveButton(v),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(v,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(v){var L=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===v});L&&this.setActiveButton(L)},Z.prototype.setCurrentMarker=function(v){var L=this;this.currentMarker=v,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){L.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},Z}(),a=function(){function Z(v,L,z,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=L,this.uiStyleSettings=z,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new p("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 p("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("toolbox-panel-row_colors",`
|
|
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new p("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new m("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new m("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Z.prototype.show=function(v){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(v){var L,z,ee=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Ee;$.uiStyleSettings=ee.uiStyleSettings;var Fe=document.createElement("div");Fe.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Fe.innerHTML=$.icon,Fe.title=$.title,Fe.addEventListener("click",function(){ee.panelButtonClick($)}),ee.panelButtons.push(Fe),ee.buttonRow.appendChild(Fe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(v){var L=this,z=-1;if(v!==this.activePanel){z=this.panels.indexOf(v),this.panelRow.innerHTML="";var ee=v.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Ee){var Fe,qe;$.className=L.toolboxButtonStyleClass.name+" "+(Ee===z?""+((Fe=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:L.toolboxActiveButtonStyleColorsClass.name):""+((qe=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:L.toolboxButtonStyleColorsClass.name))})},Z}(),c=function(Z,v){this.title=Z,this.icon=v},s=function(Z){function v(L,z,ee,$){var Ee=Z.call(this,L,$||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=z,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var $=L.getColorBox(ee);z.appendChild($),L.colorBoxes.push($)}),z},v.prototype.getColorBox=function(L){var z=this,ee=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=$-2+"px",Ee.style.height=$-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=($+2)/2+"px",Ee.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){z.setCurrentColor(L,Ee)});var Fe=document.createElement("div");return Fe.style.display="inline-block",Fe.style.width=$-2+"px",Fe.style.height=$-2+"px",Fe.style.backgroundColor=L,Fe.style.borderRadius=$/2+"px",L==="transparent"&&(Fe.style.fill=this.uiStyleSettings.toolboxAccentColor,Fe.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>`),Ee.appendChild(Fe),Ee},v.prototype.setCurrentColor=function(L,z){var ee=this;this.currentColor=L,this.colorBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},v}(c),i=function(){function Z(v,L,z){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=L,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(v){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(v,L){},Z.prototype.dblClick=function(v,L){},Z.prototype.manipulate=function(v){},Z.prototype.pointerUp=function(v){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},Z.prototype.scale=function(v,L){},Z.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},Z.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),t=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},Z}(),u=function(){function Z(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},Z}(),o=function(){function Z(){}return Z.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},Z.toSVGMatrix=function(v,L){return v.a=L.a,v.b=L.b,v.c=L.c,v.d=L.d,v.e=L.e,v.f=L.f,v},Z}(),O=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(M.createTransform()),$.setupControlBox(),$}return Q(v,Z),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var z=M.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(L){return!!Z.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(L);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(L){var z=this.state;Z.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},v.prototype.manipulate=function(L){var z=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(L)},v.prototype.resize=function(L){var z=this.manipulationStartLeft,ee=this.manipulationStartWidth,$=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+L.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+L.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+L.y-this.manipulationStartY}ee>=0?(this.left=z,this.width=ee):(this.left=z+ee,this.width=-ee),Ee>=0?(this.top=$,this.height=Ee):(this.top=$+Ee,this.height=-Ee),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var z=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},v.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},v.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var z=this.container.getCTM(),ee=M.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(z)).x,y:ee.y}},v.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var z=this.container.getCTM();z=z.inverse();var ee=M.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(z)).x,y:ee.y}},v.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var L=M.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=M.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=M.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 t,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.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()},v.prototype.createGrip=function(){var L=new u;return L.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(L.visual),L},v.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,z=-L/2,ee=z,$=(this.width+this.CB_DISTANCE)/2-L/2,Ee=(this.height+this.CB_DISTANCE)/2-L/2,Fe=this.height+this.CB_DISTANCE-L/2,qe=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,z,ee),this.positionGrip(this.controlGrips.topCenter.visual,$,ee),this.positionGrip(this.controlGrips.topRight.visual,qe,ee),this.positionGrip(this.controlGrips.centerLeft.visual,z,Ee),this.positionGrip(this.controlGrips.centerRight.visual,qe,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,z,Fe),this.positionGrip(this.controlGrips.bottomCenter.visual,$,Fe),this.positionGrip(this.controlGrips.bottomRight.visual,qe,Fe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,ee-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(L,z,ee){var $=L.transform.baseVal.getItem(0);$.setTranslate(z,ee),L.transform.baseVal.replaceItem($,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:o.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:o.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L);var z=L;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z);var ee=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:ee.x*L,y:ee.y*z});this.left=$.x,this.top=$.y,this.width=this.width*L,this.height=this.height*z,this.adjustControlBox()},v}(i),S=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.visual)},v.prototype.createVisual=function(){this.visual=M.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)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},v.prototype.manipulate=function(L){Z.prototype.manipulate.call(this,L)},v.prototype.resize=function(L){Z.prototype.resize.call(this,L),this.setSize()},v.prototype.setSize=function(){Z.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(L){Z.prototype.pointerUp.call(this,L),this.setSize()},v.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},v.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},v.prototype.restoreState=function(L){var z=L;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Z.prototype.restoreState.call(this,L),this.setSize()},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.setSize()},v.title="Rectangle marker",v}(O),R=function(Z){function v(L,z,ee,$){var Ee=Z.call(this,L,$||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=z,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(ee){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ee===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentWidth(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",$.appendChild(Ee);var Fe=document.createElement("div");Fe.style.minHeight="20px",Fe.style.flexGrow="2",Fe.style.display="flex",Fe.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=ee+"px solid "+L.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",Fe.appendChild(qe),$.appendChild(Fe),L.widthBoxes.push($)}),z},v.prototype.setCurrentWidth=function(L,z){var ee=this;this.currentWidth=L,this.widthBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(c),A=function(Z){function v(L,z,ee,$){var Ee=Z.call(this,L,$||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=z,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(ee){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/L.styles.length-5+"%",$.style.borderColor=ee===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentStyle(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Fe=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
|
|
</svg>`;Ee.innerHTML=Fe,$.appendChild(Ee),L.styleBoxes.push($)}),z},v.prototype.setCurrentStyle=function(L,z){var ee=this;this.currentStyle=L,this.styleBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(c),P=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new R("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new A("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(v,Z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Z.prototype.getState.call(this);return L.typeName=v.typeName,L},v.typeName="FrameMarker",v.title="Frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',v}(S),w=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},E=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!!Z.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(L){var z=this.state;Z.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},v.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var L=new u;return L.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(L.visual),L},v.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},v.prototype.positionGrip=function(L,z,ee){var $=L.transform.baseVal.getItem(0);$.setTranslate(z,ee),L.transform.baseVal.replaceItem($,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L);var z=L;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.x1=this.x1*L,this.y1=this.y1*z,this.x2=this.x2*L,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},v}(i),h=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new R("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new A("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.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)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.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()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},v.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},v.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L);var z=L;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',v}(E),f=function(Z){function v(L,z,ee,$){var Ee=Z.call(this,L,$||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=z,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(ee){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/L.fonts.length-5+"%",$.style.borderColor=ee===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentFont(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Fe=document.createElement("div");Fe.style.whiteSpace="nowrap",Fe.style.overflow="hidden",Fe.style.textOverflow="ellipsis",Fe.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Fe),$.appendChild(Ee),L.fontBoxes.push($)}),z},v.prototype.setCurrentFont=function(L,z){var ee=this;this.currentFont=L,this.fontBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(c),T=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=ee.defaultColor,$.fontFamily=ee.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new s("Color",ee.defaultColorSet,ee.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new f("Font",ee.defaultFontFamilies,ee.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return Q(v,Z),v.prototype.ownsTarget=function(L){if(Z.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(ee){ee===L&&(z=!0)}),z},v.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},v.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){L.textElement.appendChild(M.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var L=this.textElement.getBBox(),z=1;if(L.width>0&&L.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/L.width,$=(1*this.height-this.height*this.padding*2/100)/L.height;z=Math.min(ee,$)}return z},v.prototype.getTextPosition=function(L){var z=this.textElement.getBBox(),ee=0,$=0;return z.width>0&&z.height>0&&(ee=(this.width-z.width*L)/2,$=this.height/2-z.height*L/2),{x:ee,y:$}},v.prototype.sizeText=function(){var L=this.textElement.getBBox(),z=this.getTextScale(),ee=this.getTextPosition(z);ee.y-=L.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},v.prototype.manipulate=function(L){Z.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(L){Z.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(L){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,L),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&z>.9;)z-=.1,L.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var ee=z.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(ee)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),$={x:ee.width*L,y:ee.height*L};z.x-=$.x/2,z.y-=$.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},v.prototype.dblClick=function(L,z){Z.prototype.dblClick.call(this,L,z),this.showTextEditor()},v.prototype.setColor=function(L){this.textElement&&M.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},v.prototype.setFont=function(L){this.textElement&&M.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){var z=L;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),Z.prototype.restoreState.call(this,L),this.setSize()},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.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>',v}(O),x=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=ee.defaultColor,$.lineWidth=ee.defaultStrokeWidth,$.pixelRatio=ee.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new s("Color",ee.defaultColorSet,ee.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new R("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var L=M.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(L,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):Z.prototype.pointerDown.call(this,L,z)},v.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,L)},v.prototype.resize=function(L){Z.prototype.resize.call(this,L),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,L)},v.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)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=z[0],$=z[1],Ee=z[2],Fe=z[3],qe=!1,Ce=0;Ce<this.canvasElement.height;Ce++)for(var Me=0;Me<this.canvasElement.width;Me++)L.data[Ce*this.canvasElement.width*4+4*Me+3]>0&&(qe=!0,Ce<$&&($=Ce),Me<ee&&(ee=Me),Ce>Fe&&(Fe=Ce),Me>Ee&&(Ee=Me));if(qe){this.left=ee/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Fe-$)/this.pixelRatio;var He=document.createElement("canvas");He.width=Ee-ee,He.height=Fe-$,He.getContext("2d").putImageData(this.canvasContext.getImageData(ee,$,Ee-ee,Fe-$),0,0),this.drawingImgUrl=He.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},v.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){this.createVisual(),Z.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.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>',v}(O),_=function(Z){function v(L,z,ee){var $=Z.call(this,L,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return $.typeBoxes=[],$.currentType=z,$.setCurrentType=$.setCurrentType.bind($),$}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var ee=function(Fe){var qe="both";switch(Fe){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var Ce=document.createElement("div");if(Ce.style.display="flex",Ce.style.flexGrow="2",Ce.style.alignItems="center",Ce.style.justifyContent="space-between",Ce.style.padding="5px",Ce.style.borderWidth="2px",Ce.style.borderStyle="solid",Ce.style.borderColor=qe===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",Ce.addEventListener("click",function(){L.setCurrentType(qe,Ce)}),z.appendChild(Ce),qe==="both"||qe==="start"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.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="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Me.style.marginLeft="5px",Ce.appendChild(Me)}var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.style.flexGrow="2";var Ke=document.createElement("hr");if(Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),Ke.style.flexGrow="2",He.appendChild(Ke),Ce.appendChild(He),qe==="both"||qe==="end"){var ut=document.createElement("div");ut.style.display="flex",ut.style.alignItems="center",ut.style.minHeight="20px",ut.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="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ut.style.marginRight="5px",Ce.appendChild(ut)}$.typeBoxes.push(Ce)},$=this,Ee=0;Ee<4;Ee++)ee(Ee);return z},v.prototype.setCurrentType=function(L,z){var ee=this;this.currentType=L,this.typeBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(c),j=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new _("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},v.prototype.getArrowPoints=function(L,z){var ee=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return L-ee/2+","+(z+$/2)+" "+L+","+(z-$/2)+" "+(L+ee/2)+","+(z+$/2)},v.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(Z.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",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},v.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L);var z=L;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',v}(h),W=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.fillColor=ee.defaultFillColor,$.strokeWidth=0,$.fillPanel=new s("Color",ee.defaultColorSet,ee.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return Q(v,Z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Z.prototype.getState.call(this);return L.typeName=v.typeName,L},v.typeName="CoverMarker",v.title="Cover marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',v}(S),C=function(Z){function v(L,z,ee,$){var Ee=Z.call(this,L,$||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=z,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Q(v,Z),v.prototype.getUi=function(){var L=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(ee){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ee===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){L.setCurrentOpacity(ee,$)}),z.appendChild($);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",$.appendChild(Ee),L.opacityBoxes.push($)}),z},v.prototype.setCurrentOpacity=function(L,z){var ee=this;this.currentOpacity=L,this.opacityBoxes.forEach(function($){$.style.borderColor=$===z?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(c),F=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=ee.defaultHighlightColor,$.strokeWidth=0,$.opacity=ee.defaultHighlightOpacity,$.fillPanel=new s("Color",ee.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new C("Opacity",ee.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Q(v,Z),v.prototype.setOpacity=function(L){this.opacity=L,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Z.prototype.getState.call(this);return L.typeName=v.typeName,L},v.typeName="HighlightMarker",v.title="Highlight marker",v.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>',v}(W),k='<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>',y=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=ee.defaultStrokeColor,$.bgColor=ee.defaultFillColor,$.fontFamily=ee.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new s("Text color",ee.defaultColorSet,$.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>'),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new s("Fill color",ee.defaultColorSet,$.bgColor,k),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new f("Font",ee.defaultFontFamilies,ee.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new u,$.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return Q(v,Z),v.prototype.ownsTarget=function(L){return Z.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},v.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(L,z){this.state==="new"&&Z.prototype.pointerDown.call(this,L,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,L,z)},v.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,L);else{var z=this.state==="creating";Z.prototype.pointerUp.call(this,L),this.setTipPoints(z),this.positionTip()}},v.prototype.manipulate=function(L){if(this.tipMoving){var z=this.unrotatePoint(L);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,L)},v.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",L]]),M.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},v.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},v.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var z=Math.min(this.height/2,15),ee=this.height/5;L&&(this.tipPosition={x:z+ee/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+ee,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ee,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?$<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ee,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-ee},this.tipBase2Position={x:this.width,y:this.height-z}):$<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-ee})},v.prototype.resize=function(L){Z.prototype.resize.call(this,L),this.positionTip()},v.prototype.positionTip=function(){M.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},v.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){var z=L;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,Z.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*z},this.positionTip()},v.typeName="CalloutMarker",v.title="Callout marker",v.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>',v}(T),H=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.fillColor=ee.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new s("Line color",K(ee.defaultColorSet,["transparent"]),ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new s("Fill color",K(ee.defaultColorSet,["transparent"]),$.fillColor,k),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new R("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new A("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new C("Opacity",ee.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.visual)},v.prototype.createVisual=function(){this.visual=M.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)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},v.prototype.manipulate=function(L){Z.prototype.manipulate.call(this,L)},v.prototype.resize=function(L){Z.prototype.resize.call(this,L),this.setSize()},v.prototype.setSize=function(){Z.prototype.setSize.call(this),M.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(L){Z.prototype.pointerUp.call(this,L),this.setSize()},v.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},v.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},v.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(L){this.opacity=L,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){var z=L;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Z.prototype.restoreState.call(this,L),this.setSize()},v.prototype.scale=function(L,z){Z.prototype.scale.call(this,L,z),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.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>',v}(O),J=function(Z){function v(L,z,ee){return Z.call(this,L,z,ee)||this}return Q(v,Z),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},v.prototype.createTips=function(){this.tip1=M.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(M.createTransform()),this.visual.appendChild(this.tip1),this.tip2=M.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(M.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(M.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()]]),M.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Z.prototype.getState.call(this);return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.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>',v}(h),ae=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.strokePanel.colors=ee.defaultColorSet,$.fillColor="transparent",$}return Q(v,Z),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Z.prototype.getState.call(this);return L.typeName=v.typeName,L},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.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>',v}(H),fe=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),ge=function(Z){function v(L,z,ee){var $=Z.call(this,L,z,ee)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=ee.defaultColor,$.strokeWidth=ee.defaultStrokeWidth,$.strokeDasharray=ee.defaultStrokeDasharray,$.strokePanel=new s("Line color",ee.defaultColorSet,ee.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new R("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new A("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Q(v,Z),v.prototype.ownsTarget=function(L){return!(!Z.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.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)},v.prototype.pointerDown=function(L,z){Z.prototype.pointerDown.call(this,L,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.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)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){Z.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),Z.prototype.manipulate.call(this,L)},v.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),Z.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},v.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},v.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},v.prototype.scale=function(L,z){this.curveX=this.curveX*L,this.curveY=this.curveY*z,Z.prototype.scale.call(this,L,z)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return L.typeName=v.typeName,L},v.prototype.restoreState=function(L){Z.prototype.restoreState.call(this,L);var z=L;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.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>',v}(E),Te=function(){function Z(v,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=L}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),Ue=function(Z){function v(L,z,ee){var $=Z.call(this,L,!1)||this;return $.dataUrl=z,$.state=ee,$}return Q(v,Z),v}(Te),Se=function(Z){function v(L,z,ee){ee===void 0&&(ee=!1);var $=Z.call(this,L,ee)||this;return $.marker=z,$}return Q(v,Z),v}(Te),Le=function(){function Z(){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 Z.prototype.addEventListener=function(v,L){this[v].push(L)},Z.prototype.removeEventListener=function(v,L){var z=this[v].indexOf(L);z>-1&&this[v].splice(z,1)},Z}(),ye=function(){function Z(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new w,this._isOpen=!1,this.undoRedoManager=new fe,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 Le,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new D(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.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(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[P,x,j,T,ae,H,F,y,J,W,h,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[P,x,j,T,H,F,y]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[P,x,j,T,F]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var L=this;this._availableMarkerTypes.splice(0),v.forEach(function(z){if(typeof z=="string"){var ee=L.ALL_MARKER_TYPES.find(function($){return $.typeName===z});ee!==void 0&&L._availableMarkerTypes.push(ee)}else L._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,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(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Y.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&r.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=r.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new Te(v))})},Z.prototype.render=function(){return B(this,void 0,void 0,function(){var v;return q(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(v=new V).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},Z.prototype.close=function(v){var L=this;if(v===void 0&&(v=!1),this.isOpen){var z=!1;v||this.eventListeners.beforeclose.forEach(function(ee){var $=new Te(L,!0);ee($),$.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new Te(L))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var v,L=[],z=0;z<arguments.length;z++)L[z]=arguments[z];(v=this._availableMarkerTypes).push.apply(v,L)},Z.prototype.addRenderEventListener=function(v){this.addEventListener("render",function(L){v(L.dataUrl,L.state)})},Z.prototype.removeRenderEventListener=function(v){},Z.prototype.addCloseEventListener=function(v){this.addEventListener("close",function(){v()})},Z.prototype.removeCloseEventListener=function(v){},Z.prototype.setupResizeObserver=function(){var v=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return v.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var v=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/v>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,z=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/v;this.resize(L,z)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(v,L){this._isResizing=!0;var z=v/this.imageWidth,ee=L/this.imageHeight;this.imageWidth=Math.round(v),this.imageHeight=Math.round(L),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,ee),this._isResizing=!1},Z.prototype.scaleMarkers=function(v,L){var z,ee=this;this._currentMarker&&this._currentMarker instanceof T?this._currentMarker.scale(v,L):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function($){$!==ee._currentMarker&&$.scale(v,L)}),z!==void 0&&this.setCurrentMarker(z)},Z.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"},Z.prototype.setTopLeft=function(){var v=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=v.left-L.left,this.top=v.top-L.top},Z.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)},Z.prototype.addDefs=function(){for(var v,L=[],z=0;z<arguments.length;z++)L[z]=arguments[z];this.defs=M.createDefs(),this.addDefsToImage(),(v=this.defs).append.apply(v,L)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.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)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.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)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.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)},Z.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 v=document.createElement("a");v.href="https://markerjs.com/",v.target="_blank",v.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>',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.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")},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.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 v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"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 g(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 a(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(v){this.markerImage.removeChild(v.container),this.markers.indexOf(v)>-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},Z.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())},Z.prototype.toolbarButtonClicked=function(v,L){if(v==="marker"&&L!==void 0)this.createNewMarker(L);else if(v==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Z.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var $=new Se(v,v._currentMarker,!0);ee($),$.defaultPrevented&&(L=!0)}),!L){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new Se(v,z))})}}},Z.prototype.clear=function(){var v=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Fe=new Se(v,void 0,!0);Ee(Fe),Fe.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var z=function(Ee){var Fe=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(qe){return qe(new Se(v,Fe))})},ee=this,$=this.markers.length-1;$>=0;$--)z($);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var v;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=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},Z.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)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===L.width&&z.height===L.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function($){return $(new Te(v))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function($){return $(new Te(v))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var v=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Te(v))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var v=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Te(v))}))},Z.prototype.stepZoom=function(){var v=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=v<this.zoomSteps.length-1?this.zoomSteps[v+1]:this.zoomSteps[0]},Z.prototype.panTo=function(v){this.contentDiv.scrollBy({left:this.prevPanPoint.x-v.x,top:this.prevPanPoint.y-v.y}),this.prevPanPoint=v},Z.prototype.startRenderAndClose=function(){return B(this,void 0,void 0,function(){var v,L,z=this;return q(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return v=ee.sent(),L=this.getState(),this.eventListeners.render.forEach(function($){return $(new Ue(z,v,L))}),this.close(!0),[2]}})})},Z.prototype.getState=function(v){v===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return L.markers.push(z.getState())}),L},Z.prototype.restoreState=function(v){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);v.markers.forEach(function(z){var ee=L._availableMarkerTypes.find(function(Ee){return Ee.typeName===z.typeName});if(ee!==void 0){var $=L.addNewMarker(ee);$.restoreState(z),L.markers.push($)}}),v.width&&v.height&&(v.width!==this.imageWidth||v.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/v.width,this.imageHeight/v.height),this.eventListeners.restorestate.forEach(function(z){return z(new Te(L))})},Z.prototype.addNewMarker=function(v){var L=M.createGroup();return this.markerImage.appendChild(L),new v(L,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(v){var L,z=this;(L=typeof v=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===v}):v)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Se(z,z._currentMarker))}))},Z.prototype.markerCreated=function(v){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(v),this.setCurrentMarker(v),v instanceof x&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(x):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new Se(L,L._currentMarker))})},Z.prototype.colorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=v,this.settings.defaultStrokeColor=v)},Z.prototype.fillColorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=v)},Z.prototype.markerStateChanged=function(v){var L=this;this.eventListeners.markerchange.forEach(function(z){return z(new Se(L,v))})},Z.prototype.setCurrentMarker=function(v){var L=this;this._currentMarker!==v&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new Se(L,L._currentMarker))})),this._currentMarker=v,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new Se(L,L._currentMarker))}))},Z.prototype.onPointerDown=function(v){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||v.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(z){return z.ownsTarget(v.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:v.clientX,y:v.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY))},Z.prototype.onDblClick=function(v){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(z){return z.ownsTarget(v.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(v){this.touchPoints!==1&&v.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||v.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(v.clientX,v.clientY)):this.zoomLevel>1&&this.panTo({x:v.clientX,y:v.clientY}))},Z.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(v,L){var z=this.markerImage.getBoundingClientRect();return{x:(v-z.left)/this.zoomLevel,y:(L-z.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"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()},Z.prototype.addLicenseKey=function(v){Y.addKey(v)},Z.prototype.addEventListener=function(v,L){this.eventListeners.addEventListener(v,L)},Z.prototype.removeEventListener=function(v,L){this.eventListeners.removeEventListener(v,L)},Z.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new Te(v))}))},Z.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new Te(v))}))},Z.instanceCounter=0,Z}()},T1X5:function(wt,Pe){wt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},T8No:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Y}),U.d(Pe,"e",function(){return V}),U.d(Pe,"c",function(){return h}),U.d(Pe,"b",function(){return f}),U.d(Pe,"d",function(){return T}),U.d(Pe,"f",function(){return j});var ne=U("MNsG"),Q=U("N0LK"),B=U("Cg/j");let q=ne.k||"";const K=new Map;K.set("false",!1),K.set("true",!0),K.set("isMac",ne.f),K.set("isLinux",ne.d),K.set("isWindows",ne.i),K.set("isWeb",ne.h),K.set("isMacNative",ne.f&&!ne.h),K.set("isEdge",q.indexOf("Edg/")>=0),K.set("isFirefox",q.indexOf("Firefox")>=0),K.set("isChrome",q.indexOf("Chrome")>=0),K.set("isSafari",q.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class Y{static has(C){return p.create(C)}static equals(C,F){return g.create(C,F)}static regex(C,F){return R.create(C,F)}static not(C){return i.create(C)}static and(...C){return w.create(C,null)}static or(...C){return E.create(C,null,!0)}static deserialize(C,F=!1){return C?this._deserializeOrExpression(C,F):void 0}static _deserializeOrExpression(C,F){let k=C.split("||");return E.create(k.map(y=>this._deserializeAndExpression(y,F)),null,!0)}static _deserializeAndExpression(C,F){let k=C.split("&&");return w.create(k.map(y=>this._deserializeOne(y,F)),null)}static _deserializeOne(C,F){if(C=C.trim(),C.indexOf("!=")>=0){let k=C.split("!=");return s.create(k[0].trim(),this._deserializeValue(k[1],F))}if(C.indexOf("==")>=0){let k=C.split("==");return g.create(k[0].trim(),this._deserializeValue(k[1],F))}if(C.indexOf("=~")>=0){let k=C.split("=~");return R.create(k[0].trim(),this._deserializeRegexValue(k[1],F))}if(C.indexOf(" in ")>=0){let k=C.split(" in ");return a.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(C)){const k=C.split(">=");return o.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(C)){const k=C.split(">");return u.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(C)){const k=C.split("<=");return S.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(C)){const k=C.split("<");return O.create(k[0].trim(),k[1].trim())}return/^\!\s*/.test(C)?i.create(C.substr(1).trim()):p.create(C)}static _deserializeValue(C,F){if(C=C.trim(),C==="true")return!0;if(C==="false")return!1;let k=/^'([^']*)'$/.exec(C);return k?k[1].trim():C}static _deserializeRegexValue(C,F){if(Object(Q.C)(C)){if(F)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let k=C.indexOf("/"),y=C.lastIndexOf("/");if(k===y||k<0){if(F)throw new Error(`bad regexp-value '${C}', missing /-enclosure`);return console.warn(`bad regexp-value '${C}', missing /-enclosure`),null}let H=C.slice(k+1,y),J=C[y+1]==="i"?"i":"";try{return new RegExp(H,J)}catch(ae){if(F)throw new Error(`bad regexp-value '${C}', parse error: ${ae}`);return console.warn(`bad regexp-value '${C}', parse error: ${ae}`),null}}}function V(C,F){const k=C?C.substituteConstants():void 0,y=F?F.substituteConstants():void 0;return!k&&!y?!0:!k||!y?!1:k.equals(y)}function r(C,F){return C.cmp(F)}class D{constructor(){this.type=0}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!1}serialize(){return"false"}keys(){return[]}negate(){return m.INSTANCE}}D.INSTANCE=new D;class m{constructor(){this.type=1}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}m.INSTANCE=new m;class p{constructor(C,F){this.key=C,this.negated=F,this.type=2}static create(C,F=null){const k=K.get(C);return typeof k=="boolean"?k?m.INSTANCE:D.INSTANCE:new p(C,F)}cmp(C){return C.type!==this.type?this.type-C.type:x(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=K.get(this.key);return typeof C=="boolean"?C?m.INSTANCE:D.INSTANCE:this}evaluate(C){return!!C.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 g{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=4}static create(C,F,k=null){if(typeof F=="boolean")return F?p.create(C,k):i.create(C,k);const y=K.get(C);if(typeof y=="boolean"){const H=y?"true":"false";return F===H?m.INSTANCE:D.INSTANCE}return new g(C,F,k)}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=K.get(this.key);if(typeof C=="boolean"){const F=C?"true":"false";return this.value===F?m.INSTANCE:D.INSTANCE}return this}evaluate(C){return C.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(C,F){this.key=C,this.valueKey=F,this.type=10,this.negated=null}static create(C,F){return new a(C,F)}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.valueKey,C.key,C.valueKey)}equals(C){return C.type===this.type?this.key===C.key&&this.valueKey===C.valueKey:!1}substituteConstants(){return this}evaluate(C){const F=C.getValue(this.valueKey),k=C.getValue(this.key);return Array.isArray(F)?F.indexOf(k)>=0:typeof k=="string"&&typeof F=="object"&&F!==null?M.call(F,k):!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(C){this._actual=C,this.type=11}static create(C){return new c(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=5}static create(C,F,k=null){if(typeof F=="boolean")return F?i.create(C,k):p.create(C,k);const y=K.get(C);if(typeof y=="boolean"){const H=y?"true":"false";return F===H?D.INSTANCE:m.INSTANCE}return new s(C,F,k)}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=K.get(this.key);if(typeof C=="boolean"){const F=C?"true":"false";return this.value===F?D.INSTANCE:m.INSTANCE}return this}evaluate(C){return C.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class i{constructor(C,F){this.key=C,this.negated=F,this.type=3}static create(C,F=null){const k=K.get(C);return typeof k=="boolean"?k?D.INSTANCE:m.INSTANCE:new i(C,F)}cmp(C){return C.type!==this.type?this.type-C.type:x(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=K.get(this.key);return typeof C=="boolean"?C?D.INSTANCE:m.INSTANCE:this}evaluate(C){return!C.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function t(C,F){if(typeof C=="string"){const k=parseFloat(C);isNaN(k)||(C=k)}return typeof C=="string"||typeof C=="number"?F(C):D.INSTANCE}class u{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=12}static create(C,F,k=null){return t(F,y=>new u(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.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 o{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=13}static create(C,F,k=null){return t(F,y=>new o(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=14}static create(C,F,k=null){return t(F,y=>new O(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.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 S{constructor(C,F,k){this.key=C,this.value=F,this.negated=k,this.type=15}static create(C,F,k=null){return t(F,y=>new S(C,y,k))}cmp(C){return C.type!==this.type?this.type-C.type:_(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.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 R{constructor(C,F){this.key=C,this.regexp=F,this.type=7,this.negated=null}static create(C,F){return new R(C,F)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.key<C.key)return-1;if(this.key>C.key)return 1;const F=this.regexp?this.regexp.source:"",k=C.regexp?C.regexp.source:"";return F<k?-1:F>k?1:0}equals(C){if(C.type===this.type){const F=this.regexp?this.regexp.source:"",k=C.regexp?C.regexp.source:"";return this.key===C.key&&F===k}return!1}substituteConstants(){return this}evaluate(C){let F=C.getValue(this.key);return this.regexp?this.regexp.test(F):!1}serialize(){const C=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${C}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(C){this._actual=C,this.type=8}static create(C){return new A(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function P(C){let F=null;for(let k=0,y=C.length;k<y;k++){const H=C[k].substituteConstants();if(C[k]!==H&&F===null){F=[];for(let J=0;J<k;J++)F[J]=C[J]}F!==null&&(F[k]=H)}return F===null?C:F}class w{constructor(C,F){this.expr=C,this.negated=F,this.type=6}static create(C,F){return w._normalizeArr(C,F)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let F=0,k=this.expr.length;F<k;F++){const y=r(this.expr[F],C.expr[F]);if(y!==0)return y}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let F=0,k=this.expr.length;F<k;F++)if(!this.expr[F].equals(C.expr[F]))return!1;return!0}return!1}substituteConstants(){const C=P(this.expr);return C===this.expr?this:w.create(C,this.negated)}evaluate(C){for(let F=0,k=this.expr.length;F<k;F++)if(!this.expr[F].evaluate(C))return!1;return!0}static _normalizeArr(C,F){const k=[];let y=!1;for(const H of C){if(!H)continue;if(H.type===1){y=!0;continue}if(H.type===0)return D.INSTANCE;if(H.type===6){k.push(...H.expr);continue}k.push(H)}if(k.length===0&&y)return m.INSTANCE;if(k.length===0)return;if(k.length===1)return k[0];k.sort(r);for(let H=1;H<k.length;H++)k[H-1].equals(k[H])&&(k.splice(H,1),H--);if(k.length===1)return k[0];for(;k.length>1;){const H=k[k.length-1];if(H.type!==9)break;k.pop();const J=k.pop(),ae=k.length===0,fe=E.create(H.expr.map(ge=>w.create([ge,J],null)),null,ae);fe&&(k.push(fe),k.sort(r))}return k.length===1?k[0]:new w(k,F)}serialize(){return this.expr.map(C=>C.serialize()).join(" && ")}keys(){const C=[];for(let F of this.expr)C.push(...F.keys());return C}negate(){if(!this.negated){const C=[];for(let F of this.expr)C.push(F.negate());this.negated=E.create(C,this,!0)}return this.negated}}class E{constructor(C,F){this.expr=C,this.negated=F,this.type=9}static create(C,F,k){return E._normalizeArr(C,F,k)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let F=0,k=this.expr.length;F<k;F++){const y=r(this.expr[F],C.expr[F]);if(y!==0)return y}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let F=0,k=this.expr.length;F<k;F++)if(!this.expr[F].equals(C.expr[F]))return!1;return!0}return!1}substituteConstants(){const C=P(this.expr);return C===this.expr?this:E.create(C,this.negated,!1)}evaluate(C){for(let F=0,k=this.expr.length;F<k;F++)if(this.expr[F].evaluate(C))return!0;return!1}static _normalizeArr(C,F,k){let y=[],H=!1;if(C){for(let J=0,ae=C.length;J<ae;J++){const fe=C[J];if(!fe)continue;if(fe.type===0){H=!0;continue}if(fe.type===1)return m.INSTANCE;if(fe.type===9){y=y.concat(fe.expr);continue}y.push(fe)}if(y.length===0&&H)return D.INSTANCE;y.sort(r)}if(y.length===0)return;if(y.length===1)return y[0];for(let J=1;J<y.length;J++)y[J-1].equals(y[J])&&(y.splice(J,1),J--);if(y.length===1)return y[0];if(k){for(let J=0;J<y.length;J++)for(let ae=J+1;ae<y.length;ae++)j(y[J],y[ae])&&(y.splice(ae,1),ae--);if(y.length===1)return y[0]}return new E(y,F)}serialize(){return this.expr.map(C=>C.serialize()).join(" || ")}keys(){const C=[];for(let F of this.expr)C.push(...F.keys());return C}negate(){if(!this.negated){let C=[];for(let F of this.expr)C.push(F.negate());for(;C.length>1;){const F=C.shift(),k=C.shift(),y=[];for(const J of W(F))for(const ae of W(k))y.push(w.create([J,ae],null));const H=C.length===0;C.unshift(E.create(y,null,H))}this.negated=C[0]}return this.negated}}class h extends p{constructor(C,F,k){super(C,null);this._defaultValue=F,typeof k=="object"?h._info.push(Object.assign(Object.assign({},k),{key:C})):k!==!0&&h._info.push({key:C,description:k,type:F!=null?typeof F:void 0})}static all(){return h._info.values()}bindTo(C){return C.createKey(this.key,this._defaultValue)}getValue(C){return C.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(C){return g.create(this.key,C)}}h._info=[];const f=Object(B.c)("contextKeyService"),T="setContext";function x(C,F){return C<F?-1:C>F?1:0}function _(C,F,k,y){return C<k?-1:C>k?1:F<y?-1:F>y?1:0}function j(C,F){if(F.type===6&&C.type!==9&&C.type!==6){for(const H of F.expr)if(C.equals(H))return!0}const k=C.negate(),y=W(k).concat(W(F));y.sort(r);for(let H=0;H<y.length;H++){const J=y[H],ae=J.negate();for(let fe=H+1;fe<y.length;fe++){const ge=y[fe];if(ae.equals(ge))return!0}}return!1}function W(C){return C.type===9?C.expr:[C]}},TXwP:function(wt,Pe,U){var ne,Q;(function(){var B;(function(){"use strict";var K=[,,function(r){function D(g){this.__parent=g,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 g=new D(this.__parent);return g.set_indent(this.__indent_count,this.__alignment_count),g},D.prototype.item=function(g){return g<0?this.__items[this.__items.length+g]:this.__items[g]},D.prototype.has_match=function(g){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(g))return!0;return!1},D.prototype.set_indent=function(g,a){this.is_empty()&&(this.__indent_count=g||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 g=this.__parent.current_line;return g.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),g.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),g.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,g.__items[0]===" "&&(g.__items.splice(0,1),g.__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(g){this.__items.push(g);var a=g.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=g.length-a:this.__character_count+=g.length},D.prototype.pop=function(){var g=null;return this.is_empty()||(g=this.__items.pop(),this.__character_count-=g.length),g},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 g="";return this.is_empty()?this.__parent.indent_empty_lines&&(g=this.__parent.get_indent_string(this.__indent_count)):(g=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),g+=this.__items.join("")),g};function m(g,a){this.__cache=[""],this.__indent_size=g.indent_size,this.__indent_string=g.indent_char,g.indent_with_tabs||(this.__indent_string=new Array(g.indent_size+1).join(g.indent_char)),a=a||"",g.indent_level>0&&(a=new Array(g.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(g,a){var c=this.__base_string_length;return a=a||0,g<0&&(c=0),c+=g*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(g,a){var c=this.__base_string;return a=a||0,g<0&&(g=0,c=""),a+=g*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(g){for(;g>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var g=this.__cache.length,a=0,c="";this.__indent_size&&g>=this.__indent_size&&(a=Math.floor(g/this.__indent_size),g-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),g&&(c+=new Array(g+1).join(" ")),this.__cache.push(c)};function p(g,a){this.__indent_cache=new m(g,a),this.raw=!1,this._end_with_newline=g.end_with_newline,this.indent_size=g.indent_size,this.wrap_line_length=g.wrap_line_length,this.indent_empty_lines=g.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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(g,a){return this.__indent_cache.get_indent_string(g,a)},p.prototype.get_indent_size=function(g,a){return this.__indent_cache.get_indent_size(g,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(g){return this.is_empty()||!g&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(g){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 g!==`
|
|
`&&(c=c.replace(/[\n]/g,g)),c},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(g,a){return g=g||0,a=a||0,this.next_line.set_indent(g,a),this.__lines.length>1?(this.current_line.set_indent(g,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(g){for(var a=0;a<g.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(g.whitespace_before),this.current_line.push(g.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(g){this.__add_space_before_token(),this.current_line.push(g),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(g){for(var a=this.__lines.length;g<a;)this.__lines[g]._remove_indent(),g++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(g){for(g=g===void 0?!1:g,this.current_line.trim();g&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(g,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(g)!==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=p},,,,function(r){function D(g,a){this.raw_options=m(g,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(g,a){var c=this.raw_options[g],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(g,a){var c=this.raw_options[g],s=c===void 0?!!a:!!c;return s},D.prototype._get_characters=function(g,a){var c=this.raw_options[g],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},D.prototype._get_number=function(g,a){var c=this.raw_options[g];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(g,a,c){var s=this._get_selection_list(g,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+g+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[g]+"'");return s[0]},D.prototype._get_selection_list=function(g,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(g,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+g+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[g]+"'");return s},D.prototype._is_valid_selection=function(g,a){return g.length&&a.length&&!g.some(function(c){return a.indexOf(c)===-1})};function m(g,a){var c={};g=p(g);var s;for(s in g)s!==a&&(c[s]=g[s]);if(a&&g[a])for(s in g[a])c[s]=g[a][s];return c}function p(g){var a={},c;for(c in g){var s=c.replace(/-/g,"_");a[s]=g[c]}return a}r.exports.Options=D,r.exports.normalizeOpts=p,r.exports.mergeOpts=m},,function(r){var D=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var g=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(g=this.__input.charAt(p)),g},m.prototype.__match=function(p,g){p.lastIndex=g;var a=p.exec(this.__input);return a&&!(D&&p.sticky)&&(a.index!==g&&(a=null)),a},m.prototype.test=function(p,g){return g=g||0,g+=this.__position,g>=0&&g<this.__input_length?!!this.__match(p,g):!1},m.prototype.testChar=function(p,g){var a=this.peek(g);return p.lastIndex=0,a!==null&&p.test(a)},m.prototype.match=function(p){var g=this.__match(p,this.__position);return g?this.__position+=g[0].length:g=null,g},m.prototype.read=function(p,g,a){var c="",s;return p&&(s=this.match(p),s&&(c+=s[0])),g&&(s||!p)&&(c+=this.readUntil(g,a)),c},m.prototype.readUntil=function(p,g){var a="",c=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(c=s.index,g&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,g){var a=null,c="g";return g&&D&&(c="y"),typeof p=="string"&&p!==""?a=new RegExp(p,c):p&&(a=new RegExp(p.source,c)),a},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var g=this.__position,a=this.readUntilAfter(p);return this.__position=g,a},m.prototype.lookBack=function(p){var g=this.__position-1;return g>=p.length&&this.__input.substring(g-p.length,g).toLowerCase()===p},r.exports.InputScanner=m},,,,,function(r){function D(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var g=this.__directive_pattern.exec(m);g;)p[g[1]]=g[2],g=this.__directive_pattern.exec(m);return p},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},,function(r,D,m){var p=m(16).Beautifier,g=m(17).Options;function a(c,s){var i=new p(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new g}},function(r,D,m){var p=m(17).Options,g=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,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function R(A,P){this._source_text=A||"",this._options=new p(P),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"]}R.prototype.eatString=function(A){var P="";for(this._ch=this._input.next();this._ch;){if(P+=this._ch,this._ch==="\\")P+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return P},R.prototype.eatWhitespace=function(A){for(var P=u.test(this._input.peek()),w=0;u.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
|
|
`&&((w===0||w<this._options.max_preserve_newlines)&&(w++,this._output.add_new_line(!0)));return P},R.prototype.foundNestedPseudoClass=function(){for(var A=0,P=1,w=this._input.peek(P);w;){if(w==="{")return!0;if(w==="(")A+=1;else if(w===")"){if(A===0)return!1;A-=1}else if(w===";"||w==="}")return!1;P++,w=this._input.peek(P)}return!1},R.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},R.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},R.prototype.indent=function(){this._indentLevel++},R.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},R.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,P=this._options.eol;P==="auto"&&(P=`
|
|
`,A&&i.test(A||"")&&(P=A.match(i)[0])),A=A.replace(t,`
|
|
`);var w=A.match(/^[\t ]*/)[0];this._output=new g(this._options,w),this._input=new a(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,h=!1,f=!1,T=!1,x=!1,_=!1,j=!1,W=this._ch,C=!1,F,k,y;F=this._input.read(o),k=F!=="",y=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(O),J=s.get_directives(H);J&&J.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(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?x=!0:ae==="import"&&(_=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!h&&E===0&&ae.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),T?(T=!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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),_=!1,x=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){C=!0;break}(h||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!x&&E===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 ge=y==='"'||y==="'";this.preserveSingleSpace(ge||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")C=!1,E===0?(f&&(this.outdent(),f=!1),x=!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(),E++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),E&&(E--,this.outdent()));else{var Te=!1;this._input.lookBack("with")&&(Te=!0),this.preserveSingleSpace(k||Te),this.print_string(this._ch),f&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||j)&&E===0&&!_&&!x?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(k),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 Ue=y==='"'||y==="'";this.preserveSingleSpace(Ue||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&C&&this._output.add_new_line()}var Se=this._output.get_code(P);return Se},r.exports.Beautifier=R},function(r,D,m){var p=m(6).Options;function g(a){p.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]}g.prototype=new p,r.exports.Options=g}],M={};function Y(r){var D=M[r];if(D!==void 0)return D.exports;var m=M[r]={exports:{}};return K[r](m,m.exports,Y),m.exports}var V=Y(15);B=V})();var q=B;!(ne=[],Q=function(){return{css_beautify:q}}.apply(Pe,ne),Q!==void 0&&(wt.exports=Q))})()},VYcG:function(wt,Pe,U){"use strict";U.r(Pe),U.d(Pe,"useCourseOptions",function(){return k});var ne=U("T2oS"),Q=U("W9HT"),B=U("+L6B"),q=U("2/Rp"),K=U("7Kak"),M=U("9yH6"),Y=U("giR+"),V=U("fyUT"),r=U("5NDa"),D=U("5rEg"),m=U("6UJt"),p=U("DFOY"),g=U("14J3"),a=U("BMrR"),c=U("jCWc"),s=U("kPKH"),i=U("sPJy"),t=U("bE4q"),u=U("k1fw"),o=U("rAM+"),O=U("y8nQ"),S=U("Vl3Y"),R=U("9og8"),A=U("tJVT"),P=U("WmNS"),w=U.n(P),E=U("q1tI"),h=U.n(E),f=U("Ty5D"),T=U("55Ip"),x=U("9kvl"),_=U("Pxm8"),j=U.n(_),W=U("vCeJ"),C=U("6fQ5"),F=U("ZWs3"),k=function(){var J=Object(E.useState)([]),ae=Object(A.a)(J,2),fe=ae[0],ge=ae[1];return Object(E.useEffect)(function(){var Te=function(){var Ue=Object(R.a)(w.a.mark(function Se(){var Le;return w.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(W.k)({source:"new_question"});case 2:Le=Z.sent,Le!=null&&Le.disciplines&&ge(Object(C.a)(Le==null?void 0:Le.disciplines));case 4:case"end":return Z.stop()}},Se)}));return function(){return Ue.apply(this,arguments)}}();Te()},[]),fe},y=function(J){var ae=J.user,fe=Object(f.i)(),ge=k(),Te=S.a.useForm(),Ue=Object(A.a)(Te,1),Se=Ue[0],Le=Object(E.useState)(),ye=Object(A.a)(Le,2),Z=ye[0],v=ye[1],L=Object(E.useState)(!1),z=Object(A.a)(L,2),ee=z[0],$=z[1];return Object(E.useEffect)(function(){if(fe.id){var Ee=function(){var Fe=Object(R.a)(w.a.mark(function qe(){var Ce,Me,He,Ke,ut,bt,Lt,Ft,Yt,Xt,Je,Qe,_t;return w.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return $(!0),_e.next=3,Object(W.l)({id:fe.id});case 3:He=_e.sent,$(!1),Ke=He==null||((Ce=He.exercise)===null||Ce===void 0)?void 0:Ce.sub_discipline_id,ut=[],bt=Object(o.a)(ge);try{for(bt.s();!(Lt=bt.n()).done;){Ft=Lt.value,Yt=Object(o.a)(Ft.children);try{for(Yt.s();!(Xt=Yt.n()).done;)Je=Xt.value,Je.value===Ke&&(ut=[Ft.value,Je.value])}catch(ie){Yt.e(ie)}finally{Yt.f()}}}catch(ie){bt.e(ie)}finally{bt.f()}Qe=He==null||((Me=He.exercise)===null||Me===void 0)?void 0:Me.time,_t=Object(u.a)(Object(u.a)({},He.exercise),{},{sub_discipline_id:ut,time:Qe===-1?null:Qe}),v(_t);case 12:case"end":return _e.stop()}},qe)}));return function(){return Fe.apply(this,arguments)}}();if(!ge.length)return;Ee()}else v({})},[ge]),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(T.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),h.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),h.a.createElement("aside",{className:"".concat(j.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:ee,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},h.a.createElement("section",{className:[j.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},Z&&h.a.createElement(S.a,{layout:"vertical",form:Se,className:j.a.formWrap,initialValues:Z},h.a.createElement(S.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},h.a.createElement(p.a,{placeholder:"\u8BF7\u9009\u62E9...",options:ge})),h.a.createElement(S.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(S.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},h.a.createElement("div",{style:{display:"flex"}},h.a.createElement(V.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(S.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},h.a.createElement(M.a.Group,null,h.a.createElement(M.a.Button,{value:1},"\u7B80\u5355"),h.a.createElement(M.a.Button,{value:2},"\u9002\u4E2D"),h.a.createElement(M.a.Button,{value:3},"\u56F0\u96BE"))),h.a.createElement(S.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(q.a,{style:{marginRight:"5px"},onClick:function(){x.d.push("/paperlibrary")}},"\u53D6\u6D88"),h.a.createElement(F.a,{onClick:Object(R.a)(w.a.mark(function Ee(){var Fe,qe,Ce,Me;return w.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Ke.next=2,Se.validateFields();case 2:if(Fe=Se.getFieldsValue(),Fe.sub_discipline_id=Fe.sub_discipline_id[1],!fe.id){Ke.next=10;break}return Ke.next=7,Object(W.z)(Object(u.a)({id:fe.id},Fe));case 7:return qe=Ke.sent,qe.status===0&&x.d.push("/paperlibrary/edit/".concat(fe.id,"?fromadd=1")),Ke.abrupt("return");case 10:return Ke.next=12,Object(W.e)(Fe);case 12:Ce=Ke.sent,Ce.status===0&&x.d.push("/paperlibrary/edit/".concat(Ce==null||((Me=Ce.data)===null||Me===void 0)?void 0:Me.exam_id,"?fromadd=1"));case 14:case"end":return Ke.stop()}},Ee)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};Pe.default=Object(x.a)(function(H){var J=H.user;return{user:J}})(y)},Vhoy:function(wt,Pe,U){"use strict";U.d(Pe,"d",function(){return q}),U.d(Pe,"e",function(){return K}),U.d(Pe,"c",function(){return M}),U.d(Pe,"b",function(){return Y}),U.d(Pe,"a",function(){return V});var ne=U("MI8n");class Q{constructor(){this._icons=new Map,this._onDidRegister=new ne.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,q=B;function K(r,D){return new Y(r,D)}function M(r){return r?r.replace(/\$\((.*?)\)/g,(D,m)=>` ${m} `).trim():""}class Y{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 V;(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 Y)return["codicon","codicon-"+a.id];const c=D.exec(a.id);if(!c)return m(Y.error);let[,s,i]=c;const t=["codicon","codicon-"+s];return i&&t.push("codicon-modifier-"+i.substr(1)),t}r.asClassNameArray=m;function p(a){return m(a).join(" ")}r.asClassName=p;function g(a){return"."+m(a).join(".")}r.asCSSSelector=g})(V||(V={})),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"})}(Y||(Y={}))},"VrN/":function(wt,Pe,U){(function(ne,Q){wt.exports=Q()})(this,function(){"use strict";var ne=navigator.userAgent,Q=navigator.platform,B=/gecko\/\d/i.test(ne),q=/MSIE \d/.test(ne),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),M=/Edge\/(\d+)/.exec(ne),Y=q||K||M,V=Y&&(q?document.documentMode||6:+(M||K)[1]),r=!M&&/WebKit\//.test(ne),D=r&&/Qt\/\d+\.\d+/.test(ne),m=!M&&/Chrome\//.test(ne),p=/Opera\//.test(ne),g=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),c=/PhantomJS/.test(ne),s=!M&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),i=/Android/.test(ne),t=s||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),u=s||/Mac/.test(Q),o=/\bCrOS\b/.test(ne),O=/win/i.test(Q),S=p&&ne.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(p=!1,r=!0);var R=u&&(D||p&&(S==null||S<12.11)),A=B||Y&&V>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,n){var d=e.className,l=P(n).exec(d);if(l){var b=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(b?l[1]+b:"")}};function E(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function h(e,n){return E(e).appendChild(n)}function f(e,n,d,l){var b=document.createElement(e);if(d&&(b.className=d),l&&(b.style.cssText=l),typeof n=="string")b.appendChild(document.createTextNode(n));else if(n)for(var G=0;G<n.length;++G)b.appendChild(n[G]);return b}function T(e,n,d,l){var b=f(e,n,d,l);return b.setAttribute("role","presentation"),b}var x;document.createRange?x=function(e,n,d,l){var b=document.createRange();return b.setEnd(l||e,d),b.setStart(e,n),b}:x=function(e,n,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(b){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",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 j(){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 W(e,n){var d=e.className;P(n).test(d)||(e.className+=(d?" ":"")+n)}function C(e,n){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!P(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}:Y&&(F=function(e){try{e.select()}catch(n){}});function k(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function y(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,b){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var G=l||0,te=b||0;;){var se=e.indexOf(" ",G);if(se<0||se>=n)return te+(n-G);te+=se-G,te+=d-te%d,G=se+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=k(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.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 ae(e,n){for(var d=0;d<e.length;++d)if(e[d]==n)return d;return-1}var fe=50,ge={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},Ue={origin:"*mouse"},Se={origin:"+move"};function Le(e,n,d){for(var l=0,b=0;;){var G=e.indexOf(" ",l);G==-1&&(G=e.length);var te=G-l;if(G==e.length||b+te>=n)return l+Math.min(te,n-b);if(b+=G-l,b+=d-b%d,l=G+1,b>=n)return l}}var ye=[""];function Z(e){for(;ye.length<=e;)ye.push(v(ye)+" ");return ye[e]}function v(e){return e[e.length-1]}function L(e,n){for(var d=[],l=0;l<e.length;l++)d[l]=n(e[l],l);return d}function z(e,n,d){for(var l=0,b=d(n);l<e.length&&d(e[l])<=b;)l++;e.splice(l,0,n)}function ee(){}function $(e,n){var d;return Object.create?d=Object.create(e):(ee.prototype=e,d=new ee),n&&y(n,d),d}var Ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Fe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ee.test(e))}function qe(e,n){return n?n.source.indexOf("\\w")>-1&&Fe(e)?!0:n.test(e):Fe(e)}function Ce(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Me=/[\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 He(e){return e.charCodeAt(0)>=768&&Me.test(e)}function Ke(e,n,d){for(;(d<0?n>0:n<e.length)&&He(e.charAt(n));)n+=d;return n}function ut(e,n,d){for(var l=n>d?-1:1;;){if(n==d)return n;var b=(n+d)/2,G=l<0?Math.ceil(b):Math.floor(b);if(G==n)return e(G)?n:d;e(G)?d=G:n=G+l}}function bt(e,n,d,l){if(!e)return l(n,d,"ltr",0);for(var b=!1,G=0;G<e.length;++G){var te=e[G];(te.from<d&&te.to>n||n==d&&te.to==n)&&(l(Math.max(te.from,n),Math.min(te.to,d),te.level==1?"rtl":"ltr",G),b=!0)}b||l(n,d,"ltr")}var Lt=null;function Ft(e,n,d){var l;Lt=null;for(var b=0;b<e.length;++b){var G=e[b];if(G.from<n&&G.to>n)return b;G.to==n&&(G.from!=G.to&&d=="before"?l=b:Lt=b),G.from==n&&(G.from!=G.to&&d!="before"?l=b:Lt=b)}return l!=null?l:Lt}var Yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(be){return be<=247?e.charAt(be):1424<=be&&be<=1524?"R":1536<=be&&be<=1785?n.charAt(be-1536):1774<=be&&be<=2220?"r":8192<=be&&be<=8203?"w":be==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,b=/[stwN]/,G=/[LRr]/,te=/[Lb1n]/,se=/[1n]/;function ue(be,je,$e){this.level=be,this.from=je,this.to=$e}return function(be,je){var $e=je=="ltr"?"L":"R";if(be.length==0||je=="ltr"&&!l.test(be))return!1;for(var ct=be.length,st=[],Ot=0;Ot<ct;++Ot)st.push(d(be.charCodeAt(Ot)));for(var Ht=0,rn=$e;Ht<ct;++Ht){var Tn=st[Ht];Tn=="m"?st[Ht]=rn:rn=Tn}for(var Yn=0,Sn=$e;Yn<ct;++Yn){var ur=st[Yn];ur=="1"&&Sn=="r"?st[Yn]="n":G.test(ur)&&(Sn=ur,ur=="r"&&(st[Yn]="R"))}for(var Rr=1,Cr=st[0];Rr<ct-1;++Rr){var Dr=st[Rr];Dr=="+"&&Cr=="1"&&st[Rr+1]=="1"?st[Rr]="1":Dr==","&&Cr==st[Rr+1]&&(Cr=="1"||Cr=="n")&&(st[Rr]=Cr),Cr=Dr}for(var Wr=0;Wr<ct;++Wr){var ri=st[Wr];if(ri==",")st[Wr]="N";else if(ri=="%"){var zr=void 0;for(zr=Wr+1;zr<ct&&st[zr]=="%";++zr);for(var Ei=Wr&&st[Wr-1]=="!"||zr<ct&&st[zr]=="1"?"1":"N",gi=Wr;gi<zr;++gi)st[gi]=Ei;Wr=zr-1}}for(var Qr=0,vi=$e;Qr<ct;++Qr){var oi=st[Qr];vi=="L"&&oi=="1"?st[Qr]="L":G.test(oi)&&(vi=oi)}for(var qr=0;qr<ct;++qr)if(b.test(st[qr])){var Jr=void 0;for(Jr=qr+1;Jr<ct&&b.test(st[Jr]);++Jr);for(var Xr=(qr?st[qr-1]:$e)=="L",_i=(Jr<ct?st[Jr]:$e)=="L",vs=Xr==_i?Xr?"L":"R":$e,wa=qr;wa<Jr;++wa)st[wa]=vs;qr=Jr-1}for(var di=[],Hi,ii=0;ii<ct;)if(te.test(st[ii])){var nu=ii;for(++ii;ii<ct&&te.test(st[ii]);++ii);di.push(new ue(0,nu,ii))}else{var Qi=ii,Ga=di.length,za=je=="rtl"?1:0;for(++ii;ii<ct&&st[ii]!="L";++ii);for(var hi=Qi;hi<ii;)if(se.test(st[hi])){Qi<hi&&(di.splice(Ga,0,new ue(1,Qi,hi)),Ga+=za);var _s=hi;for(++hi;hi<ii&&se.test(st[hi]);++hi);di.splice(Ga,0,new ue(2,_s,hi)),Ga+=za,Qi=hi}else++hi;Qi<ii&&di.splice(Ga,0,new ue(1,Qi,ii))}return je=="ltr"&&(di[0].level==1&&(Hi=be.match(/^\s+/))&&(di[0].from=Hi[0].length,di.unshift(new ue(0,0,Hi[0].length))),v(di).level==1&&(Hi=be.match(/\s+$/))&&(v(di).to-=Hi[0].length,di.push(new ue(0,ct-Hi[0].length,ct)))),je=="rtl"?di.reverse():di}}();function Xt(e,n){var d=e.order;return d==null&&(d=e.order=Yt(e.text,n)),d}var Je=[],Qe=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]||Je).concat(d)}};function _t(e,n){return e._handlers&&e._handlers[n]||Je}function xt(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,b=l&&l[n];if(b){var G=ae(b,d);G>-1&&(l[n]=b.slice(0,G).concat(b.slice(G+1)))}}}function _e(e,n){var d=_t(e,n);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),b=0;b<d.length;++b)d[b].apply(null,l)}function ie(e,n,d){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),_e(e,d||n.type,e,n),Oe(n)||n.codemirrorIgnore}function oe(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)ae(d,n[l])==-1&&d.push(n[l])}function ce(e,n){return _t(e,n).length>0}function we(e){e.prototype.on=function(n,d){Qe(this,n,d)},e.prototype.off=function(n,d){xt(this,n,d)}}function de(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function he(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function le(e){de(e),he(e)}function Ne(e){return e.target||e.srcElement}function We(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 lt=function(){if(Y&&V<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Ct;function Rt(e){if(Ct==null){var n=f("span","\u200B");h(e,f("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ct=n.offsetWidth<=1&&n.offsetHeight>2&&!(Y&&V<8))}var d=Ct?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var It;function qn(e){if(It!=null)return It;var n=h(e,document.createTextNode("A\u062EA")),d=x(n,0,1).getBoundingClientRect(),l=x(n,1,2).getBoundingClientRect();return E(e),!d||d.left==d.right?!1:It=l.right-d.right<3}var Vt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var n=0,d=[],l=e.length;n<=l;){var b=e.indexOf(`
|
|
`,n);b==-1&&(b=e.length);var G=e.slice(n,e.charAt(b-1)=="\r"?b-1:b),te=G.indexOf("\r");te!=-1?(d.push(G.slice(0,te)),n+=te+1):(d.push(G),n=b+1)}return d}:function(e){return e.split(/\r\n?|\n/)},qt=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},nn=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),On=null;function ar(e){if(On!=null)return On;var n=h(e,f("span","x")),d=n.getBoundingClientRect(),l=x(n,0,1).getBoundingClientRect();return On=Math.abs(d.left-l.left)>1}var cr={},Qn={};function yr(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),cr[e]=n}function Sr(e,n){Qn[e]=n}function Nn(e){if(typeof e=="string"&&Qn.hasOwnProperty(e))e=Qn[e];else if(e&&typeof e.name=="string"&&Qn.hasOwnProperty(e.name)){var n=Qn[e.name];typeof n=="string"&&(n={name:n}),e=$(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Nn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Nn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ar(e,n){n=Nn(n);var d=cr[n.name];if(!d)return Ar(e,"text/plain");var l=d(e,n);if(Dn.hasOwnProperty(n.name)){var b=Dn[n.name];for(var G in b){if(!b.hasOwnProperty(G))continue;l.hasOwnProperty(G)&&(l["_"+G]=l[G]),l[G]=b[G]}}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var te in n.modeProps)l[te]=n.modeProps[te];return l}var Dn={};function Pn(e,n){var d=Dn.hasOwnProperty(e)?Dn[e]:Dn[e]={};y(n,d)}function Zn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var d={};for(var l in n){var b=n[l];b instanceof Array&&(b=b.concat([])),d[l]=b}return d}function pr(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 Lr(e,n,d){return e.startState?e.startState(n,d):!0}var Or=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};Or.prototype.eol=function(){return this.pos>=this.string.length},Or.prototype.sol=function(){return this.pos==this.lineStart},Or.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Or.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Or.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},Or.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Or.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Or.prototype.skipToEnd=function(){this.pos=this.string.length},Or.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Or.prototype.backUp=function(e){this.pos-=e},Or.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)},Or.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Or.prototype.match=function(e,n,d){if(typeof e=="string"){var l=function(te){return d?te.toLowerCase():te},b=this.string.substr(this.pos,e.length);if(l(b)==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)}},Or.prototype.current=function(){return this.string.slice(this.start,this.pos)},Or.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Or.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Or.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function at(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 b=d.children[l],G=b.chunkSize();if(n<G){d=b;break}n-=G}return d.lines[n]}function Be(e,n,d){var l=[],b=n.line;return e.iter(n.line,d.line+1,function(G){var te=G.text;b==d.line&&(te=te.slice(0,d.ch)),b==n.line&&(te=te.slice(n.ch)),l.push(te),++b}),l}function pt(e,n,d){var l=[];return e.iter(n,d,function(b){l.push(b.text)}),l}function Ie(e,n){var d=n-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function xe(e){if(e.parent==null)return null;for(var n=e.parent,d=ae(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var b=0;!(l.children[b]==n);++b)d+=l.children[b].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 b=e.children[l],G=b.height;if(n<G){e=b;continue e}n-=G,d+=b.chunkSize()}return d}while(!e.lines);for(var te=0;te<e.lines.length;++te){var se=e.lines[te],ue=se.height;if(n<ue)break;n-=ue}return d+te}function Hn(e,n){return n>=e.first&&n<e.first+e.size}function kt(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function ke(e,n,d){if(d===void 0&&(d=null),!(this instanceof ke))return new ke(e,n,d);this.line=e,this.ch=n,this.sticky=d}function dt(e,n){return e.line-n.line||e.ch-n.ch}function Re(e,n){return e.sticky==n.sticky&&dt(e,n)==0}function an(e){return ke(e.line,e.ch)}function hr(e,n){return dt(e,n)<0?n:e}function mr(e,n){return dt(e,n)<0?e:n}function Kn(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function Wt(e,n){if(n.line<e.first)return ke(e.first,0);var d=e.first+e.size-1;return n.line>d?ke(d,at(e,d).text.length):dr(n,at(e,n.line).text.length)}function dr(e,n){var d=e.ch;return d==null||d>n?ke(e.line,n):d<0?ke(e.line,0):e}function ht(e,n){for(var d=[],l=0;l<n.length;l++)d[l]=Wt(e,n[l]);return d}var Un=function(e,n){this.state=e,this.lookAhead=n},yn=function(e,n,d,l){this.state=n,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};yn.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},yn.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}},yn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},yn.fromSaved=function(e,n,d){return n instanceof Un?new yn(e,Zn(e.mode,n.state),d,n.lookAhead):new yn(e,Zn(e.mode,n),d)},yn.prototype.save=function(e){var n=e!==!1?Zn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Un(n,this.maxLookAhead):n};function un(e,n,d,l){var b=[e.state.modeGen],G={};Fn(e,n.text,e.doc.mode,d,function(be,je){return b.push(be,je)},G,l);for(var te=d.state,se=function(be){d.baseTokens=b;var je=e.state.overlays[be],$e=1,ct=0;d.state=!0,Fn(e,n.text,je.mode,d,function(st,Ot){for(var Ht=$e;ct<st;){var rn=b[$e];rn>st&&b.splice($e,1,st,b[$e+1],rn),$e+=2,ct=Math.min(st,rn)}if(!Ot)return;if(je.opaque)b.splice(Ht,$e-Ht,st,"overlay "+Ot),$e=Ht+2;else for(;Ht<$e;Ht+=2){var Tn=b[Ht+1];b[Ht+1]=(Tn?Tn+" ":"")+"overlay "+Ot}},G),d.state=te,d.baseTokens=null,d.baseTokenPos=1},ue=0;ue<e.state.overlays.length;++ue)se(ue);return{styles:b,classes:G.bgClass||G.textClass?G:null}}function Qt(e,n,d){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=Ln(e,xe(n)),b=n.text.length>e.options.maxHighlightLength&&Zn(e.doc.mode,l.state),G=un(e,n,l);b&&(l.state=b),n.stateAfter=l.save(!b),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 Ln(e,n,d){var l=e.doc,b=e.display;if(!l.mode.startState)return new yn(l,!0,n);var G=bn(e,n,d),te=G>l.first&&at(l,G-1).stateAfter,se=te?yn.fromSaved(l,te,G):new yn(l,Lr(l.mode),G);return l.iter(G,n,function(ue){hn(e,ue.text,se);var be=se.line;ue.stateAfter=be==n-1||be%5==0||be>=b.viewFrom&&be<b.viewTo?se.save():null,se.nextLine()}),d&&(l.modeFrontier=se.line),se}function hn(e,n,d,l){var b=e.doc.mode,G=new Or(n,e.options.tabSize,d);for(G.start=G.pos=l||0,n==""&&en(b,d.state);!G.eol();)Ut(b,G,d.state),G.start=G.pos}function en(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var d=pr(e,n);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function Ut(e,n,d,l){for(var b=0;b<10;b++){l&&(l[0]=pr(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 Kt=function(e,n,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=d};function sr(e,n,d,l){var b=e.doc,G=b.mode,te;n=Wt(b,n);var se=at(b,n.line),ue=Ln(e,n.line,d),be=new Or(se.text,e.options.tabSize,ue),je;for(l&&(je=[]);(l||be.pos<n.ch)&&!be.eol();)be.start=be.pos,te=Ut(G,be,ue.state),l&&je.push(new Kt(be,te,Zn(b.mode,ue.state)));return l?je:new Kt(be,te,ue.state)}function or(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 Fn(e,n,d,l,b,G,te){var se=d.flattenSpans;se==null&&(se=e.options.flattenSpans);var ue=0,be=null,je=new Or(n,e.options.tabSize,l),$e,ct=e.options.addModeClass&&[null];for(n==""&&or(en(d,l.state),G);!je.eol();){if(je.pos>e.options.maxHighlightLength?(se=!1,te&&hn(e,n,l,je.pos),je.pos=n.length,$e=null):$e=or(Ut(d,je,l.state,ct),G),ct){var st=ct[0].name;st&&($e="m-"+($e?st+" "+$e:st))}if(!se||be!=$e){for(;ue<je.start;)ue=Math.min(je.start,ue+5e3),b(ue,be);be=$e}je.start=je.pos}for(;ue<je.pos;){var Ot=Math.min(je.pos,ue+5e3);b(Ot,be),ue=Ot}}function bn(e,n,d){for(var l,b,G=e.doc,te=d?-1:n-(e.doc.mode.innerMode?1e3:100),se=n;se>te;--se){if(se<=G.first)return G.first;var ue=at(G,se-1),be=ue.stateAfter;if(be&&(!d||se+(be instanceof Un?be.lookAhead:0)<=G.modeFrontier))return se;var je=H(ue.text,null,e.options.tabSize);(b==null||l>je)&&(b=se-1,l=je)}return b}function Bt(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 b=at(e,l).stateAfter;if(b&&(!(b instanceof Un)||l+b.lookAhead<n)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var $t=!1,Gt=!1;function Dt(){$t=!0}function er(){Gt=!0}function An(e,n,d){this.marker=e,this.from=n,this.to=d}function fn(e,n){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==n)return l}}function Vn(e,n){for(var d,l=0;l<e.length;++l)e[l]!=n&&(d||(d=[])).push(e[l]);return d}function dn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function _n(e,n,d){var l;if(e)for(var b=0;b<e.length;++b){var G=e[b],te=G.marker,se=G.from==null||(te.inclusiveLeft?G.from<=n:G.from<n);if(se||G.from==n&&te.type=="bookmark"&&(!d||!G.marker.insertLeft)){var ue=G.to==null||(te.inclusiveRight?G.to>=n:G.to>n);(l||(l=[])).push(new An(te,G.from,ue?null:G.to))}}return l}function tn(e,n,d){var l;if(e)for(var b=0;b<e.length;++b){var G=e[b],te=G.marker,se=G.to==null||(te.inclusiveRight?G.to>=n:G.to>n);if(se||G.from==n&&te.type=="bookmark"&&(!d||G.marker.insertLeft)){var ue=G.from==null||(te.inclusiveLeft?G.from<=n:G.from<n);(l||(l=[])).push(new An(te,ue?null:G.from-n,G.to==null?null:G.to-n))}}return l}function kn(e,n){if(n.full)return null;var d=Hn(e,n.from.line)&&at(e,n.from.line).markedSpans,l=Hn(e,n.to.line)&&at(e,n.to.line).markedSpans;if(!d&&!l)return null;var b=n.from.ch,G=n.to.ch,te=dt(n.from,n.to)==0,se=_n(d,b,te),ue=tn(l,G,te),be=n.text.length==1,je=v(n.text).length+(be?b:0);if(se)for(var $e=0;$e<se.length;++$e){var ct=se[$e];if(ct.to==null){var st=fn(ue,ct.marker);st?be&&(ct.to=st.to==null?null:st.to+je):ct.to=b}}if(ue)for(var Ot=0;Ot<ue.length;++Ot){var Ht=ue[Ot];if(Ht.to!=null&&(Ht.to+=je),Ht.from==null){var rn=fn(se,Ht.marker);rn||(Ht.from=je,be&&(se||(se=[])).push(Ht))}else Ht.from+=je,be&&(se||(se=[])).push(Ht)}se&&(se=tr(se)),ue&&ue!=se&&(ue=tr(ue));var Tn=[se];if(!be){var Yn=n.text.length-2,Sn;if(Yn>0&&se)for(var ur=0;ur<se.length;++ur)se[ur].to==null&&(Sn||(Sn=[])).push(new An(se[ur].marker,null,null));for(var Rr=0;Rr<Yn;++Rr)Tn.push(Sn);Tn.push(ue)}return Tn}function tr(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(st){if(st.markedSpans)for(var Ot=0;Ot<st.markedSpans.length;++Ot){var Ht=st.markedSpans[Ot].marker;Ht.readOnly&&(!l||ae(l,Ht)==-1)&&(l||(l=[])).push(Ht)}}),!l)return null;for(var b=[{from:n,to:d}],G=0;G<l.length;++G)for(var te=l[G],se=te.find(0),ue=0;ue<b.length;++ue){var be=b[ue];if(dt(be.to,se.from)<0||dt(be.from,se.to)>0)continue;var je=[ue,1],$e=dt(be.from,se.from),ct=dt(be.to,se.to);($e<0||!te.inclusiveLeft&&!$e)&&je.push({from:be.from,to:se.from}),(ct>0||!te.inclusiveRight&&!ct)&&je.push({from:se.to,to:be.to}),b.splice.apply(b,je),ue+=je.length-3}return b}function wn(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 Mn(e,n){if(!n)return;for(var d=0;d<n.length;++d)n[d].marker.attachLine(e);e.markedSpans=n}function cn(e){return e.inclusiveLeft?-1:0}function lr(e){return e.inclusiveRight?1:0}function Xn(e,n){var d=e.lines.length-n.lines.length;if(d!=0)return d;var l=e.find(),b=n.find(),G=dt(l.from,b.from)||cn(e)-cn(n);if(G)return-G;var te=dt(l.to,b.to)||lr(e)-lr(n);return te||n.id-e.id}function vr(e,n){var d=Gt&&e.markedSpans,l;if(d)for(var b=void 0,G=0;G<d.length;++G)b=d[G],b.marker.collapsed&&(n?b.from:b.to)==null&&(!l||Xn(l,b.marker)<0)&&(l=b.marker);return l}function gr(e){return vr(e,!0)}function Gn(e){return vr(e,!1)}function Bn(e,n){var d=Gt&&e.markedSpans,l;if(d)for(var b=0;b<d.length;++b){var G=d[b];G.marker.collapsed&&(G.from==null||G.from<n)&&(G.to==null||G.to>n)&&(!l||Xn(l,G.marker)<0)&&(l=G.marker)}return l}function _r(e,n,d,l,b){var G=at(e,n),te=Gt&&G.markedSpans;if(te)for(var se=0;se<te.length;++se){var ue=te[se];if(!ue.marker.collapsed)continue;var be=ue.marker.find(0),je=dt(be.from,d)||cn(ue.marker)-cn(b),$e=dt(be.to,l)||lr(ue.marker)-lr(b);if(je>=0&&$e<=0||je<=0&&$e>=0)continue;if(je<=0&&(ue.marker.inclusiveRight&&b.inclusiveLeft?dt(be.to,d)>=0:dt(be.to,d)>0)||je>=0&&(ue.marker.inclusiveRight&&b.inclusiveLeft?dt(be.from,l)<=0:dt(be.from,l)<0))return!0}}function Rn(e){for(var n;n=gr(e);)e=n.find(-1,!0).line;return e}function En(e){for(var n;n=Gn(e);)e=n.find(1,!0).line;return e}function Cn(e){for(var n,d;n=Gn(e);)e=n.find(1,!0).line,(d||(d=[])).push(e);return d}function vn(e,n){var d=at(e,n),l=Rn(d);return d==l?n:xe(l)}function Zt(e,n){if(n>e.lastLine())return n;var d=at(e,n),l;if(!St(e,d))return n;for(;l=Gn(d);)d=l.find(1,!0).line;return xe(d)+1}function St(e,n){var d=Gt&&n.markedSpans;if(d)for(var l=void 0,b=0;b<d.length;++b){if(l=d[b],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Mt(e,n,l))return!0}}function Mt(e,n,d){if(d.to==null){var l=d.marker.find(1,!0);return Mt(e,l.line,fn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==n.text.length)return!0;for(var b=void 0,G=0;G<n.markedSpans.length;++G)if(b=n.markedSpans[G],b.marker.collapsed&&!b.marker.widgetNode&&b.from==d.to&&(b.to==null||b.to!=d.from)&&(b.marker.inclusiveLeft||d.marker.inclusiveRight)&&Mt(e,n,b))return!0}function Nt(e){e=Rn(e);for(var n=0,d=e.parent,l=0;l<d.lines.length;++l){var b=d.lines[l];if(b==e)break;n+=b.height}for(var G=d.parent;G;d=G,G=d.parent)for(var te=0;te<G.children.length;++te){var se=G.children[te];if(se==d)break;n+=se.height}return n}function At(e){if(e.height==0)return 0;for(var n=e.text.length,d,l=e;d=gr(l);){var b=d.find(0,!0);l=b.from.line,n+=b.from.ch-b.to.ch}for(l=e;d=Gn(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 zt(e){var n=e.display,d=e.doc;n.maxLine=at(d,d.first),n.maxLineLength=At(n.maxLine),n.maxLineChanged=!0,d.iter(function(l){var b=At(l);b>n.maxLineLength&&(n.maxLineLength=b,n.maxLine=l)})}var on=function(e,n,d){this.text=e,Mn(this,n),this.height=d?d(this):1};on.prototype.lineNo=function(){return xe(this)},we(on);function sn(e,n,d,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),wn(e),Mn(e,d);var b=l?l(e):1;b!=e.height&&Ie(e,b)}function ft(e){e.parent=null,wn(e)}var rt={},Ye={};function et(e,n){if(!e||/^\s*$/.test(e))return null;var d=n.addModeClass?Ye:rt;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Ge(e,n){var d=T("span",null,null,r?"padding-right: .1px":null),l={pre:T("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var b=0;b<=(n.rest?n.rest.length:0);b++){var G=b?n.rest[b-1]:n.line,te=void 0;l.pos=0,l.addToken=tt,qn(e.display.measure)&&(te=Xt(G,e.doc.direction))&&(l.addToken=Tt(l.addToken,te)),l.map=[];var se=n!=e.display.externalMeasured&&xe(G);Pt(G,l,Qt(e,G,se)),G.styleClasses&&(G.styleClasses.bgClass&&(l.bgClass=C(G.styleClasses.bgClass,l.bgClass||"")),G.styleClasses.textClass&&(l.textClass=C(G.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Rt(e.display.measure))),b==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 ue=l.content.lastChild;(/\bcm-tab\b/.test(ue.className)||ue.querySelector&&ue.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return _e(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=C(l.pre.className,l.textClass||"")),l}function ot(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 tt(e,n,d,l,b,G,te){if(!n)return;var se=e.splitSpaces?mt(n,e.trailingSpace):n,ue=e.cm.state.specialChars,be=!1,je;if(!ue.test(n))e.col+=n.length,je=document.createTextNode(se),e.map.push(e.pos,e.pos+n.length,je),Y&&V<9&&(be=!0),e.pos+=n.length;else{je=document.createDocumentFragment();for(var $e=0;;){ue.lastIndex=$e;var ct=ue.exec(n),st=ct?ct.index-$e:n.length-$e;if(st){var Ot=document.createTextNode(se.slice($e,$e+st));Y&&V<9?je.appendChild(f("span",[Ot])):je.appendChild(Ot),e.map.push(e.pos,e.pos+st,Ot),e.col+=st,e.pos+=st}if(!ct)break;$e+=st+1;var Ht=void 0;if(ct[0]==" "){var rn=e.cm.options.tabSize,Tn=rn-e.col%rn;Ht=je.appendChild(f("span",Z(Tn),"cm-tab")),Ht.setAttribute("role","presentation"),Ht.setAttribute("cm-text"," "),e.col+=Tn}else ct[0]=="\r"||ct[0]==`
|
|
`?(Ht=je.appendChild(f("span",ct[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ht.setAttribute("cm-text",ct[0]),e.col+=1):(Ht=e.cm.options.specialCharPlaceholder(ct[0]),Ht.setAttribute("cm-text",ct[0]),Y&&V<9?je.appendChild(f("span",[Ht])):je.appendChild(Ht),e.col+=1);e.map.push(e.pos,e.pos+1,Ht),e.pos++}}if(e.trailingSpace=se.charCodeAt(n.length-1)==32,d||l||b||be||G||te){var Yn=d||"";l&&(Yn+=l),b&&(Yn+=b);var Sn=f("span",[je],Yn,G);if(te)for(var ur in te)te.hasOwnProperty(ur)&&ur!="style"&&ur!="class"&&Sn.setAttribute(ur,te[ur]);return e.content.appendChild(Sn)}e.content.appendChild(je)}function mt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var d=n,l="",b=0;b<e.length;b++){var G=e.charAt(b);G==" "&&d&&(b==e.length-1||e.charCodeAt(b+1)==32)&&(G="\xA0"),l+=G,d=G==" "}return l}function Tt(e,n){return function(d,l,b,G,te,se,ue){b=b?b+" cm-force-border":"cm-force-border";for(var be=d.pos,je=be+l.length;;){for(var $e=void 0,ct=0;ct<n.length&&!($e=n[ct],$e.to>be&&$e.from<=be);ct++);if($e.to>=je)return e(d,l,b,G,te,se,ue);e(d,l.slice(0,$e.to-be),b,G,null,se,ue),G=null,l=l.slice($e.to-be),be=$e.to}}}function gt(e,n,d,l){var b=!l&&d.widgetNode;b&&e.map.push(e.pos,e.pos+n,b),!l&&e.cm.display.input.needsContentAttribute&&(b||(b=e.content.appendChild(document.createElement("span"))),b.setAttribute("cm-marker",d.id)),b&&(e.cm.display.input.setUneditable(b),e.content.appendChild(b)),e.pos+=n,e.trailingSpace=!1}function Pt(e,n,d){var l=e.markedSpans,b=e.text,G=0;if(!l){for(var te=1;te<d.length;te+=2)n.addToken(n,b.slice(G,G=d[te]),et(d[te+1],n.cm.options));return}for(var se=b.length,ue=0,be=1,je="",$e,ct,st=0,Ot,Ht,rn,Tn,Yn;;){if(st==ue){Ot=Ht=rn=ct="",Yn=null,Tn=null,st=Infinity;for(var Sn=[],ur=void 0,Rr=0;Rr<l.length;++Rr){var Cr=l[Rr],Dr=Cr.marker;if(Dr.type=="bookmark"&&Cr.from==ue&&Dr.widgetNode)Sn.push(Dr);else if(Cr.from<=ue&&(Cr.to==null||Cr.to>ue||Dr.collapsed&&Cr.to==ue&&Cr.from==ue)){if(Cr.to!=null&&Cr.to!=ue&&st>Cr.to&&(st=Cr.to,Ht=""),Dr.className&&(Ot+=" "+Dr.className),Dr.css&&(ct=(ct?ct+";":"")+Dr.css),Dr.startStyle&&Cr.from==ue&&(rn+=" "+Dr.startStyle),Dr.endStyle&&Cr.to==st&&(ur||(ur=[])).push(Dr.endStyle,Cr.to),Dr.title&&((Yn||(Yn={})).title=Dr.title),Dr.attributes)for(var Wr in Dr.attributes)(Yn||(Yn={}))[Wr]=Dr.attributes[Wr];Dr.collapsed&&(!Tn||Xn(Tn.marker,Dr)<0)&&(Tn=Cr)}else Cr.from>ue&&st>Cr.from&&(st=Cr.from)}if(ur)for(var ri=0;ri<ur.length;ri+=2)ur[ri+1]==st&&(Ht+=" "+ur[ri]);if(!Tn||Tn.from==ue)for(var zr=0;zr<Sn.length;++zr)gt(n,0,Sn[zr]);if(Tn&&(Tn.from||0)==ue){if(gt(n,(Tn.to==null?se+1:Tn.to)-ue,Tn.marker,Tn.from==null),Tn.to==null)return;Tn.to==ue&&(Tn=!1)}}if(ue>=se)break;for(var Ei=Math.min(se,st);;){if(je){var gi=ue+je.length;if(!Tn){var Qr=gi>Ei?je.slice(0,Ei-ue):je;n.addToken(n,Qr,$e?$e+Ot:Ot,rn,ue+Qr.length==st?Ht:"",ct,Yn)}if(gi>=Ei){je=je.slice(Ei-ue),ue=Ei;break}ue=gi,rn=""}je=b.slice(G,G=d[be++]),$e=et(d[be++],n.cm.options)}}}function vt(e,n,d){this.line=n,this.rest=Cn(n),this.size=this.rest?xe(v(this.rest))-d+1:1,this.node=this.text=null,this.hidden=St(e,n)}function Et(e,n,d){for(var l=[],b,G=n;G<d;G=b){var te=new vt(e.doc,at(e.doc,G),G);b=G+te.size,l.push(te)}return l}var ln=null;function Jt(e){ln?ln.ops.push(e):e.ownsGroup=ln={ops:[e],delayedCallbacks:[]}}function fr(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 b=e.ops[l];if(b.cursorActivityHandlers)for(;b.cursorActivityCalled<b.cursorActivityHandlers.length;)b.cursorActivityHandlers[b.cursorActivityCalled++].call(null,b.cm)}}while(d<n.length)}function jn(e,n){var d=e.ownsGroup;if(!d)return;try{fr(d)}finally{ln=null,n(d)}}var Wn=null;function jt(e,n){var d=_t(e,n);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),b;ln?b=ln.delayedCallbacks:Wn?b=Wn:(b=Wn=[],setTimeout(pn,0));for(var G=function(se){b.push(function(){return d[se].apply(null,l)})},te=0;te<d.length;++te)G(te)}function pn(){var e=Wn;Wn=null;for(var n=0;n<e.length;++n)e[n]()}function In(e,n,d,l){for(var b=0;b<n.changes.length;b++){var G=n.changes[b];G=="text"?jr(e,n):G=="gutter"?Jn(e,n,d,l):G=="class"?Er(e,n):G=="widget"&&xr(e,n,l)}n.changes=null}function zn(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),Y&&V<8&&(e.node.style.zIndex=2)),e.node}function mn(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=zn(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,Er(e,n)):d&&(n.text.className=d)}function Er(e,n){mn(e,n),n.line.wrapClass?zn(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 Jn(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 b=zn(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),b.insertBefore(n.gutterBackground,n.text)}var G=n.line.gutterMarkers;if(e.options.lineNumbers||G){var te=zn(n),se=n.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(se),te.insertBefore(se,n.text),n.line.gutterClass&&(se.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!G||!G["CodeMirror-linenumbers"])&&(n.lineNumber=se.appendChild(f("div",kt(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),G)for(var ue=0;ue<e.display.gutterSpecs.length;++ue){var be=e.display.gutterSpecs[ue].className,je=G.hasOwnProperty(be)&&G[be];je&&se.appendChild(f("div",[je],"CodeMirror-gutter-elt","left: "+l.gutterLeft[be]+"px; width: "+l.gutterWidth[be]+"px"))}}}function xr(e,n,d){n.alignable&&(n.alignable=null);for(var l=P("CodeMirror-linewidget"),b=n.node.firstChild,G=void 0;b;b=G)G=b.nextSibling,l.test(b.className)&&n.node.removeChild(b);wr(e,n,d)}function br(e,n,d,l){var b=Ir(e,n);return n.text=n.node=b.pre,b.bgClass&&(n.bgClass=b.bgClass),b.textClass&&(n.textClass=b.textClass),Er(e,n),Jn(e,n,d,l),wr(e,n,l),n.node}function wr(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,b){if(!n.widgets)return;for(var G=zn(d),te=0,se=n.widgets;te<se.length;++te){var ue=se[te],be=f("div",[ue.node],"CodeMirror-linewidget"+(ue.className?" "+ue.className:""));ue.handleMouseEvents||be.setAttribute("cm-ignore-events","true"),Vr(ue,be,d,l),e.display.input.setUneditable(be),b&&ue.above?G.insertBefore(be,d.gutter||d.text):G.appendChild(be),jt(ue,"redraw")}}function Vr(e,n,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(n);var b=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(b-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=b+"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=Ne(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 fe-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,b=l&&ei(e);if(!n.measure.heights||l&&n.measure.width!=b){var G=n.measure.heights=[];if(l){n.measure.width=b;for(var te=n.text.firstChild.getClientRects(),se=0;se<te.length-1;se++){var ue=te[se],be=te[se+1];Math.abs(ue.bottom-be.bottom)>2&&G.push((ue.bottom+be.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 b=0;b<e.rest.length;b++)if(xe(e.rest[b])>d)return{map:e.measure.maps[b],cache:e.measure.caches[b],before:!0}}function fi(e,n){n=Rn(n);var d=xe(n),l=e.display.externalMeasured=new vt(e.doc,n,d);l.lineN=d;var b=l.built=Ge(e,l);return l.text=b.pre,h(e.display.lineMeasure,b.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=xe(n),l=Ki(e,d);l&&!l.text?l=null:l&&l.changes&&(In(e,l,d,As(e)),e.curOp.forceUpdate=!0),l||(l=fi(e,n));var b=Va(l,n,d);return{line:n,view:l,rect:null,map:b.map,cache:b.cache,before:b.before,hasHeights:!1}}function ai(e,n,d,l,b){n.before&&(d=-1);var G=d+(l||""),te;return n.cache.hasOwnProperty(G)?te=n.cache[G]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ri(e,n.view,n.rect),n.hasHeights=!0),te=Es(e,n,d,l),te.bogus||(n.cache[G]=te)),{left:te.left,right:te.right,top:b?te.rtop:te.top,bottom:b?te.rbottom:te.bottom}}var Ji={left:0,right:0,top:0,bottom:0};function ys(e,n,d){for(var l,b,G,te,se,ue,be=0;be<e.length;be+=3)if(se=e[be],ue=e[be+1],n<se?(b=0,G=1,te="left"):n<ue?(b=n-se,G=b+1):(be==e.length-3||n==ue&&e[be+3]>n)&&(G=ue-se,b=G-1,n>=ue&&(te="right")),b!=null){if(l=e[be+2],se==ue&&d==(l.insertLeft?"left":"right")&&(te=d),d=="left"&&b==0)for(;be&&e[be-2]==e[be-3]&&e[be-1].insertLeft;)l=e[(be-=3)+2],te="left";if(d=="right"&&b==ue-se)for(;be<e.length-3&&e[be+3]==e[be+4]&&!e[be+5].insertLeft;)l=e[(be+=3)+2],te="right";break}return{node:l,start:b,end:G,collapse:te,coverStart:se,coverEnd:ue}}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 b=e.length-1;b>=0&&!((d=e[b]).left!=d.right);b--);return d}function Es(e,n,d,l){var b=ys(n.map,d,l),G=b.node,te=b.start,se=b.end,ue=b.collapse,be;if(G.nodeType==3){for(var je=0;je<4;je++){for(;te&&He(n.line.text.charAt(b.coverStart+te));)--te;for(;b.coverStart+se<b.coverEnd&&He(n.line.text.charAt(b.coverStart+se));)++se;if(Y&&V<9&&te==0&&se==b.coverEnd-b.coverStart?be=G.parentNode.getBoundingClientRect():be=bs(x(G,te,se).getClientRects(),l),be.left||be.right||te==0)break;se=te,te=te-1,ue="right"}Y&&V<11&&(be=co(e.display.measure,be))}else{te>0&&(ue=l="right");var $e;e.options.lineWrapping&&($e=G.getClientRects()).length>1?be=$e[l=="right"?$e.length-1:0]:be=G.getBoundingClientRect()}if(Y&&V<9&&!te&&(!be||!be.left&&!be.right)){var ct=G.parentNode.getClientRects()[0];ct?be={left:ct.left,right:ct.left+qi(e.display),top:ct.top,bottom:ct.bottom}:be=Ji}for(var st=be.top-n.rect.top,Ot=be.bottom-n.rect.top,Ht=(st+Ot)/2,rn=n.view.measure.heights,Tn=0;Tn<rn.length-1&&!(Ht<rn[Tn]);Tn++);var Yn=Tn?rn[Tn-1]:0,Sn=rn[Tn],ur={left:(ue=="right"?be.right:be.left)-n.rect.left,right:(ue=="left"?be.left:be.right)-n.rect.left,top:Yn,bottom:Sn};return!be.left&&!be.right&&(ur.bogus=!0),e.options.singleCursorHeightPerLine||(ur.rtop=st,ur.rbottom=Ot),ur}function co(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ar(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,E(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,b){if(!b){var G=ws(n);d.top+=G,d.bottom+=G}if(l=="line")return d;l||(l="local");var te=Nt(n);if(l=="local"?te+=Ti(e.display):te-=e.display.viewOffset,l=="page"||l=="window"){var se=e.display.lineSpace.getBoundingClientRect();te+=se.top+(l=="window"?0:po());var ue=se.left+(l=="window"?0:fo());d.left+=ue,d.right+=ue}return d.top+=te,d.bottom+=te,d}function Cs(e,n,d){if(d=="div")return n;var l=n.left,b=n.top;if(d=="page")l-=fo(),b-=po();else if(d=="local"||!d){var G=e.display.sizer.getBoundingClientRect();l+=G.left,b+=G.top}var te=e.display.lineSpace.getBoundingClientRect();return{left:l-te.left,top:b-te.top}}function Ts(e,n,d,l,b){return l||(l=at(e.doc,n.line)),$a(e,l,Xa(e,l,n.ch,b),d)}function xi(e,n,d,l,b,G){l=l||at(e.doc,n.line),b||(b=ki(e,l));function te(Ot,Ht){var rn=ai(e,b,Ot,Ht?"right":"left",G);return Ht?rn.left=rn.right:rn.right=rn.left,$a(e,l,rn,d)}var se=Xt(l,e.doc.direction),ue=n.ch,be=n.sticky;if(ue>=l.text.length?(ue=l.text.length,be="before"):ue<=0&&(ue=0,be="after"),!se)return te(be=="before"?ue-1:ue,be=="before");function je(Ot,Ht,rn){var Tn=se[Ht],Yn=Tn.level==1;return te(rn?Ot-1:Ot,Yn!=rn)}var $e=Ft(se,ue,be),ct=Lt,st=je(ue,$e,be=="before");return ct!=null&&(st.other=je(ue,ct,be!="before")),st}function mo(e,n){var d=0;n=Wt(e.doc,n),e.options.lineWrapping||(d=qi(e.display)*n.ch);var l=at(e.doc,n.line),b=Nt(l)+Ti(e.display);return{left:d,right:d,top:b,bottom:b+l.height}}function Ss(e,n,d,l,b){var G=ke(e,n,d);return G.xRel=b,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 b=ve(l,d),G=l.first+l.size-1;if(b>G)return Ss(l.first+l.size-1,at(l,G).text.length,null,1,1);n<0&&(n=0);for(var te=at(l,b);;){var se=El(e,te,b,n,d),ue=Bn(te,se.ch+(se.xRel>0||se.outside>0?1:0));if(!ue)return se;var be=ue.find(1);if(be.line==b)return be;te=at(l,b=be.line)}}function go(e,n,d,l){l-=ws(n);var b=n.text.length,G=ut(function(te){return ai(e,d,te-1).bottom<=l},b,0);return b=ut(function(te){return ai(e,d,te).top>l},G,b),{begin:G,end:b}}function vo(e,n,d,l){d||(d=ki(e,n));var b=$a(e,n,ai(e,d,l),"line").top;return go(e,n,d,b)}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,b){b-=Nt(n);var G=ki(e,n),te=ws(n),se=0,ue=n.text.length,be=!0,je=Xt(n,e.doc.direction);if(je){var $e=(e.options.lineWrapping?Ya:Ta)(e,n,d,G,je,l,b);be=$e.level!=1,se=be?$e.from:$e.to-1,ue=be?$e.to:$e.from-1}var ct=null,st=null,Ot=ut(function(Rr){var Cr=ai(e,G,Rr);return Cr.top+=te,Cr.bottom+=te,Os(Cr,l,b,!1)?(Cr.top<=b&&Cr.left<=l&&(ct=Rr,st=Cr),!0):!1},se,ue),Ht,rn,Tn=!1;if(st){var Yn=l-st.left<st.right-l,Sn=Yn==be;Ot=ct+(Sn?0:1),rn=Sn?"after":"before",Ht=Yn?st.left:st.right}else{!be&&(Ot==ue||Ot==se)&&Ot++,rn=Ot==0?"after":Ot==n.text.length?"before":ai(e,G,Ot-(be?1:0)).bottom+te<=b==be?"after":"before";var ur=xi(e,ke(d,Ot,rn),"line",n,G);Ht=ur.left,Tn=b<ur.top?-1:b>=ur.bottom?1:0}return Ot=Ke(n.text,Ot,1),Ss(d,Ot,rn,Tn,l-Ht)}function Ta(e,n,d,l,b,G,te){var se=ut(function($e){var ct=b[$e],st=ct.level!=1;return Os(xi(e,ke(d,st?ct.to:ct.from,st?"before":"after"),"line",n,l),G,te,!0)},0,b.length-1),ue=b[se];if(se>0){var be=ue.level!=1,je=xi(e,ke(d,be?ue.from:ue.to,be?"after":"before"),"line",n,l);Os(je,G,te,!0)&&je.top>te&&(ue=b[se-1])}return ue}function Ya(e,n,d,l,b,G,te){var se=go(e,n,l,te),ue=se.begin,be=se.end;/\s/.test(n.text.charAt(be-1))&&be--;for(var je=null,$e=null,ct=0;ct<b.length;ct++){var st=b[ct];if(st.from>=be||st.to<=ue)continue;var Ot=st.level!=1,Ht=ai(e,l,Ot?Math.min(be,st.to)-1:Math.max(ue,st.from)).right,rn=Ht<G?G-Ht+1e9:Ht-G;(!je||$e>rn)&&(je=st,$e=rn)}return je||(je=b[b.length-1]),je.from<ue&&(je={from:ue,to:je.to,level:je.level}),je.to>be&&(je={from:je.from,to:be,level:je.level}),je}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),E(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(),b=(l.right-l.left)/10;return b>2&&(e.cachedCharWidth=b),b||10}function As(e){for(var n=e.display,d={},l={},b=n.gutters.clientLeft,G=n.gutters.firstChild,te=0;G;G=G.nextSibling,++te){var se=e.display.gutterSpecs[te].className;d[se]=G.offsetLeft+G.clientLeft+b,l[se]=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(b){if(St(e.doc,b))return 0;var G=0;if(b.widgets)for(var te=0;te<b.widgets.length;te++)b.widgets[te].height&&(G+=b.widgets[te].height);return d?G+(Math.ceil(b.text.length/l)||1)*n:G+n}}function Ps(e){var n=e.doc,d=_o(e);n.iter(function(l){var b=d(l);b!=l.height&&Ie(l,b)})}function Gi(e,n,d,l){var b=e.display;if(!d&&Ne(n).getAttribute("cm-not-content")=="true")return null;var G,te,se=b.lineSpace.getBoundingClientRect();try{G=n.clientX-se.left,te=n.clientY-se.top}catch($e){return null}var ue=Rs(e,G,te),be;if(l&&ue.xRel>0&&(be=at(e.doc,ue.line).text).length==ue.ch){var je=H(be,be.length,e.options.tabSize)-be.length;ue=ke(ue.line,Math.max(0,Math.round((G-Si(e.display).left)/qi(e.display))-je))}return ue}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 b=e.display;if(l&&d<b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>n)&&(b.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=b.viewTo)Gt&&vn(e.doc,n)<b.viewTo&&Ni(e);else if(d<=b.viewFrom)Gt&&Zt(e.doc,d+l)>b.viewFrom?Ni(e):(b.viewFrom+=l,b.viewTo+=l);else if(n<=b.viewFrom&&d>=b.viewTo)Ni(e);else if(n<=b.viewFrom){var G=ea(e,d,d+l,1);G?(b.view=b.view.slice(G.index),b.viewFrom=G.lineN,b.viewTo+=l):Ni(e)}else if(d>=b.viewTo){var te=ea(e,n,n,-1);te?(b.view=b.view.slice(0,te.index),b.viewTo=te.lineN):Ni(e)}else{var se=ea(e,n,n,-1),ue=ea(e,d,d+l,1);se&&ue?(b.view=b.view.slice(0,se.index).concat(Et(e,se.lineN,ue.lineN)).concat(b.view.slice(ue.index)),b.viewTo+=l):Ni(e)}var be=b.externalMeasured;be&&(d<be.lineN?be.lineN+=l:n<be.lineN+be.size&&(b.externalMeasured=null))}function Mi(e,n,d){e.curOp.viewChanged=!0;var l=e.display,b=e.display.externalMeasured;if(b&&n>=b.lineN&&n<b.lineN+b.size&&(l.externalMeasured=null),n<l.viewFrom||n>=l.viewTo)return;var G=l.view[zi(e,n)];if(G.node==null)return;var te=G.changes||(G.changes=[]);ae(te,d)==-1&&te.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 b=zi(e,n),G,te=e.display.view;if(!Gt||d==e.doc.first+e.doc.size)return{index:b,lineN:d};for(var se=e.display.viewFrom,ue=0;ue<b;ue++)se+=te[ue].size;if(se!=n){if(l>0){if(b==te.length-1)return null;G=se+te[b].size-n,b++}else G=se-n;n+=G,d+=G}for(;vn(e.doc,d)!=d;){if(b==(l<0?0:te.length-1))return null;d+=l*te[b-(l<0?1:0)].size,b+=l}return{index:b,lineN:d}}function xl(e,n,d){var l=e.display,b=l.view;b.length==0||n>=l.viewTo||d<=l.viewFrom?(l.view=Et(e,n,d),l.viewFrom=n):(l.viewFrom>n?l.view=Et(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(Et(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 b=n[l];!b.hidden&&(!b.node||b.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={},b=l.cursors=document.createDocumentFragment(),G=l.selection=document.createDocumentFragment(),te=0;te<d.sel.ranges.length;te++){if(!n&&te==d.sel.primIndex)continue;var se=d.sel.ranges[te];if(se.from().line>=e.display.viewTo||se.to().line<e.display.viewFrom)continue;var ue=se.empty();(ue||e.options.showCursorWhenSelecting)&&yo(e,se.head,b),ue||bo(e,se,G)}return l}function yo(e,n,d){var l=xi(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),b=d.appendChild(f("div","\xA0","CodeMirror-cursor"));if(b.style.left=l.left+"px",b.style.top=l.top+"px",b.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var 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,b=e.doc,G=document.createDocumentFragment(),te=Si(e.display),se=te.left,ue=Math.max(l.sizerWidth,ei(e)-l.sizer.offsetLeft)-te.right,be=b.direction=="ltr";function je(Sn,ur,Rr,Cr){ur<0&&(ur=0),ur=Math.round(ur),Cr=Math.round(Cr),G.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Sn+`px;
|
|
top: `+ur+"px; width: "+(Rr==null?ue-Sn:Rr)+`px;
|
|
height: `+(Cr-ur)+"px"))}function $e(Sn,ur,Rr){var Cr=at(b,Sn),Dr=Cr.text.length,Wr,ri;function zr(Qr,vi){return Ts(e,ke(Sn,Qr),"div",Cr,vi)}function Ei(Qr,vi,oi){var qr=vo(e,Cr,null,Qr),Jr=vi=="ltr"==(oi=="after")?"left":"right",Xr=oi=="after"?qr.begin:qr.end-(/\s/.test(Cr.text.charAt(qr.end-1))?2:1);return zr(Xr,Jr)[Jr]}var gi=Xt(Cr,b.direction);return bt(gi,ur||0,Rr==null?Dr:Rr,function(Qr,vi,oi,qr){var Jr=oi=="ltr",Xr=zr(Qr,Jr?"left":"right"),_i=zr(vi-1,Jr?"right":"left"),vs=ur==null&&Qr==0,wa=Rr==null&&vi==Dr,di=qr==0,Hi=!gi||qr==gi.length-1;if(_i.top-Xr.top<=3){var ii=(be?vs:wa)&&di,nu=(be?wa:vs)&&Hi,Qi=ii?se:(Jr?Xr:_i).left,Ga=nu?ue:(Jr?_i:Xr).right;je(Qi,Xr.top,Ga-Qi,Xr.bottom)}else{var za,hi,_s,ru;Jr?(za=be&&vs&&di?se:Xr.left,hi=be?ue:Ei(Qr,oi,"before"),_s=be?se:Ei(vi,oi,"after"),ru=be&&wa&&Hi?ue:_i.right):(za=be?Ei(Qr,oi,"before"):se,hi=!be&&vs&&di?ue:Xr.right,_s=!be&&wa&&Hi?se:_i.left,ru=be?Ei(vi,oi,"after"):ue),je(za,Xr.top,hi-za,Xr.bottom),Xr.bottom<_i.top&&je(se,Xr.bottom,null,_i.top),je(_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 ct=n.from(),st=n.to();if(ct.line==st.line)$e(ct.line,ct.ch,st.ch);else{var Ot=at(b,ct.line),Ht=at(b,st.line),rn=Rn(Ot)==Rn(Ht),Tn=$e(ct.line,ct.ch,rn?Ot.text.length+1:null).end,Yn=$e(st.line,rn?0:null,st.ch).start;rn&&(Tn.top<Yn.top-2?(je(Tn.right,Tn.top,null,Tn.bottom),je(se,Yn.top,Yn.left,Yn.bottom)):je(Tn.right,Tn.top,Yn.left-Tn.right,Tn.bottom)),Tn.bottom<Yn.top&&je(se,Tn.bottom,null,Yn.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||(_e(e,"focus",e,n),e.state.focused=!0,W(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&&(_e(e,"blur",e,n),e.state.focused=!1,w(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 b=n.view[l],G=e.options.lineWrapping,te=void 0,se=0;if(b.hidden)continue;if(Y&&V<8){var ue=b.node.offsetTop+b.node.offsetHeight;te=ue-d,d=ue}else{var be=b.node.getBoundingClientRect();te=be.bottom-be.top,!G&&b.text.firstChild&&(se=b.text.firstChild.getBoundingClientRect().right-be.left-1)}var je=b.line.height-te;if((je>.005||je<-.005)&&(Ie(b.line,te),Ai(b.line),b.rest))for(var $e=0;$e<b.rest.length;$e++)Ai(b.rest[$e]);if(se>e.display.sizerWidth){var ct=Math.ceil(se/qi(e.display));ct>e.display.maxLineLength&&(e.display.maxLineLength=ct,e.display.maxLine=b.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 b=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,G=ve(n,l),te=ve(n,b);if(d&&d.ensure){var se=d.ensure.from.line,ue=d.ensure.to.line;se<G?(G=se,te=ve(n,Nt(at(n,se))+e.wrapper.clientHeight)):Math.min(ue,n.lastLine())>=te&&(G=ve(n,Nt(at(n,ue))-e.wrapper.clientHeight),te=ue)}return{from:G,to:Math.max(te,G+1)}}function xo(e,n){if(ie(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),b=null;if(n.top+l.top<0?b=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(b=!1),b!=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(b),e.display.lineSpace.removeChild(G)}}function Us(e,n,d,l){l==null&&(l=0);var b;!e.options.lineWrapping&&n==d&&(n=n.ch?ke(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,d=n.sticky=="before"?ke(n.line,n.ch+1,"before"):n);for(var G=0;G<5;G++){var te=!1,se=xi(e,n),ue=!d||d==n?se:xi(e,d);b={left:Math.min(se.left,ue.left),top:Math.min(se.top,ue.top)-l,right:Math.max(se.left,ue.left),bottom:Math.max(se.bottom,ue.bottom)+l};var be=qa(e,b),je=e.doc.scrollTop,$e=e.doc.scrollLeft;if(be.scrollTop!=null&&(aa(e,be.scrollTop),Math.abs(e.doc.scrollTop-je)>1&&(te=!0)),be.scrollLeft!=null&&(Di(e,be.scrollLeft),Math.abs(e.doc.scrollLeft-$e)>1&&(te=!0)),!te)break}return b}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 b=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,G=yi(e),te={};n.bottom-n.top>G&&(n.bottom=n.top+G);var se=e.doc.height+Kr(d),ue=n.top<l,be=n.bottom>se-l;if(n.top<b)te.scrollTop=ue?0:n.top;else if(n.bottom>b+G){var je=Math.min(n.top,(be?se:n.bottom)-G);je!=b&&(te.scrollTop=je)}var $e=e.options.fixedGutter?0:d.gutters.offsetWidth,ct=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-$e,st=ei(e)-d.gutters.offsetWidth,Ot=n.right-n.left>st;return Ot&&(n.right=n.left+st),n.left<10?te.scrollLeft=0:n.left<ct?te.scrollLeft=Math.max(0,n.left+$e-(Ot?0:10)):n.right>st+ct-3&&(te.scrollLeft=n.right+(Ot?0:10)-st),te}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 b=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,b.scrollLeft,b.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"),b=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=b.tabIndex=-1,e(l),e(b),Qe(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),Qe(b,"scroll",function(){b.clientWidth&&n(b.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Y&&V<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 b=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+b)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(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 J,this.disableVert=new J},Pi.prototype.enableZeroWidthBar=function(e,n,d){e.style.pointerEvents="auto";function l(){var b=e.getBoundingClientRect(),G=d=="vert"?document.elementFromPoint(b.right-1,(b.top+b.bottom)/2):document.elementFromPoint((b.right+b.left)/2,b.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 b=0;b<4&&d!=e.display.barWidth||l!=e.display.barHeight;b++)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&&w(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),Qe(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&&W(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},Jt(e.curOp)}function Xi(e){var n=e.curOp;n&&jn(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 b=0;b<n.length;b++)Fs(n[b]);for(var G=0;G<n.length;G++)Tl(n[G]);for(var te=0;te<n.length;te++)Do(n[te])}function oa(e){var n=e.cm,d=n.display;Sl(n),e.updateMaxLine&&zt(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==j();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 b=Us(n,Wt(l,e.scrollToPos.from),Wt(l,e.scrollToPos.to),e.scrollToPos.margin);xo(n,b)}var G=e.maybeHiddenMarkers,te=e.maybeUnhiddenMarkers;if(G)for(var se=0;se<G.length;++se)G[se].lines.length||_e(G[se],"hide");if(te)for(var ue=0;ue<te.length;++ue)te[ue].lines.length&&_e(te[ue],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&_e(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function ci(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,k(Bs,e))}function Bs(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=Ln(e,n.highlightFrontier),b=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(G){if(l.line>=e.display.viewFrom){var te=G.styles,se=G.text.length>e.options.maxHighlightLength?Zn(n.mode,l.state):null,ue=un(e,G,l,!0);se&&(l.state=se),G.styles=ue.styles;var be=G.styleClasses,je=ue.classes;je?G.styleClasses=je:be&&(G.styleClasses=null);for(var $e=!te||te.length!=G.styles.length||be!=je&&(!be||!je||be.bgClass!=je.bgClass||be.textClass!=je.textClass),ct=0;!$e&&ct<te.length;++ct)$e=te[ct]!=G.styles[ct];$e&&b.push(l.line),G.stateAfter=l.save(),l.nextLine()}else G.text.length<=e.options.maxHighlightLength&&hn(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),b.length&&ci(e,function(){for(var G=0;G<b.length;G++)Mi(e,b[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){ce(e,n)&&this.events.push(arguments)},Ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)_e.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=j();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==j())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 b=l.first+l.size,G=Math.max(n.visible.from-e.options.viewportMargin,l.first),te=Math.min(b,n.visible.to+e.options.viewportMargin);d.viewFrom<G&&G-d.viewFrom<20&&(G=Math.max(l.first,d.viewFrom)),d.viewTo>te&&d.viewTo-te<20&&(te=Math.min(b,d.viewTo)),Gt&&(G=vn(e.doc,G),te=Zt(e.doc,te));var se=G!=d.viewFrom||te!=d.viewTo||d.lastWrapHeight!=n.wrapperHeight||d.lastWrapWidth!=n.wrapperWidth;xl(e,G,te),d.viewOffset=Nt(at(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var ue=Ls(e);if(!se&&ue==0&&!n.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var be=Po(e);return ue>4&&(d.lineDiv.style.display="none"),Rl(e,d.updateLineNumbers,n.dims),ue>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,Oa(be),E(d.cursorDiv),E(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,se&&(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 b=sa(e);ta(e),Ui(e,b),$i(e,b),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,b=e.options.lineNumbers,G=l.lineDiv,te=G.firstChild;function se(Ot){var Ht=Ot.nextSibling;return r&&u&&e.display.currentWheelTarget==Ot?Ot.style.display="none":Ot.parentNode.removeChild(Ot),Ht}for(var ue=l.view,be=l.viewFrom,je=0;je<ue.length;je++){var $e=ue[je];if(!$e.hidden)if(!$e.node||$e.node.parentNode!=G){var ct=br(e,$e,be,d);G.insertBefore(ct,te)}else{for(;te!=$e.node;)te=se(te);var st=b&&n!=null&&n<=be&&$e.lineNumber;$e.changes&&(ae($e.changes,"gutter")>-1&&(st=!1),In(e,$e,be,d)),st&&(E($e.lineNumber),$e.lineNumber.appendChild(document.createTextNode(kt(e.options,be)))),te=$e.node.nextSibling}be+=$e.size}for(;te;)te=se(te)}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,b=n.gutters.offsetWidth,G=l+"px",te=0;te<d.length;te++)if(!d[te].hidden){e.options.fixedGutter&&(d[te].gutter&&(d[te].gutter.style.left=G),d[te].gutterBackground&&(d[te].gutterBackground.style.left=G));var se=d[te].alignable;if(se)for(var ue=0;ue<se.length;ue++)se[ue].style.left=G}e.options.fixedGutter&&(n.gutters.style.left=l+b+"px")}function ko(e){if(!e.options.lineNumbers)return!1;var n=e.doc,d=kt(e.options,n.first+n.size-1),l=e.display;if(d.length!=l.lineNumChars){var b=l.measure.appendChild(f("div",[f("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),G=b.firstChild.offsetWidth,te=b.offsetWidth-G;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(G,l.lineGutter.offsetWidth-te)+1,l.lineNumWidth=l.lineNumInnerWidth+te,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,b=0;b<e.length;b++){var G=e[b],te=null;if(typeof G!="string"&&(te=G.style,G=G.className),G=="CodeMirror-linenumbers")if(n)l=!0;else continue;d.push({className:G,style:te})}return n&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function Hs(e){var n=e.gutters,d=e.gutterSpecs;E(n),e.lineGutter=null;for(var l=0;l<d.length;++l){var b=d[l],G=b.className,te=b.style,se=n.appendChild(f("div",null,"CodeMirror-gutter "+G));te&&(se.style.cssText=te),G=="CodeMirror-linenumbers"&&(e.lineGutter=se,se.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 b=this;this.input=d,b.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),b.scrollbarFiller.setAttribute("cm-not-content","true"),b.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),b.gutterFiller.setAttribute("cm-not-content","true"),b.lineDiv=T("div",null,"CodeMirror-code"),b.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),b.cursorDiv=f("div",null,"CodeMirror-cursors"),b.measure=f("div",null,"CodeMirror-measure"),b.lineMeasure=f("div",null,"CodeMirror-measure"),b.lineSpace=T("div",[b.measure,b.lineMeasure,b.selectionDiv,b.cursorDiv,b.lineDiv],null,"position: relative; outline: none");var G=T("div",[b.lineSpace],"CodeMirror-lines");b.mover=f("div",[G],null,"position: relative"),b.sizer=f("div",[b.mover],"CodeMirror-sizer"),b.sizerWidth=null,b.heightForcer=f("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),b.gutters=f("div",null,"CodeMirror-gutters"),b.lineGutter=null,b.scroller=f("div",[b.sizer,b.heightForcer,b.gutters],"CodeMirror-scroll"),b.scroller.setAttribute("tabIndex","-1"),b.wrapper=f("div",[b.scrollbarFiller,b.gutterFiller,b.scroller],"CodeMirror"),Y&&V<8&&(b.gutters.style.zIndex=-1,b.scroller.style.paddingRight=0),!r&&!(B&&t)&&(b.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(b.wrapper):e(b.wrapper)),b.viewFrom=b.viewTo=n.first,b.reportedViewFrom=b.reportedViewTo=n.first,b.view=[],b.renderedView=null,b.externalMeasured=null,b.viewOffset=0,b.lastWrapHeight=b.lastWrapWidth=0,b.updateLineNumbers=null,b.nativeBarWidth=b.barHeight=b.barWidth=0,b.scrollbarsClipped=!1,b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null,b.alignWidgets=!1,b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.maxLine=null,b.maxLineLength=0,b.maxLineChanged=!1,b.wheelDX=b.wheelDY=b.wheelStartX=b.wheelStartY=null,b.shift=!1,b.selForContextMenu=null,b.activeTouch=null,b.gutterSpecs=Ws(l.gutters,l.lineNumbers),Hs(b),d.init(b)}var ua=0,pi=null;Y?pi=-.53:B?pi=15:m?pi=-.7:g&&(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,b=d.y,G=e.display,te=G.scroller,se=te.scrollWidth>te.clientWidth,ue=te.scrollHeight>te.clientHeight;if(!(l&&se||b&&ue))return;if(b&&u&&r){e:for(var be=n.target,je=G.view;be!=te;be=be.parentNode)for(var $e=0;$e<je.length;$e++)if(je[$e].node==be){e.display.currentWheelTarget=be;break e}}if(l&&!B&&!p&&pi!=null){b&&ue&&aa(e,Math.max(0,te.scrollTop+b*pi)),Di(e,Math.max(0,te.scrollLeft+l*pi)),(!b||b&&ue)&&de(n),G.wheelStartX=null;return}if(b&&pi!=null){var ct=b*pi,st=e.doc.scrollTop,Ot=st+G.wrapper.clientHeight;ct<0?st=Math.max(0,st+ct-50):Ot=Math.min(e.doc.height,Ot+ct+50),js(e,{top:st,bottom:Ot})}ua<20&&(G.wheelStartX==null?(G.wheelStartX=te.scrollLeft,G.wheelStartY=te.scrollTop,G.wheelDX=l,G.wheelDY=b,setTimeout(function(){if(G.wheelStartX==null)return;var Ht=te.scrollLeft-G.wheelStartX,rn=te.scrollTop-G.wheelStartY,Tn=rn&&G.wheelDY&&rn/G.wheelDY||Ht&&G.wheelDX&&Ht/G.wheelDX;if(G.wheelStartX=G.wheelStartY=null,!Tn)return;pi=(pi*ua+Tn)/(ua+1),++ua},200)):(G.wheelDX+=l,G.wheelDY+=b))}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(!Re(d.anchor,l.anchor)||!Re(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(an(this.ranges[n].anchor),an(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(dt(n,l.from())>=0&&dt(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,b=n[d];n.sort(function(ct,st){return dt(ct.from(),st.from())}),d=ae(n,b);for(var G=1;G<n.length;G++){var te=n[G],se=n[G-1],ue=dt(se.to(),te.from());if(l&&!te.empty()?ue>0:ue>=0){var be=mr(se.from(),te.from()),je=hr(se.to(),te.to()),$e=se.empty()?te.from()==te.head:se.from()==se.head;G<=d&&--d,n.splice(--G,2,new Nr($e?je:be,$e?be:je))}}return new mi(n,d)}function Fi(e,n){return new mi([new Nr(e,n||e)],0)}function Yi(e){return e.text?ke(e.from.line+e.text.length-1,v(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Uo(e,n){if(dt(e,n.from)<0)return e;if(dt(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),ke(d,l)}function Pa(e,n){for(var d=[],l=0;l<e.sel.ranges.length;l++){var b=e.sel.ranges[l];d.push(new Nr(Uo(b.anchor,n),Uo(b.head,n)))}return wi(e.cm,d,e.sel.primIndex)}function da(e,n,d){return e.line==n.line?ke(d.line,e.ch-n.ch+d.ch):ke(d.line+(e.line-n.line),e.ch)}function Al(e,n,d){for(var l=[],b=ke(e.first,0),G=b,te=0;te<n.length;te++){var se=n[te],ue=da(se.from,b,G),be=da(Yi(se),b,G);if(b=se.to,G=be,d=="around"){var je=e.sel.ranges[te],$e=dt(je.head,je.anchor)<0;l[te]=new Nr($e?be:ue,$e?ue:be)}else l[te]=new Nr(ue,ue)}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&&v(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ks(e,n,d,l){function b(Yn){return d?d[Yn]:null}function G(Yn,Sn,ur){sn(Yn,Sn,ur,l),jt(Yn,"change",Yn,n)}function te(Yn,Sn){for(var ur=[],Rr=Yn;Rr<Sn;++Rr)ur.push(new on(be[Rr],b(Rr),l));return ur}var se=n.from,ue=n.to,be=n.text,je=at(e,se.line),$e=at(e,ue.line),ct=v(be),st=b(be.length-1),Ot=ue.line-se.line;if(n.full)e.insert(0,te(0,be.length)),e.remove(be.length,e.size-be.length);else if(Fo(e,n)){var Ht=te(0,be.length-1);G($e,$e.text,st),Ot&&e.remove(se.line,Ot),Ht.length&&e.insert(se.line,Ht)}else if(je==$e)if(be.length==1)G(je,je.text.slice(0,se.ch)+ct+je.text.slice(ue.ch),st);else{var rn=te(1,be.length-1);rn.push(new on(ct+je.text.slice(ue.ch),st,l)),G(je,je.text.slice(0,se.ch)+be[0],b(0)),e.insert(se.line+1,rn)}else if(be.length==1)G(je,je.text.slice(0,se.ch)+be[0]+$e.text.slice(ue.ch),b(0)),e.remove(se.line+1,Ot);else{G(je,je.text.slice(0,se.ch)+be[0],b(0)),G($e,ct+$e.text.slice(ue.ch),st);var Tn=te(1,be.length-1);Ot>1&&e.remove(se.line+1,Ot-1),e.insert(se.line+1,Tn)}jt(e,"change",e,n)}function Ci(e,n,d){function l(b,G,te){if(b.linked)for(var se=0;se<b.linked.length;++se){var ue=b.linked[se];if(ue.doc==G)continue;var be=te&&ue.sharedHist;if(d&&!be)continue;n(ue.doc,be),l(ue.doc,b,be)}}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||zt(e),e.options.mode=n.modeOption,li(e)}function Bo(e){(e.doc.direction=="rtl"?W:w)(e.display.lineDiv,"CodeMirror-rtl")}function Dl(e){ci(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:an(n.from),to:Yi(n),text:Be(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=v(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return jo(e.done),v(e.done);if(e.done.length&&!v(e.done).ranges)return v(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),v(e.done)}function Wo(e,n,d,l){var b=e.history;b.undone.length=0;var G=+new Date,te,se;if((b.lastOp==l||b.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&b.lastModTime>G-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(te=Pl(b,b.lastOp==l)))se=v(te.changes),dt(n.from,n.to)==0&&dt(n.from,se.to)==0?se.to=Yi(n):te.changes.push(zs(e,n));else{var ue=v(b.done);for((!ue||!ue.ranges)&&ss(e.sel,b.done),te={changes:[zs(e,n)],generation:b.generation},b.done.push(te);b.done.length>b.undoDepth;)b.done.shift(),b.done[0].ranges||b.done.shift()}b.done.push(d),b.generation=++b.maxGeneration,b.lastModTime=b.lastSelTime=G,b.lastOp=b.lastSelOp=l,b.lastOrigin=b.lastSelOrigin=n.origin,se||_e(e,"historyAdded")}function Ll(e,n,d,l){var b=n.charAt(0);return b=="*"||b=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function as(e,n,d,l){var b=e.history,G=l&&l.origin;d==b.lastSelOp||G&&b.lastSelOrigin==G&&(b.lastModTime==b.lastSelTime&&b.lastOrigin==G||Ll(e,G,v(b.done),n))?b.done[b.done.length-1]=n:ss(n,b.done),b.lastSelTime=+new Date,b.lastSelOrigin=G,b.lastSelOp=d,l&&l.clearRedo!==!1&&jo(b.undone)}function ss(e,n){var d=v(n);d&&d.ranges&&d.equals(e)||n.push(e)}function Vs(e,n,d,l){var b=n["spans_"+e.id],G=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function(te){te.markedSpans&&((b||(b=n["spans_"+e.id]={}))[G]=te.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=[],b=0;b<n.text.length;++b)l.push(os(d[b]));return l}function Xs(e,n){var d=Ho(e,n),l=kn(e,n);if(!d)return l;if(!l)return d;for(var b=0;b<d.length;++b){var G=d[b],te=l[b];if(G&&te){e:for(var se=0;se<te.length;++se){for(var ue=te[se],be=0;be<G.length;++be)if(G[be].marker==ue.marker)continue e;G.push(ue)}}else te&&(d[b]=te)}return d}function ca(e,n,d){for(var l=[],b=0;b<e.length;++b){var G=e[b];if(G.ranges){l.push(d?mi.prototype.deepCopy.call(G):G);continue}var te=G.changes,se=[];l.push({changes:se});for(var ue=0;ue<te.length;++ue){var be=te[ue],je=void 0;if(se.push({from:be.from,to:be.to,text:be.text}),n)for(var $e in be)(je=$e.match(/^spans_(\d+)$/))&&(ae(n,Number(je[1]))>-1&&(v(se)[$e]=be[$e],delete be[$e]))}}return l}function ls(e,n,d,l){if(l){var b=e.anchor;if(d){var G=dt(n,b)<0;G!=dt(d,b)<0?(b=n,n=d):G!=dt(n,d)<0&&(n=d)}return new Nr(b,n)}else return new Nr(d||n,n)}function us(e,n,d,l,b){b==null&&(b=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new mi([ls(e.sel.primary(),n,d,b)],0),l)}function Ko(e,n,d){for(var l=[],b=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,b);var te=wi(e.cm,l,e.sel.primIndex);ni(e,te,d)}function Bi(e,n,d,l){var b=e.sel.ranges.slice(0);b[n]=d,ni(e,wi(e.cm,b,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(b){this.ranges=[];for(var G=0;G<b.length;G++)this.ranges[G]=new Nr(Wt(e,b[G].anchor),Wt(e,b[G].head))},origin:d&&d.origin};return _e(e,"beforeSelectionChange",e,l),e.cm&&_e(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,b=v(l);b&&b.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){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,d));var l=d&&d.bias||(dt(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,oe(e.cm)),jt(e,"cursorActivity",e)}function Xo(e){Vo(e,$o(e,e.sel,null,!1))}function $o(e,n,d,l){for(var b,G=0;G<n.ranges.length;G++){var te=n.ranges[G],se=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[G],ue=ds(e,te.anchor,se&&se.anchor,d,l),be=ds(e,te.head,se&&se.head,d,l);(b||ue!=te.anchor||be!=te.head)&&(b||(b=n.ranges.slice(0,G)),b[G]=new Nr(ue,be))}return b?wi(e.cm,b,n.primIndex):n}function fa(e,n,d,l,b){var G=at(e,n.line);if(G.markedSpans)for(var te=0;te<G.markedSpans.length;++te){var se=G.markedSpans[te],ue=se.marker,be="selectLeft"in ue?!ue.selectLeft:ue.inclusiveLeft,je="selectRight"in ue?!ue.selectRight:ue.inclusiveRight;if((se.from==null||(be?se.from<=n.ch:se.from<n.ch))&&(se.to==null||(je?se.to>=n.ch:se.to>n.ch))){if(b&&(_e(ue,"beforeCursorEnter"),ue.explicitlyCleared))if(G.markedSpans){--te;continue}else break;if(!ue.atomic)continue;if(d){var $e=ue.find(l<0?1:-1),ct=void 0;if((l<0?je:be)&&($e=Yo(e,$e,-l,$e&&$e.line==n.line?G:null)),$e&&$e.line==n.line&&(ct=dt($e,d))&&(l<0?ct<0:ct>0))return fa(e,$e,n,l,b)}var st=ue.find(l<0?-1:1);return(l<0?be:je)&&(st=Yo(e,st,l,st.line==n.line?G:null)),st?fa(e,st,n,l,b):null}}return n}function ds(e,n,d,l,b){var G=l||1,te=fa(e,n,d,G,b)||!b&&fa(e,n,d,G,!0)||fa(e,n,d,-G,b)||!b&&fa(e,n,d,-G,!0);return te||(e.cantEdit=!0,ke(e.first,0))}function Yo(e,n,d,l){return d<0&&n.ch==0?n.line>e.first?Wt(e,ke(n.line-1)):null:d>0&&n.ch==(l||at(e,n.line)).text.length?n.line<e.first+e.size-1?ke(n.line+1,0):null:new ke(n.line,n.ch+d)}function Qo(e){e.setSelection(ke(e.firstLine(),0),ke(e.lastLine()),Te)}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(b,G,te,se){b&&(l.from=Wt(e,b)),G&&(l.to=Wt(e,G)),te&&(l.text=te),se!==void 0&&(l.origin=se)}),_e(e,"beforeChange",e,l),e.cm&&_e(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((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(n=$s(e,n,!0),!n))return;var l=$t&&!d&&nr(e,n.from,n.to);if(l)for(var b=l.length-1;b>=0;--b)Jo(e,{from:l[b].from,to:l[b].to,text:b?[""]:n.text,origin:n.origin});else Jo(e,n)}function Jo(e,n){if(n.text.length==1&&n.text[0]==""&&dt(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,kn(e,n));var l=[];Ci(e,function(b,G){!G&&ae(l,b.history)==-1&&(tl(b.history,n),l.push(b.history)),ma(b,n,null,kn(b,n))})}function cs(e,n,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var b=e.history,G,te=e.sel,se=n=="undo"?b.done:b.undone,ue=n=="undo"?b.undone:b.done,be=0;be<se.length&&!(G=se[be],d?G.ranges&&!G.equals(e.sel):!G.ranges);be++);if(be==se.length)return;for(b.lastOrigin=b.lastSelOrigin=null;;)if(G=se.pop(),G.ranges){if(ss(G,ue),d&&!G.equals(e.sel)){ni(e,G,{clearRedo:!1});return}te=G}else if(l){se.push(G);return}else break;var je=[];ss(te,ue),ue.push({changes:je,generation:b.generation}),b.generation=G.generation||++b.maxGeneration;for(var $e=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),ct=function(Ht){var rn=G.changes[Ht];if(rn.origin=n,$e&&!$s(e,rn,!1))return se.length=0,{};je.push(zs(e,rn));var Tn=Ht?Pa(e,rn):v(se);ma(e,rn,Tn,Xs(e,rn)),!Ht&&e.cm&&e.cm.scrollIntoView({from:rn.from,to:Yi(rn)});var Yn=[];Ci(e,function(Sn,ur){!ur&&ae(Yn,Sn.history)==-1&&(tl(Sn.history,rn),Yn.push(Sn.history)),ma(Sn,rn,null,Xs(Sn,rn))})},st=G.changes.length-1;st>=0;--st){var Ot=ct(st);if(Ot)return Ot.v}}function Zo(e,n){if(n==0)return;if(e.first+=n,e.sel=new mi(L(e.sel.ranges,function(b){return new Nr(ke(b.anchor.line+n,b.anchor.ch),ke(b.head.line+n,b.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 b=n.text.length-1-(e.first-n.from.line);Zo(e,b),n={from:ke(e.first,0),to:ke(n.to.line+b,n.to.ch),text:[v(n.text)],origin:n.origin}}var G=e.lastLine();n.to.line>G&&(n={from:n.from,to:ke(G,at(e,G).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Be(e,n.from,n.to),d||(d=Pa(e,n)),e.cm?kl(e.cm,n,l):Ks(e,n,l),ha(e,d,Te),e.cantEdit&&ds(e,ke(e.firstLine(),0))&&(e.cantEdit=!1)}function kl(e,n,d){var l=e.doc,b=e.display,G=n.from,te=n.to,se=!1,ue=G.line;e.options.lineWrapping||(ue=xe(Rn(at(l,G.line))),l.iter(ue,te.line+1,function(st){if(st==b.maxLine)return se=!0,!0})),l.sel.contains(n.from,n.to)>-1&&oe(e),Ks(l,n,d,_o(e)),e.options.lineWrapping||(l.iter(ue,G.line+n.text.length,function(st){var Ot=At(st);Ot>b.maxLineLength&&(b.maxLine=st,b.maxLineLength=Ot,b.maxLineChanged=!0,se=!1)}),se&&(e.curOp.updateMaxLine=!0)),Bt(l,G.line),ti(e,400);var be=n.text.length-(te.line-G.line)-1;n.full?li(e):G.line==te.line&&n.text.length==1&&!Fo(e.doc,n)?Mi(e,G.line,"text"):li(e,G.line,te.line+1,be);var je=ce(e,"changes"),$e=ce(e,"change");if($e||je){var ct={from:G,to:te,text:n.text,removed:n.removed,origin:n.origin};$e&&jt(e,"change",e,ct),je&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ct)}e.display.selForContextMenu=null}function ga(e,n,d,l,b){var G;l||(l=d),dt(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:b})}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 b=0;b<e.length;++b){var G=e[b],te=!0;if(G.ranges){G.copied||(G=e[b]=G.deepCopy(),G.copied=!0);for(var se=0;se<G.ranges.length;se++)qo(G.ranges[se].anchor,n,d,l),qo(G.ranges[se].head,n,d,l);continue}for(var ue=0;ue<G.changes.length;++ue){var be=G.changes[ue];if(d<be.from.line)be.from=ke(be.from.line+l,be.from.ch),be.to=ke(be.to.line+l,be.to.ch);else if(n<=be.to.line){te=!1;break}}te||(e.splice(0,b+1),b=0)}}function tl(e,n){var d=n.from.line,l=n.to.line,b=n.text.length-(l-d)-1;el(e.done,d,l,b),el(e.undone,d,l,b)}function ka(e,n,d,l){var b=n,G=n;return typeof n=="number"?G=at(e,Kn(e,n)):b=xe(n),b==null?null:(l(G,b)&&e.cm&&Mi(e.cm,b,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 b=this.lines[d];this.height-=b.height,ft(b),jt(b,"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 b=e[l];n+=b.chunkSize(),d+=b.height,b.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],b=l.chunkSize();if(e<b){var G=Math.min(n,b-e),te=l.height;if(l.removeInner(e,G),this.height-=te-l.height,b==G&&(this.children.splice(d--,1),l.parent=null),(n-=G)==0)break;e=0}else e-=b}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof ji))){var se=[];this.collapse(se),this.children=[new ji(se)],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 b=this.children[l],G=b.chunkSize();if(e<=G){if(b.insertInner(e,n,d),b.lines&&b.lines.length>50){for(var te=b.lines.length%25+25,se=te;se<b.lines.length;){var ue=new ji(b.lines.slice(se,se+=25));b.height-=ue.height,this.children.splice(++l,0,ue),ue.parent=this}b.lines=b.lines.slice(0,te),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 b=ae(e.parent.children,e);e.parent.children.splice(b+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 b=this.children[l],G=b.chunkSize();if(e<G){var te=Math.min(n,G-e);if(b.iterN(e,te,d))return!0;if((n-=te)==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=xe(d);if(l==null||!n)return;for(var b=0;b<n.length;++b)n[b]==this&&n.splice(b--,1);n.length||(d.widgets=null);var G=Fr(this);Ie(d,Math.max(0,d.height-G)),e&&(ci(e,function(){nl(e,d,-G),Mi(e,l,"widget")}),jt(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 b=Fr(this)-n;if(!b)return;St(this.doc,l)||Ie(l,l.height+b),d&&ci(d,function(){d.curOp.forceUpdate=!0,nl(d,l,b),jt(d,"lineWidgetChanged",d,e,xe(l))})},we(Ma);function nl(e,n,d){Nt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&es(e,d)}function Ml(e,n,d,l){var b=new Ma(e,d,l),G=e.cm;return G&&b.noHScroll&&(G.display.alignWidgets=!0),ka(e,n,"widget",function(te){var se=te.widgets||(te.widgets=[]);if(b.insertAt==null?se.push(b):se.splice(Math.min(se.length-1,Math.max(0,b.insertAt)),0,b),b.line=te,G&&!St(e,te)){var ue=Nt(te)<e.scrollTop;Ie(te,te.height+Fr(b)),ue&&es(G,b.height),G.curOp.forceUpdate=!0}return!0}),G&&jt(G,"lineWidgetAdded",G,b,typeof n=="number"?n:xe(n)),b}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),ce(this,"clear")){var d=this.find();d&&jt(this,"clear",d.from,d.to)}for(var l=null,b=null,G=0;G<this.lines.length;++G){var te=this.lines[G],se=fn(te.markedSpans,this);e&&!this.collapsed?Mi(e,xe(te),"text"):e&&(se.to!=null&&(b=xe(te)),se.from!=null&&(l=xe(te))),te.markedSpans=Vn(te.markedSpans,se),se.from==null&&this.collapsed&&!St(this.doc,te)&&e&&Ie(te,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ue=0;ue<this.lines.length;++ue){var be=Rn(this.lines[ue]),je=At(be);je>e.display.maxLineLength&&(e.display.maxLine=be,e.display.maxLineLength=je,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&li(e,l,b+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&jt(e,"markerCleared",e,this,l,b),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,b=0;b<this.lines.length;++b){var G=this.lines[b],te=fn(G.markedSpans,this);if(te.from!=null&&(d=ke(n?G:xe(G),te.from),e==-1))return d;if(te.to!=null&&(l=ke(n?G:xe(G),te.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;ci(l,function(){var b=n.line,G=xe(n.line),te=Ki(l,G);if(te&&(ho(te),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!St(d.doc,b)&&d.height!=null){var se=d.height;d.height=null;var ue=Fr(d)-se;ue&&Ie(b,b.height+ue)}jt(l,"markerChanged",l,e)})},bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ae(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bi.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},we(bi);function _a(e,n,d,l,b){if(l&&l.shared)return Nl(e,n,d,l,b);if(e.cm&&!e.cm.curOp)return Gr(e.cm,_a)(e,n,d,l,b);var G=new bi(e,b),te=dt(n,d);if(l&&y(l,G,!1),te>0||te==0&&G.clearWhenEmpty!==!1)return G;if(G.replacedWith&&(G.collapsed=!0,G.widgetNode=T("span",[G.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||G.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(G.widgetNode.insertLeft=!0)),G.collapsed){if(_r(e,n.line,n,d,G)||n.line!=d.line&&_r(e,d.line,n,d,G))throw new Error("Inserting collapsed marker partially overlapping an existing one");er()}G.addToHistory&&Wo(e,{from:n,to:d,origin:"markText"},e.sel,NaN);var se=n.line,ue=e.cm,be;if(e.iter(se,d.line+1,function($e){ue&&G.collapsed&&!ue.options.lineWrapping&&Rn($e)==ue.display.maxLine&&(be=!0),G.collapsed&&se!=n.line&&Ie($e,0),dn($e,new An(G,se==n.line?n.ch:null,se==d.line?d.ch:null)),++se}),G.collapsed&&e.iter(n.line,d.line+1,function($e){St(e,$e)&&Ie($e,0)}),G.clearOnEnter&&Qe(G,"beforeCursorEnter",function(){return G.clear()}),G.readOnly&&(Dt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),G.collapsed&&(G.id=++rl,G.atomic=!0),ue){if(be&&(ue.curOp.updateMaxLine=!0),G.collapsed)li(ue,n.line,d.line+1);else if(G.className||G.startStyle||G.endStyle||G.css||G.attributes||G.title)for(var je=n.line;je<=d.line;je++)Mi(ue,je,"text");G.atomic&&Xo(ue.doc),jt(ue,"markerAdded",ue,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();jt(this,"clear")},ya.prototype.find=function(e,n){return this.primary.find(e,n)},we(ya);function Nl(e,n,d,l,b){l=y(l),l.shared=!1;var G=[_a(e,n,d,l,b)],te=G[0],se=l.widgetNode;return Ci(e,function(ue){se&&(l.widgetNode=se.cloneNode(!0)),G.push(_a(ue,Wt(ue,n),Wt(ue,d),l,b));for(var be=0;be<ue.linked.length;++be)if(ue.linked[be].isParent)return;te=v(G)}),new ya(G,te)}function il(e){return e.findMarks(ke(e.first,0),e.clipPos(ke(e.lastLine())),function(n){return n.parent})}function iu(e,n){for(var d=0;d<n.length;d++){var l=n[d],b=l.find(),G=e.clipPos(b.from),te=e.clipPos(b.to);if(dt(G,te)){var se=_a(e,G,te,l.primary,l.primary.type);l.markers.push(se),se.parent=l}}}function Ul(e){for(var n=function(l){var b=e[l],G=[b.primary.doc];Ci(b.primary.doc,function(ue){return G.push(ue)});for(var te=0;te<b.markers.length;te++){var se=b.markers[te];ae(G,se.doc)==-1&&(se.parent=null,b.markers.splice(te--,1))}},d=0;d<e.length;d++)n(d)}var Ys=0,ui=function(e,n,d,l,b){if(!(this instanceof ui))return new ui(e,n,d,l,b);d==null&&(d=0),va.call(this,[new ji([new on("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var G=ke(d,0);this.sel=Fi(G),this.history=new is(null),this.id=++Ys,this.modeOption=n,this.lineSep=l,this.direction=b=="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),Te)};ui.prototype=$(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=pt(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yr(function(e){var n=ke(this.first,0),d=this.first+this.size-1;pa(this,{from:n,to:ke(d,at(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),ni(this,Fi(n),Te)}),replaceRange:function(e,n,d,l){n=Wt(this,n),d=d?Wt(this,d):n,ga(this,e,n,d,l)},getRange:function(e,n,d){var l=Be(this,Wt(this,e),Wt(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(Hn(this,e))return at(this,e)},getLineNumber:function(e){return xe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=at(this,e)),Rn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Wt(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,Wt(this,typeof e=="number"?ke(e,n||0):e),null,d)}),setSelection:Yr(function(e,n,d){Go(this,Wt(this,e),Wt(this,n||e),d)}),extendSelection:Yr(function(e,n,d){us(this,Wt(this,e),n&&Wt(this,n),d)}),extendSelections:Yr(function(e,n){Ko(this,ht(this,e),n)}),extendSelectionsBy:Yr(function(e,n){var d=L(this.sel.ranges,e);Ko(this,ht(this,d),n)}),setSelections:Yr(function(e,n,d){if(!e.length)return;for(var l=[],b=0;b<e.length;b++)l[b]=new Nr(Wt(this,e[b].anchor),Wt(this,e[b].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(Wt(this,e),Wt(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 b=Be(this,n[l].from(),n[l].to());d=d?d.concat(b):b}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 b=Be(this,d[l].from(),d[l].to());e!==!1&&(b=b.join(e||this.lineSeparator())),n[l]=b}return n},replaceSelection:function(e,n,d){for(var l=[],b=0;b<this.sel.ranges.length;b++)l[b]=e;this.replaceSelections(l,n,d||"+input")},replaceSelections:Yr(function(e,n,d){for(var l=[],b=this.sel,G=0;G<b.ranges.length;G++){var te=b.ranges[G];l[G]={from:te.from(),to:te.to(),text:this.splitLines(e[G]),origin:d}}for(var se=n&&n!="end"&&Al(this,l,n),ue=l.length-1;ue>=0;ue--)pa(this,l[ue]);se?zo(this,se):this.cm&&ra(this.cm)}),undo:Yr(function(){cs(this,"undo")}),redo:Yr(function(){cs(this,"redo")}),undoSelection:Yr(function(){cs(this,"undo",!0)}),redoSelection:Yr(function(){cs(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 b=0;b<e.undone.length;b++)e.undone[b].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:ca(this.history.done),undone:ca(this.history.undone)}},setHistory:function(e){var n=this.history=new is(this.history.maxGeneration);n.done=ca(e.done.slice(0),null,!0),n.undone=ca(e.undone.slice(0),null,!0)},setGutterMarker:Yr(function(e,n,d){return ka(this,e,"gutter",function(l){var b=l.gutterMarkers||(l.gutterMarkers={});return b[n]=d,!d&&Ce(b)&&(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,Ce(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Hn(this,e))return null;if(n=e,e=at(this,e),!e)return null}else if(n=xe(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 b=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[b])l[b]=d;else{if(P(d).test(l[b]))return!1;l[b]+=" "+d}return!0})}),removeLineClass:Yr(function(e,n,d){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var b=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",G=l[b];if(G)if(d==null)l[b]=null;else{var te=G.match(P(d));if(!te)return!1;var se=te.index+te[0].length;l[b]=G.slice(0,te.index)+(!te.index||se==G.length?"":" ")+G.slice(se)||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,Wt(this,e),Wt(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=Wt(this,e),_a(this,e,e,d,"bookmark")},findMarksAt:function(e){e=Wt(this,e);var n=[],d=at(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var b=d[l];(b.from==null||b.from<=e.ch)&&(b.to==null||b.to>=e.ch)&&n.push(b.marker.parent||b.marker)}return n},findMarks:function(e,n,d){e=Wt(this,e),n=Wt(this,n);var l=[],b=e.line;return this.iter(e.line,n.line+1,function(G){var te=G.markedSpans;if(te)for(var se=0;se<te.length;se++){var ue=te[se];!(ue.to!=null&&b==e.line&&e.ch>=ue.to||ue.from==null&&b!=e.line||ue.from!=null&&b==n.line&&ue.from>=n.ch)&&(!d||d(ue.marker))&&l.push(ue.marker.parent||ue.marker)}++b}),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(b){var G=b.text.length+l;if(G>e)return n=e,!0;e-=G,++d}),Wt(this,ke(d,n))},indexFromPos:function(e){e=Wt(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(pt(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(pt(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(b){return l.push(b.id)},!0),e.history=new is(null),e.history.done=ca(this.history.done,l),e.history.undone=ca(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):Vt(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),ie(n,e)||kr(n.display,e))return;de(e),Y&&(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 b=l.length,G=Array(b),te=0,se=function(){++te==b&&Gr(n,function(){d=Wt(n.doc,d);var st={from:d,to:d,text:n.doc.splitLines(G.filter(function(Ot){return Ot!=null}).join(n.doc.lineSeparator())),origin:"paste"};pa(n.doc,st),zo(n.doc,Fi(Wt(n.doc,d),Wt(n.doc,Yi(st))))})()},ue=function(st,Ot){if(n.options.allowDropFileTypes&&ae(n.options.allowDropFileTypes,st.type)==-1){se();return}var Ht=new FileReader;Ht.onerror=function(){return se()},Ht.onload=function(){var rn=Ht.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(rn)){se();return}G[Ot]=rn,se()},Ht.readAsText(st)},be=0;be<l.length;be++)ue(l[be],be);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 je=e.dataTransfer.getData("Text");if(je){var $e;if(n.state.draggingText&&!n.state.draggingText.copy&&($e=n.listSelections()),ha(n.doc,Fi(d,d)),$e)for(var ct=0;ct<$e.length;++ct)ga(n.doc,"",$e[ct].anchor,$e[ct].head,"drag");n.replaceSelection(je,"around","paste"),n.display.input.focus()}}catch(st){}}}function sl(e,n){if(Y&&(!e.state.draggingText||+new Date-al<100)){le(n);return}if(ie(e,n)||kr(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!g){var d=f("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),n.dataTransfer.setDragImage(d,0,0),p&&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 b=n[l].CodeMirror;b&&d.push(b)}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;Qe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ol(jl)},100))}),Qe(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,b,G,te=0;te<n.length-1;te++){var se=n[te];if(/^(cmd|meta|m)$/i.test(se))G=!0;else if(/^a(lt)?$/i.test(se))d=!0;else if(/^(c|ctrl|control)$/i.test(se))l=!0;else if(/^s(hift)?$/i.test(se))b=!0;else throw new Error("Unrecognized modifier name: "+se)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),G&&(e="Cmd-"+e),b&&(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 b=L(d.split(" "),Wl),G=0;G<b.length;G++){var te=void 0,se=void 0;G==b.length-1?(se=b.join(" "),te=l):(se=b.slice(0,G+1).join(" "),te="...");var ue=n[se];if(!ue)n[se]=te;else if(ue!=te)throw new Error("Inconsistent bindings for "+se)}delete e[d]}for(var be in n)e[be]=n[be];return e}function Ii(e,n,d,l){n=Ba(n);var b=n.call?n.call(e,l):n[e];if(b===!1)return"nothing";if(b==="...")return"multi";if(b!=null&&d(b))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 te=Ii(e,n.fallthrough[G],d,l);if(te)return te}}}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),(R?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(R?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function fs(e,n){if(p&&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=[],b=0;b<d.length;b++){for(var G=n(d[b]);l.length&&dt(G.from,v(l).to)<=0;){var te=l.pop();if(dt(te.from,G.from)<0){G.from=te.from;break}}l.push(G)}ci(e,function(){for(var se=l.length-1;se>=0;se--)ga(e.doc,"",l[se].from,l[se].to,"+delete");ra(e)})}function qs(e,n,d){var l=Ke(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 ke(n.line,l,d<0?"after":"before")}function to(e,n,d,l,b){if(e){n.doc.direction=="rtl"&&(b=-b);var G=Xt(d,n.doc.direction);if(G){var te=b<0?v(G):G[0],se=b<0==(te.level==1),ue=se?"after":"before",be;if(te.level>0||n.doc.direction=="rtl"){var je=ki(n,d);be=b<0?d.text.length-1:0;var $e=ai(n,je,be).top;be=ut(function(ct){return ai(n,je,ct).top==$e},b<0==(te.level==1)?te.from:te.to-1,be),ue=="before"&&(be=qs(d,be,1))}else be=b<0?te.to:te.from;return new ke(l,be,ue)}}return new ke(l,b<0?d.text.length:0,b<0?"before":"after")}function no(e,n,d,l){var b=Xt(n,e.doc.direction);if(!b)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=Ft(b,d.ch,d.sticky),te=b[G];if(e.doc.direction=="ltr"&&te.level%2==0&&(l>0?te.to>d.ch:te.from<d.ch))return eo(n,d,l);var se=function(Tn,Yn){return qs(n,Tn instanceof ke?Tn.ch:Tn,Yn)},ue,be=function(Tn){return e.options.lineWrapping?(ue=ue||ki(e,n),vo(e,n,ue,Tn)):{begin:0,end:n.text.length}},je=be(d.sticky=="before"?se(d,-1):d.ch);if(e.doc.direction=="rtl"||te.level==1){var $e=te.level==1==l<0,ct=se(d,$e?1:-1);if(ct!=null&&($e?ct<=te.to&&ct<=je.end:ct>=te.from&&ct>=je.begin)){var st=$e?"before":"after";return new ke(d.line,ct,st)}}var Ot=function(Tn,Yn,Sn){for(var ur=function(Wr,ri){return ri?new ke(d.line,se(Wr,1),"before"):new ke(d.line,Wr,"after")};Tn>=0&&Tn<b.length;Tn+=Yn){var Rr=b[Tn],Cr=Yn>0==(Rr.level!=1),Dr=Cr?Sn.begin:se(Sn.end,-1);if(Rr.from<=Dr&&Dr<Rr.to)return ur(Dr,Cr);if(Dr=Cr?Rr.from:se(Rr.to,-1),Sn.begin<=Dr&&Dr<Sn.end)return ur(Dr,Cr)}},Ht=Ot(G+l,l,je);if(Ht)return Ht;var rn=l>0?je.end:se(je.begin,-1);return rn!=null&&!(l>0&&rn==n.text.length)&&(Ht=Ot(l>0?0:b.length-1,l,be(rn)),Ht)?Ht:null}var Ea={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return ba(e,function(n){if(n.empty()){var d=at(e.doc,n.head.line).text.length;return n.head.ch==d&&n.head.line<e.lastLine()?{from:n.head,to:ke(n.head.line+1,0)}:{from:n.head,to:ke(n.head.line,d)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ba(e,function(n){return{from:ke(n.from().line,0),to:Wt(e.doc,ke(n.to().line+1,0))}})},delLineLeft:function(e){return ba(e,function(n){return{from:ke(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(ke(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ke(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 dl(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")},Se)},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")},Se)},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/)?dl(e,n.head):l},Se)},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,b=0;b<d.length;b++){var G=d[b].from(),te=H(e.getLine(G.line),G.ch,l);n.push(Z(l-te%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ci(e,function(){for(var n=e.listSelections(),d=[],l=0;l<n.length;l++){if(!n[l].empty())continue;var b=n[l].head,G=at(e.doc,b.line).text;if(G){if(b.ch==G.length&&(b=new ke(b.line,b.ch-1)),b.ch>0)b=new ke(b.line,b.ch+1),e.replaceRange(G.charAt(b.ch-1)+G.charAt(b.ch-2),ke(b.line,b.ch-2),b,"+transpose");else if(b.line>e.doc.first){var te=at(e.doc,b.line-1).text;te&&(b=new ke(b.line,1),e.replaceRange(G.charAt(0)+e.doc.lineSeparator()+te.charAt(te.length-1),ke(b.line-1,te.length-1),b,"+transpose"))}}d.push(new Nr(b,b))}e.setSelections(d)})},newlineAndIndent:function(e){return ci(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=at(e.doc,n),l=Rn(d);return l!=d&&(n=xe(l)),to(!0,e,l,n,1)}function ro(e,n){var d=at(e.doc,n),l=En(d);return l!=d&&(n=xe(l)),to(!0,e,d,n,-1)}function dl(e,n){var d=ps(e,n.line),l=at(e.doc,d.line),b=Xt(l,e.doc.direction);if(!b||b[0].level==0){var G=Math.max(d.ch,l.text.search(/\S/)),te=n.line==d.line&&n.ch<=G&&n.ch;return ke(d.line,te?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,b=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),b=n(e)!=ge}finally{e.display.shift=l,e.state.suppressEdits=!1}return b}function Hl(e,n,d){for(var l=0;l<e.state.keyMaps.length;l++){var b=Ii(n,e.state.keyMaps[l],d,e);if(b)return b}return e.options.extraKeys&&Ii(n,e.options.extraKeys,d,e)||Ii(n,e.options.keyMap,d,e)}var Kl=new J;function ja(e,n,d,l){var b=e.state.keySeq;if(b){if(Fa(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Kl.set(50,function(){e.state.keySeq==b&&(e.state.keySeq=null,e.display.input.reset())}),io(e,b+" "+n,d,l))return!0}return io(e,n,d,l)}function io(e,n,d,l){var b=Hl(e,n,l);return b=="multi"&&(e.state.keySeq=n),b=="handled"&&jt(e,"keyHandled",e,n,d),(b=="handled"||b=="multi")&&(de(d),ks(e)),!!b}function cl(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=j(),ie(n,e))return;Y&&V<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;n.display.shift=d==16||e.shiftKey;var l=cl(n,e);p&&(ao=l?d:null,!l&&d==88&&!nn&&(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;W(n,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(w(n,"CodeMirror-crosshair"),xt(document,"keyup",d),xt(document,"mouseover",d))}Qe(document,"keyup",d),Qe(document,"mouseover",d)}function fl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ie(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(kr(n.display,e)||ie(n,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(p&&d==ao){ao=null,de(e);return}if(p&&(!e.which||e.which<10)&&cl(n,e))return;var b=String.fromCharCode(l==null?d:l);if(b=="\b")return;if(Gl(n,e,b))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&&dt(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(ie(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),b=We(e),G=l?Xl(l,b):"single";if(window.focus(),b==1&&n.state.selectingText&&n.state.selectingText(e),l&&ml(n,b,l,G,e))return;b==1?l?Yl(n,l,G,e):Ne(e)==d.scroller&&de(e):b==2?(l&&us(n.doc,l),setTimeout(function(){return d.input.focus()},20)):b==3&&(A?n.display.input.onContextMenu(e):Eo(n))}function ml(e,n,d,l,b){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,b),b,function(te){if(typeof te=="string"&&(te=Ea[te]),!te)return!1;var se=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),se=te(e,d)!=ge}finally{e.state.suppressEdits=!1}return se})}function $l(e,n,d){var l=e.getOption("configureMouse"),b=l?l(e,n,d):{};if(b.unit==null){var G=o?d.shiftKey&&d.metaKey:d.altKey;b.unit=G?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(b.extend==null||e.doc.extend)&&(b.extend=e.doc.extend||d.shiftKey),b.addNew==null&&(b.addNew=u?d.metaKey:d.ctrlKey),b.moveOnDrag==null&&(b.moveOnDrag=!(u?d.altKey:d.ctrlKey)),b}function Yl(e,n,d,l){Y?setTimeout(k(Ms,e),0):e.curOp.focus=j();var b=$l(e,d,l),G=e.doc.sel,te;e.options.dragDrop&<&&!e.isReadOnly()&&d=="single"&&(te=G.contains(n))>-1&&(dt((te=G.ranges[te]).from(),n)<0||n.xRel>0)&&(dt(te.to(),n)>0||n.xRel<0)?Ql(e,l,n,b):Jl(e,l,n,b)}function Ql(e,n,d,l){var b=e.display,G=!1,te=Gr(e,function(be){r&&(b.scroller.draggable=!1),e.state.draggingText=!1,xt(b.wrapper.ownerDocument,"mouseup",te),xt(b.wrapper.ownerDocument,"mousemove",se),xt(b.scroller,"dragstart",ue),xt(b.scroller,"drop",te),G||(de(be),l.addNew||us(e.doc,d,null,null,l.extend),r&&!g||Y&&V==9?setTimeout(function(){b.wrapper.ownerDocument.body.focus({preventScroll:!0}),b.input.focus()},20):b.input.focus())}),se=function(be){G=G||Math.abs(n.clientX-be.clientX)+Math.abs(n.clientY-be.clientY)>=10},ue=function(){return G=!0};r&&(b.scroller.draggable=!0),e.state.draggingText=te,te.copy=!l.moveOnDrag,b.scroller.dragDrop&&b.scroller.dragDrop(),Qe(b.wrapper.ownerDocument,"mouseup",te),Qe(b.wrapper.ownerDocument,"mousemove",se),Qe(b.scroller,"dragstart",ue),Qe(b.scroller,"drop",te),Eo(e),setTimeout(function(){return b.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(ke(n.line,0),Wt(e.doc,ke(n.line+1,0)));var l=d(e,n);return new Nr(l.from,l.to)}function Jl(e,n,d,l){var b=e.display,G=e.doc;de(n);var te,se,ue=G.sel,be=ue.ranges;if(l.addNew&&!l.extend?(se=G.sel.contains(d),se>-1?te=be[se]:te=new Nr(d,d)):(te=G.sel.primary(),se=G.sel.primIndex),l.unit=="rectangle")l.addNew||(te=new Nr(d,d)),d=Gi(e,n,!0,!0),se=-1;else{var je=lo(e,d,l.unit);l.extend?te=ls(te,je.anchor,je.head,l.extend):te=je}l.addNew?se==-1?(se=be.length,ni(G,wi(e,be.concat([te]),se),{scroll:!1,origin:"*mouse"})):be.length>1&&be[se].empty()&&l.unit=="char"&&!l.extend?(ni(G,wi(e,be.slice(0,se).concat(be.slice(se+1)),0),{scroll:!1,origin:"*mouse"}),ue=G.sel):Bi(G,se,te,Ue):(se=0,ni(G,new mi([te],0),Ue),ue=G.sel);var $e=d;function ct(Sn){if(dt($e,Sn)==0)return;if($e=Sn,l.unit=="rectangle"){for(var ur=[],Rr=e.options.tabSize,Cr=H(at(G,d.line).text,d.ch,Rr),Dr=H(at(G,Sn.line).text,Sn.ch,Rr),Wr=Math.min(Cr,Dr),ri=Math.max(Cr,Dr),zr=Math.min(d.line,Sn.line),Ei=Math.min(e.lastLine(),Math.max(d.line,Sn.line));zr<=Ei;zr++){var gi=at(G,zr).text,Qr=Le(gi,Wr,Rr);Wr==ri?ur.push(new Nr(ke(zr,Qr),ke(zr,Qr))):gi.length>Qr&&ur.push(new Nr(ke(zr,Qr),ke(zr,Le(gi,ri,Rr))))}ur.length||ur.push(new Nr(d,d)),ni(G,wi(e,ue.ranges.slice(0,se).concat(ur),se),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Sn)}else{var vi=te,oi=lo(e,Sn,l.unit),qr=vi.anchor,Jr;dt(oi.anchor,qr)>0?(Jr=oi.head,qr=mr(vi.from(),oi.anchor)):(Jr=oi.anchor,qr=hr(vi.to(),oi.head));var Xr=ue.ranges.slice(0);Xr[se]=Zl(e,new Nr(Wt(G,qr),Jr)),ni(G,wi(e,Xr,se),Ue)}}var st=b.wrapper.getBoundingClientRect(),Ot=0;function Ht(Sn){var ur=++Ot,Rr=Gi(e,Sn,!0,l.unit=="rectangle");if(!Rr)return;if(dt(Rr,$e)!=0){e.curOp.focus=j(),ct(Rr);var Cr=Za(b,G);(Rr.line>=Cr.to||Rr.line<Cr.from)&&setTimeout(Gr(e,function(){Ot==ur&&Ht(Sn)}),150)}else{var Dr=Sn.clientY<st.top?-20:Sn.clientY>st.bottom?20:0;Dr&&setTimeout(Gr(e,function(){if(Ot!=ur)return;b.scroller.scrollTop+=Dr,Ht(Sn)}),50)}}function rn(Sn){e.state.selectingText=!1,Ot=Infinity,Sn&&(de(Sn),b.input.focus()),xt(b.wrapper.ownerDocument,"mousemove",Tn),xt(b.wrapper.ownerDocument,"mouseup",Yn),G.history.lastSelOrigin=null}var Tn=Gr(e,function(Sn){Sn.buttons===0||!We(Sn)?rn(Sn):Ht(Sn)}),Yn=Gr(e,rn);e.state.selectingText=Yn,Qe(b.wrapper.ownerDocument,"mousemove",Tn),Qe(b.wrapper.ownerDocument,"mouseup",Yn)}function Zl(e,n){var d=n.anchor,l=n.head,b=at(e.doc,d.line);if(dt(d,l)==0&&d.sticky==l.sticky)return n;var G=Xt(b);if(!G)return n;var te=Ft(G,d.ch,d.sticky),se=G[te];if(se.from!=d.ch&&se.to!=d.ch)return n;var ue=te+(se.from==d.ch==(se.level!=1)?0:1);if(ue==0||ue==G.length)return n;var be;if(l.line!=d.line)be=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var je=Ft(G,l.ch,l.sticky),$e=je-te||(l.ch-d.ch)*(se.level==1?-1:1);je==ue-1||je==ue?be=$e<0:be=$e>0}var ct=G[ue+(be?-1:0)],st=be==(ct.level==1),Ot=st?ct.from:ct.to,Ht=st?"after":"before";return d.ch==Ot&&d.sticky==Ht?n:new Nr(new ke(d.line,Ot,Ht),l)}function gl(e,n,d,l){var b,G;if(n.touches)b=n.touches[0].clientX,G=n.touches[0].clientY;else try{b=n.clientX,G=n.clientY}catch(ct){return!1}if(b>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&de(n);var te=e.display,se=te.lineDiv.getBoundingClientRect();if(G>se.bottom||!ce(e,d))return Oe(n);G-=se.top-te.viewOffset;for(var ue=0;ue<e.display.gutterSpecs.length;++ue){var be=te.gutters.childNodes[ue];if(be&&be.getBoundingClientRect().right>=b){var je=ve(e.doc,G),$e=e.display.gutterSpecs[ue];return _e(e,d,e,je,$e.className,n),Oe(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(ie(e,n,"contextmenu"))return;A||e.display.input.onContextMenu(n)}function _l(e,n){return ce(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,b,G,te){e.defaults[l]=b,G&&(n[l]=te?function(se,ue,be){be!=xa&&G(se,ue,be)}:G)}e.defineOption=d,e.Init=xa,d("value","",function(l,b){return l.setValue(b)},!0),d("mode",null,function(l,b){l.doc.modeOption=b,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,b){if(l.doc.lineSep=b,!b)return;var G=[],te=l.doc.first;l.doc.iter(function(ue){for(var be=0;;){var je=ue.text.indexOf(b,be);if(je==-1)break;be=je+b.length,G.push(ke(te,je))}te++});for(var se=G.length-1;se>=0;se--)ga(l.doc,b,G[se],ke(G[se].line,G[se].ch+b.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,b,G){l.state.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),G!=xa&&l.refresh()}),d("specialCharPlaceholder",ot,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,b){return l.getInputField().spellcheck=b},!0),d("autocorrect",!1,function(l,b){return l.getInputField().autocorrect=b},!0),d("autocapitalize",!1,function(l,b){return l.getInputField().autocapitalize=b},!0),d("rtlMoveVisually",!O),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){yl(l),Da(l)},!0),d("keyMap","default",function(l,b,G){var te=Ba(b),se=G!=xa&&Ba(G);se&&se.detach&&se.detach(l,te),te.attach&&te.attach(l,se||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,tu,!0),d("gutters",[],function(l,b){l.display.gutterSpecs=Ws(b,l.options.lineNumbers),Da(l)},!0),d("fixedGutter",!0,function(l,b){l.display.gutters.style.left=b?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,b){l.display.gutterSpecs=Ws(l.options.gutters,b),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,b){b=="nocursor"&&(na(l),l.display.input.blur()),l.display.input.readOnlyChanged(b)}),d("screenReaderLabel",null,function(l,b){b=b===""?null:b,l.display.input.screenReaderLabelChanged(b)}),d("disableInput",!1,function(l,b){b||l.display.input.reset()},!0),d("dragDrop",!0,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,b){return l.doc.history.undoDepth=b}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,Ia,!0),d("moveInputWithCursor",!0,function(l,b){b||l.display.input.resetPosition()}),d("tabindex",null,function(l,b){return l.display.input.getField().tabIndex=b||""}),d("autofocus",null),d("direction","ltr",function(l,b){return l.doc.setDirection(b)},!0),d("phrases",null)}function eu(e,n,d){var l=d&&d!=xa;if(!n!=!l){var b=e.display.dragFunctions,G=n?Qe:xt;G(e.display.scroller,"dragstart",b.start),G(e.display.scroller,"dragenter",b.enter),G(e.display.scroller,"dragover",b.over),G(e.display.scroller,"dragleave",b.leave),G(e.display.scroller,"drop",b.drop)}}function tu(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),zt(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?y(n):{},y(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 b=new Hr.inputStyles[n.inputStyle](this),G=this.display=new Ol(e,l,b,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 J,keySeq:null,specialChars:null},n.autofocus&&!t&&G.input.focus(),Y&&V<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 te in Ka)Ka.hasOwnProperty(te)&&Ka[te](this,n[te],xa);ko(this),n.finishInit&&n.finishInit(this);for(var se=0;se<I.length;++se)I[se](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;Qe(n.scroller,"mousedown",Gr(e,oo)),Y&&V<11?Qe(n.scroller,"dblclick",Gr(e,function(ue){if(ie(e,ue))return;var be=Gi(e,ue);if(!be||uo(e,ue)||kr(e.display,ue))return;de(ue);var je=e.findWordAt(be);us(e.doc,je.anchor,je.head)})):Qe(n.scroller,"dblclick",function(ue){return ie(e,ue)||de(ue)}),Qe(n.scroller,"contextmenu",function(ue){return vl(e,ue)}),Qe(n.input.getField(),"contextmenu",function(ue){n.scroller.contains(ue.target)||vl(e,ue)});var d,l={end:0};function b(){n.activeTouch&&(d=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function G(ue){if(ue.touches.length!=1)return!1;var be=ue.touches[0];return be.radiusX<=1&&be.radiusY<=1}function te(ue,be){if(be.left==null)return!0;var je=be.left-ue.left,$e=be.top-ue.top;return je*je+$e*$e>20*20}Qe(n.scroller,"touchstart",function(ue){if(!ie(e,ue)&&!G(ue)&&!uo(e,ue)){n.input.ensurePolled(),clearTimeout(d);var be=+new Date;n.activeTouch={start:be,moved:!1,prev:be-l.end<=300?l:null},ue.touches.length==1&&(n.activeTouch.left=ue.touches[0].pageX,n.activeTouch.top=ue.touches[0].pageY)}}),Qe(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Qe(n.scroller,"touchend",function(ue){var be=n.activeTouch;if(be&&!kr(n,ue)&&be.left!=null&&!be.moved&&new Date-be.start<300){var je=e.coordsChar(n.activeTouch,"page"),$e;!be.prev||te(be,be.prev)?$e=new Nr(je,je):!be.prev.prev||te(be,be.prev.prev)?$e=e.findWordAt(je):$e=new Nr(ke(je.line,0),Wt(e.doc,ke(je.line+1,0))),e.setSelection($e.anchor,$e.head),e.focus(),de(ue)}b()}),Qe(n.scroller,"touchcancel",b),Qe(n.scroller,"scroll",function(){n.scroller.clientHeight&&(aa(e,n.scroller.scrollTop),Di(e,n.scroller.scrollLeft,!0),_e(e,"scroll",e))}),Qe(n.scroller,"mousewheel",function(ue){return No(e,ue)}),Qe(n.scroller,"DOMMouseScroll",function(ue){return No(e,ue)}),Qe(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(ue){ie(e,ue)||le(ue)},over:function(ue){ie(e,ue)||(Bl(e,ue),le(ue))},start:function(ue){return sl(e,ue)},drop:Gr(e,Fl),leave:function(ue){ie(e,ue)||Qs(e)}};var se=n.input.getField();Qe(se,"keyup",function(ue){return fl.call(e,ue)}),Qe(se,"keydown",Gr(e,hl)),Qe(se,"keypress",Gr(e,pl)),Qe(se,"focus",function(ue){return Ns(e,ue)}),Qe(se,"blur",function(ue){return na(e,ue)})}var I=[];Hr.defineInitHook=function(e){return I.push(e)};function N(e,n,d,l){var b=e.doc,G;d==null&&(d="add"),d=="smart"&&(b.mode.indent?G=Ln(e,n).state:d="prev");var te=e.options.tabSize,se=at(b,n),ue=H(se.text,null,te);se.stateAfter&&(se.stateAfter=null);var be=se.text.match(/^\s*/)[0],je;if(!l&&!/\S/.test(se.text))je=0,d="not";else if(d=="smart"&&(je=b.mode.indent(G,se.text.slice(be.length),se.text),je==ge||je>150)){if(!l)return;d="prev"}d=="prev"?n>b.first?je=H(at(b,n-1).text,null,te):je=0:d=="add"?je=ue+e.options.indentUnit:d=="subtract"?je=ue-e.options.indentUnit:typeof d=="number"&&(je=ue+d),je=Math.max(0,je);var $e="",ct=0;if(e.options.indentWithTabs)for(var st=Math.floor(je/te);st;--st)ct+=te,$e+=" ";if(ct<je&&($e+=Z(je-ct)),$e!=be)return ga(b,$e,ke(n,0),ke(n,be.length),"+input"),se.stateAfter=null,!0;for(var Ot=0;Ot<b.sel.ranges.length;Ot++){var Ht=b.sel.ranges[Ot];if(Ht.head.line==n&&Ht.head.ch<be.length){var rn=ke(n,be.length);Bi(b,Ot,new Nr(rn,rn));break}}}var X=null;function re(e){X=e}function pe(e,n,d,l,b){var G=e.doc;e.display.shift=!1,l||(l=G.sel);var te=+new Date-200,se=b=="paste"||e.state.pasteIncoming>te,ue=Vt(n),be=null;if(se&&l.ranges.length>1)if(X&&X.text.join(`
|
|
`)==n){if(l.ranges.length%X.text.length==0){be=[];for(var je=0;je<X.text.length;je++)be.push(G.splitLines(X.text[je]))}}else ue.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(be=L(ue,function(Tn){return[Tn]}));for(var $e=e.curOp.updateInput,ct=l.ranges.length-1;ct>=0;ct--){var st=l.ranges[ct],Ot=st.from(),Ht=st.to();st.empty()&&(d&&d>0?Ot=ke(Ot.line,Ot.ch-d):e.state.overwrite&&!se?Ht=ke(Ht.line,Math.min(at(G,Ht.line).text.length,Ht.ch+v(ue).length)):se&&X&&X.lineWise&&X.text.join(`
|
|
`)==ue.join(`
|
|
`)&&(Ot=Ht=ke(Ot.line,0)));var rn={from:Ot,to:Ht,text:be?be[ct%be.length]:ue,origin:b||(se?"paste":e.state.cutIncoming>te?"cut":"+input")};pa(e.doc,rn),jt(e,"inputRead",e,rn)}n&&!se&&Ae(e,n),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=$e),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function me(e,n){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&ci(n,function(){return pe(n,d,0,null,"paste")}),!0}function Ae(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 b=d.ranges[l];if(b.head.ch>100||l&&d.ranges[l-1].head.line==b.head.line)continue;var G=e.getModeAt(b.head),te=!1;if(G.electricChars){for(var se=0;se<G.electricChars.length;se++)if(n.indexOf(G.electricChars.charAt(se))>-1){te=N(e,b.head.line,"smart");break}}else G.electricInput&&(G.electricInput.test(at(e.doc,b.head.line).text.slice(0,b.head.ch))&&(te=N(e,b.head.line,"smart")));te&&jt(e,"electricInput",e,b.head.line)}}function De(e){for(var n=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var b=e.doc.sel.ranges[l].head.line,G={anchor:ke(b,0),head:ke(b+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 nt(){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 it(e){var n=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,b){var G=this.options,te=G[l];if(G[l]==b&&l!="mode")return;G[l]=b,n.hasOwnProperty(l)&&Gr(this,n[l])(this,b,te),_e(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,b){this.state.keyMaps[b?"push":"unshift"](Ba(l))},removeKeyMap:function(l){for(var b=this.state.keyMaps,G=0;G<b.length;++G)if(b[G]==l||b[G].name==l)return b.splice(G,1),!0},addOverlay:si(function(l,b){var G=l.token?l:e.getMode(this.options,l);if(G.startState)throw new Error("Overlays may not be stateful.");z(this.state.overlays,{mode:G,modeSpec:l,opaque:b&&b.opaque,priority:b&&b.priority||0},function(te){return te.priority}),this.state.modeGen++,li(this)}),removeOverlay:si(function(l){for(var b=this.state.overlays,G=0;G<b.length;++G){var te=b[G].modeSpec;if(te==l||typeof l=="string"&&te.name==l){b.splice(G,1),this.state.modeGen++,li(this);return}}}),indentLine:si(function(l,b,G){typeof b!="string"&&typeof b!="number"&&(b==null?b=this.options.smartIndent?"smart":"prev":b=b?"add":"subtract"),Hn(this.doc,l)&&N(this,l,b,G)}),indentSelection:si(function(l){for(var b=this.doc.sel.ranges,G=-1,te=0;te<b.length;te++){var se=b[te];if(se.empty())se.head.line>G&&(N(this,se.head.line,l,!0),G=se.head.line,te==this.doc.sel.primIndex&&ra(this));else{var ue=se.from(),be=se.to(),je=Math.max(G,ue.line);G=Math.min(this.lastLine(),be.line-(be.ch?0:1))+1;for(var $e=je;$e<G;++$e)N(this,$e,l);var ct=this.doc.sel.ranges;ue.ch==0&&b.length==ct.length&&ct[te].from().ch>0&&Bi(this.doc,te,new Nr(ue,ct[te].to()),Te)}}}),getTokenAt:function(l,b){return sr(this,l,b)},getLineTokens:function(l,b){return sr(this,ke(l),b,!0)},getTokenTypeAt:function(l){l=Wt(this.doc,l);var b=Qt(this,at(this.doc,l.line)),G=0,te=(b.length-1)/2,se=l.ch,ue;if(se==0)ue=b[2];else for(;;){var be=G+te>>1;if((be?b[be*2-1]:0)>=se)te=be;else if(b[be*2+1]<se)G=be+1;else{ue=b[be*2+2];break}}var je=ue?ue.indexOf("overlay "):-1;return je<0?ue:je==0?null:ue.slice(0,je-1)},getModeAt:function(l){var b=this.doc.mode;return b.innerMode?e.innerMode(b,this.getTokenAt(l).state).mode:b},getHelper:function(l,b){return this.getHelpers(l,b)[0]},getHelpers:function(l,b){var G=[];if(!d.hasOwnProperty(b))return G;var te=d[b],se=this.getModeAt(l);if(typeof se[b]=="string")te[se[b]]&&G.push(te[se[b]]);else if(se[b])for(var ue=0;ue<se[b].length;ue++){var be=te[se[b][ue]];be&&G.push(be)}else se.helperType&&te[se.helperType]?G.push(te[se.helperType]):te[se.name]&&G.push(te[se.name]);for(var je=0;je<te._global.length;je++){var $e=te._global[je];$e.pred(se,this)&&ae(G,$e.val)==-1&&G.push($e.val)}return G},getStateAfter:function(l,b){var G=this.doc;return l=Kn(G,l==null?G.first+G.size-1:l),Ln(this,l+1,b).state},cursorCoords:function(l,b){var G,te=this.doc.sel.primary();return l==null?G=te.head:typeof l=="object"?G=Wt(this.doc,l):G=l?te.from():te.to(),xi(this,G,b||"page")},charCoords:function(l,b){return Ts(this,Wt(this.doc,l),b||"page")},coordsChar:function(l,b){return l=Cs(this,l,b||"page"),Rs(this,l.left,l.top)},lineAtHeight:function(l,b){return l=Cs(this,{top:l,left:0},b||"page").top,ve(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,b,G){var te=!1,se;if(typeof l=="number"){var ue=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>ue&&(l=ue,te=!0),se=at(this.doc,l)}else se=l;return $a(this,se,{top:0,left:0},b||"page",G||te).top+(te?this.doc.height-Nt(se):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,b,G,te,se){var ue=this.display;l=xi(this,Wt(this.doc,l));var be=l.bottom,je=l.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),ue.sizer.appendChild(b),te=="over")be=l.top;else if(te=="above"||te=="near"){var $e=Math.max(ue.wrapper.clientHeight,this.doc.height),ct=Math.max(ue.sizer.clientWidth,ue.lineSpace.clientWidth);(te=="above"||l.bottom+b.offsetHeight>$e)&&l.top>b.offsetHeight?be=l.top-b.offsetHeight:l.bottom+b.offsetHeight<=$e&&(be=l.bottom),je+b.offsetWidth>ct&&(je=ct-b.offsetWidth)}b.style.top=be+"px",b.style.left=b.style.right="",se=="right"?(je=ue.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):(se=="left"?je=0:se=="middle"&&(je=(ue.sizer.clientWidth-b.offsetWidth)/2),b.style.left=je+"px"),G&&wl(this,{left:je,top:be,right:je+b.offsetWidth,bottom:be+b.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){Ae(this,l)}),findPosH:function(l,b,G,te){var se=1;b<0&&(se=-1,b=-b);for(var ue=Wt(this.doc,l),be=0;be<b&&!(ue=Xe(this.doc,ue,se,G,te),ue.hitSide);++be);return ue},moveH:si(function(l,b){var G=this;this.extendSelectionsBy(function(te){return G.display.shift||G.doc.extend||te.empty()?Xe(G.doc,te.head,l,b,G.options.rtlMoveVisually):l<0?te.from():te.to()},Se)}),deleteH:si(function(l,b){var G=this.doc.sel,te=this.doc;G.somethingSelected()?te.replaceSelection("",null,"+delete"):ba(this,function(se){var ue=Xe(te,se.head,l,b,!1);return l<0?{from:ue,to:se.head}:{from:se.head,to:ue}})}),findPosV:function(l,b,G,te){var se=1,ue=te;b<0&&(se=-1,b=-b);for(var be=Wt(this.doc,l),je=0;je<b;++je){var $e=xi(this,be,"div");if(ue==null?ue=$e.left:$e.left=ue,be=Ve(this,$e,se,G),be.hitSide)break}return be},moveV:si(function(l,b){var G=this,te=this.doc,se=[],ue=!this.display.shift&&!te.extend&&te.sel.somethingSelected();if(te.extendSelectionsBy(function(je){if(ue)return l<0?je.from():je.to();var $e=xi(G,je.head,"div");je.goalColumn!=null&&($e.left=je.goalColumn),se.push($e.left);var ct=Ve(G,$e,l,b);return b=="page"&&je==te.sel.primary()&&es(G,Ts(G,ct,"div").top-$e.top),ct},Se),se.length)for(var be=0;be<te.sel.ranges.length;be++)te.sel.ranges[be].goalColumn=se[be]}),findWordAt:function(l){var b=this.doc,G=at(b,l.line).text,te=l.ch,se=l.ch;if(G){var ue=this.getHelper(l,"wordChars");(l.sticky=="before"||se==G.length)&&te?--te:++se;for(var be=G.charAt(te),je=qe(be,ue)?function($e){return qe($e,ue)}:/\s/.test(be)?function($e){return/\s/.test($e)}:function($e){return!/\s/.test($e)&&!qe($e)};te>0&&je(G.charAt(te-1));)--te;for(;se<G.length&&je(G.charAt(se));)++se}return new Nr(ke(l.line,te),ke(l.line,se))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),_e(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:si(function(l,b){ia(this,l,b)}),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,b){l==null?(l={from:this.doc.sel.primary().head,to:null},b==null&&(b=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ke(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=b||0,l.from.line!=null?wo(this,l):Co(this,l.from,l.to,l.margin)}),setSize:si(function(l,b){var G=this,te=function(ue){return typeof ue=="number"||/^\d+$/.test(String(ue))?ue+"px":ue};l!=null&&(this.display.wrapper.style.width=te(l)),b!=null&&(this.display.wrapper.style.height=te(b)),this.options.lineWrapping&&xs(this);var se=this.display.viewFrom;this.doc.iter(se,this.display.viewTo,function(ue){if(ue.widgets){for(var be=0;be<ue.widgets.length;be++)if(ue.widgets[be].noHScroll){Mi(G,se,"widget");break}}++se}),this.curOp.forceUpdate=!0,_e(this,"refresh",this)}),operation:function(l){return ci(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),_e(this,"refresh",this)}),swapDoc:si(function(l){var b=this.doc;return b.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,jt(this,"swapDoc",this,b),b}),phrase:function(l){var b=this.options.phrases;return b&&Object.prototype.hasOwnProperty.call(b,l)?b[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(l,b,G){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][b]=G},e.registerGlobalHelper=function(l,b,G,te){e.registerHelper(l,b,te),d[l]._global.push({pred:G,val:te})}}function Xe(e,n,d,l,b){var G=n,te=d,se=at(e,n.line),ue=b&&e.direction=="rtl"?-d:d;function be(){var Yn=n.line+ue;return Yn<e.first||Yn>=e.first+e.size?!1:(n=new ke(Yn,n.ch,n.sticky),se=at(e,Yn))}function je(Yn){var Sn;if(l=="codepoint"){var ur=se.text.charCodeAt(n.ch+(l>0?0:-1));isNaN(ur)?Sn=null:Sn=new ke(n.line,Math.max(0,Math.min(se.text.length,n.ch+d*(ur>=55296&&ur<56320?2:1))),-d)}else b?Sn=no(e.cm,se,n,d):Sn=eo(se,n,d);if(Sn==null)if(!Yn&&be())n=to(b,e.cm,se,n.line,ue);else return!1;else n=Sn;return!0}if(l=="char"||l=="codepoint")je();else if(l=="column")je(!0);else if(l=="word"||l=="group")for(var $e=null,ct=l=="group",st=e.cm&&e.cm.getHelper(n,"wordChars"),Ot=!0;!(d<0&&!je(!Ot));Ot=!1){var Ht=se.text.charAt(n.ch)||`
|
|
`,rn=qe(Ht,st)?"w":ct&&Ht==`
|
|
`?"n":!ct||/\s/.test(Ht)?null:"p";if(ct&&!Ot&&!rn&&(rn="s"),$e&&$e!=rn){d<0&&(d=1,je(),n.sticky="after");break}if(rn&&($e=rn),d>0&&!je(!Ot))break}var Tn=ds(e,n,G,te,!0);return Re(G,Tn)&&(Tn.hitSide=!0),Tn}function Ve(e,n,d,l){var b=e.doc,G=n.left,te;if(l=="page"){var se=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ue=Math.max(se-.5*Zi(e.display),3);te=(d>0?n.bottom:n.top)+d*ue}else l=="line"&&(te=d>0?n.bottom+3:n.top-3);for(var be;!(be=Rs(e,G,te),!be.outside);){if(d<0?te<=0:te>=b.height){be.hitSide=!0;break}te+=d*5}return be}var Ze=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ze.prototype.init=function(e){var n=this,d=this,l=d.cm,b=d.div=e.lineDiv;ze(b,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function G(se){for(var ue=se.target;ue;ue=ue.parentNode){if(ue==b)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ue.className))break}return!1}Qe(b,"paste",function(se){if(!G(se)||ie(l,se)||me(se,l))return;V<=11&&setTimeout(Gr(l,function(){return n.updateFromDOM()}),20)}),Qe(b,"compositionstart",function(se){n.composing={data:se.data,done:!1}}),Qe(b,"compositionupdate",function(se){n.composing||(n.composing={data:se.data,done:!1})}),Qe(b,"compositionend",function(se){n.composing&&(se.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Qe(b,"touchstart",function(){return d.forceCompositionEnd()}),Qe(b,"input",function(){n.composing||n.readFromDOMSoon()});function te(se){if(!G(se)||ie(l,se))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()}),se.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var ue=De(l);re({lineWise:!0,text:ue.text}),se.type=="cut"&&l.operation(function(){l.setSelections(ue.ranges,0,Te),l.replaceSelection("",null,"cut")})}else return;if(se.clipboardData){se.clipboardData.clearData();var be=X.text.join(`
|
|
`);if(se.clipboardData.setData("Text",be),se.clipboardData.getData("Text")==be){se.preventDefault();return}}var je=nt(),$e=je.firstChild;l.display.lineSpace.insertBefore(je,l.display.lineSpace.firstChild),$e.value=X.text.join(`
|
|
`);var ct=document.activeElement;F($e),setTimeout(function(){l.display.lineSpace.removeChild(je),ct.focus(),ct==b&&d.showPrimarySelection()},50)}Qe(b,"copy",te),Qe(b,"cut",te)},Ze.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ze.prototype.prepareSelection=function(){var e=Is(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ze.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ze.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ze.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,d=n.doc.sel.primary(),l=d.from(),b=d.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||b.line<n.display.viewFrom){e.removeAllRanges();return}var G=ir(n,e.anchorNode,e.anchorOffset),te=ir(n,e.focusNode,e.focusOffset);if(G&&!G.bad&&te&&!te.bad&&dt(mr(G,te),l)==0&&dt(hr(G,te),b)==0)return;var se=n.display.view,ue=l.line>=n.display.viewFrom&&yt(n,l)||{node:se[0].measure.map[2],offset:0},be=b.line<n.display.viewTo&&yt(n,b);if(!be){var je=se[se.length-1].measure,$e=je.maps?je.maps[je.maps.length-1]:je.map;be={node:$e[$e.length-1],offset:$e[$e.length-2]-$e[$e.length-3]}}if(!ue||!be){e.removeAllRanges();return}var ct=e.rangeCount&&e.getRangeAt(0),st;try{st=x(ue.node,ue.offset,be.offset,be.node)}catch(Ot){}st&&(!B&&n.state.focused?(e.collapse(ue.node,ue.offset),st.collapsed||(e.removeAllRanges(),e.addRange(st))):(e.removeAllRanges(),e.addRange(st)),ct&&e.anchorNode==null?e.addRange(ct):B&&this.startGracePeriod()),this.rememberSelection()},Ze.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)},Ze.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},Ze.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ze.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return _(this.div,n)},Ze.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ze.prototype.blur=function(){this.div.blur()},Ze.prototype.getField=function(){return this.div},Ze.prototype.supportsTouch=function(){return!0},Ze.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ci(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)},Ze.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ze.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&&gn(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var d=ir(n,e.anchorNode,e.anchorOffset),l=ir(n,e.focusNode,e.focusOffset);d&&l&&ci(n,function(){ni(n.doc,Fi(d,l),Te),(d.bad||l.bad)&&(n.curOp.selectionChanged=!0)})},Ze.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(),b=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=ke(l.line-1,at(e.doc,l.line-1).length)),b.ch==at(e.doc,b.line).text.length&&b.line<e.lastLine()&&(b=ke(b.line+1,0)),l.line<n.viewFrom||b.line>n.viewTo-1)return!1;var G,te,se;l.line==n.viewFrom||(G=zi(e,l.line))==0?(te=xe(n.view[0].line),se=n.view[0].node):(te=xe(n.view[G].line),se=n.view[G-1].node.nextSibling);var ue=zi(e,b.line),be,je;if(ue==n.view.length-1?(be=n.viewTo-1,je=n.lineDiv.lastChild):(be=xe(n.view[ue+1].line)-1,je=n.view[ue+1].node.previousSibling),!se)return!1;for(var $e=e.doc.splitLines($n(e,se,je,te,be)),ct=Be(e.doc,ke(te,0),ke(be,at(e.doc,be).text.length));$e.length>1&&ct.length>1;)if(v($e)==v(ct))$e.pop(),ct.pop(),be--;else if($e[0]==ct[0])$e.shift(),ct.shift(),te++;else break;for(var st=0,Ot=0,Ht=$e[0],rn=ct[0],Tn=Math.min(Ht.length,rn.length);st<Tn&&Ht.charCodeAt(st)==rn.charCodeAt(st);)++st;for(var Yn=v($e),Sn=v(ct),ur=Math.min(Yn.length-($e.length==1?st:0),Sn.length-(ct.length==1?st:0));Ot<ur&&Yn.charCodeAt(Yn.length-Ot-1)==Sn.charCodeAt(Sn.length-Ot-1);)++Ot;if($e.length==1&&ct.length==1&&te==l.line)for(;st&&st>l.ch&&Yn.charCodeAt(Yn.length-Ot-1)==Sn.charCodeAt(Sn.length-Ot-1);)st--,Ot++;$e[$e.length-1]=Yn.slice(0,Yn.length-Ot).replace(/^\u200b+/,""),$e[0]=$e[0].slice(st).replace(/\u200b+$/,"");var Rr=ke(te,st),Cr=ke(be,ct.length?v(ct).length-Ot:0);if($e.length>1||$e[0]||dt(Rr,Cr))return ga(e.doc,$e,Rr,Cr,"+input"),!0},Ze.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ze.prototype.reset=function(){this.forceCompositionEnd()},Ze.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ze.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)},Ze.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ci(this.cm,function(){return li(e.cm)})},Ze.prototype.setUneditable=function(e){e.contentEditable="false"},Ze.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,pe)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ze.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ze.prototype.onContextMenu=function(){},Ze.prototype.resetPosition=function(){},Ze.prototype.needsContentAttribute=!0;function yt(e,n){var d=Ki(e,n.line);if(!d||d.hidden)return null;var l=at(e.doc,n.line),b=Va(d,l,n.line),G=Xt(l,e.doc.direction),te="left";if(G){var se=Ft(G,n.ch);te=se%2?"right":"left"}var ue=ys(b.map,n.ch,te);return ue.offset=ue.collapse=="right"?ue.end:ue.start,ue}function gn(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function xn(e,n){return n&&(e.bad=!0),e}function $n(e,n,d,l,b){var G="",te=!1,se=e.doc.lineSeparator(),ue=!1;function be(st){return function(Ot){return Ot.id==st}}function je(){te&&(G+=se,ue&&(G+=se),te=ue=!1)}function $e(st){st&&(je(),G+=st)}function ct(st){if(st.nodeType==1){var Ot=st.getAttribute("cm-text");if(Ot){$e(Ot);return}var Ht=st.getAttribute("cm-marker"),rn;if(Ht){var Tn=e.findMarks(ke(l,0),ke(b+1,0),be(+Ht));Tn.length&&(rn=Tn[0].find(0))&&$e(Be(e.doc,rn.from,rn.to).join(se));return}if(st.getAttribute("contenteditable")=="false")return;var Yn=/^(pre|div|p|li|table|br)$/i.test(st.nodeName);if(!/^br$/i.test(st.nodeName)&&st.textContent.length==0)return;Yn&&je();for(var Sn=0;Sn<st.childNodes.length;Sn++)ct(st.childNodes[Sn]);/^(pre|p)$/i.test(st.nodeName)&&(ue=!0),Yn&&(te=!0)}else st.nodeType==3&&$e(st.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ct(n),n==d);)n=n.nextSibling,ue=!1;return G}function ir(e,n,d){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return xn(e.clipPos(ke(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 b=0;b<e.display.view.length;b++){var G=e.display.view[b];if(G.node==l)return Tr(G,n,d)}}function Tr(e,n,d){var l=e.text.firstChild,b=!1;if(!n||!_(l,n))return xn(ke(xe(e.line),0),!0);if(n==l&&(b=!0,n=l.childNodes[d],d=0,!n)){var G=e.rest?v(e.rest):e.line;return xn(ke(xe(G),G.text.length),b)}var te=n.nodeType==3?n:null,se=n;for(!te&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(te=n.firstChild,d&&(d=te.nodeValue.length));se.parentNode!=l;)se=se.parentNode;var ue=e.measure,be=ue.maps;function je(rn,Tn,Yn){for(var Sn=-1;Sn<(be?be.length:0);Sn++)for(var ur=Sn<0?ue.map:be[Sn],Rr=0;Rr<ur.length;Rr+=3){var Cr=ur[Rr+2];if(Cr==rn||Cr==Tn){var Dr=xe(Sn<0?e.line:e.rest[Sn]),Wr=ur[Rr]+Yn;return(Yn<0||Cr!=rn)&&(Wr=ur[Rr+(Yn?1:0)]),ke(Dr,Wr)}}}var $e=je(te,se,d);if($e)return xn($e,b);for(var ct=se.nextSibling,st=te?te.nodeValue.length-d:0;ct;ct=ct.nextSibling){if($e=je(ct,ct.firstChild,0),$e)return xn(ke($e.line,$e.ch-st),b);st+=ct.textContent.length}for(var Ot=se.previousSibling,Ht=d;Ot;Ot=Ot.previousSibling){if($e=je(Ot,Ot.firstChild,-1),$e)return xn(ke($e.line,$e.ch+Ht),b);Ht+=Ot.textContent.length}}var rr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};rr.prototype.init=function(e){var n=this,d=this,l=this.cm;this.createField(e);var b=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(b.style.width="0px"),Qe(b,"input",function(){Y&&V>=9&&n.hasSelection&&(n.hasSelection=null),d.poll()}),Qe(b,"paste",function(te){if(ie(l,te)||me(te,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function G(te){if(ie(l,te))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var se=De(l);re({lineWise:!0,text:se.text}),te.type=="cut"?l.setSelections(se.ranges,null,Te):(d.prevInput="",b.value=se.text.join(`
|
|
`),F(b))}else return;te.type=="cut"&&(l.state.cutIncoming=+new Date)}Qe(b,"cut",G),Qe(b,"copy",G),Qe(e.scroller,"paste",function(te){if(kr(e,te)||ie(l,te))return;if(!b.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var se=new Event("paste");se.clipboardData=te.clipboardData,b.dispatchEvent(se)}),Qe(e.lineSpace,"selectstart",function(te){kr(e,te)||de(te)}),Qe(b,"compositionstart",function(){var te=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:te,range:l.markText(te,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Qe(b,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},rr.prototype.createField=function(e){this.wrapper=nt(),this.textarea=this.wrapper.firstChild},rr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},rr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,d=e.doc,l=Is(e);if(e.options.moveInputWithCursor){var b=xi(e,d.sel.primary().head,"div"),G=n.wrapper.getBoundingClientRect(),te=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,b.top+te.top-G.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,b.left+te.left-G.left))}return l},rr.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")},rr.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),Y&&V>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",Y&&V>=9&&(this.hasSelection=null))},rr.prototype.getField=function(){return this.textarea},rr.prototype.supportsTouch=function(){return!1},rr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},rr.prototype.blur=function(){this.textarea.blur()},rr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rr.prototype.receivedFocus=function(){this.slowPoll()},rr.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()})},rr.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)},rr.prototype.poll=function(){var e=this,n=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||qt(d)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var b=d.value;if(b==l&&!n.somethingSelected())return!1;if(Y&&V>=9&&this.hasSelection===b||u&&/[\uf700-\uf7ff]/.test(b))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var G=b.charCodeAt(0);if(G==8203&&!l&&(l="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var te=0,se=Math.min(l.length,b.length);te<se&&l.charCodeAt(te)==b.charCodeAt(te);)++te;return ci(n,function(){pe(n,b.slice(te),l.length-te,null,e.composing?"*compose":null),b.length>1e3||b.indexOf(`
|
|
`)>-1?d.value=e.prevInput="":e.prevInput=b,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},rr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rr.prototype.onKeyPress=function(){Y&&V>=9&&(this.hasSelection=null),this.fastPoll()},rr.prototype.onContextMenu=function(e){var n=this,d=n.cm,l=d.display,b=n.textarea;n.contextMenuPending&&n.contextMenuPending();var G=Gi(d,e),te=l.scroller.scrollTop;if(!G||p)return;var se=d.options.resetSelectionOnContextMenu;se&&d.doc.sel.contains(G)==-1&&Gr(d,ni)(d.doc,Fi(G),Te);var ue=b.style.cssText,be=n.wrapper.style.cssText,je=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",b.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-je.top-5)+"px; left: "+(e.clientX-je.left-5)+`px;
|
|
z-index: 1000; background: `+(Y?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var $e;r&&($e=window.scrollY),l.input.focus(),r&&window.scrollTo(null,$e),l.input.reset(),d.somethingSelected()||(b.value=n.prevInput=" "),n.contextMenuPending=st,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function ct(){if(b.selectionStart!=null){var Ht=d.somethingSelected(),rn="\u200B"+(Ht?b.value:"");b.value="\u21DA",b.value=rn,n.prevInput=Ht?"":"\u200B",b.selectionStart=1,b.selectionEnd=rn.length,l.selForContextMenu=d.doc.sel}}function st(){if(n.contextMenuPending!=st)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=be,b.style.cssText=ue,Y&&V<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=te),b.selectionStart!=null){(!Y||Y&&V<9)&&ct();var Ht=0,rn=function(){l.selForContextMenu==d.doc.sel&&b.selectionStart==0&&b.selectionEnd>0&&n.prevInput=="\u200B"?Gr(d,Qo)(d):Ht++<10?l.detectingSelectAll=setTimeout(rn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(rn,200)}}if(Y&&V>=9&&ct(),A){le(e);var Ot=function(){xt(window,"mouseup",Ot),setTimeout(st,20)};Qe(window,"mouseup",Ot)}else setTimeout(st,50)},rr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},rr.prototype.setUneditable=function(){},rr.prototype.needsContentAttribute=!1;function Mr(e,n){if(n=n?y(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=j();n.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=se.getValue()}var b;if(e.form&&(Qe(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var G=e.form;b=G.submit;try{var te=G.submit=function(){l(),G.submit=b,G.submit(),G.submit=te}}catch(ue){}}n.finishInit=function(ue){ue.save=l,ue.getTextArea=function(){return e},ue.toTextArea=function(){ue.toTextArea=isNaN,l(),e.parentNode.removeChild(ue.getWrapperElement()),e.style.display="",e.form&&(xt(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=b))}},e.style.display="none";var se=Hr(function(ue){return e.parentNode.insertBefore(ue,e.nextSibling)},n);return se}function Pr(e){e.off=xt,e.on=Qe,e.wheelEventPixels=rs,e.Doc=ui,e.splitLines=Vt,e.countColumn=H,e.findColumn=Le,e.isWordChar=Fe,e.Pass=ge,e.signal=_e,e.Line=on,e.changeEnd=Yi,e.scrollbarModel=Ro,e.Pos=ke,e.cmpPos=dt,e.modes=cr,e.mimeModes=Qn,e.resolveMode=Nn,e.getMode=Ar,e.modeExtensions=Dn,e.extendMode=Pn,e.copyState=Zn,e.startState=Lr,e.innerMode=pr,e.commands=Ea,e.keyMap=Li,e.keyName=fs,e.isModifierKey=Fa,e.lookupKey=Ii,e.normalizeKeyMap=ll,e.StringStream=Or,e.SharedTextMarker=ya,e.TextMarker=bi,e.LineWidget=Ma,e.e_preventDefault=de,e.e_stopPropagation=he,e.e_stop=le,e.addClass=W,e.contains=_,e.rmClass=w,e.keyNames=Wi}ql(Hr),it(Hr);var Br="iter insert remove copy getEditor constructor".split(" ");for(var $r in ui.prototype)ui.prototype.hasOwnProperty($r)&&ae(Br,$r)<0&&(Hr.prototype[$r]=function(e){return function(){return e.apply(this.doc,arguments)}}(ui.prototype[$r]));return we(ui),Hr.inputStyles={textarea:rr,contenteditable:Ze},Hr.defineMode=function(e){!Hr.defaults.mode&&e!="null"&&(Hr.defaults.mode=e),yr.apply(this,arguments)},Hr.defineMIME=Sr,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,Pr(Hr),Hr.version="5.58.2",Hr})},WaYH:function(wt,Pe,U){"use strict";var ne=U("rePB"),Q=U("Ff2n"),B=U("VTBJ"),q=U("1OyB"),K=U("vuIU"),M=U("JX7q"),Y=U("Ji7U"),V=U("LK+K"),r=U("q1tI"),D=U("TSYQ"),m=U.n(D),p=U("sboe"),g=U("OZM5"),a=function(A){var P=A.prefixCls,w=A.level,E=A.isStart,h=A.isEnd;if(!w)return null;for(var f="".concat(P,"-indent-unit"),T=[],x=0;x<w;x+=1){var _;T.push(r.createElement("span",{key:x,className:m()(f,(_={},Object(ne.a)(_,"".concat(f,"-start"),E[x+1]),Object(ne.a)(_,"".concat(f,"-end"),h[x+1]),Object(ne.a)(_,"".concat(f,"-end-first-level"),!x&&h[0]),_))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(P,"-indent")},T)},c=a,s=U("815F"),i="open",t="close",u="---",o=function(R){Object(Y.a)(P,R);var A=Object(V.a)(P);function P(){var w;return Object(q.a)(this,P),w=A.apply(this,arguments),w.state={dragNodeHighlight:!1},w.onSelectorClick=function(E){var h=w.props.context.onNodeClick;h(E,Object(s.b)(w.props)),w.isSelectable()?w.onSelect(E):w.onCheck(E)},w.onSelectorDoubleClick=function(E){var h=w.props.context.onNodeDoubleClick;h(E,Object(s.b)(w.props))},w.onSelect=function(E){if(w.isDisabled())return;var h=w.props.context.onNodeSelect;E.preventDefault(),h(E,Object(s.b)(w.props))},w.onCheck=function(E){if(w.isDisabled())return;var h=w.props,f=h.disableCheckbox,T=h.checked,x=w.props.context.onNodeCheck;if(!w.isCheckable()||f)return;E.preventDefault();var _=!T;x(E,Object(s.b)(w.props),_)},w.onMouseEnter=function(E){var h=w.props.context.onNodeMouseEnter;h(E,Object(s.b)(w.props))},w.onMouseLeave=function(E){var h=w.props.context.onNodeMouseLeave;h(E,Object(s.b)(w.props))},w.onContextMenu=function(E){var h=w.props.context.onNodeContextMenu;h(E,Object(s.b)(w.props))},w.onDragStart=function(E){var h=w.props.context.onNodeDragStart;E.stopPropagation(),w.setState({dragNodeHighlight:!0}),h(E,Object(M.a)(w));try{E.dataTransfer.setData("text/plain","")}catch(f){}},w.onDragEnter=function(E){var h=w.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),h(E,Object(M.a)(w))},w.onDragOver=function(E){var h=w.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),h(E,Object(M.a)(w))},w.onDragLeave=function(E){var h=w.props.context.onNodeDragLeave;E.stopPropagation(),h(E,Object(M.a)(w))},w.onDragEnd=function(E){var h=w.props.context.onNodeDragEnd;E.stopPropagation(),w.setState({dragNodeHighlight:!1}),h(E,Object(M.a)(w))},w.onDrop=function(E){var h=w.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),w.setState({dragNodeHighlight:!1}),h(E,Object(M.a)(w))},w.onExpand=function(E){var h=w.props.context.onNodeExpand;h(E,Object(s.b)(w.props))},w.setSelectHandle=function(E){w.selectHandle=E},w.getNodeState=function(){var E=w.props.expanded;return w.isLeaf()?null:E?i:t},w.hasChildren=function(){var E=w.props.eventKey,h=w.props.context.keyEntities,f=h[E]||{},T=f.children;return!!(T||[]).length},w.isLeaf=function(){var E=w.props,h=E.isLeaf,f=E.loaded,T=w.props.context.loadData,x=w.hasChildren();return h===!1?!1:h||!T&&!x||T&&f&&!x},w.isDisabled=function(){var E=w.props.disabled,h=w.props.context.disabled;return!!(h||E)},w.isCheckable=function(){var E=w.props.checkable,h=w.props.context.checkable;return!h||E===!1?!1:h},w.syncLoadData=function(E){var h=E.expanded,f=E.loading,T=E.loaded,x=w.props.context,_=x.loadData,j=x.onNodeLoad;if(f)return;_&&h&&!w.isLeaf()&&(!w.hasChildren()&&!T&&j(Object(s.b)(w.props)))},w.renderSwitcher=function(){var E=w.props,h=E.expanded,f=E.switcherIcon,T=w.props.context,x=T.prefixCls,_=T.switcherIcon,j=f||_;if(w.isLeaf())return r.createElement("span",{className:m()("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof j=="function"?j(Object(B.a)(Object(B.a)({},w.props),{},{isLeaf:!0})):j);var W=m()("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(h?i:t));return r.createElement("span",{onClick:w.onExpand,className:W},typeof j=="function"?j(Object(B.a)(Object(B.a)({},w.props),{},{isLeaf:!1})):j)},w.renderCheckbox=function(){var E=w.props,h=E.checked,f=E.halfChecked,T=E.disableCheckbox,x=w.props.context.prefixCls,_=w.isDisabled(),j=w.isCheckable();if(!j)return null;var W=typeof j!="boolean"?j:null;return r.createElement("span",{className:m()("".concat(x,"-checkbox"),h&&"".concat(x,"-checkbox-checked"),!h&&f&&"".concat(x,"-checkbox-indeterminate"),(_||T)&&"".concat(x,"-checkbox-disabled")),onClick:w.onCheck},W)},w.renderIcon=function(){var E=w.props.loading,h=w.props.context.prefixCls;return r.createElement("span",{className:m()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(w.getNodeState()||"docu"),E&&"".concat(h,"-icon_loading"))})},w.renderSelector=function(){var E=w.state.dragNodeHighlight,h=w.props,f=h.title,T=h.selected,x=h.icon,_=h.loading,j=h.data,W=w.props.context,C=W.prefixCls,F=W.showIcon,k=W.icon,y=W.draggable,H=W.loadData,J=W.titleRender,ae=w.isDisabled(),fe="".concat(C,"-node-content-wrapper"),ge;if(F){var Te=x||k;ge=Te?r.createElement("span",{className:m()("".concat(C,"-iconEle"),"".concat(C,"-icon__customize"))},typeof Te=="function"?Te(w.props):Te):w.renderIcon()}else H&&_&&(ge=w.renderIcon());var Ue;typeof f=="function"?Ue=f(j):J?Ue=J(j):Ue=f;var Se=r.createElement("span",{className:"".concat(C,"-title")},Ue);return r.createElement("span",{ref:w.setSelectHandle,title:typeof f=="string"?f:"",className:m()("".concat(fe),"".concat(fe,"-").concat(w.getNodeState()||"normal"),!ae&&(T||E)&&"".concat(C,"-node-selected"),!ae&&y&&"draggable"),draggable:!ae&&y||void 0,"aria-grabbed":!ae&&y||void 0,onMouseEnter:w.onMouseEnter,onMouseLeave:w.onMouseLeave,onContextMenu:w.onContextMenu,onClick:w.onSelectorClick,onDoubleClick:w.onSelectorDoubleClick,onDragStart:y?w.onDragStart:void 0},ge,Se)},w}return Object(K.a)(P,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,h=this.props.context.selectable;return typeof E=="boolean"?E:h}},{key:"render",value:function(){var E,h=this.props,f=h.eventKey,T=h.className,x=h.style,_=h.dragOver,j=h.dragOverGapTop,W=h.dragOverGapBottom,C=h.isLeaf,F=h.isStart,k=h.isEnd,y=h.expanded,H=h.selected,J=h.checked,ae=h.halfChecked,fe=h.loading,ge=h.domRef,Te=h.active,Ue=h.onMouseMove,Se=Object(Q.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Le=this.props.context,ye=Le.prefixCls,Z=Le.filterTreeNode,v=Le.draggable,L=Le.keyEntities,z=this.isDisabled(),ee=Object(g.f)(Se),$=L[f]||{},Ee=$.level,Fe=k[k.length-1];return r.createElement("div",Object.assign({ref:ge,className:m()(T,"".concat(ye,"-treenode"),(E={},Object(ne.a)(E,"".concat(ye,"-treenode-disabled"),z),Object(ne.a)(E,"".concat(ye,"-treenode-switcher-").concat(y?"open":"close"),!C),Object(ne.a)(E,"".concat(ye,"-treenode-checkbox-checked"),J),Object(ne.a)(E,"".concat(ye,"-treenode-checkbox-indeterminate"),ae),Object(ne.a)(E,"".concat(ye,"-treenode-selected"),H),Object(ne.a)(E,"".concat(ye,"-treenode-loading"),fe),Object(ne.a)(E,"".concat(ye,"-treenode-active"),Te),Object(ne.a)(E,"".concat(ye,"-treenode-leaf-last"),Fe),Object(ne.a)(E,"drag-over",!z&&_),Object(ne.a)(E,"drag-over-gap-top",!z&&j),Object(ne.a)(E,"drag-over-gap-bottom",!z&&W),Object(ne.a)(E,"filter-node",Z&&Z(Object(s.b)(this.props))),E)),style:x,onDragEnter:v?this.onDragEnter:void 0,onDragOver:v?this.onDragOver:void 0,onDragLeave:v?this.onDragLeave:void 0,onDrop:v?this.onDrop:void 0,onDragEnd:v?this.onDragEnd:void 0,onMouseMove:Ue},ee),r.createElement(c,{prefixCls:ye,level:Ee,isStart:F,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),P}(r.Component),O=function(A){return r.createElement(p.a.Consumer,null,function(P){return r.createElement(o,Object.assign({},A,{context:P}))})};O.displayName="TreeNode",O.defaultProps={title:u},O.isTreeNode=1;var S=Pe.a=O},XIdC:function(wt,Pe,U){"use strict";var ne=U("rePB"),Q=U("ODXe"),B=U("Ff2n"),q=U("q1tI"),K=U.n(q),M=U("TSYQ"),Y=U.n(M),V=U("6cGi"),r=U("4IlW"),D=q.forwardRef(function(m,p){var g,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,O=m.checkedChildren,S=m.unCheckedChildren,R=m.onClick,A=m.onChange,P=m.onKeyDown,w=Object(B.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=Object(V.a)(!1,{value:i,defaultValue:t}),h=Object(Q.a)(E,2),f=h[0],T=h[1];function x(C,F){var k=f;return u||(k=C,T(k),A==null||A(k,F)),k}function _(C){C.which===r.a.LEFT?x(!1,C):C.which===r.a.RIGHT&&x(!0,C),P==null||P(C)}function j(C){var F=x(!f,C);R==null||R(F,C)}var W=Y()(c,s,(g={},Object(ne.a)(g,"".concat(c,"-checked"),f),Object(ne.a)(g,"".concat(c,"-disabled"),u),g));return q.createElement("button",Object.assign({},w,{type:"button",role:"switch","aria-checked":f,disabled:u,className:W,ref:p,onKeyDown:_,onClick:j}),o,q.createElement("span",{className:"".concat(c,"-inner")},f?O:S))});D.displayName="Switch",Pe.a=D},Y1PL:function(wt,Pe,U){"use strict";U.r(Pe),U.d(Pe,"ResizableTextArea",function(){return ae});var ne=U("wx14"),Q=U("1OyB"),B=U("vuIU"),q=U("Ji7U"),K=U("LK+K"),M=U("q1tI"),Y=U("VTBJ"),V=U("rePB"),r=U("Zm9Q"),D=U("Kwbf"),m=U("c+Xe"),p=U("m+aA"),g=U("bdgK"),a=new Map;function c(Te){Te.forEach(function(Ue){var Se,Le=Ue.target;(Se=a.get(Le))===null||Se===void 0||Se.forEach(function(ye){return ye(Le)})})}var s=new g.default(c),i=null,t=null;function u(Te,Ue){a.has(Te)||(a.set(Te,new Set),s.observe(Te)),a.get(Te).add(Ue)}function o(Te,Ue){a.has(Te)&&(a.get(Te).delete(Ue),a.get(Te).size||(s.unobserve(Te),a.delete(Te)))}var O=function(Te){Object(q.a)(Se,Te);var Ue=Object(K.a)(Se);function Se(){return Object(Q.a)(this,Se),Ue.apply(this,arguments)}return Object(B.a)(Se,[{key:"render",value:function(){return this.props.children}}]),Se}(M.Component),S=M.createContext(null);function R(Te){var Ue=Te.children,Se=Te.onBatchResize,Le=M.useRef(0),ye=M.useRef([]),Z=M.useContext(S),v=M.useCallback(function(L,z,ee){Le.current+=1;var $=Le.current;ye.current.push({size:L,element:z,data:ee}),Promise.resolve().then(function(){$===Le.current&&(Se==null||Se(ye.current),ye.current=[])}),Z==null||Z(L,z,ee)},[Se,Z]);return M.createElement(S.Provider,{value:v},Ue)}function A(Te){var Ue=Te.children,Se=Te.disabled,Le=M.useRef(null),ye=M.useRef(null),Z=M.useContext(S),v=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),L=M.isValidElement(Ue)&&Object(m.c)(Ue),z=L?Ue.ref:null,ee=M.useMemo(function(){return Object(m.a)(z,Le)},[z,Le]),$=M.useRef(Te);$.current=Te;var Ee=M.useCallback(function(Fe){var qe=$.current,Ce=qe.onResize,Me=qe.data,He=Fe.getBoundingClientRect(),Ke=He.width,ut=He.height,bt=Fe.offsetWidth,Lt=Fe.offsetHeight,Ft=Math.floor(Ke),Yt=Math.floor(ut);if(v.current.width!==Ft||v.current.height!==Yt||v.current.offsetWidth!==bt||v.current.offsetHeight!==Lt){var Xt={width:Ft,height:Yt,offsetWidth:bt,offsetHeight:Lt};v.current=Xt;var Je=bt===Math.round(Ke)?Ke:bt,Qe=Lt===Math.round(ut)?ut:Lt,_t=Object(Y.a)(Object(Y.a)({},Xt),{},{offsetWidth:Je,offsetHeight:Qe});Z==null||Z(_t,Fe,Me),Ce&&Promise.resolve().then(function(){Ce(_t,Fe)})}},[]);return M.useEffect(function(){var Fe=Object(p.a)(Le.current)||Object(p.a)(ye.current);return Fe&&!Se&&u(Fe,Ee),function(){return o(Fe,Ee)}},[Le.current,Se]),M.createElement(O,{ref:ye},L?M.cloneElement(Ue,{ref:ee}):Ue)}var P="rc-observer-key";function w(Te){var Ue=Te.children,Se=Object(r.a)(Ue);return Se.map(function(Le,ye){var Z=(Le==null?void 0:Le.key)||"".concat(P,"-").concat(ye);return M.createElement(A,Object(ne.a)({},Te,{key:Z}),Le)})}w.Collection=R;var E=w,h=U("bT9E"),f=U("TSYQ"),T=U.n(f),x=`
|
|
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"],j={},W;function C(Te){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(Ue&&j[Se])return j[Se];var Le=window.getComputedStyle(Te),ye=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),Z=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),v=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),L=_.map(function(ee){return"".concat(ee,":").concat(Le.getPropertyValue(ee))}).join(";"),z={sizingStyle:L,paddingSize:Z,borderSize:v,boxSizing:ye};return Ue&&Se&&(j[Se]=z),z}function F(Te){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),Te.getAttribute("wrap")?W.setAttribute("wrap",Te.getAttribute("wrap")):W.removeAttribute("wrap");var ye=C(Te,Ue),Z=ye.paddingSize,v=ye.borderSize,L=ye.boxSizing,z=ye.sizingStyle;W.setAttribute("style","".concat(z,";").concat(x)),W.value=Te.value||Te.placeholder||"";var ee=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER,Ee=W.scrollHeight,Fe;if(L==="border-box"?Ee+=v:L==="content-box"&&(Ee-=Z),Se!==null||Le!==null){W.value=" ";var qe=W.scrollHeight-Z;Se!==null&&(ee=qe*Se,L==="border-box"&&(ee=ee+Z+v),Ee=Math.max(ee,Ee)),Le!==null&&($=qe*Le,L==="border-box"&&($=$+Z+v),Fe=Ee>$?"":"hidden",Ee=Math.min($,Ee))}return{height:Ee,minHeight:ee,maxHeight:$,overflowY:Fe,resize:"none"}}var k=U("Gytx"),y=U.n(k),H;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(H||(H={}));var J=function(Te){Object(q.a)(Se,Te);var Ue=Object(K.a)(Se);function Se(Le){var ye;return Object(Q.a)(this,Se),ye=Ue.call(this,Le),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(Z){ye.textArea=Z},ye.handleResize=function(Z){var v=ye.state.resizeStatus,L=ye.props,z=L.autoSize,ee=L.onResize;if(v!==H.NONE)return;typeof ee=="function"&&ee(Z),z&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var Z=ye.props.autoSize;if(!Z||!ye.textArea)return;var v=Z.minRows,L=Z.maxRows,z=F(ye.textArea,!1,v,L);ye.setState({textareaStyles:z,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:H.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:H.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var Z=ye.props,v=Z.prefixCls,L=v===void 0?"rc-textarea":v,z=Z.autoSize,ee=Z.onResize,$=Z.className,Ee=Z.disabled,Fe=ye.state,qe=Fe.textareaStyles,Ce=Fe.resizeStatus,Me=Object(h.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),He=T()(L,$,Object(V.a)({},"".concat(L,"-disabled"),Ee));"value"in Me&&(Me.value=Me.value||"");var Ke=Object(Y.a)(Object(Y.a)(Object(Y.a)({},ye.props.style),qe),Ce===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(E,{onResize:ye.handleResize,disabled:!(z||ee)},M.createElement("textarea",Object(ne.a)({},Me,{className:He,style:Ke,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:H.NONE},ye}return Object(B.a)(Se,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!y()(ye.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 ye=this.textArea.selectionStart,Z=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,Z)}}catch(v){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Se}(M.Component),ae=J,fe=function(Te){Object(q.a)(Se,Te);var Ue=Object(K.a)(Se);function Se(Le){var ye;Object(Q.a)(this,Se),ye=Ue.call(this,Le),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(v){ye.resizableTextArea=v},ye.handleChange=function(v){var L=ye.props.onChange;ye.setValue(v.target.value,function(){ye.resizableTextArea.resizeTextarea()}),L&&L(v)},ye.handleKeyDown=function(v){var L=ye.props,z=L.onPressEnter,ee=L.onKeyDown;v.keyCode===13&&z&&z(v),ee&&ee(v)};var Z=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ye.state={value:Z},ye}return Object(B.a)(Se,[{key:"setValue",value:function(ye,Z){"value"in this.props||this.setState({value:ye},Z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(ae,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Se}(M.Component),ge=Pe.default=fe},YIbm:function(wt,Pe,U){wt.exports={content:"content___24s9X"}},"YJx+":function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___TKIS5",flex_space_between:"flex_space_between___3ITJg",flex_box_vertical_center:"flex_box_vertical_center___pGLbk",flex_box_center_end:"flex_box_center_end___3-z2A",flex_box_column:"flex_box_column___1SlIq",wrap:"wrap___2TxDh",modal:"modal___jkvmI",titleWrap:"titleWrap___386Y5",required:"required___3ddar",title:"title___2scfU",colorGray:"colorGray___10JDh",choiceWrap:"choiceWrap___3UMox",answer:"answer___1kvCr",activeAnswer:"activeAnswer___1tun2",deleteIcon:"deleteIcon___2_EJk",addIcon:"addIcon___b404_",editorWrap:"editorWrap___1qDS7",htmlWrap:"htmlWrap___2ear6",radio:"radio___3EFAB",color333:"color333___lt3ql",color999:"color999___11Mt_",questionType:"questionType___1yIj7",questionChoices:"questionChoices___1n3A7",action:"action___3PqBm",difficult:"difficult___1L4Zj",fold:"fold___3zBy6",head:"head___1dsW5"}},Z9P2:function(wt,Pe,U){"use strict";var ne=U("+BJd"),Q=U("mr32"),B=U("14J3"),q=U("BMrR"),K=U("5NDa"),M=U("5rEg"),Y=U("oBTY"),V=U("5Dmo"),r=U("3S7+"),D=U("miYZ"),m=U("tsqr"),p=U("tJVT"),g=U("q1tI"),a=U.n(g),c=function(i){var t,u,o=i.value,O=o===void 0?[[],[]]:o,S=i.onChange,R=Object(g.useState)(""),A=Object(p.a)(R,2),P=A[0],w=A[1],E=Object(g.useState)(""),h=Object(p.a)(E,2),f=h[0],T=h[1],x=function(j){if(!j)return!1;var W=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 W.test(j)?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):j==="|"?(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(q.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",a.a.createElement(M.a,{value:P,onChange:function(j){w(j.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(j){var W,C=(W=j.target)===null||W===void 0?void 0:W.value;if(x(C)){var F,k;(F=O[0])===null||F===void 0||F.push(C==null||((k=C.split("|"))===null||k===void 0)?void 0:k.filter(function(y){return!!y})),S(Object(Y.a)(O)),w("")}},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"},O==null||((t=O[0])===null||t===void 0)?void 0:t.map(function(_,j){return a.a.createElement(Q.a,{className:"mb10",key:j,closable:!0,onClose:function(C){var F;C.preventDefault(),O[0]=(F=O[0])===null||F===void 0?void 0:F.filter(function(k,y){return y!==j}),S(Object(Y.a)(O))}},_==null?void 0:_.join(" \u6216 "))})),a.a.createElement(q.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",a.a.createElement(M.a,{value:f,onChange:function(j){T(j.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(j){var W,C=(W=j.target)===null||W===void 0?void 0:W.value;if(x(C)){var F,k;(F=O[1])===null||F===void 0||F.push(C==null||((k=C.split("|"))===null||k===void 0)?void 0:k.filter(function(y){return!!y})),S(Object(Y.a)(O)),T("")}},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"},O==null||((u=O[1])===null||u===void 0)?void 0:u.map(function(_,j){return a.a.createElement(Q.a,{className:"mb10",key:j,closable:!0,onClose:function(C){var F;C.preventDefault(),O[1]=(F=O[1])===null||F===void 0?void 0:F.filter(function(k,y){return y!==j}),S(Object(Y.a)(O))}},_==null?void 0:_.join(" \u6216 "))})))};Pe.a=c},ZW9T:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return k});var ne=U("k1fw"),Q=U("oBTY"),B=U("miYZ"),q=U("tsqr"),K=U("rAM+"),M=U("tJVT"),Y=U("PpiC"),V=U("q1tI"),r=U.n(V),D=U("bdgK"),m=U("9og8"),p=U("WmNS"),g=U.n(p),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"]}},O=function(H,J){return J.map(function(ae){return{label:ae,kind:H.languages.CompletionItemKind.Keyword,insertText:ae}})},S=function(H){return Object.keys(o.tables).map(function(J){return{label:J,kind:H.languages.CompletionItemKind.Variable,insertText:J}})},R=function(H,J){var ae=o.tables[H];return ae?ae.map(function(fe){return{label:fe,kind:J.languages.CompletionItemKind.Field,insertText:fe}}):[]};function A(y,H,J,ae,fe){var ge=H.getWordUntilPosition(J),Te={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Ue=ae.map(function(Se){return{label:Se,kind:y.languages.CompletionItemKind.Keyword,insertText:Se,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}});return fe.map(function(Se){Ue.push(Object(ne.a)(Object(ne.a)({},Se),{},{range:Te}))}),Ue}var P=function(y){o.languages.map(function(fe){return y.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(Te,Ue,Se){return Object(m.a)(g.a.mark(function Le(){var ye;return g.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return ye=u()(Te.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}),v.abrupt("return",[{range:Te.getFullModelRange(),text:ye}]);case 2:case"end":return v.stop()}},Le)}))()}}),fe});var H=s.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=i.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=c.quickKey.map(function(fe){return{label:fe.label,kind:y.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ge,Te){var Ue=ge.getWordUntilPosition(Te),Se={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Le=ge.getLineContent(Te.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(s.keywords.map(function(ye){return{label:ye,kind:y.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(Q.a)(s.quickKey.map(function(ye){return{label:ye.label,kind:y.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}}),y.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ge,Te){var Ue=ge.getWordUntilPosition(Te),Se={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn};return{suggestions:Object(Q.a)(a.keywords.map(function(Le){return{label:Le,kind:y.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}}))}}}),y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ge,Te){var Ue=ge.getWordUntilPosition(Te),Se={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Le=ge.getLineContent(Te.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(c.keywords.map(function(ye){return{label:ye,kind:y.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(Q.a)(c.quickKey.map(function(ye){return{label:ye.label,kind:y.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}}),y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ge,Te){var Ue=ge.getWordUntilPosition(Te),Se={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Ue.startColumn,endColumn:Ue.endColumn},Le=ge.getLineContent(Te.lineNumber).substring(Ue.startColumn-2,Ue.endColumn);return{suggestions:[].concat(Object(Q.a)(i.keywords.map(function(ye){return{label:ye,kind:y.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(Q.a)(i.quickKey.map(function(ye){return{label:ye.label,kind:y.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=U("fjLI"),h=U("LvDl"),f=U("+ua5");function T(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function x(){}var _=!1,j={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function W(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=y;if(Array.isArray(y)){for(var J=0;J<y.length;J++){var ae=j[y[J]];if(ae)return ae}return H[0]}return j[H]||H}var C=null,F=Pe.b=function(y){var H=y.width,J=H===void 0?"100%":H,ae=y.height,fe=ae===void 0?"100%":ae,ge=y.value,Te=y.language,Ue=Te===void 0?"javascript":Te,Se=y.style,Le=Se===void 0?{}:Se,ye=y.options,Z=ye===void 0?{}:ye,v=y.overrideServices,L=v===void 0?{}:v,z=y.theme,ee=z===void 0?"vs-dark":z,$=y.onEditBlur,Ee=y.onSave,Fe=y.autoHeight,qe=Fe===void 0?!1:Fe,Ce=y.forbidCopy,Me=Ce===void 0?!1:Ce,He=y.onChange,Ke=He===void 0?x:He,ut=y.editorDidMount,bt=ut===void 0?x:ut,Lt=y.onFocus,Ft=Lt===void 0?x:Lt,Yt=y.filename,Xt=Yt===void 0?"educoder.txt":Yt,Je=y.errorLine,Qe=y.errorContent,_t=Qe===void 0?"":Qe,xt=Object(Y.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),_e=Object(V.useRef)(),ie=Object(V.useRef)({}),oe=Object(V.useRef)(),ce=Object(V.useRef)(),we=Object(V.useRef)(!1),de=Object(V.useRef)(),he=Object(V.useState)(!1),Oe=Object(M.a)(he,2),le=Oe[0],Ne=Oe[1];function We(){var Dn;return _e.current&&(Dn=new D.default(function(Pn){var Zn=Object(K.a)(Pn),pr;try{for(Zn.s();!(pr=Zn.n()).done;){var Lr=pr.value;(Lr.target.offsetHeight>0||Lr.target.offsetWidth>0)&&ie.current.instance.layout()}}catch(Or){Zn.e(Or)}finally{Zn.f()}}),Dn.observe(_e.current)),Dn}function lt(){q.b.warn(decodeURIComponent(w))}var Ct=function(){var Pn=ie.current.instance;if(ge!=null&&Pn&&le){var Zn=Pn.getModel();Zn&&ge!==Zn.getValue()&&(_=!0,Zn.setValue(ge),Pn.layout(),_=!1)}};Object(V.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){Ct()},500)},[ge,le,ie.current]),Object(V.useEffect)(function(){if(Je&&ie.current&&ie.current.instance){var Dn=ie.current.instance;Dn.changeViewZones(function(Zn){var pr=document.createElement("div");pr.style.padding="10px 20px",pr.style.width="calc(100% - 20px)",pr.className="my-error-line-wrp",pr.innerHTML=_t,Zn.addZone({afterLineNumber:Je||11,heightInLines:3,domNode:pr})});var Pn={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}};Dn.addOverlayWidget(Pn),Dn.revealPositionInCenter({lineNumber:20,column:1})}},[Je,ie.current,le]);function Rt(){var Dn=ie.current.instance;if(Dn){var Pn=Dn.getSelection(),Zn=ie.current.pastePos||{},pr=new C.Range(Zn.startLineNumber||Pn.endLineNumber,Zn.startColumn||Pn.endColumn,Zn.endLineNumber||Pn.endLineNumber,Zn.endColumn||Pn.endColumn);setTimeout(function(){Dn.executeEdits("",[{range:pr,text:""}])},300)}}function It(Dn){(window.navigator.platform.match("Mac")?Dn.metaKey:Dn.ctrlKey)&&Dn.keyCode==83&&(Dn.preventDefault(),Ee())}var qn=function(){if(qe&&ie.current.instance){var Pn=ie.current.instance.getContentHeight();Nn(Pn<fe?fe:Pn)}else Nn(fe)};function Vt(Dn){var Pn=document.createEvent("MouseEvents");Pn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Dn.dispatchEvent(Pn)}function qt(Dn,Pn){var Zn=window.URL||window.webkitURL||window,pr=new Blob([Pn]),Lr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Lr.href=Zn.createObjectURL(pr),Lr.download=Dn,Vt(Lr)}Object(V.useEffect)(function(){qn()},[qn]),Object(V.useEffect)(function(){_e.current&&!le&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Dn){try{C=Dn,ie.current.instance=C.editor.create(_e.current,{value:ge,language:W(Ue),theme:ee,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},L);var Pn=ie.current.instance,Zn=E.d._menuItems,pr=Object(Q.a)(Zn).find(function(pt){return pt[0]._debugName=="EditorContext"}),Lr=pr[1],Or=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],at=function(Ie,xe){var ve=Ie._first;do{var Hn,kt,ke=xe.includes((Hn=ve.element)===null||Hn===void 0||((kt=Hn.command)===null||kt===void 0)?void 0:kt.id);ke&&Ie._remove(ve)}while(ve=ve.next)};if(bt(Pn,C),setTimeout(function(){qn(),ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){qt(Xt||"educoder.txt",Pn.getValue())}}),Pn.getDomNode().addEventListener("input",function(){oe.current.autoFormat&&Pn.getAction("editor.action.formatDocument").run()})},500),ie.current.subscription=Pn.onDidChangeModelContent(function(pt){we.current?clearTimeout(de.current):(qn(),Ke(Pn.getValue(),pt)),de.current=setTimeout(function(){we.current=!1},500)}),window.Monaco||P(C,W(Ue)),Me&&(at(Lr,Or),_e.current.classList.add("noCopyPaste"),Pn.onKeyDown(function(pt){var Ie=pt.keyCode,xe=pt.ctrlKey,ve=pt.metaKey;(Ie===33||Ie===52)&&(ve||xe)&&(lt(),pt.preventDefault())})),window.Monaco=C,$&&Pn.onDidBlurEditorWidget(function(){$(Pn.getValue())}),Ft&&Pn.onDidFocusEditorText(function(){Ft(Pn.getValue())}),Me){Pn.addCommand(C.KeyMod.CtrlCmd|C.KeyCode.KEY_V,function(){return lt(),null}),Pn.onDidPaste(function(pt){ie.current.pastePos=pt});try{window.addEventListener("paste",Rt)}catch(pt){}}var Be=We();return Ne(!0),function(){var pt=ie.current.instance;pt.dispose();var Ie=pt.getModel();Ie&&Ie.dispose(),ie.current.subscription&&ie.current.subscription.dispose(),Me&&window.removeEventListener("paste",Rt),Be.unobserve(_e.current)}}catch(pt){}})},[]),Object(V.useEffect)(function(){var Dn=ie.current.instance;if(Dn&&le)return document.addEventListener("keydown",It,!1),function(){document.removeEventListener("keydown",It)}},[Ee,le]),Object(V.useEffect)(function(){var Dn=ie.current.instance;if(Dn&&le){var Pn=W(Ue);C.editor.setModelLanguage(Dn.getModel(),Pn),console.log("language:",Ue,Dn.getModel(),Pn)}},[Ue,le]),Object(V.useEffect)(function(){var Dn=ie.current.instance;Dn&&le&&C.editor.setTheme(ee)},[ee,le]),Object(V.useEffect)(function(){var Dn=ie.current.instance;oe.current=Z,Dn&&le&&(Dn.updateOptions(Object(ne.a)({},Z)),setTimeout(function(){Dn.getModel().updateOptions(Object(ne.a)({},Z))},200))},[JSON.stringify(Z),le]),Object(V.useEffect)(function(){var Dn=ie.current.instance;Dn&&le&&Dn.layout()},[J,fe,le]);var nn=Object(V.useState)(T(J)),On=Object(M.a)(nn,2),ar=On[0],cr=On[1],Qn=Object(V.useState)(T(fe)),yr=Object(M.a)(Qn,2),Sr=yr[0],Nn=yr[1],Ar=Object(ne.a)(Object(ne.a)({},Le),{},{width:ar,height:Sr});return r.a.createElement("div",{className:"my-monaco-editor",ref:_e,style:Ar})};function k(y){var H=y.width,J=H===void 0?"100%":H,ae=y.height,fe=ae===void 0?"100%":ae,ge=y.original,Te=y.modified,Ue=y.language,Se=y.options,Le=Se===void 0?{}:Se,ye=Object(V.useRef)(),Z=Object(V.useState)(null),v=Object(M.a)(Z,2),L=v[0],z=v[1];function ee(qe){var Ce;return ye.current&&(Ce=new D.default(function(Me){var He=Object(K.a)(Me),Ke;try{for(He.s();!(Ke=He.n()).done;){var ut=Ke.value;(ut.target.offsetHeight>0||ut.target.offsetWidth>0)&&qe.layout()}}catch(bt){He.e(bt)}finally{He.f()}}),Ce.observe(ye.current)),Ce}Object(V.useEffect)(function(){ye.current&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(qe){C=qe;var Ce=C.editor.createDiffEditor(ye.current,Object(ne.a)(Object(ne.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},Le),{},{wordWrap:!0}));z(Ce);var Me=ee(Ce);return function(){Ce.dispose();var He=Ce.getModel();He&&He.dispose(),Me.unobserve(ye.current)}})},[]),Object(V.useEffect)(function(){L&&L.setModel({original:C.editor.createModel(ge,Ue),modified:C.editor.createModel(Te,Ue)})},[ge,Te,Ue,L]);var $=T(J),Ee=T(fe),Fe={width:$,height:Ee};return r.a.createElement("div",{className:"my-diff-editor",ref:ye,style:Fe})}},ZWs3:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return m});var ne=U("+L6B"),Q=U("2/Rp"),B=U("0Owb"),q=U("9og8"),K=U("tJVT"),M=U("PpiC"),Y=U("WmNS"),V=U.n(Y),r=U("q1tI"),D=U.n(r),m=function(g){var a=g.children,c=Object(M.a)(g,["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(q.a)(V.a.mark(function O(S){return V.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,u(!0),A.next=4,c.onClick(S);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()}},O,null,[[0,7]])}));return function(O){return o.apply(this,arguments)}}()}),a)}},Zss7:function(wt,Pe,U){var ne;(function(Q){var B=/^\s+/,q=/\s+$/,K=0,M=Q.round,Y=Q.min,V=Q.max,r=Q.random;function D(v,L){if(v=v||"",L=L||{},v instanceof D)return v;if(!(this instanceof D))return new D(v,L);var z=m(v);this._originalInput=v,this._r=z.r,this._g=z.g,this._b=z.b,this._a=z.a,this._roundA=M(100*this._a)/100,this._format=L.format||z.format,this._gradientType=L.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=z.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 v=this.toRgb();return(v.r*299+v.g*587+v.b*114)/1e3},getLuminance:function(){var v=this.toRgb(),L,z,ee,$,Ee,Fe;return L=v.r/255,z=v.g/255,ee=v.b/255,L<=.03928?$=L/12.92:$=Q.pow((L+.055)/1.055,2.4),z<=.03928?Ee=z/12.92:Ee=Q.pow((z+.055)/1.055,2.4),ee<=.03928?Fe=ee/12.92:Fe=Q.pow((ee+.055)/1.055,2.4),.2126*$+.7152*Ee+.0722*Fe},setAlpha:function(v){return this._a=F(v),this._roundA=M(100*this._a)/100,this},toHsv:function(){var v=c(this._r,this._g,this._b);return{h:v.h*360,s:v.s,v:v.v,a:this._a}},toHsvString:function(){var v=c(this._r,this._g,this._b),L=M(v.h*360),z=M(v.s*100),ee=M(v.v*100);return this._a==1?"hsv("+L+", "+z+"%, "+ee+"%)":"hsva("+L+", "+z+"%, "+ee+"%, "+this._roundA+")"},toHsl:function(){var v=g(this._r,this._g,this._b);return{h:v.h*360,s:v.s,l:v.l,a:this._a}},toHslString:function(){var v=g(this._r,this._g,this._b),L=M(v.h*360),z=M(v.s*100),ee=M(v.l*100);return this._a==1?"hsl("+L+", "+z+"%, "+ee+"%)":"hsla("+L+", "+z+"%, "+ee+"%, "+this._roundA+")"},toHex:function(v){return i(this._r,this._g,this._b,v)},toHexString:function(v){return"#"+this.toHex(v)},toHex8:function(v){return t(this._r,this._g,this._b,this._a,v)},toHex8String:function(v){return"#"+this.toHex8(v)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(k(this._r,255)*100)+"%",g:M(k(this._g,255)*100)+"%",b:M(k(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(k(this._r,255)*100)+"%, "+M(k(this._g,255)*100)+"%, "+M(k(this._b,255)*100)+"%)":"rgba("+M(k(this._r,255)*100)+"%, "+M(k(this._g,255)*100)+"%, "+M(k(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(v){var L="#"+u(this._r,this._g,this._b,this._a),z=L,ee=this._gradientType?"GradientType = 1, ":"";if(v){var $=D(v);z="#"+u($._r,$._g,$._b,$._a)}return"progid:DXImageTransform.Microsoft.gradient("+ee+"startColorstr="+L+",endColorstr="+z+")"},toString:function(v){var L=!!v;v=v||this._format;var z=!1,ee=this._a<1&&this._a>=0,$=!L&&ee&&(v==="hex"||v==="hex6"||v==="hex3"||v==="hex4"||v==="hex8"||v==="name");return $?v==="name"&&this._a===0?this.toName():this.toRgbString():(v==="rgb"&&(z=this.toRgbString()),v==="prgb"&&(z=this.toPercentageRgbString()),(v==="hex"||v==="hex6")&&(z=this.toHexString()),v==="hex3"&&(z=this.toHexString(!0)),v==="hex4"&&(z=this.toHex8String(!0)),v==="hex8"&&(z=this.toHex8String()),v==="name"&&(z=this.toName()),v==="hsl"&&(z=this.toHslString()),v==="hsv"&&(z=this.toHsvString()),z||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(v,L){var z=v.apply(null,[this].concat([].slice.call(L)));return this._r=z._r,this._g=z._g,this._b=z._b,this.setAlpha(z._a),this},lighten:function(){return this._applyModification(R,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(P,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(v,L){return v.apply(null,[this].concat([].slice.call(L)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(h,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},D.fromRatio=function(v,L){if(typeof v=="object"){var z={};for(var ee in v)v.hasOwnProperty(ee)&&(ee==="a"?z[ee]=v[ee]:z[ee]=ge(v[ee]));v=z}return D(v,L)};function m(v){var L={r:0,g:0,b:0},z=1,ee=null,$=null,Ee=null,Fe=!1,qe=!1;return typeof v=="string"&&(v=ye(v)),typeof v=="object"&&(Le(v.r)&&Le(v.g)&&Le(v.b)?(L=p(v.r,v.g,v.b),Fe=!0,qe=String(v.r).substr(-1)==="%"?"prgb":"rgb"):Le(v.h)&&Le(v.s)&&Le(v.v)?(ee=ge(v.s),$=ge(v.v),L=s(v.h,ee,$),Fe=!0,qe="hsv"):Le(v.h)&&Le(v.s)&&Le(v.l)&&(ee=ge(v.s),Ee=ge(v.l),L=a(v.h,ee,Ee),Fe=!0,qe="hsl"),v.hasOwnProperty("a")&&(z=v.a)),z=F(z),{ok:Fe,format:v.format||qe,r:Y(255,V(L.r,0)),g:Y(255,V(L.g,0)),b:Y(255,V(L.b,0)),a:z}}function p(v,L,z){return{r:k(v,255)*255,g:k(L,255)*255,b:k(z,255)*255}}function g(v,L,z){v=k(v,255),L=k(L,255),z=k(z,255);var ee=V(v,L,z),$=Y(v,L,z),Ee,Fe,qe=(ee+$)/2;if(ee==$)Ee=Fe=0;else{var Ce=ee-$;Fe=qe>.5?Ce/(2-ee-$):Ce/(ee+$);switch(ee){case v:Ee=(L-z)/Ce+(L<z?6:0);break;case L:Ee=(z-v)/Ce+2;break;case z:Ee=(v-L)/Ce+4;break}Ee/=6}return{h:Ee,s:Fe,l:qe}}function a(v,L,z){var ee,$,Ee;v=k(v,360),L=k(L,100),z=k(z,100);function Fe(Me,He,Ke){return Ke<0&&(Ke+=1),Ke>1&&(Ke-=1),Ke<1/6?Me+(He-Me)*6*Ke:Ke<1/2?He:Ke<2/3?Me+(He-Me)*(2/3-Ke)*6:Me}if(L===0)ee=$=Ee=z;else{var qe=z<.5?z*(1+L):z+L-z*L,Ce=2*z-qe;ee=Fe(Ce,qe,v+1/3),$=Fe(Ce,qe,v),Ee=Fe(Ce,qe,v-1/3)}return{r:ee*255,g:$*255,b:Ee*255}}function c(v,L,z){v=k(v,255),L=k(L,255),z=k(z,255);var ee=V(v,L,z),$=Y(v,L,z),Ee,Fe,qe=ee,Ce=ee-$;if(Fe=ee===0?0:Ce/ee,ee==$)Ee=0;else{switch(ee){case v:Ee=(L-z)/Ce+(L<z?6:0);break;case L:Ee=(z-v)/Ce+2;break;case z:Ee=(v-L)/Ce+4;break}Ee/=6}return{h:Ee,s:Fe,v:qe}}function s(v,L,z){v=k(v,360)*6,L=k(L,100),z=k(z,100);var ee=Q.floor(v),$=v-ee,Ee=z*(1-L),Fe=z*(1-$*L),qe=z*(1-(1-$)*L),Ce=ee%6,Me=[z,Fe,Ee,Ee,qe,z][Ce],He=[qe,z,z,Fe,Ee,Ee][Ce],Ke=[Ee,Ee,qe,z,z,Fe][Ce];return{r:Me*255,g:He*255,b:Ke*255}}function i(v,L,z,ee){var $=[fe(M(v).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16))];return ee&&$[0].charAt(0)==$[0].charAt(1)&&$[1].charAt(0)==$[1].charAt(1)&&$[2].charAt(0)==$[2].charAt(1)?$[0].charAt(0)+$[1].charAt(0)+$[2].charAt(0):$.join("")}function t(v,L,z,ee,$){var Ee=[fe(M(v).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16)),fe(Te(ee))];return $&&Ee[0].charAt(0)==Ee[0].charAt(1)&&Ee[1].charAt(0)==Ee[1].charAt(1)&&Ee[2].charAt(0)==Ee[2].charAt(1)&&Ee[3].charAt(0)==Ee[3].charAt(1)?Ee[0].charAt(0)+Ee[1].charAt(0)+Ee[2].charAt(0)+Ee[3].charAt(0):Ee.join("")}function u(v,L,z,ee){var $=[fe(Te(ee)),fe(M(v).toString(16)),fe(M(L).toString(16)),fe(M(z).toString(16))];return $.join("")}D.equals=function(v,L){return!v||!L?!1:D(v).toRgbString()==D(L).toRgbString()},D.random=function(){return D.fromRatio({r:r(),g:r(),b:r()})};function o(v,L){L=L===0?0:L||10;var z=D(v).toHsl();return z.s-=L/100,z.s=y(z.s),D(z)}function O(v,L){L=L===0?0:L||10;var z=D(v).toHsl();return z.s+=L/100,z.s=y(z.s),D(z)}function S(v){return D(v).desaturate(100)}function R(v,L){L=L===0?0:L||10;var z=D(v).toHsl();return z.l+=L/100,z.l=y(z.l),D(z)}function A(v,L){L=L===0?0:L||10;var z=D(v).toRgb();return z.r=V(0,Y(255,z.r-M(255*-(L/100)))),z.g=V(0,Y(255,z.g-M(255*-(L/100)))),z.b=V(0,Y(255,z.b-M(255*-(L/100)))),D(z)}function P(v,L){L=L===0?0:L||10;var z=D(v).toHsl();return z.l-=L/100,z.l=y(z.l),D(z)}function w(v,L){var z=D(v).toHsl(),ee=(z.h+L)%360;return z.h=ee<0?360+ee:ee,D(z)}function E(v){var L=D(v).toHsl();return L.h=(L.h+180)%360,D(L)}function h(v){var L=D(v).toHsl(),z=L.h;return[D(v),D({h:(z+120)%360,s:L.s,l:L.l}),D({h:(z+240)%360,s:L.s,l:L.l})]}function f(v){var L=D(v).toHsl(),z=L.h;return[D(v),D({h:(z+90)%360,s:L.s,l:L.l}),D({h:(z+180)%360,s:L.s,l:L.l}),D({h:(z+270)%360,s:L.s,l:L.l})]}function T(v){var L=D(v).toHsl(),z=L.h;return[D(v),D({h:(z+72)%360,s:L.s,l:L.l}),D({h:(z+216)%360,s:L.s,l:L.l})]}function x(v,L,z){L=L||6,z=z||30;var ee=D(v).toHsl(),$=360/z,Ee=[D(v)];for(ee.h=(ee.h-($*L>>1)+720)%360;--L;)ee.h=(ee.h+$)%360,Ee.push(D(ee));return Ee}function _(v,L){L=L||6;for(var z=D(v).toHsv(),ee=z.h,$=z.s,Ee=z.v,Fe=[],qe=1/L;L--;)Fe.push(D({h:ee,s:$,v:Ee})),Ee=(Ee+qe)%1;return Fe}D.mix=function(v,L,z){z=z===0?0:z||50;var ee=D(v).toRgb(),$=D(L).toRgb(),Ee=z/100,Fe={r:($.r-ee.r)*Ee+ee.r,g:($.g-ee.g)*Ee+ee.g,b:($.b-ee.b)*Ee+ee.b,a:($.a-ee.a)*Ee+ee.a};return D(Fe)},D.readability=function(v,L){var z=D(v),ee=D(L);return(Q.max(z.getLuminance(),ee.getLuminance())+.05)/(Q.min(z.getLuminance(),ee.getLuminance())+.05)},D.isReadable=function(v,L,z){var ee=D.readability(v,L),$,Ee;Ee=!1,$=Z(z);switch($.level+$.size){case"AAsmall":case"AAAlarge":Ee=ee>=4.5;break;case"AAlarge":Ee=ee>=3;break;case"AAAsmall":Ee=ee>=7;break}return Ee},D.mostReadable=function(v,L,z){var ee=null,$=0,Ee,Fe,qe,Ce;z=z||{},Fe=z.includeFallbackColors,qe=z.level,Ce=z.size;for(var Me=0;Me<L.length;Me++)Ee=D.readability(v,L[Me]),Ee>$&&($=Ee,ee=D(L[Me]));return D.isReadable(v,ee,{level:qe,size:Ce})||!Fe?ee:(z.includeFallbackColors=!1,D.mostReadable(v,["#fff","#000"],z))};var j=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"},W=D.hexNames=C(j);function C(v){var L={};for(var z in v)v.hasOwnProperty(z)&&(L[v[z]]=z);return L}function F(v){return v=parseFloat(v),(isNaN(v)||v<0||v>1)&&(v=1),v}function k(v,L){J(v)&&(v="100%");var z=ae(v);return v=Y(L,V(0,parseFloat(v))),z&&(v=parseInt(v*L,10)/100),Q.abs(v-L)<1e-6?1:v%L/parseFloat(L)}function y(v){return Y(1,V(0,v))}function H(v){return parseInt(v,16)}function J(v){return typeof v=="string"&&v.indexOf(".")!=-1&&parseFloat(v)===1}function ae(v){return typeof v=="string"&&v.indexOf("%")!=-1}function fe(v){return v.length==1?"0"+v:""+v}function ge(v){return v<=1&&(v=v*100+"%"),v}function Te(v){return Q.round(parseFloat(v)*255).toString(16)}function Ue(v){return H(v)/255}var Se=function(){var v="[-\\+]?\\d+%?",L="[-\\+]?\\d*\\.\\d+%?",z="(?:"+L+")|(?:"+v+")",ee="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",$="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?";return{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+ee),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+ee),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+ee),hsva:new RegExp("hsva"+$),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 Le(v){return!!Se.CSS_UNIT.exec(v)}function ye(v){v=v.replace(B,"").replace(q,"").toLowerCase();var L=!1;if(j[v])v=j[v],L=!0;else if(v=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var z;return(z=Se.rgb.exec(v))?{r:z[1],g:z[2],b:z[3]}:(z=Se.rgba.exec(v))?{r:z[1],g:z[2],b:z[3],a:z[4]}:(z=Se.hsl.exec(v))?{h:z[1],s:z[2],l:z[3]}:(z=Se.hsla.exec(v))?{h:z[1],s:z[2],l:z[3],a:z[4]}:(z=Se.hsv.exec(v))?{h:z[1],s:z[2],v:z[3]}:(z=Se.hsva.exec(v))?{h:z[1],s:z[2],v:z[3],a:z[4]}:(z=Se.hex8.exec(v))?{r:H(z[1]),g:H(z[2]),b:H(z[3]),a:Ue(z[4]),format:L?"name":"hex8"}:(z=Se.hex6.exec(v))?{r:H(z[1]),g:H(z[2]),b:H(z[3]),format:L?"name":"hex"}:(z=Se.hex4.exec(v))?{r:H(z[1]+""+z[1]),g:H(z[2]+""+z[2]),b:H(z[3]+""+z[3]),a:Ue(z[4]+""+z[4]),format:L?"name":"hex8"}:(z=Se.hex3.exec(v))?{r:H(z[1]+""+z[1]),g:H(z[2]+""+z[2]),b:H(z[3]+""+z[3]),format:L?"name":"hex"}:!1}function Z(v){var L,z;return v=v||{level:"AA",size:"small"},L=(v.level||"AA").toUpperCase(),z=(v.size||"small").toLowerCase(),L!=="AA"&&L!=="AAA"&&(L="AA"),z!=="small"&&z!=="large"&&(z="small"),{level:L,size:z}}wt.exports?wt.exports=D:!(ne=function(){return D}.call(Pe,U,Pe,wt),ne!==void 0&&(wt.exports=ne))})(Math)},a99f:function(wt,Pe,U){"use strict";U.r(Pe);var ne=U("T2oS"),Q=U("W9HT"),B=U("14J3"),q=U("BMrR"),K=U("jCWc"),M=U("kPKH"),Y=U("sPJy"),V=U("bE4q"),r=U("k1fw"),D=U("oBTY"),m=U("miYZ"),p=U("tsqr"),g=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"),O=U("55Ip"),S=U("LvDl"),R=U("bbsP"),A=U("/wGt"),P=U("DjyN"),w=U("NUBc"),E=U("/zsF"),h=U("PArb"),f=U("5Dmo"),T=U("3S7+"),x=U("sRBo"),_=U("kaz8"),j=U("+L6B"),W=U("2/Rp"),C=U("5NDa"),F=U("5rEg"),k=U("xKgJ"),y=U("kCvp"),H=U.n(y),J=U("NLgs"),ae=U("9z17"),fe=F.a.Search,ge=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],Te=[{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"}]}],Ue=function(le){var Ne,We=le.classroomList,lt=le.shixunsList,Ct=le.dispatch,Rt=le.callback,It=le.inNewPaperLibrary,qn=Object(i.useState)(Object(r.a)({},Object(u.i)())),Vt=Object(a.a)(qn,2),qt=Vt[0],nn=Vt[1],On=We.shixunLists,ar=Object(i.useState)([]),cr=Object(a.a)(ar,2),Qn=cr[0],yr=cr[1],Sr=Object(i.useState)(""),Nn=Object(a.a)(Sr,2),Ar=Nn[0],Dn=Nn[1],Pn=Object(i.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),Zn=Object(a.a)(Pn,2),pr=Zn[0],Lr=Zn[1];Object(i.useEffect)(function(){return We.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")}},[We.actionTabs.key]);var Or=We.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(i.useEffect)(function(){Or&&Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},pr)})},[qt.categoryId,Or,pr]),Object(i.useEffect)(function(){Ct({type:"shixunsList/getMenus",payload:{}})},[]),Object(i.useEffect)(function(){yr([])},[We.actionTabs.key]);var at=Object(ae.b)(),Be=Object(a.a)(at,4),pt=Be[0],Ie=Be[1],xe=Be[2],ve=Be[3],Hn=function(dt,Re,an){pr.tag_level=dt,pr.sub_discipline_id=Re,pr.discipline_id=an,Lr(Object(r.a)({},pr))},kt=function(){var ke=Object(g.a)(s.a.mark(function dt(Re){var an,hr;return s.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:Rt&&Rt(On==null||((an=On.shixun_list)===null||an===void 0)?void 0:an.filter(function(Wt){return Wt.identifier===Qn[0]})[0],(hr=We.actionTabs)===null||hr===void 0?void 0:hr.editData,Re),Ct({type:"classroomList/setActionTabs",payload:{}}),Ie();case 3:case"end":return Kn.stop()}},dt)}));return function(Re){return ke.apply(this,arguments)}}();return We.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(){Ct({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!Or,key:"bottom",className:H.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(W.a,{size:"large",onClick:function(){Ct({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(W.a,{size:"large",onClick:Object(g.a)(s.a.mark(function ke(){var dt;return s.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(!(Qn.length>1)){an.next=4;break}p.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),an.next=16;break;case 4:if(!(Qn.length===0)){an.next=8;break}p.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),an.next=16;break;case 8:if(!It){an.next=12;break}kt(0),an.next=16;break;case 12:return an.next=14,ve({id:Qn[0],course_id:qt.coursesId,type:"shixun"});case 14:dt=an.sent,dt||kt(0);case 16:case"end":return an.stop()}},ke)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(fe,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Ar,onChange:function(dt){return Dn(dt.target.value)},className:H.a.search,onSearch:function(dt){pr.keyword=dt,pr.page=1,Lr(Object(r.a)({},pr))}})),t.a.createElement("section",{className:"edu-container"},ge.map(function(ke,dt){var Re;return t.a.createElement("ul",{className:H.a.menu,key:dt},t.a.createElement("li",null,ke.name),ke==null||((Re=ke.children)===null||Re===void 0)?void 0:Re.map(function(an,hr){return t.a.createElement("li",{key:hr,className:pr[ke.id]==an.id?H.a.actived:"",onClick:function(){pr[ke.id]=an.id,Lr(Object(r.a)({},pr)),Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},pr)})}},t.a.createElement("strong",null,an.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:pr.discipline_id?"":H.a.actived3,onClick:function(){Hn(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),lt.menus&<.menus.map(function(ke,dt){return t.a.createElement("li",{key:dt,className:pr.discipline_id==ke.id?H.a.actived3:""},t.a.createElement("strong",{onClick:function(){Hn(1,null,ke.id)}},ke.name),t.a.createElement("div",null,ke.sub_repertoires.map(function(Re,an){return t.a.createElement("div",{key:an,className:"mt5"},t.a.createElement("div",{className:pr.sub_discipline_id==Re.id?"".concat(H.a.actived4," ").concat(H.a.subTag):H.a.subTag,onClick:function(){Hn(2,Re.id,ke.id)}},Re.name),t.a.createElement("ul",{className:"mt5"},Re.tags&&Re.tags.map(function(hr,mr){return t.a.createElement("li",{key:mr,className:pr.sub_discipline_id==hr.id?H.a.actived4:"",onClick:function(){Hn(3,hr.id,ke.id)}},hr.name)})))})))})),Te.map(function(ke,dt){var Re;return t.a.createElement("ul",{className:H.a.menu,key:dt},t.a.createElement("li",null,ke.name),ke==null||((Re=ke.children)===null||Re===void 0)?void 0:Re.map(function(an,hr){return t.a.createElement("li",{key:hr,className:pr[ke.id]==an.id?H.a.actived:"",onClick:function(){pr[ke.id]=an.id,Lr(Object(r.a)({},pr)),Ct({type:"classroomList/getShixunLists",payload:Object(r.a)({},pr)})}},t.a.createElement("strong",null,an.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"},Qn.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},On.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){pr.order=pr.order==="asc"?"desc":"asc",Lr(Object(r.a)({},pr))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(pr.order)},pr.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:Qn,onChange:function(dt){yr(dt)}},On==null||((Ne=On.shixun_list)===null||Ne===void 0)?void 0:Ne.map(function(ke,dt){return t.a.createElement("div",{className:H.a.listItem,key:ke.identifier},t.a.createElement(_.a,{value:ke.identifier,disabled:ke==null?void 0:ke.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(O.a,{to:"/shixuns/".concat(ke.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:ke.title}})),(ke==null?void 0:ke.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(J.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===1&&t.a.createElement(T.a,{title:ke==null?void 0:ke.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===2&&t.a.createElement(T.a,{title:ke==null?void 0:ke.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(k.w)()&&(ke==null?void 0:ke.mark_status)===3&&t.a.createElement(T.a,{title:ke==null?void 0:ke.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:ke.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},ke.challenge_names.map(function(Re,an){return t.a.createElement("span",{key:an,className:"mr30"},"\u7B2C",an+1,"\u5173 ",Re," ")})),t.a.createElement(h.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,ke.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,ke.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",ke.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,ke.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(w.a,{defaultCurrent:1,current:pr.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:On==null?void 0:On.shixuns_count,onChange:function(dt){pr.page=dt,Lr(Object(r.a)({},pr)),yr([])}})),t.a.createElement(ae.a,{visible:pt,onCancel:Ie,onOk:kt,renderData:xe,inPaper:!0,modalType:"single",type:"shixun"}))},Se=Object(o.a)(function(Oe){var le=Oe.classroomList,Ne=Oe.shixunsList,We=Oe.user;return{classroomList:le,shixunsList:Ne,user:We}})(Ue),Le=U("sZF6"),ye=U("2aBv"),Z=U("zWo0"),v=U.n(Z),L=U("LYsE"),z=U("1vsH"),ee=U("vCeJ"),$=U("7Kak"),Ee=U("9yH6"),Fe=U("giR+"),qe=U("fyUT"),Ce=U("6UJt"),Me=U("DFOY"),He=U("rAM+"),Ke=U("y8nQ"),ut=U("Vl3Y"),bt=U("ZWs3"),Lt=function(le){var Ne=le.initValue,We=le.courseOptions,lt=le.setIsEdit,Ct=le.setEditKey,Rt=le.reload,It=ut.a.useForm(),qn=Object(a.a)(It,1),Vt=qn[0],qt=Object(u.i)(),nn=Object(i.useMemo)(function(){var On=Ne==null?void 0:Ne.sub_discipline_id,ar=[],cr=Object(He.a)(We),Qn;try{for(cr.s();!(Qn=cr.n()).done;){var yr=Qn.value,Sr=Object(He.a)(yr.children),Nn;try{for(Sr.s();!(Nn=Sr.n()).done;){var Ar=Nn.value;Ar.value===On&&(ar=[yr.value,Ar.value])}}catch(Pn){Sr.e(Pn)}finally{Sr.f()}}}catch(Pn){cr.e(Pn)}finally{cr.f()}var Dn=Ne.time;return Object(r.a)(Object(r.a)({},Ne),{},{sub_discipline_id:ar,time:Dn===-1?null:Dn})},[Ne,We]);return t.a.createElement(ut.a,{initialValues:nn,layout:"vertical",form:Vt,className:v.a.formWrap},t.a.createElement(ut.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(Me.a,{placeholder:"\u8BF7\u9009\u62E9...",options:We})),t.a.createElement(ut.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(ut.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(qe.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(ut.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(Ee.a.Group,null,t.a.createElement(Ee.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(Ee.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(Ee.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(ut.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(ut.a.Item,{className:"tr"},t.a.createElement(bt.a,{type:"primary",onClick:Object(g.a)(s.a.mark(function On(){var ar,cr;return s.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Vt.validateFields();case 2:return ar=Vt.getFieldsValue(),ar.sub_discipline_id=ar.sub_discipline_id[1],yr.next=6,Object(ee.z)(Object(r.a)({id:qt.id},ar));case 6:cr=yr.sent,cr.status===0&&(lt(!1),Ct(-1),Rt());case 8:case"end":return yr.stop()}},On)}))},"\u4FDD\u5B58"),t.a.createElement(W.a,{style:{marginLeft:10},onClick:function(){Vt.resetFields(),lt(!1)}},"\u53D6\u6D88")))},Ft=Lt,Yt=U("g9YV"),Xt=U("wCAj"),Je=U("+BqJ"),Qe=U.n(Je),_t=U("9Bee"),xt=function(le){var Ne=le.isPreview,We=Ne===void 0?!1:Ne,lt=le.isExportBlank,Ct=lt===void 0?!1:lt,Rt=le.newExercisePaper,It=le.setIsEdit,qn=Object(u.i)(),Vt=Object(i.useState)(),qt=Object(a.a)(Vt,2),nn=qt[0],On=qt[1],ar=Object(i.useState)(),cr=Object(a.a)(ar,2),Qn=cr[0],yr=cr[1],Sr=Object(i.useRef)(null),Nn=Object(i.useState)(21),Ar=Object(a.a)(Nn,2),Dn=Ar[0],Pn=Ar[1];Object(i.useEffect)(function(){Zn()},[]),Object(i.useEffect)(function(){Sr.current&&Pn(Sr.current.clientHeight)},[Sr.current]),Object(i.useEffect)(function(){var at;if((at=Rt.exerciseExportHeadData)!==null&&at!==void 0&&at.title){var Be=Rt.exerciseExportHeadData;On(Object(r.a)({},Be||{}));var pt=Be||{},Ie=pt.table,xe,ve;(Ie!=null&&Ie.total_singles_scores||Ie!=null&&Ie.total_doubles_scores||Ie!=null&&Ie.total_nulls_scores||Ie!=null&&Ie.total_judges_scores||Ie!=null&&Ie.total_pros_scores||Ie!=null&&Ie.total_shixuns_scores||Ie!=null&&Ie.total_mains_scores||Ie!=null&&Ie.total_combination_scores)&&(xe=Number(Ie==null?void 0:Ie.total_singles_scores)+Number(Ie==null?void 0:Ie.total_doubles_scores)+Number(Ie==null?void 0:Ie.total_nulls_scores)+Number(Ie==null?void 0:Ie.total_judges_scores)+Number(Ie==null?void 0:Ie.total_pros_scores)+Number(Ie==null?void 0:Ie.total_shixuns_scores)+Number(Ie==null?void 0:Ie.total_mains_scores)+Number(Ie==null?void 0:Ie.total_combination_scores)),(Ie!=null&&Ie.singles_scores||Ie!=null&&Ie.doubles_scores||Ie!=null&&Ie.nulls_scores||Ie!=null&&Ie.judges_scores||Ie!=null&&Ie.pros_scores||Ie!=null&&Ie.shixuns_scores||Ie!=null&&Ie.mains_scores||Ie!=null&&Ie.combination_scores)&&(ve=Number(Ie==null?void 0:Ie.singles_scores)+Number(Ie==null?void 0:Ie.doubles_scores)+Number(Ie==null?void 0:Ie.nulls_scores)+Number(Ie==null?void 0:Ie.judges_scores)+Number(Ie==null?void 0:Ie.pros_scores)+Number(Ie==null?void 0:Ie.shixuns_scores)+Number(Ie==null?void 0:Ie.mains_scores)+Number(Ie==null?void 0:Ie.combination_scores));var Hn=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ie==null?void 0:Ie.total_singles_scores,doubles_score:Ie==null?void 0:Ie.total_doubles_scores,nulls_score:Ie==null?void 0:Ie.total_nulls_scores,judges_score:Ie==null?void 0:Ie.total_judges_scores,pros_score:Ie==null?void 0:Ie.total_pros_scores,shixuns_score:Ie==null?void 0:Ie.total_shixuns_scores,mains_score:Ie==null?void 0:Ie.total_mains_scores,combinations_score:Ie==null?void 0:Ie.total_combination_scores,total_score:xe},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Ie==null?void 0:Ie.singles_scores,doubles_score:Ie==null?void 0:Ie.doubles_scores,nulls_score:Ie==null?void 0:Ie.nulls_scores,judges_score:Ie==null?void 0:Ie.judges_scores,pros_score:Ie==null?void 0:Ie.pros_scores,shixuns_score:Ie==null?void 0:Ie.shixuns_scores,mains_score:Ie==null?void 0:Ie.mains_scores,combinations_score:Ie==null?void 0:Ie.combination_scores,total_score:ve},{key:"3",name:"\u8BC4\u5377\u4EBA"}],kt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ie==null?void 0:Ie.total_singles_scores,doubles_score:Ie==null?void 0:Ie.total_doubles_scores,nulls_score:Ie==null?void 0:Ie.total_nulls_scores,judges_score:Ie==null?void 0:Ie.total_judges_scores,pros_score:Ie==null?void 0:Ie.total_pros_scores,shixuns_score:Ie==null?void 0:Ie.total_shixuns_scores,mains_score:Ie==null?void 0:Ie.total_mains_scores,combinations_score:Ie==null?void 0:Ie.combination_scores,total_score:xe},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];yr(Object(D.a)(Ct?kt:Hn))}},[Rt.exerciseExportHeadData]);var Zn=function(){var at=Object(g.a)(s.a.mark(function Be(){var pt,Ie,xe,ve,Hn,kt,ke;return s.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,Object(ee.m)(qn.id);case 2:pt=Re.sent,On(pt||{}),Ie=pt||{},xe=Ie.table,(xe!=null&&xe.total_singles_scores||xe!=null&&xe.total_doubles_scores||xe!=null&&xe.total_nulls_scores||xe!=null&&xe.total_judges_scores||xe!=null&&xe.total_pros_scores||xe!=null&&xe.total_shixuns_scores||xe!=null&&xe.total_mains_scores||xe!=null&&xe.total_combination_scores)&&(ve=Number(xe==null?void 0:xe.total_singles_scores)+Number(xe==null?void 0:xe.total_doubles_scores)+Number(xe==null?void 0:xe.total_nulls_scores)+Number(xe==null?void 0:xe.total_judges_scores)+Number(xe==null?void 0:xe.total_pros_scores)+Number(xe==null?void 0:xe.total_shixuns_scores)+Number(xe==null?void 0:xe.total_mains_scores)+Number(xe==null?void 0:xe.total_combination_scores)),(xe!=null&&xe.singles_scores||xe!=null&&xe.doubles_scores||xe!=null&&xe.nulls_scores||xe!=null&&xe.judges_scores||xe!=null&&xe.pros_scores||xe!=null&&xe.shixuns_scores||xe!=null&&xe.mains_scores||xe!=null&&xe.combinations_score)&&(Hn=Number(xe==null?void 0:xe.singles_scores)+Number(xe==null?void 0:xe.doubles_scores)+Number(xe==null?void 0:xe.nulls_scores)+Number(xe==null?void 0:xe.judges_scores)+Number(xe==null?void 0:xe.pros_scores)+Number(xe==null?void 0:xe.shixuns_scores)+Number(xe==null?void 0:xe.mains_scores)+Number(xe==null?void 0:xe.combinations_score)),kt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:xe==null?void 0:xe.total_singles_scores,doubles_score:xe==null?void 0:xe.total_doubles_scores,nulls_score:xe==null?void 0:xe.total_nulls_scores,judges_score:xe==null?void 0:xe.total_judges_scores,pros_score:xe==null?void 0:xe.total_pros_scores,shixuns_score:xe==null?void 0:xe.total_shixuns_scores,combinations_score:xe==null?void 0:xe.total_combination_scores,mains_score:xe==null?void 0:xe.total_mains_scores,total_score:ve},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:xe==null?void 0:xe.singles_scores,doubles_score:xe==null?void 0:xe.doubles_scores,nulls_score:xe==null?void 0:xe.nulls_scores,judges_score:xe==null?void 0:xe.judges_scores,pros_score:xe==null?void 0:xe.pros_scores,shixuns_score:xe==null?void 0:xe.shixuns_scores,mains_score:xe==null?void 0:xe.mains_scores,combinations_score:xe==null?void 0:xe.combination_scores,total_score:Hn},{key:"3",name:"\u8BC4\u5377\u4EBA"}],ke=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],yr(Ct?ke:kt);case 10:case"end":return Re.stop()}},Be)}));return function(){return at.apply(this,arguments)}}(),pr=[{width:"10%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:function(Be){return t.a.createElement("a",null,Be)}},{width:"10%",title:"\u5355\u9009\u9898",align:"center",dataIndex:"singles_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u591A\u9009\u9898",align:"center",dataIndex:"doubles_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u586B\u7A7A\u9898",align:"center",dataIndex:"nulls_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u5224\u65AD\u9898",align:"center",dataIndex:"judges_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u7F16\u7A0B\u9898",align:"center",dataIndex:"pros_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u5B9E\u8BAD\u9898",align:"center",dataIndex:"shixuns_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u7B80\u7B54\u9898",align:"center",dataIndex:"mains_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u7EC4\u5408\u9898",align:"center",dataIndex:"combinations_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}},{width:"10%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:function(Be){return t.a.createElement("a",null,Be==="0.0"?0:Be)}}],Lr=nn||{},Or=Lr.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(Qe.a.wrap," ").concat(We?"pl20":""," ")},(nn==null?void 0:nn.photo_url)&&t.a.createElement("img",{className:Qe.a.img,src:nn==null?void 0:nn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(W.a,{onClick:function(){return It(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(Or==null?void 0:Or.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,nn==null?void 0:nn.title)),(nn==null?void 0:nn.exercise_description)&&t.a.createElement("span",{ref:Sr,style:{justifyContent:Dn===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(nn==null?void 0:nn.exercise_description)),(Or==null?void 0:Or.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",nn==null?void 0:nn.large_counts,"\u5927\u9898\u3011\u3010",nn==null?void 0:nn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",nn==null?void 0:nn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(nn==null?void 0:nn.time)>-1?"".concat(nn==null?void 0:nn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(Or==null?void 0:Or.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(_t.a,{value:nn==null?void 0:nn.description})),(Or==null?void 0:Or.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(Xt.a,{className:Qe.a.table,columns:pr,dataSource:Object(D.a)(Qn||[]),bordered:!0,pagination:!1}))))},_e=Object(o.a)(function(Oe){var le=Oe.newExercisePaper;return{newExercisePaper:le}})(xt),ie=U("VYcG"),oe=function(le){var Ne=le.onImport,We=le.questionType,lt=le.onAdd,Ct=le.onSort,Rt=le.user,It=Object(u.i)(),qn=function(){var Vt=Object(g.a)(s.a.mark(function qt(){var nn,On;return s.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return cr.next=2,Object(ee.h)(It.id);case 2:nn=cr.sent,nn.status===0&&o.d.push("/classrooms/coursesId/exercise/".concat(nn.exercise_id,"/").concat((On=Rt.userInfo)===null||On===void 0?void 0:On.login,"/initate_answer"));case 4:case"end":return cr.stop()}},qt)}));return function(){return Vt.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:[v.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(W.a,{style:{height:30,marginRight:10,width:104},type:"primary",onClick:function(){o.d.push("/paperlibrary/edit_select/".concat(It.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(W.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Ne},"\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}},We.map(function(Vt){return t.a.createElement("span",{key:Vt.id,className:v.a.button,onClick:function(){return lt(Vt.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),Vt.name)})),t.a.createElement("div",{style:{marginRight:"25px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement(W.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8",onClick:Ct},t.a.createElement("i",{className:"iconfont icon-tixingpaixu mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9898\u578B\u6392\u5E8F"),t.a.createElement(W.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8"},t.a.createElement(O.a,{to:"/paperlibrary/see/".concat(It.id)},t.a.createElement("i",{className:"iconfont icon-yulan mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9884\u89C8")),t.a.createElement(W.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},onClick:Object(S.throttle)(qn,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},ce=Object(o.a)(function(Oe){var le=Oe.user;return{user:le}})(oe),we=U("hQp1"),de=function(le){var Ne,We,lt,Ct=le.exercise,Rt=le.newExercisePaper,It=le.user,qn=le.dispatch,Vt=Object(u.i)(),qt=Object(i.useState)(!1),nn=Object(a.a)(qt,2),On=nn[0],ar=nn[1],cr=Object(i.useState)(!1),Qn=Object(a.a)(cr,2),yr=Qn[0],Sr=Qn[1],Nn=Object(i.useState)(-1),Ar=Object(a.a)(Nn,2),Dn=Ar[0],Pn=Ar[1],Zn=Object(i.useRef)(),pr=[{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"}],Lr=Object(z.I)();Object(i.useEffect)(function(){return qn({type:"globalSetting/footerToggle",payload:!1}),function(){qn({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(i.useEffect)(function(){Hn()},[]);var Or=Object(ie.useCourseOptions)();Object(i.useEffect)(function(){var yn,un,Qt;if(Rt!=null&&(yn=Rt.editData)!==null&&yn!==void 0&&yn.exercise_question_types){var Ln,hn;xe(Object(S.cloneDeep)(Rt==null||((Ln=Rt.editData)===null||Ln===void 0)?void 0:Ln.exercise_question_types)),ve.current=Object(S.cloneDeep)(Rt==null||((hn=Rt.editData)===null||hn===void 0)?void 0:hn.exercise_question_types)}var en=(un=Rt.editData)===null||un===void 0||((Qt=un.exercise)===null||Qt===void 0)?void 0:Qt.sub_discipline_id;en&&at(en)},[Rt.editData]);var at=function(){var yn=Object(g.a)(s.a.mark(function un(Qt){return s.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,qn({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:Qt}});case 2:case"end":return hn.stop()}},un)}));return function(Qt){return yn.apply(this,arguments)}}(),Be=Object(i.useState)(),pt=Object(a.a)(Be,2),Ie=pt[0],xe=pt[1],ve=Object(i.useRef)(Ie),Hn=function(){var yn=Object(g.a)(s.a.mark(function un(){var Qt;return s.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:Qt=qn({type:"newExercisePaper/editExercise",payload:{id:Vt.id}}),Qt.status===0&&xe(Qt.exercise_question_types);case 2:case"end":return hn.stop()}},un)}));return function(){return yn.apply(this,arguments)}}(),kt=function(){var yn=Object(g.a)(s.a.mark(function un(Qt){var Ln,hn,en,Ut,Kt,sr,or;return s.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!(Dn!==-1)){bn.next=3;break}return p.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),bn.abrupt("return");case 3:if(!(Qt===we.a.Shixun)){bn.next=7;break}qn({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),bn.next=21;break;case 7:if(!(Qt===we.a.Program)){bn.next=11;break}o.d.push("/problems/new?difficult=".concat((Ln=Rt.editData)===null||Ln===void 0||((hn=Ln.exercise)===null||hn===void 0)?void 0:hn.difficulty,"&sub_discipline_id=").concat((en=Rt.editData)===null||en===void 0||((Ut=en.exercise)===null||Ut===void 0)?void 0:Ut.sub_discipline_id,"&express_id=").concat(Vt.id,"&callback_url=").concat(location.pathname)),bn.next=21;break;case 11:if(sr=Ie.find(function(Bt){return Bt.question_type===Qt}),sr){bn.next=18;break}return ve.current=Object(S.cloneDeep)(Ie),Ie.push({name:pr.find(function(Bt){return Bt.id===Qt}).name,question_type:Qt,count:0,score:0,items:[{key:1,insert_id:1,question_type:Qt}]}),xe(Object(D.a)(Ie)),Pn("".concat(Qt,"-",1)),bn.abrupt("return");case 18:setTimeout(function(){var Bt;(Bt=document.getElementById("".concat(Qt,"-").concat(sr.count-1)))===null||Bt===void 0||Bt.scrollIntoView()},400),or={key:sr.count,insert_id:(Kt=sr.items[sr.count])===null||Kt===void 0?void 0:Kt.question_id,question_type:Qt},dt(or);case 21:case"end":return bn.stop()}},un)}));return function(Qt){return yn.apply(this,arguments)}}(),ke=function(){Pn(-1),xe(ve.current)},dt=function(){var un=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ve.current=Object(S.cloneDeep)(Ie),un.question_type===we.a.Program){var Qt,Ln,hn,en;return o.d.push("/problems/new?difficult=".concat((Qt=Rt.editData)===null||Qt===void 0||((Ln=Qt.exercise)===null||Ln===void 0)?void 0:Ln.difficulty,"&sub_discipline_id=").concat((hn=Rt.editData)===null||hn===void 0||((en=hn.exercise)===null||en===void 0)?void 0:en.sub_discipline_id,"&express_id=").concat(Vt.id,"&callback_url=").concat(location.pathname)),!1}Ie.map(function(Ut){if(Ut.question_type===un.question_type){var Kt=Object(S.cloneDeep)(Ut.items);Kt.splice(un==null?void 0:un.key,0,Object(r.a)({insert_id:un==null?void 0:un.insert_id},un)),Ut.items=Kt}return Ut}),xe(Object(D.a)(Ie)),Pn("".concat(un.question_type,"-").concat(un.key+1))},Re={ref:Zn,editKey:Dn,hideAction:!1,cancelAdd:function(){return ke()},setEditKey:function(un){return Pn(un)},addCallback:function(un){return dt(un)}},an=Object(i.useState)(!1),hr=Object(a.a)(an,2),mr=hr[0],Kn=hr[1],Wt=function(){var yn=Object(g.a)(s.a.mark(function un(Qt,Ln){var hn,en;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(!(Qt.length===0)){Kt.next=4;break}return p.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),Ln(),Kt.abrupt("return");case 4:return Kt.next=6,Object(ee.s)(Vt.id,(hn=Qt[0])===null||hn===void 0?void 0:hn.file);case 6:en=Kt.sent,en.status===0&&(p.b.success("\u6210\u529F\u5BFC\u5165".concat(en==null?void 0:en.success,"\u6761")),Kn(!1),Hn());case 8:case"end":return Kt.stop()}},un)}));return function(Qt,Ln){return yn.apply(this,arguments)}}(),dr=function(){var yn=Object(g.a)(s.a.mark(function un(Qt,Ln){var hn;return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(ee.y)(Vt.id,{question_type:Qt});case 2:hn=Ut.sent,(hn==null?void 0:hn.status)===0&&(p.b.success(hn==null?void 0:hn.message),Sr(!1),Hn()),Ln();case 5:case"end":return Ut.stop()}},un)}));return function(Qt,Ln){return yn.apply(this,arguments)}}(),ht=function(){if(Dn!==-1){p.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}Kn(!0)},Un=function(){var yn=Object(g.a)(s.a.mark(function un(Qt,Ln,hn){var en,Ut,Kt;return s.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:return ve.current=Object(S.cloneDeep)(Ie),en=Ie.findIndex(function(Fn){return Fn.question_type===hn}),Ut=Ie,Ut[en].items=Ln,xe(Object(D.a)(Ut)),or.next=7,Object(ee.a)({id:Vt.id,itemId:parseInt(Qt.draggableId),position:Qt.destination.index+1});case 7:Kt=or.sent;case 8:case"end":return or.stop()}},un)}));return function(Qt,Ln,hn){return yn.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(V.a,{separator:">"},t.a.createElement(V.a.Item,null,t.a.createElement(O.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(V.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(v.a.title," mt20")},t.a.createElement(q.a,{style:{width:"100%"}},t.a.createElement(M.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(M.a,null,t.a.createElement(O.a,{className:"font16 c-light-black",to:(Lr==null?void 0:Lr.fromadd)==="1"?"/paperlibrary/add/".concat(Vt.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[v.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!On&&t.a.createElement(_e,{setIsEdit:ar,isExportBlank:!1}),On&&t.a.createElement(Ft,{initValue:(Ne=Rt.editData)===null||Ne===void 0?void 0:Ne.exercise,setIsEdit:ar,courseOptions:Or,reload:Hn,setEditKey:Pn})),Ie&&t.a.createElement("section",{className:[v.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(L.a,{inNewPaperLibrary:!0,data:Ie,editorProps:Re,isDragDisabled:Dn!==-1,onDragEnd:Un,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:Hn})),t.a.createElement(Se,{inNewPaperLibrary:!0,callback:function(un,Qt,Ln){var hn;ve.current=Object(S.cloneDeep)(Ie);var en={shixun:un.challenge_names.map(function(sr){return{challenge_name:sr,challenge_score:5}}),shixun_name:un==null||((hn=un.title)===null||hn===void 0)?void 0:hn.replace(/<.*?>/gi,""),shixun_id:un.id,question_type:5,edit:!0,is_copy:Ln};if(Qt&&(Ie.map(function(sr){if(sr.question_type===5){var or=Object(S.cloneDeep)(sr.items);or.splice(Qt==null?void 0:Qt.key,0,en),sr.items=or}return sr}),Pn("5-".concat(Ie.key+1)),xe(Object(D.a)(Ie))),!Qt){var Ut,Kt=Ie.find(function(sr){return sr.question_type===5});if(!Kt){Ie.push({name:pr.find(function(sr){return sr.id===5}).name,question_type:5,count:0,score:0,items:[en]}),xe(Object(D.a)(Ie)),Pn("".concat(5,"-",1));return}(Ut=document.getElementById("".concat(5,"-",Kt.count-1)))===null||Ut===void 0||Ut.scrollIntoView({block:"center",inline:"nearest"}),Kt.items.push(en),xe(Object(D.a)(Ie)),Pn("".concat(5,"-",Kt.count))}}})),t.a.createElement(Le.a,{visible:mr,onCancel:function(){return Kn(!1)},onOk:Wt}),t.a.createElement(ye.a,{visible:yr,onCancel:function(){return Sr(!1)},onOk:dr,data:(We=Rt.editData)===null||We===void 0||((lt=We.exercise)===null||lt===void 0)?void 0:lt.sort_by_qustion_type})),t.a.createElement(ce,{questionType:pr,onAdd:kt,onImport:ht,onSort:function(){return Sr(!0)}}))},he=Pe.default=Object(o.a)(function(Oe){var le=Oe.exercise,Ne=Oe.newExercisePaper,We=Oe.user;return{exercise:le,user:We,newExercisePaper:Ne}})(de)},bT9E:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Q});var ne=U("VTBJ");function Q(B,q){var K=Object(ne.a)({},B);return Array.isArray(q)&&q.forEach(function(M){delete K[M]}),K}},biw7:function(wt,Pe,U){"use strict";var ne=U("q1tI"),Q=U.n(ne),B=ne.createContext(null);Pe.a=B},c5Ni:function(wt,Pe,U){},dejd:function(wt,Pe,U){},dmUQ:function(wt,Pe,U){"use strict";var ne=U("Ff2n"),Q=U("rePB"),B=U("1OyB"),q=U("vuIU"),K=U("Ji7U"),M=U("md7G"),Y=U("foSv"),V=U("q1tI"),r=U.n(V),D=U("TSYQ"),m=U.n(D),p=U("4IlW");function g(h,f){var T=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);f&&(x=x.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),T.push.apply(T,x)}return T}function a(h){for(var f=1;f<arguments.length;f++){var T=arguments[f]!=null?arguments[f]:{};f%2?g(Object(T),!0).forEach(function(x){Object(Q.a)(h,x,T[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(T)):g(Object(T)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(T,x))})}return h}function c(h){var f=s();return function(){var x=Object(Y.a)(h),_;if(f){var j=Object(Y.a)(this).constructor;_=Reflect.construct(x,arguments,j)}else _=x.apply(this,arguments);return Object(M.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,O=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,R=function(f){return f!=null},A=function(f,T){return T===f||typeof T=="number"&&typeof f=="number"&&isNaN(T)&&isNaN(f)},P=function(h){Object(K.a)(T,h);var f=c(T);function T(x){var _;Object(B.a)(this,T),_=f.call(this,x),_.onKeyDown=function(C){var F=_.props,k=F.onKeyDown,y=F.onPressEnter;if(C.keyCode===p.a.UP){var H=_.getRatio(C);_.up(C,H,null),_.stop()}else if(C.keyCode===p.a.DOWN){var J=_.getRatio(C);_.down(C,J,null),_.stop()}else C.keyCode===p.a.ENTER&&y&&y(C);if(_.recordCursorPosition(),_.lastKeyCode=C.keyCode,k){for(var ae=arguments.length,fe=new Array(ae>1?ae-1:0),ge=1;ge<ae;ge++)fe[ge-1]=arguments[ge];k.apply(void 0,[C].concat(fe))}},_.onKeyUp=function(C){var F=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),F){for(var k=arguments.length,y=new Array(k>1?k-1:0),H=1;H<k;H++)y[H-1]=arguments[H];F.apply(void 0,[C].concat(y))}},_.onChange=function(C){var F=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(C)),_.setState({inputValue:_.rawInput}),F(_.toNumber(_.rawInput))},_.onMouseUp=function(){var C=_.props.onMouseUp;_.recordCursorPosition(),C&&C.apply(void 0,arguments)},_.onFocus=function(){var C;_.setState({focused:!0}),(C=_.props).onFocus.apply(C,arguments)},_.onBlur=function(){var C=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var F=_.getCurrentValidValue(_.state.inputValue),k=_.setValue(F,i);if(C){var y=_.input.value,H=_.getInputDisplayValue({focus:!1,value:k});_.input.value=H&&Number(H),C.apply(void 0,arguments),_.input.value=y}},_.getRatio=function(C){var F=1;return C.metaKey||C.ctrlKey?F=.1:C.shiftKey&&(F=10),F},_.getFullNum=function(C){return isNaN(C)?C:/e/i.test(String(C))?Number(C).toFixed(18).replace(/\.?0+$/,""):C},_.getPrecision=function(C){if(R(_.props.precision))return _.props.precision;var F=String(C);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var k=0;return F.indexOf(".")>=0&&(k=F.length-F.indexOf(".")-1),k},_.getInputDisplayValue=function(C){var F=C||_.state,k=F.focused,y=F.inputValue,H=F.value,J;k?J=y:J=_.toPrecisionAsStep(H),J==null&&(J="");var ae=_.formatWrapper(J);return R(_.props.decimalSeparator)&&(ae=ae.toString().replace(".",_.props.decimalSeparator)),ae},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(C){}},_.restoreByAfter=function(C){if(C===void 0)return!1;var F=_.input.value,k=F.lastIndexOf(C);if(k===-1)return!1;var y=_.cursorBefore.length;return _.lastKeyCode===p.a.DELETE&&_.cursorBefore.charAt(y-1)===C[0]?(_.fixCaret(y,y),!0):k+C.length===F.length?(_.fixCaret(k,k),!0):!1},_.partRestoreByAfter=function(C){return C===void 0?!1:Array.prototype.some.call(C,function(F,k){var y=C.substring(k);return _.restoreByAfter(y)})},_.isNotCompleteNumber=function(C){return isNaN(C)||C===""||C===null||C&&C.toString().indexOf(".")===C.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(C,F,k){_.pressingUpOrDown=!0,_.step("down",C,F,k)},_.up=function(C,F,k){_.pressingUpOrDown=!0,_.step("up",C,F,k)},_.saveInput=function(C){_.input=C};var j=x.value;j===void 0&&(j=x.defaultValue),_.state={focused:x.autoFocus};var W=_.getValidValue(_.toNumber(j));return _.state=a(a({},_.state),{},{inputValue:_.toPrecisionAsStep(W),value:W}),_}return Object(q.a)(T,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var j=this.props,W=j.value,C=j.onChange,F=j.max,k=j.min,y=this.state.focused;if(_){if(!A(_.value,W)||!A(_.max,F)||!A(_.min,k)){var H=y?W:this.getValidValue(W),J;this.pressingUpOrDown?J=H:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:J})}var ae="value"in this.props?W:this.state.value;"max"in this.props&&_.max!==F&&typeof ae=="number"&&ae>F&&C&&C(F),"min"in this.props&&_.min!==k&&typeof ae=="number"&&ae<k&&C&&C(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ge){}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 j=_;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(_){var j=_.target.value.trim().replace(/。/g,".");return R(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,C=parseFloat(_);return isNaN(C)?_:(C<j&&(C=j),C>W&&(C=W),C)}},{key:"setValue",value:function(_,j){var W=this.props.precision,C=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),F=this.state.value,k=F===void 0?null:F,y=this.state.inputValue,H=y===void 0?null:y,J=typeof C=="number"?C.toFixed(W):"".concat(C),ae=C!==k||J!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},j)):this.setState({value:C,inputValue:this.toPrecisionAsStep(_)},j),ae&&this.props.onChange(C),C}},{key:"getMaxPrecision",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,C=W.precision,F=W.step;if(R(C))return C;var k=this.getPrecision(j),y=this.getPrecision(F),H=this.getPrecision(_);return _?Math.max(H,k+y):k+y}},{key:"getPrecisionFactor",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(_,j);return Math.pow(10,W)}},{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 j=Math.abs(this.getMaxPrecision(_));return isNaN(j)?_.toString():Number(_).toFixed(j)}},{key:"toNumber",value:function(_){var j=this.props.precision,W=this.state.focused,C=_&&_.length>16&&W;return this.isNotCompleteNumber(_)||C?_:R(j)?Math.round(_*Math.pow(10,j))/Math.pow(10,j):Number(_)}},{key:"upStep",value:function(_,j){var W=this.props.step,C=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),k=((C*_+C*W*j)/C).toFixed(F);return this.toNumber(k)}},{key:"downStep",value:function(_,j){var W=this.props.step,C=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),k=((C*_-C*W*j)/C).toFixed(F);return this.toNumber(k)}},{key:"step",value:function(_,j){var W=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var k=this.props;if(k.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var H=this["".concat(_,"Step")](y,C),J=H>k.max||H<k.min;if(H>k.max?H=k.max:H<k.min&&(H=k.min),this.setValue(H,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){W[_](j,C,!0)},F?o:O)}},{key:"fixCaret",value:function(_,j){if(_===void 0||j===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,C=this.input.selectionEnd;(_!==W||j!==C)&&this.input.setSelectionRange(_,j)}catch(F){}}},{key:"render",value:function(){var _,j=this.props,W=j.prefixCls,C=j.disabled,F=j.readOnly,k=j.useTouch,y=j.autoComplete,H=j.upHandler,J=j.downHandler,ae=j.className,fe=j.max,ge=j.min,Te=j.style,Ue=j.title,Se=j.onMouseEnter,Le=j.onMouseLeave,ye=j.onMouseOver,Z=j.onMouseOut,v=j.required,L=j.onClick,z=j.tabIndex,ee=j.type,$=j.placeholder,Ee=j.id,Fe=j.inputMode,qe=j.pattern,Ce=j.step,Me=j.maxLength,He=j.autoFocus,Ke=j.name,ut=j.onPaste,bt=j.onInput,Lt=Object(ne.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ft=this.state,Yt=Ft.value,Xt=Ft.focused,Je=m()(W,(_={},Object(Q.a)(_,ae,!!ae),Object(Q.a)(_,"".concat(W,"-disabled"),C),Object(Q.a)(_,"".concat(W,"-focused"),Xt),_)),Qe={};Object.keys(Lt).forEach(function(le){(le.substr(0,5)==="data-"||le.substr(0,5)==="aria-"||le==="role")&&(Qe[le]=Lt[le])});var _t=!F&&!C,xt=this.getInputDisplayValue(null),_e=(Yt||Yt===0)&&(isNaN(Yt)||Number(Yt)>=fe),ie=(Yt||Yt===0)&&(isNaN(Yt)||Number(Yt)<=ge),oe=_e||C||F,ce=ie||C||F,we=m()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Q.a)({},"".concat(W,"-handler-up-disabled"),oe)),de=m()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Q.a)({},"".concat(W,"-handler-down-disabled"),ce)),he=k?{onTouchStart:oe?i:this.up,onTouchEnd:this.stop}:{onMouseDown:oe?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Oe=k?{onTouchStart:ce?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:Je,style:Te,title:Ue,onMouseEnter:Se,onMouseLeave:Le,onMouseOver:ye,onMouseOut:Z,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(W,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Increase Value","aria-disabled":oe,className:we}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:t})),r.a.createElement("span",Object.assign({unselectable:"on"},Oe,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:de}),J||r.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:t}))),r.a.createElement("div",{className:"".concat(W,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ge,"aria-valuemax":fe,"aria-valuenow":Yt,required:v,type:ee,placeholder:$,onPaste:ut,onClick:L,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:z,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:_t?this.onKeyDown:i,onKeyUp:_t?this.onKeyUp:i,autoFocus:He,maxLength:Me,readOnly:F,disabled:C,max:fe,min:ge,step:Ce,name:Ke,title:Ue,id:Ee,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(xt),pattern:qe,inputMode:Fe,onInput:bt},Qe))))}}]),T}(r.a.Component);P.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:u,required:!1,autoComplete:"off"};var w=P,E=Pe.a=w},fcSX:function(wt,Pe,U){"use strict";var ne=U("Ff2n"),Q=U("1OyB"),B=U("vuIU"),q=U("Ji7U"),K=U("md7G"),M=U("foSv"),Y=U("1W/9"),V=U("q1tI"),r=U("rePB"),D=U("JX7q"),m=U("TSYQ"),p=U.n(m),g=U("qx4F"),a=U("4IlW");function c(C){return Array.isArray(C)?C:[C]}var s={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(s).filter(function(C){if(typeof document=="undefined")return!1;var F=document.getElementsByTagName("html")[0];return C in(F?F.style:{})})[0],t=s[i];function u(C,F,k,y){C.addEventListener?C.addEventListener(F,k,y):C.attachEvent&&C.attachEvent("on".concat(F),k)}function o(C,F,k,y){C.removeEventListener?C.removeEventListener(F,k,y):C.attachEvent&&C.detachEvent("on".concat(F),k)}function O(C,F){var k=typeof C=="function"?C(F):C;return Array.isArray(k)?k.length===2?k:[k[0],k[1]]:[k]}var S=function(F){return!isNaN(parseFloat(F))&&isFinite(F)},R=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function C(F,k,y,H){if(!k||k===document||k instanceof Document)return!1;if(k===F.parentNode)return!0;var J=Math.max(Math.abs(y),Math.abs(H))===Math.abs(H),ae=Math.max(Math.abs(y),Math.abs(H))===Math.abs(y),fe=k.scrollHeight-k.clientHeight,ge=k.scrollWidth-k.clientWidth,Te=document.defaultView.getComputedStyle(k),Ue=Te.overflowY==="auto"||Te.overflowY==="scroll",Se=Te.overflowX==="auto"||Te.overflowX==="scroll",Le=fe&&Ue,ye=ge&&Se;return J&&(!Le||Le&&(k.scrollTop>=fe&&H<0||k.scrollTop<=0&&H>0))||ae&&(!ye||ye&&(k.scrollLeft>=ge&&y<0||k.scrollLeft<=0&&y>0))?C(F,k.parentNode,y,H):!1};function P(C){var F=w();return function(){var y=Object(M.a)(C),H;if(F){var J=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,J)}else H=y.apply(this,arguments);return Object(K.a)(this,H)}}function w(){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(C){return!1}}var E={},h=function(C){Object(q.a)(k,C);var F=P(k);function k(y){var H;return Object(Q.a)(this,k),H=F.call(this,y),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(J){if(J.touches.length>1)return;H.startPos={x:J.touches[0].clientX,y:J.touches[0].clientY}},H.removeMoveHandler=function(J){if(J.changedTouches.length>1)return;var ae=J.currentTarget,fe=J.changedTouches[0].clientX-H.startPos.x,ge=J.changedTouches[0].clientY-H.startPos.y;(ae===H.maskDom||ae===H.handlerDom||ae===H.contentDom&&A(ae,J.target,fe,ge))&&J.cancelable&&J.preventDefault()},H.transitionEnd=function(J){var ae=J.target;o(ae,t,H.transitionEnd),ae.style.transition=""},H.onKeyDown=function(J){if(J.keyCode===a.a.ESC){var ae=H.props.onClose;J.stopPropagation(),ae&&ae(J)}},H.onWrapperTransitionEnd=function(J){var ae=H.props,fe=ae.open,ge=ae.afterVisibleChange;J.target===H.contentWrapper&&J.propertyName.match(/transform$/)&&(H.dom.style.transition="",!fe&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),ge&&ge(!!fe))},H.openLevelTransition=function(){var J=H.props,ae=J.open,fe=J.width,ge=J.height,Te=H.getHorizontalBoolAndPlacementName(),Ue=Te.isHorizontal,Se=Te.placementName,Le=H.contentDom?H.contentDom.getBoundingClientRect()[Ue?"width":"height"]:0,ye=(Ue?fe:ge)||Le;H.setLevelAndScrolling(ae,Se,ye)},H.setLevelTransform=function(J,ae,fe,ge){var Te=H.props,Ue=Te.placement,Se=Te.levelMove,Le=Te.duration,ye=Te.ease,Z=Te.showMask;H.levelDom.forEach(function(v){v.style.transition="transform ".concat(Le," ").concat(ye),u(v,t,H.transitionEnd);var L=J?fe:0;if(Se){var z=O(Se,{target:v,open:J});L=J?z[0]:z[1]||0}var ee=typeof L=="number"?"".concat(L,"px"):L,$=Ue==="left"||Ue==="top"?ee:"-".concat(ee);$=Z&&Ue==="right"&&ge?"calc(".concat($," + ").concat(ge,"px)"):$,v.style.transform=L?"".concat(ae,"(").concat($,")"):""})},H.setLevelAndScrolling=function(J,ae,fe){var ge=H.props.onChange;if(!R){var Te=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(g.a)(!0):0;H.setLevelTransform(J,ae,fe,Te),H.toggleScrollingToDrawerAndBody(Te)}ge&&ge(J)},H.toggleScrollingToDrawerAndBody=function(J){var ae=H.props,fe=ae.getOpenCount,ge=ae.getContainer,Te=ae.showMask,Ue=ae.open,Se=ge&&ge(),Le=fe&&fe();if(Se&&Se.parentNode===document.body&&Te){var ye=["touchstart"],Z=[document.body,H.maskDom,H.handlerDom,H.contentDom];Ue&&document.body.style.overflow!=="hidden"?(J&&H.addScrollingEffect(J),Le===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Z.forEach(function(v,L){if(!v)return;u(v,ye[L]||"touchmove",L?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Le||(document.body.style.overflow=""),document.body.style.touchAction="",J&&H.remScrollingEffect(J),Z.forEach(function(v,L){if(!v)return;o(v,ye[L]||"touchmove",L?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(J){var ae=H.props,fe=ae.placement,ge=ae.duration,Te=ae.ease,Ue=ae.getOpenCount,Se=ae.switchScrollingEffect,Le=Ue&&Ue();Le===1&&Se();var ye="width ".concat(ge," ").concat(Te),Z="transform ".concat(ge," ").concat(Te);H.dom.style.transition="none";switch(fe){case"right":H.dom.style.transform="translateX(-".concat(J,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(J,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(Z,",").concat(ye),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(J){var ae=H.props,fe=ae.placement,ge=ae.duration,Te=ae.ease,Ue=ae.getOpenCount,Se=ae.switchScrollingEffect,Le=Ue&&Ue();Le||Se(!0),i&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var ye,Z="width ".concat(ge," ").concat(Te),v="transform ".concat(ge," ").concat(Te);switch(fe){case"left":{H.dom.style.width="100%",Z="width 0s ".concat(Te," ").concat(ge);break}case"right":{H.dom.style.transform="translateX(".concat(J,"px)"),H.dom.style.width="100%",Z="width 0s ".concat(Te," ").concat(ge),H.maskDom&&(H.maskDom.style.left="-".concat(J,"px"),H.maskDom.style.width="calc(100% + ".concat(J,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(J,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",ye="height 0s ".concat(Te," ").concat(ge);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(v,",").concat(ye?"".concat(ye,","):"").concat(Z),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(J){return E[J]})},H.getLevelDom=function(J){var ae=J.level,fe=J.getContainer;if(R)return;var ge=fe&&fe(),Te=ge?ge.parentNode:null;if(H.levelDom=[],ae==="all"){var Ue=Te?Array.prototype.slice.call(Te.children):[];Ue.forEach(function(Se){Se.nodeName!=="SCRIPT"&&Se.nodeName!=="STYLE"&&Se.nodeName!=="LINK"&&Se!==ge&&H.levelDom.push(Se)})}else ae&&c(ae).forEach(function(Se){document.querySelectorAll(Se).forEach(function(Le){H.levelDom.push(Le)})})},H.getHorizontalBoolAndPlacementName=function(){var J=H.props.placement,ae=J==="left"||J==="right",fe="translate".concat(ae?"X":"Y");return{isHorizontal:ae,placementName:fe}},H.state={_self:Object(D.a)(H)},H}return Object(B.a)(k,[{key:"componentDidMount",value:function(){var H=this;if(!R){var J=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return J=!0,null}}))}catch(Ue){}this.passive=J?{passive:!1}:!1}var ae=this.props,fe=ae.open,ge=ae.getContainer,Te=ge&&ge();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(Te&&Te.parentNode===document.body&&(E[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var J=this.props,ae=J.open,fe=J.getContainer,ge=fe&&fe();ae!==H.open&&(ae&&this.domFocus(),ge&&ge.parentNode===document.body&&(E[this.drawerId]=!!ae),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,J=H.getOpenCount,ae=H.open,fe=H.switchScrollingEffect,ge=typeof J=="function"&&J();delete E[this.drawerId],ae&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ge||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var H,J=this,ae=this.props,fe=ae.className,ge=ae.children,Te=ae.style,Ue=ae.width,Se=ae.height,Le=ae.defaultOpen,ye=ae.open,Z=ae.prefixCls,v=ae.placement,L=ae.level,z=ae.levelMove,ee=ae.ease,$=ae.duration,Ee=ae.getContainer,Fe=ae.handler,qe=ae.onChange,Ce=ae.afterVisibleChange,Me=ae.showMask,He=ae.maskClosable,Ke=ae.maskStyle,ut=ae.onClose,bt=ae.onHandleClick,Lt=ae.keyboard,Ft=ae.getOpenCount,Yt=ae.switchScrollingEffect,Xt=Object(ne.a)(ae,["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"]),Je=this.dom?ye:!1,Qe=p()(Z,(H={},Object(r.a)(H,"".concat(Z,"-").concat(v),!0),Object(r.a)(H,"".concat(Z,"-open"),Je),Object(r.a)(H,fe||"",!!fe),Object(r.a)(H,"no-mask",!Me),H)),_t=this.getHorizontalBoolAndPlacementName(),xt=_t.placementName,_e=v==="left"||v==="top"?"-100%":"100%",ie=Je?"":"".concat(xt,"(").concat(_e,")"),oe=Fe&&V.cloneElement(Fe,{onClick:function(we){Fe.props.onClick&&Fe.props.onClick(),bt&&bt(we)},ref:function(we){J.handlerDom=we}});return V.createElement("div",Object.assign({},Xt,{tabIndex:-1,className:Qe,style:Te,ref:function(we){J.dom=we},onKeyDown:Je&&Lt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Me&&V.createElement("div",{className:"".concat(Z,"-mask"),onClick:He?ut:void 0,style:Ke,ref:function(we){J.maskDom=we}}),V.createElement("div",{className:"".concat(Z,"-content-wrapper"),style:{transform:ie,msTransform:ie,width:S(Ue)?"".concat(Ue,"px"):Ue,height:S(Se)?"".concat(Se,"px"):Se},ref:function(we){J.contentWrapper=we}},V.createElement("div",{className:"".concat(Z,"-content"),ref:function(we){J.contentDom=we},onTouchStart:Je&&Me?this.removeStartHandler:void 0,onTouchMove:Je&&Me?this.removeMoveHandler:void 0},ge),oe))}}],[{key:"getDerivedStateFromProps",value:function(H,J){var ae=J.prevProps,fe=J._self,ge={prevProps:H};if(ae!==void 0){var Te=H.placement,Ue=H.level;Te!==ae.placement&&(fe.contentDom=null),Ue!==ae.level&&fe.getLevelDom(H)}return ge}}]),k}(V.Component);h.defaultProps={switchScrollingEffect:function(){}};var f=h;function T(C){var F=x();return function(){var y=Object(M.a)(C),H;if(F){var J=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,J)}else H=y.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(C){return!1}}var _=function(C){Object(q.a)(k,C);var F=T(k);function k(y){var H;Object(Q.a)(this,k),H=F.call(this,y),H.onHandleClick=function(ae){var fe=H.props,ge=fe.onHandleClick,Te=fe.open;if(ge&&ge(ae),typeof Te=="undefined"){var Ue=H.state.open;H.setState({open:!Ue})}},H.onClose=function(ae){var fe=H.props,ge=fe.onClose,Te=fe.open;ge&&ge(ae),typeof Te=="undefined"&&H.setState({open:!1})};var J=typeof y.open!="undefined"?y.open:!!y.defaultOpen;return H.state={open:J},"onMaskClick"in y&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(B.a)(k,[{key:"render",value:function(){var H=this,J=this.props,ae=J.defaultOpen,fe=J.getContainer,ge=J.wrapperClassName,Te=J.forceRender,Ue=J.handler,Se=Object(ne.a)(J,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Le=this.state.open;if(!fe)return V.createElement("div",{className:ge,ref:function(v){H.dom=v}},V.createElement(f,Object.assign({},Se,{open:Le,handler:Ue,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ye=!!Ue||Te;return V.createElement(Y.a,{visible:Le,forceRender:ye,getContainer:fe,wrapperClassName:ge},function(Z){var v=Z.visible,L=Z.afterClose,z=Object(ne.a)(Z,["visible","afterClose"]);return V.createElement(f,Object.assign({},Se,z,{open:v!==void 0?v:Le,afterVisibleChange:L!==void 0?L:Se.afterVisibleChange,handler:Ue,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,J){var ae=J.prevProps,fe={prevProps:H};return typeof ae!="undefined"&&H.open!==ae.open&&(fe.open=H.open),fe}}]),k}(V.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:V.createElement("div",{className:"drawer-handle"},V.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var j=_,W=Pe.a=j},fjLI:function(wt,Pe,U){"use strict";U.d(Pe,"f",function(){return g}),U.d(Pe,"b",function(){return a}),U.d(Pe,"a",function(){return c}),U.d(Pe,"d",function(){return s}),U.d(Pe,"e",function(){return i}),U.d(Pe,"c",function(){return t});var ne=U("8HAY"),Q=U("Vhoy"),B=U("MI8n"),q=U("JYp7"),K=U("pmY6"),M=U("24hK"),Y=U("nnTU"),V=U("T8No"),r=U("Cg/j"),D=U("t9D7"),m=function(u,o,O,S){var R=arguments.length,A=R<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,O):S,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,o,O,S);else for(var w=u.length-1;w>=0;w--)(P=u[w])&&(A=(R<3?P(A):R>3?P(o,O,A):P(o,O))||A);return R>3&&A&&Object.defineProperty(o,O,A),A},p=function(u,o){return function(O,S){o(O,S,u)}};function g(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(q.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 O of u)o=this._commands.delete(O.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,O)=>u.set(O,o)),u}appendMenuItem(u,o){return this.appendMenuItems(q.a.single({id:u,item:o}))}appendMenuItems(u){const o=new Set,O=new M.a;for(const{id:S,item:R}of u){let A=this._menuItems.get(S);A||(A=new M.a,this._menuItems.set(S,A)),O.push(A.push(R)),o.add(S)}return this._onDidChangeMenu.fire(o),Object(K.i)(()=>{if(O.size>0){for(let S of O)S();this._onDidChangeMenu.fire(o),O.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 O of u)g(O)&&(o.add(O.command.id),O.alt&&o.add(O.alt.id));this._commands.forEach((O,S)=>{o.has(S)||u.push({command:O})})}};class i extends ne.e{constructor(u,o,O,S){super(`submenuitem.${u.submenu.id}`,typeof u.title=="string"?u.title:u.title.value,[],"submenu");this.item=u,this._menuService=o,this._contextKeyService=O,this._options=S}get actions(){const u=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=o.getActions(this._options);o.dispose();for(const[,S]of O)S.length>0&&(u.push(...S),u.push(new ne.d));return u.length&&u.pop(),u}}let t=class u{constructor(o,O,S,R,A){var P,w;if(this._commandService=A,this.id=o.id,this.label=(S==null?void 0:S.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(w=typeof o.tooltip=="string"?o.tooltip:(P=o.tooltip)===null||P===void 0?void 0:P.value)!==null&&w!==void 0?w:"",this.enabled=!o.precondition||R.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const E=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=R.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=o,this.alt=O?new u(O,void 0,S,R,A):void 0,this._options=S,D.d.isThemeIcon(o.icon)&&(this.class=Q.a.asClassName(o.icon))}dispose(){}run(...o){var O,S;let R=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(R=[...R,this._options.arg]),((S=this._options)===null||S===void 0?void 0:S.shouldForwardArgs)&&(R=[...R,...o]),this._commandService.executeCommand(this.id,...R)}};t=m([p(3,V.b),p(4,Y.b)],t)},fyJ8:function(wt,Pe,U){"use strict";var ne=U("rePB"),Q=U("VTBJ"),B=U("Ff2n"),q=U("U8pU"),K=U("q1tI"),M=U.n(K),Y=U("TSYQ"),V=U.n(Y),r=U("c+Xe"),D=U("sR1s");function m(s){return s&&Object(q.a)(s)==="object"&&!Array.isArray(s)&&!K.isValidElement(s)}function p(s){return typeof s=="string"?!0:Object(r.c)(s)}function g(s,i){var t,u=s.prefixCls,o=s.className,O=s.record,S=s.index,R=s.dataIndex,A=s.render,P=s.children,w=s.component,E=w===void 0?"td":w,h=s.colSpan,f=s.rowSpan,T=s.fixLeft,x=s.fixRight,_=s.firstFixLeft,j=s.lastFixLeft,W=s.firstFixRight,C=s.lastFixRight,F=s.appendNode,k=s.additionalProps,y=k===void 0?{}:k,H=s.ellipsis,J=s.align,ae=s.rowType,fe=s.isSticky,ge="".concat(u,"-cell"),Te,Ue;if(P)Ue=P;else{var Se=Object(D.b)(O,R);if(Ue=Se,A){var Le=A(Se,O,S);m(Le)?(Ue=Le.children,Te=Le.props):Ue=Le}}Object(q.a)(Ue)==="object"&&!Array.isArray(Ue)&&!K.isValidElement(Ue)&&(Ue=null),H&&(j||W)&&(Ue=K.createElement("span",{className:"".concat(ge,"-content")},Ue));var ye=Te||{},Z=ye.colSpan,v=ye.rowSpan,L=ye.style,z=ye.className,ee=Object(B.a)(ye,["colSpan","rowSpan","style","className"]),$=Z!==void 0?Z:h,Ee=v!==void 0?v:f;if($===0||Ee===0)return null;var Fe={},qe=typeof T=="number",Ce=typeof x=="number";qe&&(Fe.position="sticky",Fe.left=T),Ce&&(Fe.position="sticky",Fe.right=x);var Me={};J&&(Me.textAlign=J);var He,Ke=H===!0?{showTitle:!0}:H;Ke&&(Ke.showTitle||ae==="header")&&(typeof Ue=="string"||typeof Ue=="number"?He=Ue.toString():K.isValidElement(Ue)&&typeof Ue.props.children=="string"&&(He=Ue.props.children));var ut=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:He},ee),y),{},{colSpan:$&&$!==1?$:null,rowSpan:Ee&&Ee!==1?Ee:null,className:V()(ge,o,(t={},Object(ne.a)(t,"".concat(ge,"-fix-left"),qe),Object(ne.a)(t,"".concat(ge,"-fix-left-first"),_),Object(ne.a)(t,"".concat(ge,"-fix-left-last"),j),Object(ne.a)(t,"".concat(ge,"-fix-right"),Ce),Object(ne.a)(t,"".concat(ge,"-fix-right-first"),W),Object(ne.a)(t,"".concat(ge,"-fix-right-last"),C),Object(ne.a)(t,"".concat(ge,"-ellipsis"),H),Object(ne.a)(t,"".concat(ge,"-with-append"),F),Object(ne.a)(t,"".concat(ge,"-fix-sticky"),(qe||Ce)&&fe),t),y.className,z),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},y.style),Me),Fe),L),ref:p(E)?i:null});return K.createElement(E,Object.assign({},ut),F,Ue)}var a=K.forwardRef(g);a.displayName="Cell";var c=K.memo(a,function(s,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,s.record):!1});Pe.a=c},h78n:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return _});var ne=U("q1tI"),Q=U.n(ne),B=U("TSYQ"),q=U.n(B),K={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(C){var F=C.map(function(){return Object(ne.useRef)()}),k=Object(ne.useRef)();return Object(ne.useEffect)(function(){var y=Date.now(),H=!1;Object.keys(F).forEach(function(J){var ae=F[J].current;if(!ae)return;H=!0;var fe=ae.style;fe.transitionDuration=".3s, .3s, .3s, .06s",k.current&&y-k.current<100&&(fe.transitionDuration="0s, 0s")}),H&&(k.current=Date.now())}),[F]};function Y(){return Y=Object.assign||function(W){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var k in F)Object.prototype.hasOwnProperty.call(F,k)&&(W[k]=F[k])}return W},Y.apply(this,arguments)}function V(W,C){return g(W)||p(W,C)||D(W,C)||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(W,C){if(!W)return;if(typeof W=="string")return m(W,C);var F=Object.prototype.toString.call(W).slice(8,-1);if(F==="Object"&&W.constructor&&(F=W.constructor.name),F==="Map"||F==="Set")return Array.from(W);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return m(W,C)}function m(W,C){(C==null||C>W.length)&&(C=W.length);for(var F=0,k=new Array(C);F<C;F++)k[F]=W[F];return k}function p(W,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(W)))return;var F=[],k=!0,y=!1,H=void 0;try{for(var J=W[Symbol.iterator](),ae;!(k=(ae=J.next()).done)&&!(F.push(ae.value),C&&F.length===C);k=!0);}catch(fe){y=!0,H=fe}finally{try{!k&&J.return!=null&&J.return()}finally{if(y)throw H}}return F}function g(W){if(Array.isArray(W))return W}function a(W,C){if(W==null)return{};var F=c(W,C),k,y;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(W);for(y=0;y<H.length;y++){if(k=H[y],C.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,k))continue;F[k]=W[k]}}return F}function c(W,C){if(W==null)return{};var F={},k=Object.keys(W),y,H;for(H=0;H<k.length;H++){if(y=k[H],C.indexOf(y)>=0)continue;F[y]=W[y]}return F}var s=function(C){var F=C.className,k=C.percent,y=C.prefixCls,H=C.strokeColor,J=C.strokeLinecap,ae=C.strokeWidth,fe=C.style,ge=C.trailColor,Te=C.trailWidth,Ue=C.transition,Se=a(C,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Se.gapPosition;var Le=Array.isArray(k)?k:[k],ye=Array.isArray(H)?H:[H],Z=M(Le),v=V(Z,1),L=v[0],z=ae/2,ee=100-ae/2,$="M ".concat(J==="round"?z:0,",").concat(z,`
|
|
L `).concat(J==="round"?ee:100,",").concat(z),Ee="0 0 100 ".concat(ae),Fe=0;return Q.a.createElement("svg",Y({className:q()("".concat(y,"-line"),F),viewBox:Ee,preserveAspectRatio:"none",style:fe},Se),Q.a.createElement("path",{className:"".concat(y,"-line-trail"),d:$,strokeLinecap:J,stroke:ge,strokeWidth:Te||ae,fillOpacity:"0"}),Le.map(function(qe,Ce){var Me={strokeDasharray:"".concat(qe,"px, 100px"),strokeDashoffset:"-".concat(Fe,"px"),transition:Ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},He=ye[Ce]||ye[ye.length-1];return Fe+=qe,Q.a.createElement("path",{key:Ce,className:"".concat(y,"-line-path"),d:$,strokeLinecap:J,stroke:He,strokeWidth:ae,fillOpacity:"0",ref:L[Ce],style:Me})}))};s.defaultProps=K;var i=s;function t(){return t=Object.assign||function(W){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var k in F)Object.prototype.hasOwnProperty.call(F,k)&&(W[k]=F[k])}return W},t.apply(this,arguments)}function u(W,C){return A(W)||R(W,C)||O(W,C)||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 O(W,C){if(!W)return;if(typeof W=="string")return S(W,C);var F=Object.prototype.toString.call(W).slice(8,-1);if(F==="Object"&&W.constructor&&(F=W.constructor.name),F==="Map"||F==="Set")return Array.from(W);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return S(W,C)}function S(W,C){(C==null||C>W.length)&&(C=W.length);for(var F=0,k=new Array(C);F<C;F++)k[F]=W[F];return k}function R(W,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(W)))return;var F=[],k=!0,y=!1,H=void 0;try{for(var J=W[Symbol.iterator](),ae;!(k=(ae=J.next()).done)&&!(F.push(ae.value),C&&F.length===C);k=!0);}catch(fe){y=!0,H=fe}finally{try{!k&&J.return!=null&&J.return()}finally{if(y)throw H}}return F}function A(W){if(Array.isArray(W))return W}function P(W,C){if(W==null)return{};var F=w(W,C),k,y;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(W);for(y=0;y<H.length;y++){if(k=H[y],C.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,k))continue;F[k]=W[k]}}return F}function w(W,C){if(W==null)return{};var F={},k=Object.keys(W),y,H;for(H=0;H<k.length;H++){if(y=k[H],C.indexOf(y)>=0)continue;F[y]=W[y]}return F}var E=0;function h(W){return+W.replace("%","")}function f(W){return Array.isArray(W)?W:[W]}function T(W,C,F,k){var y=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,J=50-k/2,ae=0,fe=-J,ge=0,Te=-2*J;switch(H){case"left":ae=-J,fe=0,ge=2*J,Te=0;break;case"right":ae=J,fe=0,ge=-2*J,Te=0;break;case"bottom":fe=J,Te=2*J;break;default:}var Ue="M 50,50 m ".concat(ae,",").concat(fe,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(ge,",").concat(-Te,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(-ge,",").concat(Te),Se=Math.PI*2*J,Le={stroke:F,strokeDasharray:"".concat(C/100*(Se-y),"px ").concat(Se,"px"),strokeDashoffset:"-".concat(y/2+W/100*(Se-y),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ue,pathStyle:Le}}var x=function(C){var F=C.prefixCls,k=C.strokeWidth,y=C.trailWidth,H=C.gapDegree,J=C.gapPosition,ae=C.trailColor,fe=C.strokeLinecap,ge=C.style,Te=C.className,Ue=C.strokeColor,Se=C.percent,Le=P(C,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ye=Object(ne.useMemo)(function(){return E+=1,E},[]),Z=T(0,100,ae,k,H,J),v=Z.pathString,L=Z.pathStyle,z=f(Se),ee=f(Ue),$=ee.find(function(Me){return Object.prototype.toString.call(Me)==="[object Object]"}),Ee=M(z),Fe=u(Ee,1),qe=Fe[0],Ce=function(){var He=0;return z.map(function(Ke,ut){var bt=ee[ut]||ee[ee.length-1],Lt=Object.prototype.toString.call(bt)==="[object Object]"?"url(#".concat(F,"-gradient-").concat(ye,")"):"",Ft=T(He,Ke,bt,k,H,J);return He+=Ke,Q.a.createElement("path",{key:ut,className:"".concat(F,"-circle-path"),d:Ft.pathString,stroke:Lt,strokeLinecap:fe,strokeWidth:k,opacity:Ke===0?0:1,fillOpacity:"0",style:Ft.pathStyle,ref:qe[ut]})})};return Q.a.createElement("svg",t({className:q()("".concat(F,"-circle"),Te),viewBox:"0 0 100 100",style:ge},Le),$&&Q.a.createElement("defs",null,Q.a.createElement("linearGradient",{id:"".concat(F,"-gradient-").concat(ye),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys($).sort(function(Me,He){return h(Me)-h(He)}).map(function(Me,He){return Q.a.createElement("stop",{key:He,offset:Me,stopColor:$[Me]})}))),Q.a.createElement("path",{className:"".concat(F,"-circle-trail"),d:v,stroke:ae,strokeLinecap:fe,strokeWidth:y||k,fillOpacity:"0",style:L}),Ce().reverse())};x.defaultProps=K;var _=x,j={Line:i,Circle:_}},hQp1:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Q});var ne;(function(B){B.FirstPage="firstPage",B.PrevPage="prevPage",B.NextPage="nextPage"})(ne||(ne={}));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(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return q}),U.d(Pe,"c",function(){return K}),U.d(Pe,"b",function(){return M});var ne=U("VTBJ"),Q=U("Ff2n"),B=U("Kwbf"),q="RC_TABLE_INTERNAL_COL_DEFINE";function K(Y){var V=Y.expandable,r=Object(Q.a)(Y,["expandable"]);return"expandable"in Y?Object(ne.a)(Object(ne.a)({},r),V):r}function M(Y){return Object.keys(Y).reduce(function(V,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(V[r]=Y[r]),V},{})}},i58Z:function(wt,Pe,U){wt.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ic2d:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return q});var ne=U("FWmy"),Q=U("746U");class B{constructor(){this.data=new Map}add(K,M){ne.a(Q.l(K)),ne.a(Q.k(M)),ne.a(!this.data.has(K),"There is already an extension with this id"),this.data.set(K,M)}as(K){return this.data.get(K)||null}}const q=new B},ie49:function(wt,Pe,U){wt.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___1wyfO",flex_space_between:"flex_space_between___3ie-6",flex_box_vertical_center:"flex_box_vertical_center___1eUAq",flex_box_center_end:"flex_box_center_end___29GnR",flex_box_column:"flex_box_column___1pS1E",wrp:"wrp___3A78D",drawer:"drawer___2J2c_",menu:"menu___2EGlp",actived:"actived___2vitA",actived2:"actived2___1qPkY",listItem:"listItem___2jBqU",info:"info___1kwD-",title:"title___2GCln",titleLeft:"titleLeft___3VSnz",titleRight:"titleRight___2bW7b",search:"search___llksR",description:"description____0dnE",menuCourse:"menuCourse___2-Hgo",menut:"menut___1lhlV",actived3:"actived3___P7x4U",actived4:"actived4___BZSP4",subTag:"subTag___1TmCh"}},kSUc:function(wt,Pe,U){},kqOp:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return D});var ne=U("0Owb"),Q=U("fWQN"),B=U("mtLc"),q=U("yKVA"),K=U("879j"),M=U("q1tI"),Y=U.n(M),V=U("Ot1p"),r="\u2581",D=function(m){Object(q.a)(g,m);var p=Object(K.a)(g);function g(){var a;Object(Q.a)(this,g);for(var c=arguments.length,s=new Array(c),i=0;i<c;i++)s[i]=arguments[i];return a=p.call.apply(p,[this].concat(s)),a.getChCountBeforeCursor=function(t,u){for(var o=u.line,O=0,S=0;S<o;S++)O+=t.getLine(S).split(r).length-1;var R=t.getLine(o).substring(0,u.ch);return O+=R.split(r).length-1,O},a.onCMBeforeChange=function(t,u){var o=t.getRange(u.from,u.to),O=0;if(u.text.forEach(function(P){O+=P.split(r).length-1}),o&&o.indexOf(r)!=-1){var S=o.split(r).length-1,R=a.getChCountBeforeCursor(t,u.from);console.log("\u5220\u9664".concat(S,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(R,"\u4E2A\uFF0C\u65B0\u589E").concat(O,"\u4E2A")),a.props.deleteEmptyDisabled?u.cancel():a.props.onPlaceholderChange&&a.props.onPlaceholderChange(R,S,O)}else if(O){var A=a.getChCountBeforeCursor(t,u.from);console.log("\u65B0\u589E".concat(O,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(A,"\u4E2A")),a.props.onPlaceholderChange&&a.props.onPlaceholderChange(A,0,O)}},a}return Object(B.a)(g,[{key:"render",value:function(){return Y.a.createElement(V.a,Object(ne.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),g}(M.Component)},lZu9:function(wt,Pe,U){(function(ne){ne(U("VrN/"),U("1eCo"),U("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(Q,B){var q=ne.getMode(Q,"text/html"),K=q.name=="null";function M(k){if(ne.findModeByName){var y=ne.findModeByName(k);y&&(k=y.mime||y.mimes[0])}var H=ne.getMode(Q,k);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 Y={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 V in Y)Y.hasOwnProperty(V)&&B.tokenTypeOverrides[V]&&(Y[V]=B.tokenTypeOverrides[V]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,p=B.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,g=/^ {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(k,y,H){return y.f=y.inline=H,H(k,y)}function o(k,y,H){return y.f=y.block=H,H(k,y)}function O(k){return!k||!/\S/.test(k.string)}function S(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==A){var y=K;if(!y){var H=ne.innerMode(q,k.htmlState);y=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}y&&(k.f=h,k.block=R,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function R(k,y){var H=k.column()===y.indentation,J=O(y.prevLine.stream),ae=y.indentedCode,fe=y.prevLine.hr,ge=y.list!==!1,Te=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Ue=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,ge)){for(y.list=null;Ue<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=Ue-y.listStack[y.listStack.length-1])}var Se=!J&&!fe&&!y.prevLine.header&&(!ge||!ae)&&!y.prevLine.fencedCodeEnd,Le=(y.list===!1||fe||J)&&y.indentation<=Te&&k.match(r),ye=null;if(y.indentationDiff>=4&&(ae||y.prevLine.fencedCodeEnd||y.prevLine.header||J))return k.skipToEnd(),y.indentedCode=!0,Y.code;if(k.eatSpace())return null;if(H&&y.indentation<=Te&&(ye=k.match(p))&&ye[1].length<=6)return y.quote=0,y.header=ye[1].length,y.thisLine.header=!0,B.highlightFormatting&&(y.formatting="header"),y.f=y.inline,w(y);if(y.indentation<=Te&&k.eat(">"))return y.quote=H?1:y.quote+1,B.highlightFormatting&&(y.formatting="quote"),k.eatSpace(),w(y);if(!Le&&!y.setext&&H&&y.indentation<=Te&&(ye=k.match(D))){var Z=ye[1]?"ol":"ul";return y.indentation=Ue+k.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,B.taskLists&&k.match(m,!1)&&(y.taskList=!0),y.f=y.inline,B.highlightFormatting&&(y.formatting=["list","list-"+Z]),w(y)}else{if(H&&y.indentation<=Te&&(ye=k.match(c,!0)))return y.quote=0,y.fencedEndRE=new RegExp(ye[1]+"+ *$"),y.localMode=B.fencedCodeBlockHighlighting&&M(ye[2]||B.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=ne.startState(y.localMode)),y.f=y.block=P,B.highlightFormatting&&(y.formatting="code-block"),y.code=-1,w(y);if(y.setext||(!Se||!ge)&&!y.quote&&y.list===!1&&!y.code&&!Le&&!s.test(k.string)&&(ye=k.lookAhead(1))&&(ye=ye.match(g)))return y.setext?(y.header=y.setext,y.setext=0,k.skipToEnd(),B.highlightFormatting&&(y.formatting="header")):(y.header=ye[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,w(y);if(Le)return k.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,Y.hr;if(k.peek()==="[")return u(k,y,j)}return u(k,y,y.inline)}function A(k,y){var H=q.token(k,y.htmlState);if(!K){var J=ne.innerMode(q,y.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||y.md_inside&&k.current().indexOf(">")>-1)&&(y.f=h,y.block=R,y.htmlState=null)}return H}function P(k,y){var H=y.listStack[y.listStack.length-1]||0,J=y.indentation<H,ae=H+3;if(y.fencedEndRE&&y.indentation<=ae&&(J||k.match(y.fencedEndRE))){B.highlightFormatting&&(y.formatting="code-block");var fe;return J||(fe=w(y)),y.localMode=y.localState=null,y.block=R,y.f=h,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,J?o(k,y,y.block):fe}else return y.localMode?y.localMode.token(k,y.localState):(k.skipToEnd(),Y.code)}function w(k){var y=[];if(k.formatting){y.push(Y.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var H=0;H<k.formatting.length;H++)y.push(Y.formatting+"-"+k.formatting[H]),k.formatting[H]==="header"&&y.push(Y.formatting+"-"+k.formatting[H]+"-"+k.header),k.formatting[H]==="quote"&&(!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=k.quote?y.push(Y.formatting+"-"+k.formatting[H]+"-"+k.quote):y.push("error"))}if(k.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(k.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(k.linkHref?y.push(Y.linkHref,"url"):(k.strong&&y.push(Y.strong),k.em&&y.push(Y.em),k.strikethrough&&y.push(Y.strikethrough),k.emoji&&y.push(Y.emoji),k.linkText&&y.push(Y.linkText),k.code&&y.push(Y.code),k.image&&y.push(Y.image),k.imageAltText&&y.push(Y.imageAltText,"link"),k.imageMarker&&y.push(Y.imageMarker)),k.header&&y.push(Y.header,Y.header+"-"+k.header),k.quote&&(y.push(Y.quote),!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=k.quote?y.push(Y.quote+"-"+k.quote):y.push(Y.quote+"-"+B.maxBlockquoteDepth)),k.list!==!1){var J=(k.listStack.length-1)%3;J?J===1?y.push(Y.list2):y.push(Y.list3):y.push(Y.list1)}return k.trailingSpaceNewLine?y.push("trailing-space-new-line"):k.trailingSpace&&y.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function E(k,y){return k.match(a,!0)?w(y):void 0}function h(k,y){var H=y.text(k,y);if(typeof H!="undefined")return H;if(y.list)return y.list=null,w(y);if(y.taskList){var J=k.match(m,!0)[1]===" ";return J?y.taskOpen=!0:y.taskClosed=!0,B.highlightFormatting&&(y.formatting="task"),y.taskList=!1,w(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&k.match(/^#+$/,!0))return B.highlightFormatting&&(y.formatting="header"),w(y);var ae=k.next();if(y.linkTitle){y.linkTitle=!1;var fe=ae;ae==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ge="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(k.match(new RegExp(ge),!0))return Y.linkHref}if(ae==="`"){var Te=y.formatting;B.highlightFormatting&&(y.formatting="code"),k.eatWhile("`");var Ue=k.current().length;if(y.code==0&&(!y.quote||Ue==1))return y.code=Ue,w(y);if(Ue==y.code){var Se=w(y);return y.code=0,Se}else return y.formatting=Te,w(y)}else if(y.code)return w(y);if(ae==="\\"&&(k.next(),B.highlightFormatting)){var Le=w(y),ye=Y.formatting+"-escape";return Le?Le+" "+ye:ye}if(ae==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,B.highlightFormatting&&(y.formatting="image"),w(y);if(ae==="["&&y.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,B.highlightFormatting&&(y.formatting="image"),w(y);if(ae==="]"&&y.imageAltText){B.highlightFormatting&&(y.formatting="image");var Le=w(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=T,Le}if(ae==="["&&!y.image)return y.linkText&&k.match(/^.*?\]/)||(y.linkText=!0,B.highlightFormatting&&(y.formatting="link")),w(y);if(ae==="]"&&y.linkText){B.highlightFormatting&&(y.formatting="link");var Le=w(y);return y.linkText=!1,y.inline=y.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?T:h,Le}if(ae==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=f,B.highlightFormatting&&(y.formatting="link");var Le=w(y);return Le?Le+=" ":Le="",Le+Y.linkInline}if(ae==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=f,B.highlightFormatting&&(y.formatting="link");var Le=w(y);return Le?Le+=" ":Le="",Le+Y.linkEmail}if(B.xml&&ae==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Z=k.string.indexOf(">",k.pos);if(Z!=-1){var v=k.string.substring(k.start,Z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(v)&&(y.md_inside=!0)}return k.backUp(1),y.htmlState=ne.startState(q),o(k,y,A)}if(B.xml&&ae==="<"&&k.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var L=1,z=k.pos==1?" ":k.string.charAt(k.pos-2);L<3&&k.eat(ae);)L++;var ee=k.peek()||" ",$=!/\s/.test(ee)&&(!i.test(ee)||/\s/.test(z)||i.test(z)),Ee=!/\s/.test(z)&&(!i.test(z)||/\s/.test(ee)||i.test(ee)),Fe=null,qe=null;if(L%2&&(!y.em&&$&&(ae==="*"||!Ee||i.test(z))?Fe=!0:y.em==ae&&Ee&&(ae==="*"||!$||i.test(ee))&&(Fe=!1)),L>1&&(!y.strong&&$&&(ae==="*"||!Ee||i.test(z))?qe=!0:y.strong==ae&&Ee&&(ae==="*"||!$||i.test(ee))&&(qe=!1)),qe!=null||Fe!=null){B.highlightFormatting&&(y.formatting=Fe==null?"strong":qe==null?"em":"strong em"),Fe===!0&&(y.em=ae),qe===!0&&(y.strong=ae);var Se=w(y);return Fe===!1&&(y.em=!1),qe===!1&&(y.strong=!1),Se}}else if(ae===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return w(y);k.backUp(1)}if(B.strikethrough){if(ae==="~"&&k.eatWhile(ae)){if(y.strikethrough){B.highlightFormatting&&(y.formatting="strikethrough");var Se=w(y);return y.strikethrough=!1,Se}else if(k.match(/^[^\s]/,!1))return y.strikethrough=!0,B.highlightFormatting&&(y.formatting="strikethrough"),w(y)}else if(ae===" "&&k.match(/^~~/,!0)){if(k.peek()===" ")return w(y);k.backUp(2)}}if(B.emoji&&ae===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,B.highlightFormatting&&(y.formatting="emoji");var Ce=w(y);return y.emoji=!1,Ce}return ae===" "&&(k.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),w(y)}function f(k,y){var H=k.next();if(H===">"){y.f=y.inline=h,B.highlightFormatting&&(y.formatting="link");var J=w(y);return J?J+=" ":J="",J+Y.linkInline}return k.match(/^[^>]+/,!0),Y.linkInline}function T(k,y){if(k.eatSpace())return null;var H=k.next();return H==="("||H==="["?(y.f=y.inline=_(H==="("?")":"]"),B.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,w(y)):"error"}var x={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(k){return function(y,H){var J=y.next();if(J===k){H.f=H.inline=h,B.highlightFormatting&&(H.formatting="link-string");var ae=w(H);return H.linkHref=!1,ae}return y.match(x[k]),H.linkHref=!0,w(H)}}function j(k,y){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=W,k.next(),B.highlightFormatting&&(y.formatting="link"),y.linkText=!0,w(y)):u(k,y,h)}function W(k,y){if(k.match(/^\]:/,!0)){y.f=y.inline=C,B.highlightFormatting&&(y.formatting="link");var H=w(y);return y.linkText=!1,H}return k.match(/^([^\]\\]|\\.)+/,!0),Y.linkText}function C(k,y){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?y.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=h,Y.linkHref+" url")}var F={startState:function(){return{f:R,prevLine:{stream:null},thisLine:{stream:null},block:R,htmlState:null,indentation:0,inline:h,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&ne.copyState(q,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?ne.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,y){if(y.formatting=!1,k!=y.thisLine.stream){if(y.header=0,y.hr=!1,k.match(/^\s*$/,!0))return S(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:k},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=A)){var H=k.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(y.indentation=H,y.indentationDiff=null,H>0)return null}}return y.f(k,y)},innerMode:function(k){return k.block==A?{state:k.htmlState,mode:q}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:F}},indent:function(k,y,H){return k.block==A&&q.indent?q.indent(k.htmlState,y,H):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,y,H):ne.Pass},blankLine:S,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},loLm:function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___Ea2v9",flex_space_between:"flex_space_between___1bTGw",flex_box_vertical_center:"flex_box_vertical_center___2J4zW",flex_box_center_end:"flex_box_center_end___9_5OK",flex_box_column:"flex_box_column___2FLgO",posWarp:"posWarp___3pf1n",pos:"pos___3-NfR",tips:"tips___2-j_s",markWrongBtnWrapper:"markWrongBtnWrapper___37HXF"}},n6Qo:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return V});var ne=U("q1tI"),Q=U("biw7"),B=U("fyJ8");function q(r){var D=r.className,m=r.index,p=r.children,g=r.colSpan,a=r.rowSpan,c=ne.useContext(Q.a),s=c.prefixCls,i=c.fixedInfoList,t=i[m];return ne.createElement(B.a,Object.assign({className:D,index:m,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:g,rowSpan:a}}}},t))}function K(r){return ne.createElement("tr",Object.assign({},r))}function M(r){var D=r.children,m=ne.useContext(Q.a),p=m.prefixCls;return ne.createElement("tfoot",{className:"".concat(p,"-summary")},D)}var Y=Pe.b=M,V={Cell:q,Row:K}},nEHx:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return ne});var ne;(function(Q){Q.DARK="dark",Q.LIGHT="light",Q.HIGH_CONTRAST="hc"})(ne||(ne={}))},ngQI:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Ul}),U.d(Pe,"b",function(){return yl}),U.d(Pe,"c",function(){return bl});var ne=U("q1tI"),Q=U.n(ne),B=U("dI71"),q=U("wx14"),K=U("ANjH"),M=U("/MKj");function Y(I,N){if(I.length!==N.length)return!1;for(var X=0;X<I.length;X++)if(I[X]!==N[X])return!1;return!0}function V(I,N){var X=Object(ne.useState)(function(){return{inputs:N,result:I()}})[0],re=Object(ne.useRef)(!0),pe=Object(ne.useRef)(X),me=re.current||Boolean(N&&pe.current.inputs&&Y(N,pe.current.inputs)),Ae=me?pe.current:{inputs:N,result:I()};return Object(ne.useEffect)(function(){re.current=!1,pe.current=Ae},[Ae]),Ae.result}function r(I,N){return V(function(){return I},N)}var D=V,m=r,p=U("9R94"),g=function(N){var X=N.top,re=N.right,pe=N.bottom,me=N.left,Ae=re-me,De=pe-X,ze={top:X,right:re,bottom:pe,left:me,width:Ae,height:De,x:me,y:X,center:{x:(re+me)/2,y:(pe+X)/2}};return ze},a=function(N,X){return{top:N.top-X.top,left:N.left-X.left,bottom:N.bottom+X.bottom,right:N.right+X.right}},c=function(N,X){return{top:N.top+X.top,left:N.left+X.left,bottom:N.bottom-X.bottom,right:N.right-X.right}},s=function(N,X){return{top:N.top+X.y,left:N.left+X.x,bottom:N.bottom+X.y,right:N.right+X.x}},i={top:0,right:0,bottom:0,left:0},t=function(N){var X=N.borderBox,re=N.margin,pe=re===void 0?i:re,me=N.border,Ae=me===void 0?i:me,De=N.padding,ze=De===void 0?i:De,nt=g(a(X,pe)),it=g(c(X,Ae)),Xe=g(c(it,ze));return{marginBox:nt,borderBox:g(X),paddingBox:it,contentBox:Xe,margin:pe,border:Ae,padding:ze}},u=function(N){var X=N.slice(0,-2),re=N.slice(-2);if(re!=="px")return 0;var pe=Number(X);return isNaN(pe)&&Object(p.a)(!1),pe},o=function(){return{x:window.pageXOffset,y:window.pageYOffset}},O=function(N,X){var re=N.borderBox,pe=N.border,me=N.margin,Ae=N.padding,De=s(re,X);return t({borderBox:De,border:pe,margin:me,padding:Ae})},S=function(N,X){return X===void 0&&(X=o()),O(N,X)},R=function(N,X){var re={top:u(X.marginTop),right:u(X.marginRight),bottom:u(X.marginBottom),left:u(X.marginLeft)},pe={top:u(X.paddingTop),right:u(X.paddingRight),bottom:u(X.paddingBottom),left:u(X.paddingLeft)},me={top:u(X.borderTopWidth),right:u(X.borderRightWidth),bottom:u(X.borderBottomWidth),left:u(X.borderLeftWidth)};return t({borderBox:N,margin:re,padding:pe,border:me})},A=function(N){var X=N.getBoundingClientRect(),re=window.getComputedStyle(N);return R(X,re)},P=Number.isNaN||function(N){return typeof N=="number"&&N!==N};function w(I,N){return I===N?!0:!!(P(I)&&P(N))}function E(I,N){if(I.length!==N.length)return!1;for(var X=0;X<I.length;X++)if(!w(I[X],N[X]))return!1;return!0}function h(I,N){N===void 0&&(N=E);var X,re=[],pe,me=!1;function Ae(){for(var De=[],ze=0;ze<arguments.length;ze++)De[ze]=arguments[ze];return me&&X===this&&N(De,re)||(pe=I.apply(this,De),me=!0,X=this,re=De),pe}return Ae}var f=h,T=function(N){var X=[],re=null,pe=function(){for(var Ae=arguments.length,De=new Array(Ae),ze=0;ze<Ae;ze++)De[ze]=arguments[ze];if(X=De,re)return;re=requestAnimationFrame(function(){re=null,N.apply(void 0,X)})};return pe.cancel=function(){if(!re)return;cancelAnimationFrame(re),re=null},pe},x=T,_=U("i8i4"),j=U.n(_),W=!0,C=/[ \t]{2,}/g,F=/^[ \t]*/gm,k=function(N){return N.replace(C," ").replace(F,"").trim()},y=function(N){return k(`
|
|
%creact-beautiful-dnd
|
|
|
|
%c`+k(N)+`
|
|
|
|
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
|
|
`)},H=function(N){return[y(N),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},J="__react-beautiful-dnd-disable-dev-warnings";function ae(I,N){var X;if(W)return;if(typeof window!="undefined"&&window[J])return;(X=console)[I].apply(X,H(N))}var fe=ae.bind(null,"warn"),ge=ae.bind(null,"error");function Te(){}function Ue(I,N){return Object(q.a)({},I,{},N)}function Se(I,N,X){var re=N.map(function(pe){var me=Ue(X,pe.options);return I.addEventListener(pe.eventName,pe.fn,me),function(){I.removeEventListener(pe.eventName,pe.fn,me)}});return function(){re.forEach(function(me){me()})}}var Le=!0,ye="Invariant failed";function Z(I){this.message=I}Z.prototype.toString=function(){return this.message};function v(I,N){if(I)return;throw Le?new Z(ye):new Z(ye+": "+(N||""))}var L=function(I){Object(B.a)(N,I);function N(){for(var re,pe=arguments.length,me=new Array(pe),Ae=0;Ae<pe;Ae++)me[Ae]=arguments[Ae];return re=I.call.apply(I,[this].concat(me))||this,re.callbacks=null,re.unbind=Te,re.onWindowError=function(De){var ze=re.getCallbacks();ze.isDragging()&&ze.tryAbort();var nt=De.error;nt instanceof Z&&De.preventDefault()},re.getCallbacks=function(){if(!re.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return re.callbacks},re.setCallbacks=function(De){re.callbacks=De},re}var X=N.prototype;return X.componentDidMount=function(){this.unbind=Se(window,[{eventName:"error",fn:this.onWindowError}])},X.componentWillUnmount=function(){this.unbind()},X.componentDidCatch=function(pe){if(pe instanceof Z){this.setState({});return}throw pe},X.render=function(){return this.props.children(this.setCallbacks)},N}(Q.a.Component),z=`
|
|
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
|
|
`,ee=function(N){return N+1},$=function(N){return`
|
|
You have lifted an item in position `+ee(N.source.index)+`
|
|
`},Ee=function(N,X){var re=N.droppableId===X.droppableId,pe=ee(N.index),me=ee(X.index);return re?`
|
|
You have moved the item from position `+pe+`
|
|
to position `+me+`
|
|
`:`
|
|
You have moved the item from position `+pe+`
|
|
in list `+N.droppableId+`
|
|
to list `+X.droppableId+`
|
|
in position `+me+`
|
|
`},Fe=function(N,X,re){var pe=X.droppableId===re.droppableId;return pe?`
|
|
The item `+N+`
|
|
has been combined with `+re.draggableId:`
|
|
The item `+N+`
|
|
in list `+X.droppableId+`
|
|
has been combined with `+re.draggableId+`
|
|
in list `+re.droppableId+`
|
|
`},qe=function(N){var X=N.destination;if(X)return Ee(N.source,X);var re=N.combine;return re?Fe(N.draggableId,N.source,re):"You are over an area that cannot be dropped on"},Ce=function(N){return`
|
|
The item has returned to its starting position
|
|
of `+ee(N.index)+`
|
|
`},Me=function(N){if(N.reason==="CANCEL")return`
|
|
Movement cancelled.
|
|
`+Ce(N.source)+`
|
|
`;var X=N.destination,re=N.combine;return X?`
|
|
You have dropped the item.
|
|
`+Ee(N.source,X)+`
|
|
`:re?`
|
|
You have dropped the item.
|
|
`+Fe(N.draggableId,N.source,re)+`
|
|
`:`
|
|
The item has been dropped while not over a drop area.
|
|
`+Ce(N.source)+`
|
|
`},He={dragHandleUsageInstructions:z,onDragStart:$,onDragUpdate:qe,onDragEnd:Me},Ke={x:0,y:0},ut=function(N,X){return{x:N.x+X.x,y:N.y+X.y}},bt=function(N,X){return{x:N.x-X.x,y:N.y-X.y}},Lt=function(N,X){return N.x===X.x&&N.y===X.y},Ft=function(N){return{x:N.x!==0?-N.x:0,y:N.y!==0?-N.y:0}},Yt=function(N,X,re){var pe;return re===void 0&&(re=0),pe={},pe[N]=X,pe[N==="x"?"y":"x"]=re,pe},Xt=function(N,X){return Math.sqrt(Math.pow(X.x-N.x,2)+Math.pow(X.y-N.y,2))},Je=function(N,X){return Math.min.apply(Math,X.map(function(re){return Xt(N,re)}))},Qe=function(N){return function(X){return{x:N(X.x),y:N(X.y)}}},_t=function(I,N){var X=g({top:Math.max(N.top,I.top),right:Math.min(N.right,I.right),bottom:Math.min(N.bottom,I.bottom),left:Math.max(N.left,I.left)});return X.width<=0||X.height<=0?null:X},xt=function(N,X){return{top:N.top+X.y,left:N.left+X.x,bottom:N.bottom+X.y,right:N.right+X.x}},_e=function(N){return[{x:N.left,y:N.top},{x:N.right,y:N.top},{x:N.left,y:N.bottom},{x:N.right,y:N.bottom}]},ie={top:0,right:0,bottom:0,left:0},oe=function(N,X){return X?xt(N,X.scroll.diff.displacement):N},ce=function(N,X,re){if(re&&re.increasedBy){var pe;return Object(q.a)({},N,(pe={},pe[X.end]=N[X.end]+re.increasedBy[X.line],pe))}return N},we=function(N,X){return X&&X.shouldClipSubject?_t(X.pageMarginBox,N):g(N)},de=function(I){var N=I.page,X=I.withPlaceholder,re=I.axis,pe=I.frame,me=oe(N.marginBox,pe),Ae=ce(me,re,X),De=we(Ae,pe);return{page:N,withPlaceholder:X,active:De}},he=function(I,N){I.frame||v(!1);var X=I.frame,re=bt(N,X.scroll.initial),pe=Ft(re),me=Object(q.a)({},X,{scroll:{initial:X.scroll.initial,current:N,diff:{value:re,displacement:pe},max:X.scroll.max}}),Ae=de({page:I.subject.page,withPlaceholder:I.subject.withPlaceholder,axis:I.axis,frame:me}),De=Object(q.a)({},I,{frame:me,subject:Ae});return De};function Oe(I){return Number.isInteger?Number.isInteger(I):typeof I=="number"&&isFinite(I)&&Math.floor(I)===I}function le(I){return Object.values?Object.values(I):Object.keys(I).map(function(N){return I[N]})}function Ne(I,N){if(I.findIndex)return I.findIndex(N);for(var X=0;X<I.length;X++)if(N(I[X]))return X;return-1}function We(I,N){if(I.find)return I.find(N);var X=Ne(I,N);return X!==-1?I[X]:void 0}function lt(I){return Array.prototype.slice.call(I)}var Ct=f(function(I){return I.reduce(function(N,X){return N[X.descriptor.id]=X,N},{})}),Rt=f(function(I){return I.reduce(function(N,X){return N[X.descriptor.id]=X,N},{})}),It=f(function(I){return le(I)}),qn=f(function(I){return le(I)}),Vt=f(function(I,N){var X=qn(N).filter(function(re){return I===re.descriptor.droppableId}).sort(function(re,pe){return re.descriptor.index-pe.descriptor.index});return X});function qt(I){return I.at&&I.at.type==="REORDER"?I.at.destination:null}function nn(I){return I.at&&I.at.type==="COMBINE"?I.at.combine:null}var On=f(function(I,N){return N.filter(function(X){return X.descriptor.id!==I.descriptor.id})}),ar=function(I){var N=I.isMovingForward,X=I.draggable,re=I.destination,pe=I.insideDestination,me=I.previousImpact;if(!re.isCombineEnabled)return null;var Ae=qt(me);if(!Ae)return null;function De(gn){var xn={type:"COMBINE",combine:{draggableId:gn,droppableId:re.descriptor.id}};return Object(q.a)({},me,{at:xn})}var ze=me.displaced.all,nt=ze.length?ze[0]:null;if(N)return nt?De(nt):null;var it=On(X,pe);if(!nt){if(!it.length)return null;var Xe=it[it.length-1];return De(Xe.descriptor.id)}var Ve=Ne(it,function(gn){return gn.descriptor.id===nt});Ve!==-1||v(!1);var Ze=Ve-1;if(Ze<0)return null;var yt=it[Ze];return De(yt.descriptor.id)},cr=function(I,N){return I.descriptor.droppableId===N.descriptor.id},Qn={point:Ke,value:0},yr={invisible:{},visible:{},all:[]},Sr={displaced:yr,displacedBy:Qn,at:null},Nn=function(I,N){return function(X){return I<=X&&X<=N}},Ar=function(I){var N=Nn(I.top,I.bottom),X=Nn(I.left,I.right);return function(re){var pe=N(re.top)&&N(re.bottom)&&X(re.left)&&X(re.right);if(pe)return!0;var me=N(re.top)||N(re.bottom),Ae=X(re.left)||X(re.right),De=me&&Ae;if(De)return!0;var ze=re.top<I.top&&re.bottom>I.bottom,nt=re.left<I.left&&re.right>I.right,it=ze&&nt;if(it)return!0;var Xe=ze&&Ae||nt&&me;return Xe}},Dn=function(I){var N=Nn(I.top,I.bottom),X=Nn(I.left,I.right);return function(re){var pe=N(re.top)&&N(re.bottom)&&X(re.left)&&X(re.right);return pe}},Pn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Zn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},pr=function(I){return function(N){var X=Nn(N.top,N.bottom),re=Nn(N.left,N.right);return function(pe){return I===Pn?X(pe.top)&&X(pe.bottom):re(pe.left)&&re(pe.right)}}},Lr=function(N,X){var re=X.frame?X.frame.scroll.diff.displacement:Ke;return xt(N,re)},Or=function(N,X,re){return X.subject.active?re(X.subject.active)(N):!1},at=function(N,X,re){return re(X)(N)},Be=function(N){var X=N.target,re=N.destination,pe=N.viewport,me=N.withDroppableDisplacement,Ae=N.isVisibleThroughFrameFn,De=me?Lr(X,re):X;return Or(De,re,Ae)&&at(De,pe,Ae)},pt=function(N){return Be(Object(q.a)({},N,{isVisibleThroughFrameFn:Ar}))},Ie=function(N){return Be(Object(q.a)({},N,{isVisibleThroughFrameFn:Dn}))},xe=function(N){return Be(Object(q.a)({},N,{isVisibleThroughFrameFn:pr(N.destination.axis)}))},ve=function(N,X,re){if(typeof re=="boolean")return re;if(!X)return!0;var pe=X.invisible,me=X.visible;if(pe[N])return!1;var Ae=me[N];return Ae?Ae.shouldAnimate:!0};function Hn(I,N){var X=I.page.marginBox,re={top:N.point.y,right:0,bottom:0,left:N.point.x};return g(a(X,re))}function kt(I){var N=I.afterDragging,X=I.destination,re=I.displacedBy,pe=I.viewport,me=I.forceShouldAnimate,Ae=I.last;return N.reduce(function(ze,nt){var it=Hn(nt,re),Xe=nt.descriptor.id;ze.all.push(Xe);var Ve=pt({target:it,destination:X,viewport:pe,withDroppableDisplacement:!0});if(!Ve)return ze.invisible[nt.descriptor.id]=!0,ze;var Ze=ve(Xe,Ae,me),yt={draggableId:Xe,shouldAnimate:Ze};return ze.visible[Xe]=yt,ze},{all:[],visible:{},invisible:{}})}function ke(I,N){if(!I.length)return 0;var X=I[I.length-1].descriptor.index;return N.inHomeList?X:X+1}function dt(I){var N=I.insideDestination,X=I.inHomeList,re=I.displacedBy,pe=I.destination,me=ke(N,{inHomeList:X});return{displaced:yr,displacedBy:re,at:{type:"REORDER",destination:{droppableId:pe.descriptor.id,index:me}}}}function Re(I){var N=I.draggable,X=I.insideDestination,re=I.destination,pe=I.viewport,me=I.displacedBy,Ae=I.last,De=I.index,ze=I.forceShouldAnimate,nt=cr(N,re);if(De==null)return dt({insideDestination:X,inHomeList:nt,displacedBy:me,destination:re});var it=We(X,function(gn){return gn.descriptor.index===De});if(!it)return dt({insideDestination:X,inHomeList:nt,displacedBy:me,destination:re});var Xe=On(N,X),Ve=X.indexOf(it),Ze=Xe.slice(Ve),yt=kt({afterDragging:Ze,destination:re,displacedBy:me,last:Ae,viewport:pe.frame,forceShouldAnimate:ze});return{displaced:yt,displacedBy:me,at:{type:"REORDER",destination:{droppableId:re.descriptor.id,index:De}}}}function an(I,N){return Boolean(N.effected[I])}var hr=function(I){var N=I.isMovingForward,X=I.destination,re=I.draggables,pe=I.combine,me=I.afterCritical;if(!X.isCombineEnabled)return null;var Ae=pe.draggableId,De=re[Ae],ze=De.descriptor.index,nt=an(Ae,me);return nt?N?ze:ze-1:N?ze+1:ze},mr=function(I){var N=I.isMovingForward,X=I.isInHomeList,re=I.insideDestination,pe=I.location;if(!re.length)return null;var me=pe.index,Ae=N?me+1:me-1,De=re[0].descriptor.index,ze=re[re.length-1].descriptor.index,nt=X?ze:ze+1;return Ae<De||Ae>nt?null:Ae},Kn=function(I){var N=I.isMovingForward,X=I.isInHomeList,re=I.draggable,pe=I.draggables,me=I.destination,Ae=I.insideDestination,De=I.previousImpact,ze=I.viewport,nt=I.afterCritical,it=De.at;if(it||v(!1),it.type==="REORDER"){var Xe=mr({isMovingForward:N,isInHomeList:X,location:it.destination,insideDestination:Ae});return Xe==null?null:Re({draggable:re,insideDestination:Ae,destination:me,viewport:ze,last:De.displaced,displacedBy:De.displacedBy,index:Xe})}var Ve=hr({isMovingForward:N,destination:me,displaced:De.displaced,draggables:pe,combine:it.combine,afterCritical:nt});return Ve==null?null:Re({draggable:re,insideDestination:Ae,destination:me,viewport:ze,last:De.displaced,displacedBy:De.displacedBy,index:Ve})},Wt=function(I){var N=I.displaced,X=I.afterCritical,re=I.combineWith,pe=I.displacedBy,me=Boolean(N.visible[re]||N.invisible[re]);return an(re,X)?me?Ke:Ft(pe.point):me?pe.point:Ke},dr=function(I){var N=I.afterCritical,X=I.impact,re=I.draggables,pe=nn(X);pe||v(!1);var me=pe.draggableId,Ae=re[me].page.borderBox.center,De=Wt({displaced:X.displaced,afterCritical:N,combineWith:me,displacedBy:X.displacedBy});return ut(Ae,De)},ht=function(N,X){return X.margin[N.start]+X.borderBox[N.size]/2},Un=function(N,X){return X.margin[N.end]+X.borderBox[N.size]/2},yn=function(N,X,re){return X[N.crossAxisStart]+re.margin[N.crossAxisStart]+re.borderBox[N.crossAxisSize]/2},un=function(N){var X=N.axis,re=N.moveRelativeTo,pe=N.isMoving;return Yt(X.line,re.marginBox[X.end]+ht(X,pe),yn(X,re.marginBox,pe))},Qt=function(N){var X=N.axis,re=N.moveRelativeTo,pe=N.isMoving;return Yt(X.line,re.marginBox[X.start]-Un(X,pe),yn(X,re.marginBox,pe))},Ln=function(N){var X=N.axis,re=N.moveInto,pe=N.isMoving;return Yt(X.line,re.contentBox[X.start]+ht(X,pe),yn(X,re.contentBox,pe))},hn=function(I){var N=I.impact,X=I.draggable,re=I.draggables,pe=I.droppable,me=I.afterCritical,Ae=Vt(pe.descriptor.id,re),De=X.page,ze=pe.axis;if(!Ae.length)return Ln({axis:ze,moveInto:pe.page,isMoving:De});var nt=N.displaced,it=N.displacedBy,Xe=nt.all[0];if(Xe){var Ve=re[Xe];if(an(Xe,me))return Qt({axis:ze,moveRelativeTo:Ve.page,isMoving:De});var Ze=O(Ve.page,it.point);return Qt({axis:ze,moveRelativeTo:Ze,isMoving:De})}var yt=Ae[Ae.length-1];if(yt.descriptor.id===X.descriptor.id)return De.borderBox.center;if(an(yt.descriptor.id,me)){var gn=O(yt.page,Ft(me.displacedBy.point));return un({axis:ze,moveRelativeTo:gn,isMoving:De})}return un({axis:ze,moveRelativeTo:yt.page,isMoving:De})},en=function(I,N){var X=I.frame;return X?ut(N,X.scroll.diff.displacement):N},Ut=function(N){var X=N.impact,re=N.draggable,pe=N.droppable,me=N.draggables,Ae=N.afterCritical,De=re.page.borderBox.center,ze=X.at;return pe&&ze?ze.type==="REORDER"?hn({impact:X,draggable:re,draggables:me,droppable:pe,afterCritical:Ae}):dr({impact:X,draggables:me,afterCritical:Ae}):De},Kt=function(I){var N=Ut(I),X=I.droppable,re=X?en(X,N):N;return re},sr=function(I,N){var X=bt(N,I.scroll.initial),re=Ft(X),pe=g({top:N.y,bottom:N.y+I.frame.height,left:N.x,right:N.x+I.frame.width}),me={frame:pe,scroll:{initial:I.scroll.initial,max:I.scroll.max,current:N,diff:{value:X,displacement:re}}};return me};function or(I,N){return I.map(function(X){return N[X]})}function Fn(I,N){for(var X=0;X<N.length;X++){var re=N[X].visible[I];if(re)return re}return null}var bn=function(I){var N=I.impact,X=I.viewport,re=I.destination,pe=I.draggables,me=I.maxScrollChange,Ae=sr(X,ut(X.scroll.current,me)),De=re.frame?he(re,ut(re.frame.scroll.current,me)):re,ze=N.displaced,nt=kt({afterDragging:or(ze.all,pe),destination:re,displacedBy:N.displacedBy,viewport:Ae.frame,last:ze,forceShouldAnimate:!1}),it=kt({afterDragging:or(ze.all,pe),destination:De,displacedBy:N.displacedBy,viewport:X.frame,last:ze,forceShouldAnimate:!1}),Xe={},Ve={},Ze=[ze,nt,it];ze.all.forEach(function(gn){var xn=Fn(gn,Ze);if(xn){Ve[gn]=xn;return}Xe[gn]=!0});var yt=Object(q.a)({},N,{displaced:{all:ze.all,invisible:Xe,visible:Ve}});return yt},Bt=function(I,N){return ut(I.scroll.diff.displacement,N)},$t=function(I){var N=I.pageBorderBoxCenter,X=I.draggable,re=I.viewport,pe=Bt(re,N),me=bt(pe,X.page.borderBox.center);return ut(X.client.borderBox.center,me)},Gt=function(I){var N=I.draggable,X=I.destination,re=I.newPageBorderBoxCenter,pe=I.viewport,me=I.withDroppableDisplacement,Ae=I.onlyOnMainAxis,De=Ae===void 0?!1:Ae,ze=bt(re,N.page.borderBox.center),nt=xt(N.page.borderBox,ze),it={target:nt,destination:X,withDroppableDisplacement:me,viewport:pe};return De?xe(it):Ie(it)},Dt=function(I){var N=I.isMovingForward,X=I.draggable,re=I.destination,pe=I.draggables,me=I.previousImpact,Ae=I.viewport,De=I.previousPageBorderBoxCenter,ze=I.previousClientSelection,nt=I.afterCritical;if(!re.isEnabled)return null;var it=Vt(re.descriptor.id,pe),Xe=cr(X,re),Ve=ar({isMovingForward:N,draggable:X,destination:re,insideDestination:it,previousImpact:me})||Kn({isMovingForward:N,isInHomeList:Xe,draggable:X,draggables:pe,destination:re,insideDestination:it,previousImpact:me,viewport:Ae,afterCritical:nt});if(!Ve)return null;var Ze=Kt({impact:Ve,draggable:X,droppable:re,draggables:pe,afterCritical:nt}),yt=Gt({draggable:X,destination:re,newPageBorderBoxCenter:Ze,viewport:Ae.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(yt){var gn=$t({pageBorderBoxCenter:Ze,draggable:X,viewport:Ae});return{clientSelection:gn,impact:Ve,scrollJumpRequest:null}}var xn=bt(Ze,De),$n=bn({impact:Ve,viewport:Ae,destination:re,draggables:pe,maxScrollChange:xn});return{clientSelection:ze,impact:$n,scrollJumpRequest:xn}},er=function(N){var X=N.subject.active;return X||v(!1),X},An=function(I){var N=I.isMovingForward,X=I.pageBorderBoxCenter,re=I.source,pe=I.droppables,me=I.viewport,Ae=re.subject.active;if(!Ae)return null;var De=re.axis,ze=Nn(Ae[De.start],Ae[De.end]),nt=It(pe).filter(function(Xe){return Xe!==re}).filter(function(Xe){return Xe.isEnabled}).filter(function(Xe){return Boolean(Xe.subject.active)}).filter(function(Xe){return Ar(me.frame)(er(Xe))}).filter(function(Xe){var Ve=er(Xe);return N?Ae[De.crossAxisEnd]<Ve[De.crossAxisEnd]:Ve[De.crossAxisStart]<Ae[De.crossAxisStart]}).filter(function(Xe){var Ve=er(Xe),Ze=Nn(Ve[De.start],Ve[De.end]);return ze(Ve[De.start])||ze(Ve[De.end])||Ze(Ae[De.start])||Ze(Ae[De.end])}).sort(function(Xe,Ve){var Ze=er(Xe)[De.crossAxisStart],yt=er(Ve)[De.crossAxisStart];return N?Ze-yt:yt-Ze}).filter(function(Xe,Ve,Ze){return er(Xe)[De.crossAxisStart]===er(Ze[0])[De.crossAxisStart]});if(!nt.length)return null;if(nt.length===1)return nt[0];var it=nt.filter(function(Xe){var Ve=Nn(er(Xe)[De.start],er(Xe)[De.end]);return Ve(X[De.line])});return it.length===1?it[0]:it.length>1?it.sort(function(Xe,Ve){return er(Xe)[De.start]-er(Ve)[De.start]})[0]:nt.sort(function(Xe,Ve){var Ze=Je(X,_e(er(Xe))),yt=Je(X,_e(er(Ve)));return Ze!==yt?Ze-yt:er(Xe)[De.start]-er(Ve)[De.start]})[0]},fn=function(N,X){var re=N.page.borderBox.center;return an(N.descriptor.id,X)?bt(re,X.displacedBy.point):re},Vn=function(N,X){var re=N.page.borderBox;return an(N.descriptor.id,X)?xt(re,Ft(X.displacedBy.point)):re},dn=function(I){var N=I.pageBorderBoxCenter,X=I.viewport,re=I.destination,pe=I.insideDestination,me=I.afterCritical,Ae=pe.filter(function(De){return Ie({target:Vn(De,me),destination:re,viewport:X.frame,withDroppableDisplacement:!0})}).sort(function(De,ze){var nt=Xt(N,en(re,fn(De,me))),it=Xt(N,en(re,fn(ze,me)));return nt<it?-1:it<nt?1:De.descriptor.index-ze.descriptor.index});return Ae[0]||null},_n=f(function(N,X){var re=X[N.line];return{value:re,point:Yt(N.line,re)}}),tn=function(N,X,re){var pe=N.axis;if(N.descriptor.mode==="virtual")return Yt(pe.line,X[pe.line]);var me=N.subject.page.contentBox[pe.size],Ae=Vt(N.descriptor.id,re),De=Ae.reduce(function(it,Xe){return it+Xe.client.marginBox[pe.size]},0),ze=De+X[pe.line],nt=ze-me;return nt<=0?null:Yt(pe.line,nt)},kn=function(N,X){return Object(q.a)({},N,{scroll:Object(q.a)({},N.scroll,{max:X})})},tr=function(N,X,re){var pe=N.frame;cr(X,N)&&v(!1),N.subject.withPlaceholder&&v(!1);var me=_n(N.axis,X.displaceBy).point,Ae=tn(N,me,re),De={placeholderSize:me,increasedBy:Ae,oldFrameMaxScroll:N.frame?N.frame.scroll.max:null};if(!pe){var ze=de({page:N.subject.page,withPlaceholder:De,axis:N.axis,frame:N.frame});return Object(q.a)({},N,{subject:ze})}var nt=Ae?ut(pe.scroll.max,Ae):pe.scroll.max,it=kn(pe,nt),Xe=de({page:N.subject.page,withPlaceholder:De,axis:N.axis,frame:it});return Object(q.a)({},N,{subject:Xe,frame:it})},nr=function(N){var X=N.subject.withPlaceholder;X||v(!1);var re=N.frame;if(!re){var pe=de({page:N.subject.page,axis:N.axis,frame:null,withPlaceholder:null});return Object(q.a)({},N,{subject:pe})}var me=X.oldFrameMaxScroll;me||v(!1);var Ae=kn(re,me),De=de({page:N.subject.page,axis:N.axis,frame:Ae,withPlaceholder:null});return Object(q.a)({},N,{subject:De,frame:Ae})},wn=function(I){var N=I.previousPageBorderBoxCenter,X=I.moveRelativeTo,re=I.insideDestination,pe=I.draggable,me=I.draggables,Ae=I.destination,De=I.viewport,ze=I.afterCritical;if(!X){if(re.length)return null;var nt={displaced:yr,displacedBy:Qn,at:{type:"REORDER",destination:{droppableId:Ae.descriptor.id,index:0}}},it=Kt({impact:nt,draggable:pe,droppable:Ae,draggables:me,afterCritical:ze}),Xe=cr(pe,Ae)?Ae:tr(Ae,pe,me),Ve=Gt({draggable:pe,destination:Xe,newPageBorderBoxCenter:it,viewport:De.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Ve?nt:null}var Ze=Boolean(N[Ae.axis.line]<=X.page.borderBox.center[Ae.axis.line]),yt=function(){var xn=X.descriptor.index;return X.descriptor.id===pe.descriptor.id||Ze?xn:xn+1}(),gn=_n(Ae.axis,pe.displaceBy);return Re({draggable:pe,insideDestination:re,destination:Ae,viewport:De,displacedBy:gn,last:yr,index:yt})},Mn=function(I){var N=I.isMovingForward,X=I.previousPageBorderBoxCenter,re=I.draggable,pe=I.isOver,me=I.draggables,Ae=I.droppables,De=I.viewport,ze=I.afterCritical,nt=An({isMovingForward:N,pageBorderBoxCenter:X,source:pe,droppables:Ae,viewport:De});if(!nt)return null;var it=Vt(nt.descriptor.id,me),Xe=dn({pageBorderBoxCenter:X,viewport:De,destination:nt,insideDestination:it,afterCritical:ze}),Ve=wn({previousPageBorderBoxCenter:X,destination:nt,draggable:re,draggables:me,moveRelativeTo:Xe,insideDestination:it,viewport:De,afterCritical:ze});if(!Ve)return null;var Ze=Kt({impact:Ve,draggable:re,droppable:nt,draggables:me,afterCritical:ze}),yt=$t({pageBorderBoxCenter:Ze,draggable:re,viewport:De});return{clientSelection:yt,impact:Ve,scrollJumpRequest:null}},cn=function(I){var N=I.at;return N?N.type==="REORDER"?N.destination.droppableId:N.combine.droppableId:null},lr=function(N,X){var re=cn(N);return re?X[re]:null},Xn=function(I){var N=I.state,X=I.type,re=lr(N.impact,N.dimensions.droppables),pe=Boolean(re),me=N.dimensions.droppables[N.critical.droppable.id],Ae=re||me,De=Ae.axis.direction,ze=De==="vertical"&&(X==="MOVE_UP"||X==="MOVE_DOWN")||De==="horizontal"&&(X==="MOVE_LEFT"||X==="MOVE_RIGHT");if(ze&&!pe)return null;var nt=X==="MOVE_DOWN"||X==="MOVE_RIGHT",it=N.dimensions.draggables[N.critical.draggable.id],Xe=N.current.page.borderBoxCenter,Ve=N.dimensions,Ze=Ve.draggables,yt=Ve.droppables;return ze?Dt({isMovingForward:nt,previousPageBorderBoxCenter:Xe,draggable:it,destination:Ae,draggables:Ze,viewport:N.viewport,previousClientSelection:N.current.client.selection,previousImpact:N.impact,afterCritical:N.afterCritical}):Mn({isMovingForward:nt,previousPageBorderBoxCenter:Xe,draggable:it,isOver:Ae,draggables:Ze,droppables:yt,viewport:N.viewport,afterCritical:N.afterCritical})};function vr(I){return I.phase==="DRAGGING"||I.phase==="COLLECTING"}function gr(I){var N=Nn(I.top,I.bottom),X=Nn(I.left,I.right);return function(pe){return N(pe.y)&&X(pe.x)}}function Gn(I,N){return I.left<N.right&&I.right>N.left&&I.top<N.bottom&&I.bottom>N.top}function Bn(I){var N=I.pageBorderBox,X=I.draggable,re=I.candidates,pe=X.page.borderBox.center,me=re.map(function(Ae){var De=Ae.axis,ze=Yt(Ae.axis.line,N.center[De.line],Ae.page.borderBox.center[De.crossAxisLine]);return{id:Ae.descriptor.id,distance:Xt(pe,ze)}}).sort(function(Ae,De){return De.distance-Ae.distance});return me[0]?me[0].id:null}function _r(I){var N=I.pageBorderBox,X=I.draggable,re=I.droppables,pe=It(re).filter(function(me){if(!me.isEnabled)return!1;var Ae=me.subject.active;if(!Ae)return!1;if(!Gn(N,Ae))return!1;if(gr(Ae)(N.center))return!0;var De=me.axis,ze=Ae.center[De.crossAxisLine],nt=N[De.crossAxisStart],it=N[De.crossAxisEnd],Xe=Nn(Ae[De.crossAxisStart],Ae[De.crossAxisEnd]),Ve=Xe(nt),Ze=Xe(it);return!Ve&&!Ze?!0:Ve?nt<ze:it>ze});return pe.length?pe.length===1?pe[0].descriptor.id:Bn({pageBorderBox:N,draggable:X,candidates:pe}):null}var Rn=function(N,X){return g(xt(N,X))},En=function(I,N){var X=I.frame;return X?Rn(N,X.scroll.diff.value):N};function Cn(I){var N=I.displaced,X=I.id;return Boolean(N.visible[X]||N.invisible[X])}function vn(I){var N=I.draggable,X=I.closest,re=I.inHomeList;return X?re&&X.descriptor.index>N.descriptor.index?X.descriptor.index-1:X.descriptor.index:null}var Zt=function(I){var N=I.pageBorderBoxWithDroppableScroll,X=I.draggable,re=I.destination,pe=I.insideDestination,me=I.last,Ae=I.viewport,De=I.afterCritical,ze=re.axis,nt=_n(re.axis,X.displaceBy),it=nt.value,Xe=N[ze.start],Ve=N[ze.end],Ze=On(X,pe),yt=We(Ze,function(xn){var $n=xn.descriptor.id,ir=xn.page.borderBox.center[ze.line],Tr=an($n,De),rr=Cn({displaced:me,id:$n});return Tr?rr?Ve<=ir:Xe<ir-it:rr?Ve<=ir+it:Xe<ir}),gn=vn({draggable:X,closest:yt,inHomeList:cr(X,re)});return Re({draggable:X,insideDestination:pe,destination:re,viewport:Ae,last:me,displacedBy:nt,index:gn})},St=4,Mt=function(I){var N=I.draggable,X=I.pageBorderBoxWithDroppableScroll,re=I.previousImpact,pe=I.destination,me=I.insideDestination,Ae=I.afterCritical;if(!pe.isCombineEnabled)return null;var De=pe.axis,ze=_n(pe.axis,N.displaceBy),nt=ze.value,it=X[De.start],Xe=X[De.end],Ve=On(N,me),Ze=We(Ve,function(gn){var xn=gn.descriptor.id,$n=gn.page.borderBox,ir=$n[De.size],Tr=ir/St,rr=an(xn,Ae),Mr=Cn({displaced:re.displaced,id:xn});return rr?Mr?Xe>$n[De.start]+Tr&&Xe<$n[De.end]-Tr:it>$n[De.start]-nt+Tr&&it<$n[De.end]-nt-Tr:Mr?Xe>$n[De.start]+nt+Tr&&Xe<$n[De.end]+nt-Tr:it>$n[De.start]+Tr&&it<$n[De.end]-Tr});if(!Ze)return null;var yt={displacedBy:ze,displaced:re.displaced,at:{type:"COMBINE",combine:{draggableId:Ze.descriptor.id,droppableId:pe.descriptor.id}}};return yt},Nt=function(I){var N=I.pageOffset,X=I.draggable,re=I.draggables,pe=I.droppables,me=I.previousImpact,Ae=I.viewport,De=I.afterCritical,ze=Rn(X.page.borderBox,N),nt=_r({pageBorderBox:ze,draggable:X,droppables:pe});if(!nt)return Sr;var it=pe[nt],Xe=Vt(it.descriptor.id,re),Ve=En(it,ze);return Mt({pageBorderBoxWithDroppableScroll:Ve,draggable:X,previousImpact:me,destination:it,insideDestination:Xe,afterCritical:De})||Zt({pageBorderBoxWithDroppableScroll:Ve,draggable:X,destination:it,insideDestination:Xe,last:me.displaced,viewport:Ae,afterCritical:De})},At=function(I,N){var X;return Object(q.a)({},I,(X={},X[N.descriptor.id]=N,X))},zt=function(N){var X=N.previousImpact,re=N.impact,pe=N.droppables,me=cn(X),Ae=cn(re);if(!me)return pe;if(me===Ae)return pe;var De=pe[me];if(!De.subject.withPlaceholder)return pe;var ze=nr(De);return At(pe,ze)},on=function(I){var N=I.draggable,X=I.draggables,re=I.droppables,pe=I.previousImpact,me=I.impact,Ae=zt({previousImpact:pe,impact:me,droppables:re}),De=cn(me);if(!De)return Ae;var ze=re[De];if(cr(N,ze))return Ae;if(ze.subject.withPlaceholder)return Ae;var nt=tr(ze,N,X);return At(Ae,nt)},sn=function(I){var N=I.state,X=I.clientSelection,re=I.dimensions,pe=I.viewport,me=I.impact,Ae=I.scrollJumpRequest,De=pe||N.viewport,ze=re||N.dimensions,nt=X||N.current.client.selection,it=bt(nt,N.initial.client.selection),Xe={offset:it,selection:nt,borderBoxCenter:ut(N.initial.client.borderBoxCenter,it)},Ve={selection:ut(Xe.selection,De.scroll.current),borderBoxCenter:ut(Xe.borderBoxCenter,De.scroll.current),offset:ut(Xe.offset,De.scroll.diff.value)},Ze={client:Xe,page:Ve};if(N.phase==="COLLECTING")return Object(q.a)({phase:"COLLECTING"},N,{dimensions:ze,viewport:De,current:Ze});var yt=ze.draggables[N.critical.draggable.id],gn=me||Nt({pageOffset:Ve.offset,draggable:yt,draggables:ze.draggables,droppables:ze.droppables,previousImpact:N.impact,viewport:De,afterCritical:N.afterCritical}),xn=on({draggable:yt,impact:gn,previousImpact:N.impact,draggables:ze.draggables,droppables:ze.droppables}),$n=Object(q.a)({},N,{current:Ze,dimensions:{draggables:ze.draggables,droppables:xn},impact:gn,viewport:De,scrollJumpRequest:Ae||null,forceShouldAnimate:Ae?!1:null});return $n};function ft(I,N){return I.map(function(X){return N[X]})}var rt=function(I){var N=I.impact,X=I.viewport,re=I.draggables,pe=I.destination,me=I.forceShouldAnimate,Ae=N.displaced,De=ft(Ae.all,re),ze=kt({afterDragging:De,destination:pe,displacedBy:N.displacedBy,viewport:X.frame,forceShouldAnimate:me,last:Ae});return Object(q.a)({},N,{displaced:ze})},Ye=function(I){var N=I.impact,X=I.draggable,re=I.droppable,pe=I.draggables,me=I.viewport,Ae=I.afterCritical,De=Kt({impact:N,draggable:X,draggables:pe,droppable:re,afterCritical:Ae});return $t({pageBorderBoxCenter:De,draggable:X,viewport:me})},et=function(I){var N=I.state,X=I.dimensions,re=I.viewport;N.movementMode==="SNAP"||v(!1);var pe=N.impact,me=re||N.viewport,Ae=X||N.dimensions,De=Ae.draggables,ze=Ae.droppables,nt=De[N.critical.draggable.id],it=cn(pe);it||v(!1);var Xe=ze[it],Ve=rt({impact:pe,viewport:me,destination:Xe,draggables:De}),Ze=Ye({impact:Ve,draggable:nt,droppable:Xe,draggables:De,viewport:me,afterCritical:N.afterCritical});return sn({impact:Ve,clientSelection:Ze,state:N,dimensions:Ae,viewport:me})},Ge=function(I){return{index:I.index,droppableId:I.droppableId}},ot=function(I){var N=I.draggable,X=I.home,re=I.draggables,pe=I.viewport,me=_n(X.axis,N.displaceBy),Ae=Vt(X.descriptor.id,re),De=Ae.indexOf(N);De!==-1||v(!1);var ze=Ae.slice(De+1),nt=ze.reduce(function(Ze,yt){return Ze[yt.descriptor.id]=!0,Ze},{}),it={inVirtualList:X.descriptor.mode==="virtual",displacedBy:me,effected:nt},Xe=kt({afterDragging:ze,destination:X,displacedBy:me,last:null,viewport:pe.frame,forceShouldAnimate:!1}),Ve={displaced:Xe,displacedBy:me,at:{type:"REORDER",destination:Ge(N.descriptor)}};return{impact:Ve,afterCritical:it}},tt=function(I,N){return{draggables:I.draggables,droppables:At(I.droppables,N)}},mt=function(N){},Tt=function(N){},gt=function(I){var N=I.draggable,X=I.offset,re=I.initialWindowScroll,pe=O(N.client,X),me=S(pe,re),Ae=Object(q.a)({},N,{placeholder:Object(q.a)({},N.placeholder,{client:pe}),client:pe,page:me});return Ae},Pt=function(I){var N=I.frame;return N||v(!1),N},vt=function(I){var N=I.additions,X=I.updatedDroppables,re=I.viewport,pe=re.scroll.diff.value;return N.map(function(me){var Ae=me.descriptor.droppableId,De=X[Ae],ze=Pt(De),nt=ze.scroll.diff.value,it=ut(pe,nt),Xe=gt({draggable:me,offset:it,initialWindowScroll:re.scroll.initial});return Xe})},Et=function(I){var N=I.state,X=I.published;mt();var re=X.modified.map(function(Tr){var rr=N.dimensions.droppables[Tr.droppableId],Mr=he(rr,Tr.scroll);return Mr}),pe=Object(q.a)({},N.dimensions.droppables,{},Ct(re)),me=Rt(vt({additions:X.additions,updatedDroppables:pe,viewport:N.viewport})),Ae=Object(q.a)({},N.dimensions.draggables,{},me);X.removals.forEach(function(Tr){delete Ae[Tr]});var De={droppables:pe,draggables:Ae},ze=cn(N.impact),nt=ze?De.droppables[ze]:null,it=De.draggables[N.critical.draggable.id],Xe=De.droppables[N.critical.droppable.id],Ve=ot({draggable:it,home:Xe,draggables:Ae,viewport:N.viewport}),Ze=Ve.impact,yt=Ve.afterCritical,gn=nt&&nt.isCombineEnabled?N.impact:Ze,xn=Nt({pageOffset:N.current.page.offset,draggable:De.draggables[N.critical.draggable.id],draggables:De.draggables,droppables:De.droppables,previousImpact:gn,viewport:N.viewport,afterCritical:yt});Tt();var $n=Object(q.a)({phase:"DRAGGING"},N,{phase:"DRAGGING",impact:xn,onLiftImpact:Ze,dimensions:De,afterCritical:yt,forceShouldAnimate:!1});if(N.phase==="COLLECTING")return $n;var ir=Object(q.a)({phase:"DROP_PENDING"},$n,{phase:"DROP_PENDING",reason:N.reason,isWaiting:!1});return ir},ln=function(N){return N.movementMode==="SNAP"},Jt=function(N,X,re){var pe=tt(N.dimensions,X);return!ln(N)||re?sn({state:N,dimensions:pe}):et({state:N,dimensions:pe})};function fr(I){return I.isDragging&&I.movementMode==="SNAP"?Object(q.a)({phase:"DRAGGING"},I,{scrollJumpRequest:null}):I}var jn={phase:"IDLE",completed:null,shouldFlush:!1},Wn=function(I,N){if(I===void 0&&(I=jn),N.type==="FLUSH")return Object(q.a)({},jn,{shouldFlush:!0});if(N.type==="INITIAL_PUBLISH"){I.phase==="IDLE"||v(!1);var X=N.payload,re=X.critical,pe=X.clientSelection,me=X.viewport,Ae=X.dimensions,De=X.movementMode,ze=Ae.draggables[re.draggable.id],nt=Ae.droppables[re.droppable.id],it={selection:pe,borderBoxCenter:ze.client.borderBox.center,offset:Ke},Xe={client:it,page:{selection:ut(it.selection,me.scroll.initial),borderBoxCenter:ut(it.selection,me.scroll.initial),offset:ut(it.selection,me.scroll.diff.value)}},Ve=It(Ae.droppables).every(function(Cr){return!Cr.isFixedOnPage}),Ze=ot({draggable:ze,home:nt,draggables:Ae.draggables,viewport:me}),yt=Ze.impact,gn=Ze.afterCritical,xn={phase:"DRAGGING",isDragging:!0,critical:re,movementMode:De,dimensions:Ae,initial:Xe,current:Xe,isWindowScrollAllowed:Ve,impact:yt,afterCritical:gn,onLiftImpact:yt,viewport:me,scrollJumpRequest:null,forceShouldAnimate:null};return xn}if(N.type==="COLLECTION_STARTING"){if(I.phase==="COLLECTING"||I.phase==="DROP_PENDING")return I;I.phase==="DRAGGING"||v(!1);var $n=Object(q.a)({phase:"COLLECTING"},I,{phase:"COLLECTING"});return $n}if(N.type==="PUBLISH_WHILE_DRAGGING")return I.phase==="COLLECTING"||I.phase==="DROP_PENDING"||v(!1),Et({state:I,published:N.payload});if(N.type==="MOVE"){if(I.phase==="DROP_PENDING")return I;vr(I)||v(!1);var ir=N.payload.client;return Lt(ir,I.current.client.selection)?I:sn({state:I,clientSelection:ir,impact:ln(I)?I.impact:null})}if(N.type==="UPDATE_DROPPABLE_SCROLL"){if(I.phase==="DROP_PENDING")return fr(I);if(I.phase==="COLLECTING")return fr(I);vr(I)||v(!1);var Tr=N.payload,rr=Tr.id,Mr=Tr.newScroll,Pr=I.dimensions.droppables[rr];if(!Pr)return I;var Br=he(Pr,Mr);return Jt(I,Br,!1)}if(N.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(I.phase==="DROP_PENDING")return I;vr(I)||v(!1);var $r=N.payload,e=$r.id,n=$r.isEnabled,d=I.dimensions.droppables[e];d||v(!1),d.isEnabled!==n||v(!1);var l=Object(q.a)({},d,{isEnabled:n});return Jt(I,l,!0)}if(N.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(I.phase==="DROP_PENDING")return I;vr(I)||v(!1);var b=N.payload,G=b.id,te=b.isCombineEnabled,se=I.dimensions.droppables[G];se||v(!1),se.isCombineEnabled!==te||v(!1);var ue=Object(q.a)({},se,{isCombineEnabled:te});return Jt(I,ue,!0)}if(N.type==="MOVE_BY_WINDOW_SCROLL"){if(I.phase==="DROP_PENDING"||I.phase==="DROP_ANIMATING")return I;vr(I)||v(!1),I.isWindowScrollAllowed||v(!1);var be=N.payload.newScroll;if(Lt(I.viewport.scroll.current,be))return fr(I);var je=sr(I.viewport,be);return ln(I)?et({state:I,viewport:je}):sn({state:I,viewport:je})}if(N.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!vr(I))return I;var $e=N.payload.maxScroll;if(Lt($e,I.viewport.scroll.max))return I;var ct=Object(q.a)({},I.viewport,{scroll:Object(q.a)({},I.viewport.scroll,{max:$e})});return Object(q.a)({phase:"DRAGGING"},I,{viewport:ct})}if(N.type==="MOVE_UP"||N.type==="MOVE_DOWN"||N.type==="MOVE_LEFT"||N.type==="MOVE_RIGHT"){if(I.phase==="COLLECTING"||I.phase==="DROP_PENDING")return I;I.phase==="DRAGGING"||v(!1);var st=Xn({state:I,type:N.type});return st?sn({state:I,impact:st.impact,clientSelection:st.clientSelection,scrollJumpRequest:st.scrollJumpRequest}):I}if(N.type==="DROP_PENDING"){var Ot=N.payload.reason;I.phase==="COLLECTING"||v(!1);var Ht=Object(q.a)({phase:"DROP_PENDING"},I,{phase:"DROP_PENDING",isWaiting:!0,reason:Ot});return Ht}if(N.type==="DROP_ANIMATE"){var rn=N.payload,Tn=rn.completed,Yn=rn.dropDuration,Sn=rn.newHomeClientOffset;I.phase==="DRAGGING"||I.phase==="DROP_PENDING"||v(!1);var ur={phase:"DROP_ANIMATING",completed:Tn,dropDuration:Yn,newHomeClientOffset:Sn,dimensions:I.dimensions};return ur}if(N.type==="DROP_COMPLETE"){var Rr=N.payload.completed;return{phase:"IDLE",completed:Rr,shouldFlush:!1}}return I},jt=function(N){return{type:"BEFORE_INITIAL_CAPTURE",payload:N}},pn=function(N){return{type:"LIFT",payload:N}},In=function(N){return{type:"INITIAL_PUBLISH",payload:N}},zn=function(N){return{type:"PUBLISH_WHILE_DRAGGING",payload:N}},mn=function(){return{type:"COLLECTION_STARTING",payload:null}},Ir=function(N){return{type:"UPDATE_DROPPABLE_SCROLL",payload:N}},jr=function(N){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:N}},Er=function(N){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:N}},Jn=function(N){return{type:"MOVE",payload:N}},xr=function(N){return{type:"MOVE_BY_WINDOW_SCROLL",payload:N}},br=function(N){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:N}},wr=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(N){return{type:"DROP_ANIMATE",payload:N}},Kr=function(N){return{type:"DROP_COMPLETE",payload:N}},Si=function(N){return{type:"DROP",payload:N}},Zr=function(N){return{type:"DROP_PENDING",payload:N}},ei=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function yi(I){if(I.length<=1)return;for(var N=I.map(function(De){return De.descriptor.index}),X={},re=1;re<N.length;re++){var pe=N[re],me=N[re-1];pe!==me+1&&(X[pe]=!0)}if(!Object.keys(X).length)return;var Ae=N.map(function(De){var ze=Boolean(X[De]);return ze?"[\u{1F525}"+De+"]":""+De}).join(", ")}function Ri(I,N){if(!1)var X}var Va=function(I){return function(N){var X=N.getState,re=N.dispatch;return function(pe){return function(me){if(me.type!=="LIFT"){pe(me);return}var Ae=me.payload,De=Ae.id,ze=Ae.clientSelection,nt=Ae.movementMode,it=X();it.phase==="DROP_ANIMATING"&&re(Kr({completed:it.completed})),X().phase==="IDLE"||v(!1),re(kr()),re(jt({draggableId:De,movementMode:nt}));var Xe={shouldPublishImmediately:nt==="SNAP"},Ve={draggableId:De,scrollOptions:Xe},Ze=I.startPublishing(Ve),yt=Ze.critical,gn=Ze.dimensions,xn=Ze.viewport;Ri(yt,gn),re(In({critical:yt,dimensions:gn,clientSelection:ze,movementMode:nt,viewport:xn}))}}}},fi=function(I){return function(){return function(N){return function(X){X.type==="INITIAL_PUBLISH"&&I.dragging(),X.type==="DROP_ANIMATE"&&I.dropping(X.payload.completed.result.reason),(X.type==="FLUSH"||X.type==="DROP_COMPLETE")&&I.resting(),N(X)}}}},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(N){var X=N+"s "+Xa.drop;return"transform "+X+", opacity "+X},outOfTheWay:"transform "+ai,placeholder:"height "+ai+", width "+ai+", margin "+ai},ys=function(N){return Lt(N,Ke)?null:"translate("+N.x+"px, "+N.y+"px)"},bs={moveTo:ys,drop:function(N,X){var re=ys(N);return re?X?re+" scale("+Ki.scale.drop+")":re:null}},Es=ki.minDropTime,co=ki.maxDropTime,ho=co-Es,xs=1500,Ca=.6,fo=function(I){var N=I.current,X=I.destination,re=I.reason,pe=Xt(N,X);if(pe<=0)return Es;if(pe>=xs)return co;var me=pe/xs,Ae=Es+ho*me,De=re==="CANCEL"?Ae*Ca:Ae;return Number(De.toFixed(2))},po=function(I){var N=I.impact,X=I.draggable,re=I.dimensions,pe=I.viewport,me=I.afterCritical,Ae=re.draggables,De=re.droppables,ze=cn(N),nt=ze?De[ze]:null,it=De[X.descriptor.droppableId],Xe=Ye({impact:N,draggable:X,draggables:Ae,afterCritical:me,droppable:nt||it,viewport:pe}),Ve=bt(Xe,X.client.borderBox.center);return Ve},ws=function(I){var N=I.draggables,X=I.reason,re=I.lastImpact,pe=I.home,me=I.viewport,Ae=I.onLiftImpact;if(!re.at||X!=="DROP"){var De=rt({draggables:N,impact:Ae,destination:pe,viewport:me,forceShouldAnimate:!0});return{impact:De,didDropInsideDroppable:!1}}if(re.at.type==="REORDER")return{impact:re,didDropInsideDroppable:!0};var ze=Object(q.a)({},re,{displaced:yr});return{impact:ze,didDropInsideDroppable:!0}},$a=function(I){var N=I.getState,X=I.dispatch;return function(re){return function(pe){if(pe.type!=="DROP"){re(pe);return}var me=N(),Ae=pe.payload.reason;if(me.phase==="COLLECTING"){X(Zr({reason:Ae}));return}if(me.phase==="IDLE")return;var De=me.phase==="DROP_PENDING"&&me.isWaiting;De&&v(!1),me.phase==="DRAGGING"||me.phase==="DROP_PENDING"||v(!1);var ze=me.critical,nt=me.dimensions,it=nt.draggables[me.critical.draggable.id],Xe=ws({reason:Ae,lastImpact:me.impact,afterCritical:me.afterCritical,onLiftImpact:me.onLiftImpact,home:me.dimensions.droppables[me.critical.droppable.id],viewport:me.viewport,draggables:me.dimensions.draggables}),Ve=Xe.impact,Ze=Xe.didDropInsideDroppable,yt=Ze?qt(Ve):null,gn=Ze?nn(Ve):null,xn={index:ze.draggable.index,droppableId:ze.droppable.id},$n={draggableId:it.descriptor.id,type:it.descriptor.type,source:xn,reason:Ae,mode:me.movementMode,destination:yt,combine:gn},ir=po({impact:Ve,draggable:it,dimensions:nt,viewport:me.viewport,afterCritical:me.afterCritical}),Tr={critical:me.critical,afterCritical:me.afterCritical,result:$n,impact:Ve},rr=!Lt(me.current.client.offset,ir)||Boolean($n.combine);if(!rr){X(Kr({completed:Tr}));return}var Mr=fo({current:me.current.client.offset,destination:ir,reason:Ae}),Pr={newHomeClientOffset:ir,dropDuration:Mr,completed:Tr};X(Ti(Pr))}}},Cs=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Ts(I){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(X){if(X.target!==window&&X.target!==window.document)return;I()}}}function xi(I){var N=I.onWindowScroll;function X(){N(Cs())}var re=x(X),pe=Ts(re),me=Te;function Ae(){return me!==Te}function De(){Ae()&&v(!1),me=Se(window,[pe])}function ze(){Ae()||v(!1),re.cancel(),me(),me=Te}return{start:De,stop:ze,isActive:Ae}}var mo=function(N){return N.type==="DROP_COMPLETE"||N.type==="DROP_ANIMATE"||N.type==="FLUSH"},Ss=function(I){var N=xi({onWindowScroll:function(re){I.dispatch(xr({newScroll:re}))}});return function(X){return function(re){!N.isActive()&&re.type==="INITIAL_PUBLISH"&&N.start(),N.isActive()&&mo(re)&&N.stop(),X(re)}}},Rs=function(I){var N=!1,X=!1,re=setTimeout(function(){X=!0}),pe=function(Ae){if(N)return;if(X)return;N=!0,I(Ae),clearTimeout(re)};return pe.wasCalled=function(){return N},pe},go=function(){var I=[],N=function(me){var Ae=Ne(I,function(nt){return nt.timerId===me});Ae!==-1||v(!1);var De=I.splice(Ae,1),ze=De[0];ze.callback()},X=function(me){var Ae=setTimeout(function(){return N(Ae)}),De={timerId:Ae,callback:me};I.push(De)},re=function(){if(!I.length)return;var me=[].concat(I);I.length=0,me.forEach(function(Ae){clearTimeout(Ae.timerId),Ae.callback()})};return{add:X,flush:re}},vo=function(N,X){return N==null&&X==null?!0:N==null||X==null?!1:N.droppableId===X.droppableId&&N.index===X.index},Os=function(N,X){return N==null&&X==null?!0:N==null||X==null?!1:N.draggableId===X.draggableId&&N.droppableId===X.droppableId},El=function(N,X){if(N===X)return!0;var re=N.draggable.id===X.draggable.id&&N.draggable.droppableId===X.draggable.droppableId&&N.draggable.type===X.draggable.type&&N.draggable.index===X.draggable.index,pe=N.droppable.id===X.droppable.id&&N.droppable.type===X.droppable.type;return re&&pe},Ta=function(N,X){mt(),X(),Tt()},Ya=function(N,X){return{draggableId:N.draggable.id,type:N.droppable.type,source:{droppableId:N.droppable.id,index:N.draggable.index},mode:X}},Oi=function(N,X,re,pe){if(!N){re(pe(X));return}var me=Rs(re),Ae={announce:me};N(X,Ae),me.wasCalled()||re(pe(X))},Zi=function(I,N){var X=go(),re=null,pe=function(Ve,Ze){re&&v(!1),Ta("onBeforeCapture",function(){var yt=I().onBeforeCapture;if(yt){var gn={draggableId:Ve,mode:Ze};yt(gn)}})},me=function(Ve,Ze){re&&v(!1),Ta("onBeforeDragStart",function(){var yt=I().onBeforeDragStart;yt&&yt(Ya(Ve,Ze))})},Ae=function(Ve,Ze){re&&v(!1);var yt=Ya(Ve,Ze);re={mode:Ze,lastCritical:Ve,lastLocation:yt.source,lastCombine:null},X.add(function(){Ta("onDragStart",function(){return Oi(I().onDragStart,yt,N,He.onDragStart)})})},De=function(Ve,Ze){var yt=qt(Ze),gn=nn(Ze);re||v(!1);var xn=!El(Ve,re.lastCritical);xn&&(re.lastCritical=Ve);var $n=!vo(re.lastLocation,yt);$n&&(re.lastLocation=yt);var ir=!Os(re.lastCombine,gn);if(ir&&(re.lastCombine=gn),!xn&&!$n&&!ir)return;var Tr=Object(q.a)({},Ya(Ve,re.mode),{combine:gn,destination:yt});X.add(function(){Ta("onDragUpdate",function(){return Oi(I().onDragUpdate,Tr,N,He.onDragUpdate)})})},ze=function(){re||v(!1),X.flush()},nt=function(Ve){re||v(!1),re=null,Ta("onDragEnd",function(){return Oi(I().onDragEnd,Ve,N,He.onDragEnd)})},it=function(){if(!re)return;var Ve=Object(q.a)({},Ya(re.lastCritical,re.mode),{combine:null,destination:null,reason:"CANCEL"});nt(Ve)};return{beforeCapture:pe,beforeStart:me,start:Ae,update:De,flush:ze,drop:nt,abort:it}},qi=function(I,N){var X=Zi(I,N);return function(re){return function(pe){return function(me){if(me.type==="BEFORE_INITIAL_CAPTURE"){X.beforeCapture(me.payload.draggableId,me.payload.movementMode);return}if(me.type==="INITIAL_PUBLISH"){var Ae=me.payload.critical;X.beforeStart(Ae,me.payload.movementMode),pe(me),X.start(Ae,me.payload.movementMode);return}if(me.type==="DROP_COMPLETE"){var De=me.payload.completed.result;X.flush(),pe(me),X.drop(De);return}if(pe(me),me.type==="FLUSH"){X.abort();return}var ze=re.getState();ze.phase==="DRAGGING"&&X.update(ze.critical,ze.impact)}}}},As=function(I){return function(N){return function(X){if(X.type!=="DROP_ANIMATION_FINISHED"){N(X);return}var re=I.getState();re.phase==="DROP_ANIMATING"||v(!1),I.dispatch(Kr({completed:re.completed}))}}},Ds=function(I){var N=null,X=null;function re(){X&&(cancelAnimationFrame(X),X=null),N&&(N(),N=null)}return function(pe){return function(me){if((me.type==="FLUSH"||me.type==="DROP_COMPLETE"||me.type==="DROP_ANIMATION_FINISHED")&&re(),pe(me),me.type!=="DROP_ANIMATE")return;var Ae={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var ze=I.getState();ze.phase==="DROP_ANIMATING"&&I.dispatch(ei())}};X=requestAnimationFrame(function(){X=null,N=Se(window,[Ae])})}}},_o=function(I){return function(){return function(N){return function(X){(X.type==="DROP_COMPLETE"||X.type==="FLUSH"||X.type==="DROP_ANIMATE")&&I.stopPublishing(),N(X)}}}},Ps=function(I){var N=!1;return function(){return function(X){return function(re){if(re.type==="INITIAL_PUBLISH"){N=!0,I.tryRecordFocus(re.payload.critical.draggable.id),X(re),I.tryRestoreFocusRecorded();return}if(X(re),!N)return;if(re.type==="FLUSH"){N=!1,I.tryRestoreFocusRecorded();return}if(re.type==="DROP_COMPLETE"){N=!1;var pe=re.payload.completed.result;pe.combine&&I.tryShiftRecord(pe.draggableId,pe.combine.draggableId),I.tryRestoreFocusRecorded()}}}}},Gi=function(N){return N.type==="DROP_COMPLETE"||N.type==="DROP_ANIMATE"||N.type==="FLUSH"},zi=function(I){return function(N){return function(X){return function(re){if(Gi(re)){I.stop(),X(re);return}if(re.type==="INITIAL_PUBLISH"){X(re);var pe=N.getState();pe.phase==="DRAGGING"||v(!1),I.start(pe);return}X(re),I.scroll(N.getState())}}}},li=function(I){return function(N){return function(X){if(N(X),X.type!=="PUBLISH_WHILE_DRAGGING")return;var re=I.getState();if(re.phase!=="DROP_PENDING")return;if(re.isWaiting)return;I.dispatch(Si({reason:re.reason}))}}},Mi=K.d,Ni=function(I){var N=I.dimensionMarshal,X=I.focusMarshal,re=I.styleMarshal,pe=I.getResponders,me=I.announce,Ae=I.autoScroller;return Object(K.e)(Wn,Mi(Object(K.a)(fi(re),_o(N),Va(N),$a,As,Ds,li,zi(Ae),Ss,Ps(X),qi(pe,me))))},ea=function(){return{additions:{},removals:{},modified:{}}};function xl(I){var N=I.registry,X=I.callbacks,re=ea(),pe=null,me=function(){if(pe)return;X.collectionStarting(),pe=requestAnimationFrame(function(){pe=null,mt();var it=re,Xe=it.additions,Ve=it.removals,Ze=it.modified,yt=Object.keys(Xe).map(function($n){return N.draggable.getById($n).getDimension(Ke)}).sort(function($n,ir){return $n.descriptor.index-ir.descriptor.index}),gn=Object.keys(Ze).map(function($n){var ir=N.droppable.getById($n),Tr=ir.callbacks.getScrollWhileDragging();return{droppableId:$n,scroll:Tr}}),xn={additions:yt,removals:Object.keys(Ve),modified:gn};re=ea(),Tt(),X.publish(xn)})},Ae=function(it){var Xe=it.descriptor.id;re.additions[Xe]=it,re.modified[it.descriptor.droppableId]=!0,re.removals[Xe]&&delete re.removals[Xe],me()},De=function(it){var Xe=it.descriptor;re.removals[Xe.id]=!0,re.modified[Xe.droppableId]=!0,re.additions[Xe.id]&&delete re.additions[Xe.id],me()},ze=function(){if(!pe)return;cancelAnimationFrame(pe),pe=null,re=ea()};return{add:Ae,remove:De,stop:ze}}var Ls=function(I){var N=I.scrollHeight,X=I.scrollWidth,re=I.height,pe=I.width,me=bt({x:X,y:N},{x:pe,y:re}),Ae={x:Math.max(0,me.x),y:Math.max(0,me.y)};return Ae},ta=function(){var I=document.documentElement;return I||v(!1),I},Is=function(){var I=ta(),N=Ls({scrollHeight:I.scrollHeight,scrollWidth:I.scrollWidth,width:I.clientWidth,height:I.clientHeight});return N},yo=function(){var I=Cs(),N=Is(),X=I.y,re=I.x,pe=ta(),me=pe.clientWidth,Ae=pe.clientHeight,De=re+me,ze=X+Ae,nt=g({top:X,left:re,right:De,bottom:ze}),it={frame:nt,scroll:{initial:I,current:I,max:N,diff:{value:Ke,displacement:Ke}}};return it},Qa=function(I){var N=I.critical,X=I.scrollOptions,re=I.registry;mt();var pe=yo(),me=pe.scroll.current,Ae=N.droppable,De=re.droppable.getAllByType(Ae.type).map(function(Xe){return Xe.callbacks.getDimensionAndWatchScroll(me,X)}),ze=re.draggable.getAllByType(N.draggable.type).map(function(Xe){return Xe.getDimension(me)}),nt={draggables:Rt(ze),droppables:Ct(De)};Tt();var it={dimensions:nt,critical:N,viewport:pe};return it};function bo(I,N,X){if(X.descriptor.id===N.id)return!1;if(X.descriptor.type!==N.type)return!1;var re=I.droppable.getById(X.descriptor.droppableId);return!(re.descriptor.mode!=="virtual")}var ks=function(I,N){var X=null,re=xl({callbacks:{publish:N.publishWhileDragging,collectionStarting:N.collectionStarting},registry:I}),pe=function(Ze,yt){if(I.droppable.exists(Ze)||v(!1),!X)return;N.updateDroppableIsEnabled({id:Ze,isEnabled:yt})},me=function(Ze,yt){if(!X)return;I.droppable.exists(Ze)||v(!1),N.updateDroppableIsCombineEnabled({id:Ze,isCombineEnabled:yt})},Ae=function(Ze,yt){if(!X)return;I.droppable.exists(Ze)||v(!1),N.updateDroppableScroll({id:Ze,newScroll:yt})},De=function(Ze,yt){if(!X)return;I.droppable.getById(Ze).callbacks.scroll(yt)},ze=function(){if(!X)return;re.stop();var Ze=X.critical.droppable;I.droppable.getAllByType(Ze.type).forEach(function(yt){return yt.callbacks.dragStopped()}),X.unsubscribe(),X=null},nt=function(Ze){X||v(!1);var yt=X.critical.draggable;Ze.type==="ADDITION"&&(bo(I,yt,Ze.value)&&re.add(Ze.value)),Ze.type==="REMOVAL"&&(bo(I,yt,Ze.value)&&re.remove(Ze.value))},it=function(Ze){X&&v(!1);var yt=I.draggable.getById(Ze.draggableId),gn=I.droppable.getById(yt.descriptor.droppableId),xn={draggable:yt.descriptor,droppable:gn.descriptor},$n=I.subscribe(nt);return X={critical:xn,unsubscribe:$n},Qa({critical:xn,registry:I,scrollOptions:Ze.scrollOptions})},Xe={updateDroppableIsEnabled:pe,updateDroppableIsCombineEnabled:me,scrollDroppable:De,updateDroppableScroll:Ae,startPublishing:it,stopPublishing:ze};return Xe},Ms=function(I,N){return I.phase==="IDLE"?!0:I.phase!=="DROP_ANIMATING"||I.completed.result.draggableId===N?!1:I.completed.result.reason==="DROP"},Eo=function(I){window.scrollBy(I.x,I.y)},Ns=f(function(I){return It(I).filter(function(N){return N.isEnabled?!!N.frame:!1})}),na=function(N,X){var re=We(Ns(X),function(pe){return pe.frame||v(!1),gr(pe.frame.pageMarginBox)(N)});return re},Ja=function(I){var N=I.center,X=I.destination,re=I.droppables;if(X){var pe=re[X];return pe.frame?pe:null}var me=na(N,re);return me},Ai={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(N){return Math.pow(N,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Za=function(I,N){var X=I[N.size]*Ai.startFromPercentage,re=I[N.size]*Ai.maxScrollAtPercentage,pe={startScrollingFrom:X,maxScrollValueAt:re};return pe},xo=function(I){var N=I.startOfRange,X=I.endOfRange,re=I.current,pe=X-N;if(pe===0)return 0;var me=re-N,Ae=me/pe;return Ae},Us=1,wl=function(I,N){if(I>N.startScrollingFrom)return 0;if(I<=N.maxScrollValueAt)return Ai.maxPixelScroll;if(I===N.startScrollingFrom)return Us;var X=xo({startOfRange:N.maxScrollValueAt,endOfRange:N.startScrollingFrom,current:I}),re=1-X,pe=Ai.maxPixelScroll*Ai.ease(re);return Math.ceil(pe)},qa=Ai.durationDampening.accelerateAt,es=Ai.durationDampening.stopDampeningAt,ra=function(I,N){var X=N,re=es,pe=Date.now(),me=pe-X;if(me>=es)return I;if(me<qa)return Us;var Ae=xo({startOfRange:qa,endOfRange:re,current:me}),De=I*Ai.ease(Ae);return Math.ceil(De)},ia=function(I){var N=I.distanceToEdge,X=I.thresholds,re=I.dragStartTime,pe=I.shouldUseTimeDampening,me=wl(N,X);return me===0?0:pe?Math.max(ra(me,re),Us):me},wo=function(I){var N=I.container,X=I.distanceToEdges,re=I.dragStartTime,pe=I.axis,me=I.shouldUseTimeDampening,Ae=Za(N,pe),De=X[pe.end]<X[pe.start];return De?ia({distanceToEdge:X[pe.end],thresholds:Ae,dragStartTime:re,shouldUseTimeDampening:me}):-1*ia({distanceToEdge:X[pe.start],thresholds:Ae,dragStartTime:re,shouldUseTimeDampening:me})},ts=function(I){var N=I.container,X=I.subject,re=I.proposedScroll,pe=X.height>N.height,me=X.width>N.width;return!me&&!pe?re:me&&pe?null:{x:me?0:re.x,y:pe?0:re.y}},Co=Qe(function(I){return I===0?0:I}),aa=function(I){var N=I.dragStartTime,X=I.container,re=I.subject,pe=I.center,me=I.shouldUseTimeDampening,Ae={top:pe.y-X.top,right:X.right-pe.x,bottom:X.bottom-pe.y,left:pe.x-X.left},De=wo({container:X,distanceToEdges:Ae,dragStartTime:N,axis:Pn,shouldUseTimeDampening:me}),ze=wo({container:X,distanceToEdges:Ae,dragStartTime:N,axis:Zn,shouldUseTimeDampening:me}),nt=Co({x:ze,y:De});if(Lt(nt,Ke))return null;var it=ts({container:X,subject:re,proposedScroll:nt});return it?Lt(it,Ke)?null:it:null},To=Qe(function(I){return I===0?0:I>0?1:-1}),Di=function(){var I=function(X,re){return X<0?X:X>re?X-re:0};return function(N){var X=N.current,re=N.max,pe=N.change,me=ut(X,pe),Ae={x:I(me.x,re.x),y:I(me.y,re.y)};return Lt(Ae,Ke)?null:Ae}}(),sa=function(N){var X=N.max,re=N.current,pe=N.change,me={x:Math.max(re.x,X.x),y:Math.max(re.y,X.y)},Ae=To(pe),De=Di({max:me,current:re,change:Ae});return De?Ae.x!==0&&De.x===0?!0:Ae.y!==0&&De.y===0:!0},Pi=function(N,X){return sa({current:N.scroll.current,max:N.scroll.max,change:X})},Sa=function(N,X){if(!Pi(N,X))return null;var re=N.scroll.max,pe=N.scroll.current;return Di({current:pe,max:re,change:X})},Ui=function(N,X){var re=N.frame;return re?sa({current:re.scroll.current,max:re.scroll.max,change:X}):!1},So=function(N,X){var re=N.frame;return re&&Ui(N,X)?Di({current:re.scroll.current,max:re.scroll.max,change:X}):null},Ro=function(I){var N=I.viewport,X=I.subject,re=I.center,pe=I.dragStartTime,me=I.shouldUseTimeDampening,Ae=aa({dragStartTime:pe,container:N.frame,subject:X,center:re,shouldUseTimeDampening:me});return Ae&&Pi(N,Ae)?Ae:null},Oo=function(I){var N=I.droppable,X=I.subject,re=I.center,pe=I.dragStartTime,me=I.shouldUseTimeDampening,Ae=N.frame;if(!Ae)return null;var De=aa({dragStartTime:pe,container:Ae.pageMarginBox,subject:X,center:re,shouldUseTimeDampening:me});return De&&Ui(N,De)?De:null},Ao=function(I){var N=I.state,X=I.dragStartTime,re=I.shouldUseTimeDampening,pe=I.scrollWindow,me=I.scrollDroppable,Ae=N.current.page.borderBoxCenter,De=N.dimensions.draggables[N.critical.draggable.id],ze=De.page.marginBox;if(N.isWindowScrollAllowed){var nt=N.viewport,it=Ro({dragStartTime:X,viewport:nt,subject:ze,center:Ae,shouldUseTimeDampening:re});if(it){pe(it);return}}var Xe=Ja({center:Ae,destination:cn(N.impact),droppables:N.dimensions.droppables});if(!Xe)return;var Ve=Oo({dragStartTime:X,droppable:Xe,subject:ze,center:Ae,shouldUseTimeDampening:re});Ve&&me(Xe.descriptor.id,Ve)},Vi=function(I){var N=I.scrollWindow,X=I.scrollDroppable,re=x(N),pe=x(X),me=null,Ae=function(it){me||v(!1);var Xe=me,Ve=Xe.shouldUseTimeDampening,Ze=Xe.dragStartTime;Ao({state:it,scrollWindow:re,scrollDroppable:pe,dragStartTime:Ze,shouldUseTimeDampening:Ve})},De=function(it){mt(),me&&v(!1);var Xe=Date.now(),Ve=!1,Ze=function(){Ve=!0};Ao({state:it,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Ze,scrollDroppable:Ze}),me={dragStartTime:Xe,shouldUseTimeDampening:Ve},Tt(),Ve&&Ae(it)},ze=function(){if(!me)return;re.cancel(),pe.cancel(),me=null};return{start:De,stop:ze,scroll:Ae}},Xi=function(I){var N=I.move,X=I.scrollDroppable,re=I.scrollWindow,pe=function(nt,it){var Xe=ut(nt.current.client.selection,it);N({client:Xe})},me=function(nt,it){if(!Ui(nt,it))return it;var Xe=So(nt,it);if(!Xe)return X(nt.descriptor.id,it),null;var Ve=bt(it,Xe);X(nt.descriptor.id,Ve);var Ze=bt(it,Ve);return Ze},Ae=function(nt,it,Xe){if(!nt)return Xe;if(!Pi(it,Xe))return Xe;var Ve=Sa(it,Xe);if(!Ve)return re(Xe),null;var Ze=bt(Xe,Ve);re(Ze);var yt=bt(Xe,Ze);return yt},De=function(nt){var it=nt.scrollJumpRequest;if(!it)return;var Xe=cn(nt.impact);Xe||v(!1);var Ve=me(nt.dimensions.droppables[Xe],it);if(!Ve)return;var Ze=nt.viewport,yt=Ae(nt.isWindowScrollAllowed,Ze,Ve);if(!yt)return;pe(nt,yt)};return De},Cl=function(I){var N=I.scrollDroppable,X=I.scrollWindow,re=I.move,pe=Vi({scrollWindow:X,scrollDroppable:N}),me=Xi({move:re,scrollWindow:X,scrollDroppable:N}),Ae=function(nt){if(nt.phase!=="DRAGGING")return;if(nt.movementMode==="FLUID"){pe.scroll(nt);return}if(!nt.scrollJumpRequest)return;me(nt)},De={scroll:Ae,start:pe.start,stop:pe.stop};return De},oa="data-rbd",la=function(){var I=oa+"-drag-handle";return{base:I,draggableId:I+"-draggable-id",contextId:I+"-context-id"}}(),Fs=function(){var I=oa+"-draggable";return{base:I,contextId:I+"-context-id",id:I+"-id"}}(),Tl=function(){var I=oa+"-droppable";return{base:I,contextId:I+"-context-id",id:I+"-id"}}(),Do={contextId:oa+"-scroll-container-context-id"},ci=function(N){return function(X){return"["+X+'="'+N+'"]'}},Gr=function(N,X){return N.map(function(re){var pe=re.styles[X];return pe?re.selector+" { "+pe+" }":""}).join(" ")},si="pointer-events: none;",Yr=function(I){var N=ci(I),X=function(){var De=`
|
|
cursor: -webkit-grab;
|
|
cursor: grab;
|
|
`;return{selector:N(la.contextId),styles:{always:`
|
|
-webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
touch-action: manipulation;
|
|
`,resting:De,dragging:si,dropAnimating:De}}}(),re=function(){var De=`
|
|
transition: `+Ji.outOfTheWay+`;
|
|
`;return{selector:N(Fs.contextId),styles:{dragging:De,dropAnimating:De,userCancel:De}}}(),pe={selector:N(Tl.contextId),styles:{always:"overflow-anchor: none;"}},me={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;
|
|
`}},Ae=[re,X,pe,me];return{always:Gr(Ae,"always"),resting:Gr(Ae,"resting"),dragging:Gr(Ae,"dragging"),dropAnimating:Gr(Ae,"dropAnimating"),userCancel:Gr(Ae,"userCancel")}},ti=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?ne.useLayoutEffect:ne.useEffect,Bs=function(){var N=document.querySelector("head");return N||v(!1),N},Ra=function(N){var X=document.createElement("style");return N&&X.setAttribute("nonce",N),X.type="text/css",X};function Sl(I,N){var X=D(function(){return Yr(I)},[I]),re=Object(ne.useRef)(null),pe=Object(ne.useRef)(null),me=m(f(function(Xe){var Ve=pe.current;Ve||v(!1),Ve.textContent=Xe}),[]),Ae=m(function(Xe){var Ve=re.current;Ve||v(!1),Ve.textContent=Xe},[]);ti(function(){!re.current&&!pe.current||v(!1);var Xe=Ra(N),Ve=Ra(N);return re.current=Xe,pe.current=Ve,Xe.setAttribute(oa+"-always",I),Ve.setAttribute(oa+"-dynamic",I),Bs().appendChild(Xe),Bs().appendChild(Ve),Ae(X.always),me(X.resting),function(){var Ze=function(gn){var xn=gn.current;xn||v(!1),Bs().removeChild(xn),gn.current=null};Ze(re),Ze(pe)}},[N,Ae,me,X.always,X.resting,I]);var De=m(function(){return me(X.dragging)},[me,X.dragging]),ze=m(function(Xe){if(Xe==="DROP"){me(X.dropAnimating);return}me(X.userCancel)},[me,X.dropAnimating,X.userCancel]),nt=m(function(){if(!pe.current)return;me(X.resting)},[me,X.resting]),it=D(function(){return{dragging:De,dropping:ze,resting:nt}},[De,ze,nt]);return it}var Po=function(I){return I&&I.ownerDocument?I.ownerDocument.defaultView:window};function Oa(I){return I instanceof Po(I).HTMLElement}function ns(I,N){var X="["+la.contextId+'="'+I+'"]',re=lt(document.querySelectorAll(X));if(!re.length)return null;var pe=We(re,function(me){return me.getAttribute(la.draggableId)===N});return pe&&Oa(pe)?pe:null}function Lo(I){var N=Object(ne.useRef)({}),X=Object(ne.useRef)(null),re=Object(ne.useRef)(null),pe=Object(ne.useRef)(!1),me=m(function(Ve,Ze){var yt={id:Ve,focus:Ze};return N.current[Ve]=yt,function(){var xn=N.current,$n=xn[Ve];$n!==yt&&delete xn[Ve]}},[]),Ae=m(function(Ve){var Ze=ns(I,Ve);Ze&&Ze!==document.activeElement&&Ze.focus()},[I]),De=m(function(Ve,Ze){X.current===Ve&&(X.current=Ze)},[]),ze=m(function(){if(re.current)return;if(!pe.current)return;re.current=requestAnimationFrame(function(){re.current=null;var Ve=X.current;Ve&&Ae(Ve)})},[Ae]),nt=m(function(Ve){X.current=null;var Ze=document.activeElement;if(!Ze)return;if(Ze.getAttribute(la.draggableId)!==Ve)return;X.current=Ve},[]);ti(function(){return pe.current=!0,function(){pe.current=!1;var Ve=re.current;Ve&&cancelAnimationFrame(Ve)}},[]);var it=D(function(){return{register:me,tryRecordFocus:nt,tryRestoreFocusRecorded:ze,tryShiftRecord:De}},[me,nt,ze,De]);return it}function js(){var I={draggables:{},droppables:{}},N=[];function X(Xe){return N.push(Xe),function(){var Ze=N.indexOf(Xe);if(Ze===-1)return;N.splice(Ze,1)}}function re(Xe){N.length&&N.forEach(function(Ve){return Ve(Xe)})}function pe(Xe){return I.draggables[Xe]||null}function me(Xe){var Ve=pe(Xe);return Ve||v(!1),Ve}var Ae={register:function(Ve){I.draggables[Ve.descriptor.id]=Ve,re({type:"ADDITION",value:Ve})},update:function(Ve,Ze){var yt=I.draggables[Ze.descriptor.id];if(!yt)return;if(yt.uniqueId!==Ve.uniqueId)return;delete I.draggables[Ze.descriptor.id],I.draggables[Ve.descriptor.id]=Ve},unregister:function(Ve){var Ze=Ve.descriptor.id,yt=pe(Ze);if(!yt)return;if(Ve.uniqueId!==yt.uniqueId)return;delete I.draggables[Ze],re({type:"REMOVAL",value:Ve})},getById:me,findById:pe,exists:function(Ve){return Boolean(pe(Ve))},getAllByType:function(Ve){return le(I.draggables).filter(function(Ze){return Ze.descriptor.type===Ve})}};function De(Xe){return I.droppables[Xe]||null}function ze(Xe){var Ve=De(Xe);return Ve||v(!1),Ve}var nt={register:function(Ve){I.droppables[Ve.descriptor.id]=Ve},unregister:function(Ve){var Ze=De(Ve.descriptor.id);if(!Ze)return;if(Ve.uniqueId!==Ze.uniqueId)return;delete I.droppables[Ve.descriptor.id]},getById:ze,findById:De,exists:function(Ve){return Boolean(De(Ve))},getAllByType:function(Ve){return le(I.droppables).filter(function(Ze){return Ze.descriptor.type===Ve})}};function it(){I.draggables={},I.droppables={},N.length=0}return{draggable:Ae,droppable:nt,subscribe:X,clean:it}}function Rl(){var I=D(js,[]);return Object(ne.useEffect)(function(){return function(){requestAnimationFrame(I.clean)}},[I]),I}var Aa=Q.a.createContext(null),$i=function(){var I=document.body;return I||v(!1),I},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(N){return"rbd-announcement-"+N};function Ws(I){var N=D(function(){return ko(I)},[I]),X=Object(ne.useRef)(null);Object(ne.useEffect)(function(){var me=document.createElement("div");return X.current=me,me.id=N,me.setAttribute("aria-live","assertive"),me.setAttribute("aria-atomic","true"),Object(q.a)(me.style,Io),$i().appendChild(me),function(){setTimeout(function(){var ze=$i();ze.contains(me)&&ze.removeChild(me),me===X.current&&(X.current=null)})}},[N]);var re=m(function(pe){var me=X.current;if(me){me.textContent=pe;return}},[]);return re}var Hs=0,Da={separator:"::"};function Ol(){Hs=0}function ua(I,N){return N===void 0&&(N=Da),D(function(){return""+I+N.separator+Hs++},[N.separator,I])}function pi(I){var N=I.contextId,X=I.uniqueId;return"rbd-hidden-text-"+N+"-"+X}function Mo(I){var N=I.contextId,X=I.text,re=ua("hidden-text",{separator:"-"}),pe=D(function(){return pi({contextId:N,uniqueId:re})},[re,N]);return Object(ne.useEffect)(function(){var Ae=document.createElement("div");return Ae.id=pe,Ae.textContent=X,Ae.style.display="none",$i().appendChild(Ae),function(){var ze=$i();ze.contains(Ae)&&ze.removeChild(Ae)}},[pe,X]),pe}var rs=Q.a.createContext(null),No={react:"^16.8.5","react-dom":"^16.8.5"},mi=/(\d+)\.(\d+)\.(\d+)/,Nr=function(N){var X=mi.exec(N);X!=null||v(!1);var re=Number(X[1]),pe=Number(X[2]),me=Number(X[3]);return{major:re,minor:pe,patch:me,raw:N}},wi=function(N,X){return X.major>N.major?!0:X.major<N.major?!1:X.minor>N.minor?!0:X.minor<N.minor?!1:X.patch>=N.patch},Fi=function(I,N){var X=Nr(I),re=Nr(N);if(wi(X,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(I){var N=I.doctype;if(!N)return;N.name.toLowerCase()!=="html",N.publicId!==""};function Pa(I){}function da(I,N){Pa(function(){Object(ne.useEffect)(function(){try{I()}catch(X){ge(`
|
|
A setup problem was encountered.
|
|
|
|
> `+X.message+`
|
|
`)}},N)})}function Al(){da(function(){Fi(No.react,Q.a.version),Uo(document)},[])}function La(I){var N=Object(ne.useRef)(I);return Object(ne.useEffect)(function(){N.current=I}),N}function Ia(){var I=null;function N(){return Boolean(I)}function X(Ae){return Ae===I}function re(Ae){I&&v(!1);var De={abandon:Ae};return I=De,De}function pe(){I||v(!1),I=null}function me(){I&&(I.abandon(),pe())}return{isClaimed:N,isActive:X,claim:re,release:pe,tryAbandon:me}}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(I){ss[I.keyCode]&&I.preventDefault()},os=function(){var I="visibilitychange";if(typeof document=="undefined")return I;var N=[I,"ms"+I,"webkit"+I,"moz"+I,"o"+I],X=We(N,function(re){return"on"+re in document});return X||I}(),Ho=0,Xs=5;function ca(I,N){return Math.abs(N.x-I.x)>=Xs||Math.abs(N.y-I.y)>=Xs}var ls={type:"IDLE"};function us(I){var N=I.cancel,X=I.completed,re=I.getPhase,pe=I.setPhase;return[{eventName:"mousemove",fn:function(Ae){var De=Ae.button,ze=Ae.clientX,nt=Ae.clientY;if(De!==Ho)return;var it={x:ze,y:nt},Xe=re();if(Xe.type==="DRAGGING"){Ae.preventDefault(),Xe.actions.move(it);return}Xe.type==="PENDING"||v(!1);var Ve=Xe.point;if(!ca(Ve,it))return;Ae.preventDefault();var Ze=Xe.actions.fluidLift(it);pe({type:"DRAGGING",actions:Ze})}},{eventName:"mouseup",fn:function(Ae){var De=re();if(De.type!=="DRAGGING"){N();return}Ae.preventDefault(),De.actions.drop({shouldBlockNextClick:!0}),X()}},{eventName:"mousedown",fn:function(Ae){re().type==="DRAGGING"&&Ae.preventDefault(),N()}},{eventName:"keydown",fn:function(Ae){var De=re();if(De.type==="PENDING"){N();return}if(Ae.keyCode===Ci){Ae.preventDefault(),N();return}Vs(Ae)}},{eventName:"resize",fn:N},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){re().type==="PENDING"&&N()}},{eventName:"webkitmouseforcedown",fn:function(Ae){var De=re();if(De.type!=="IDLE"||v(!1),De.actions.shouldRespectForcePress()){N();return}Ae.preventDefault()}},{eventName:os,fn:N}]}function Ko(I){var N=Object(ne.useRef)(ls),X=Object(ne.useRef)(Te),re=D(function(){return{eventName:"mousedown",fn:function(Xe){if(Xe.defaultPrevented)return;if(Xe.button!==Ho)return;if(Xe.ctrlKey||Xe.metaKey||Xe.shiftKey||Xe.altKey)return;var Ve=I.findClosestDraggableId(Xe);if(!Ve)return;var Ze=I.tryGetLock(Ve,Ae,{sourceEvent:Xe});if(!Ze)return;Xe.preventDefault();var yt={x:Xe.clientX,y:Xe.clientY};X.current(),nt(Ze,yt)}}},[I]),pe=D(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(Xe){if(Xe.defaultPrevented)return;var Ve=I.findClosestDraggableId(Xe);if(!Ve)return;var Ze=I.findOptionsForDraggable(Ve);if(!Ze)return;if(Ze.shouldRespectForcePress)return;if(!I.canGetLock(Ve))return;Xe.preventDefault()}}},[I]),me=m(function(){var Xe={passive:!1,capture:!0};X.current=Se(window,[pe,re],Xe)},[pe,re]),Ae=m(function(){var it=N.current;if(it.type==="IDLE")return;N.current=ls,X.current(),me()},[me]),De=m(function(){var it=N.current;Ae(),it.type==="DRAGGING"&&it.actions.cancel({shouldBlockNextClick:!0}),it.type==="PENDING"&&it.actions.abort()},[Ae]),ze=m(function(){var Xe={capture:!0,passive:!1},Ve=us({cancel:De,completed:Ae,getPhase:function(){return N.current},setPhase:function(yt){N.current=yt}});X.current=Se(window,Ve,Xe)},[De,Ae]),nt=m(function(Xe,Ve){N.current.type==="IDLE"||v(!1),N.current={type:"PENDING",point:Ve,actions:Xe},ze()},[ze]);ti(function(){return me(),function(){X.current()}},[me])}var Bi;function Go(){}var Il=(Bi={},Bi[Dl]=!0,Bi[Bo]=!0,Bi[zs]=!0,Bi[is]=!0,Bi);function zo(I,N){function X(){N(),I.cancel()}function re(){N(),I.drop()}return[{eventName:"keydown",fn:function(me){if(me.keyCode===Ci){me.preventDefault(),X();return}if(me.keyCode===Gs){me.preventDefault(),re();return}if(me.keyCode===Ll){me.preventDefault(),I.moveDown();return}if(me.keyCode===Pl){me.preventDefault(),I.moveUp();return}if(me.keyCode===Wo){me.preventDefault(),I.moveRight();return}if(me.keyCode===jo){me.preventDefault(),I.moveLeft();return}if(Il[me.keyCode]){me.preventDefault();return}Vs(me)}},{eventName:"mousedown",fn:X},{eventName:"mouseup",fn:X},{eventName:"click",fn:X},{eventName:"touchstart",fn:X},{eventName:"resize",fn:X},{eventName:"wheel",fn:X,options:{passive:!0}},{eventName:os,fn:X}]}function ni(I){var N=Object(ne.useRef)(Go),X=D(function(){return{eventName:"keydown",fn:function(me){if(me.defaultPrevented)return;if(me.keyCode!==Gs)return;var Ae=I.findClosestDraggableId(me);if(!Ae)return;var De=I.tryGetLock(Ae,it,{sourceEvent:me});if(!De)return;me.preventDefault();var ze=!0,nt=De.snapLift();N.current();function it(){ze||v(!1),ze=!1,N.current(),re()}N.current=Se(window,zo(nt,it),{capture:!0,passive:!1})}}},[I]),re=m(function(){var me={passive:!1,capture:!0};N.current=Se(window,[X],me)},[X]);ti(function(){return re(),function(){N.current()}},[re])}var ha={type:"IDLE"},Vo=120,Xo=.15;function $o(I){var N=I.cancel,X=I.getPhase;return[{eventName:"orientationchange",fn:N},{eventName:"resize",fn:N},{eventName:"contextmenu",fn:function(pe){pe.preventDefault()}},{eventName:"keydown",fn:function(pe){if(X().type!=="DRAGGING"){N();return}pe.keyCode===Ci&&pe.preventDefault(),N()}},{eventName:os,fn:N}]}function fa(I){var N=I.cancel,X=I.completed,re=I.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(me){var Ae=re();if(Ae.type!=="DRAGGING"){N();return}Ae.hasMoved=!0;var De=me.touches[0],ze=De.clientX,nt=De.clientY,it={x:ze,y:nt};me.preventDefault(),Ae.actions.move(it)}},{eventName:"touchend",fn:function(me){var Ae=re();if(Ae.type!=="DRAGGING"){N();return}me.preventDefault(),Ae.actions.drop({shouldBlockNextClick:!0}),X()}},{eventName:"touchcancel",fn:function(me){if(re().type!=="DRAGGING"){N();return}me.preventDefault(),N()}},{eventName:"touchforcechange",fn:function(me){var Ae=re();Ae.type!=="IDLE"||v(!1);var De=me.touches[0];if(!De)return;var ze=De.force>=Xo;if(!ze)return;var nt=Ae.actions.shouldRespectForcePress();if(Ae.type==="PENDING"){nt&&N();return}if(nt){if(Ae.hasMoved){me.preventDefault();return}N();return}me.preventDefault()}},{eventName:os,fn:N}]}function ds(I){var N=Object(ne.useRef)(ha),X=Object(ne.useRef)(Te),re=m(function(){return N.current},[]),pe=m(function(Ze){N.current=Ze},[]),me=D(function(){return{eventName:"touchstart",fn:function(Ze){if(Ze.defaultPrevented)return;var yt=I.findClosestDraggableId(Ze);if(!yt)return;var gn=I.tryGetLock(yt,De,{sourceEvent:Ze});if(!gn)return;var xn=Ze.touches[0],$n=xn.clientX,ir=xn.clientY,Tr={x:$n,y:ir};X.current(),Xe(gn,Tr)}}},[I]),Ae=m(function(){var Ze={capture:!0,passive:!1};X.current=Se(window,[me],Ze)},[me]),De=m(function(){var Ve=N.current;if(Ve.type==="IDLE")return;Ve.type==="PENDING"&&clearTimeout(Ve.longPressTimerId),pe(ha),X.current(),Ae()},[Ae,pe]),ze=m(function(){var Ve=N.current;De(),Ve.type==="DRAGGING"&&Ve.actions.cancel({shouldBlockNextClick:!0}),Ve.type==="PENDING"&&Ve.actions.abort()},[De]),nt=m(function(){var Ze={capture:!0,passive:!1},yt={cancel:ze,completed:De,getPhase:re},gn=Se(window,fa(yt),Ze),xn=Se(window,$o(yt),Ze);X.current=function(){gn(),xn()}},[ze,re,De]),it=m(function(){var Ze=re();Ze.type==="PENDING"||v(!1);var yt=Ze.actions.fluidLift(Ze.point);pe({type:"DRAGGING",actions:yt,hasMoved:!1})},[re,pe]),Xe=m(function(Ze,yt){re().type==="IDLE"||v(!1);var gn=setTimeout(it,Vo);pe({type:"PENDING",point:yt,actions:Ze,longPressTimerId:gn}),nt()},[nt,re,pe,it]);ti(function(){return Ae(),function(){X.current();var yt=re();yt.type==="PENDING"&&(clearTimeout(yt.longPressTimerId),pe(ha))}},[re,Ae,pe]),ti(function(){var Ze=Se(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Ze},[])}function Yo(I){Pa(function(){var N=La(I);da(function(){N.current.length===I.length||v(!1)})})}var Qo={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function $s(I,N){if(N==null)return!1;var X=Boolean(Qo[N.tagName.toLowerCase()]);if(X)return!0;var re=N.getAttribute("contenteditable");return re==="true"||re===""?!0:N===I?!1:$s(I,N.parentElement)}function pa(I,N){var X=N.target;return Oa(X)?$s(I,X):!1}var Jo=function(I){return g(I.getBoundingClientRect()).center};function cs(I){return I instanceof Po(I).Element}var Zo=function(){var I="matches";if(typeof document=="undefined")return I;var N=[I,"msMatchesSelector","webkitMatchesSelector"],X=We(N,function(re){return re in Element.prototype});return X||I}();function ma(I,N){return I==null?null:I[Zo](N)?I:ma(I.parentElement,N)}function kl(I,N){return I.closest?I.closest(N):ma(I,N)}function ga(I){return"["+la.contextId+'="'+I+'"]'}function qo(I,N){var X=N.target;if(!cs(X))return null;var re=ga(I),pe=kl(X,re);return pe&&Oa(pe)?pe:null}function el(I,N){var X=qo(I,N);return X?X.getAttribute(la.draggableId):null}function tl(I,N){var X="["+Fs.contextId+'="'+I+'"]',re=lt(document.querySelectorAll(X)),pe=We(re,function(me){return me.getAttribute(Fs.id)===N});return pe&&Oa(pe)?pe:null}function ka(I){I.preventDefault()}function ji(I){var N=I.expected,X=I.phase,re=I.isLockActive,pe=I.shouldWarn;return re()?!(N!==X):!1}function va(I){var N=I.lockAPI,X=I.store,re=I.registry,pe=I.draggableId;if(N.isClaimed())return!1;var me=re.draggable.findById(pe);return me&&me.options.isEnabled?!!Ms(X.getState(),pe):!1}function Ma(I){var N=I.lockAPI,X=I.contextId,re=I.store,pe=I.registry,me=I.draggableId,Ae=I.forceSensorStop,De=I.sourceEvent,ze=va({lockAPI:N,store:re,registry:pe,draggableId:me});if(!ze)return null;var nt=pe.draggable.getById(me),it=tl(X,nt.descriptor.id);if(!it)return null;if(De&&!nt.options.canDragInteractiveElements&&pa(it,De))return null;var Xe=N.claim(Ae||Te),Ve="PRE_DRAG";function Ze(){return nt.options.shouldRespectForcePress}function yt(){return N.isActive(Xe)}function gn(Pr,Br){ji({expected:Pr,phase:Ve,isLockActive:yt,shouldWarn:!0})&&re.dispatch(Br())}var xn=gn.bind(null,"DRAGGING");function $n(Pr){function Br(){N.release(),Ve="COMPLETED"}Ve!=="PRE_DRAG"&&(Br(),Ve==="PRE_DRAG"||v(!1)),re.dispatch(pn(Pr.liftActionArgs)),Ve="DRAGGING";function $r(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Pr.cleanup(),n.shouldBlockNextClick){var d=Se(window,[{eventName:"click",fn:ka,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(d)}Br(),re.dispatch(Si({reason:e}))}return Object(q.a)({isActive:function(){return ji({expected:"DRAGGING",phase:Ve,isLockActive:yt,shouldWarn:!1})},shouldRespectForcePress:Ze,drop:function(n){return $r("DROP",n)},cancel:function(n){return $r("CANCEL",n)}},Pr.actions)}function ir(Pr){var Br=x(function(e){xn(function(){return Jn({client:e})})}),$r=$n({liftActionArgs:{id:me,clientSelection:Pr,movementMode:"FLUID"},cleanup:function(){return Br.cancel()},actions:{move:Br}});return Object(q.a)({},$r,{move:Br})}function Tr(){var Pr={moveUp:function(){return xn(wr)},moveRight:function(){return xn(Vr)},moveDown:function(){return xn(Ur)},moveLeft:function(){return xn(Fr)}};return $n({liftActionArgs:{id:me,clientSelection:Jo(it),movementMode:"SNAP"},cleanup:Te,actions:Pr})}function rr(){var Pr=ji({expected:"PRE_DRAG",phase:Ve,isLockActive:yt,shouldWarn:!0});Pr&&N.release()}var Mr={isActive:function(){return ji({expected:"PRE_DRAG",phase:Ve,isLockActive:yt,shouldWarn:!1})},shouldRespectForcePress:Ze,fluidLift:ir,snapLift:Tr,abort:rr};return Mr}var nl=[Ko,ni,ds];function Ml(I){var N=I.contextId,X=I.store,re=I.registry,pe=I.customSensors,me=I.enableDefaultSensors,Ae=[].concat(me?nl:[],pe||[]),De=Object(ne.useState)(function(){return Ia()})[0],ze=m(function(ir,Tr){ir.isDragging&&!Tr.isDragging&&De.tryAbandon()},[De]);ti(function(){var ir=X.getState(),Tr=X.subscribe(function(){var rr=X.getState();ze(ir,rr),ir=rr});return Tr},[De,X,ze]),ti(function(){return De.tryAbandon},[De.tryAbandon]);var nt=m(function($n){return va({lockAPI:De,registry:re,store:X,draggableId:$n})},[De,re,X]),it=m(function($n,ir,Tr){return Ma({lockAPI:De,registry:re,contextId:N,store:X,draggableId:$n,forceSensorStop:ir,sourceEvent:Tr&&Tr.sourceEvent?Tr.sourceEvent:null})},[N,De,re,X]),Xe=m(function($n){return el(N,$n)},[N]),Ve=m(function($n){var ir=re.draggable.findById($n);return ir?ir.options:null},[re.draggable]),Ze=m(function(){if(!De.isClaimed())return;De.tryAbandon(),X.getState().phase!=="IDLE"&&X.dispatch(kr())},[De,X]),yt=m(De.isClaimed,[De]),gn=D(function(){return{canGetLock:nt,tryGetLock:it,findClosestDraggableId:Xe,findOptionsForDraggable:Ve,tryReleaseLock:Ze,isLockClaimed:yt}},[nt,it,Xe,Ve,Ze,yt]);Yo(Ae);for(var xn=0;xn<Ae.length;xn++)Ae[xn](gn)}var rl=function(N){return{onBeforeCapture:N.onBeforeCapture,onBeforeDragStart:N.onBeforeDragStart,onDragStart:N.onDragStart,onDragEnd:N.onDragEnd,onDragUpdate:N.onDragUpdate}};function bi(I){return I.current||v(!1),I.current}function _a(I){var N=I.contextId,X=I.setCallbacks,re=I.sensors,pe=I.nonce,me=I.dragHandleUsageInstructions,Ae=Object(ne.useRef)(null);Al();var De=La(I),ze=m(function(){return rl(De.current)},[De]),nt=Ws(N),it=Mo({contextId:N,text:me}),Xe=Sl(N,pe),Ve=m(function(e){bi(Ae).dispatch(e)},[]),Ze=D(function(){return Object(K.b)({publishWhileDragging:zn,updateDroppableScroll:Ir,updateDroppableIsEnabled:jr,updateDroppableIsCombineEnabled:Er,collectionStarting:mn},Ve)},[Ve]),yt=Rl(),gn=D(function(){return ks(yt,Ze)},[yt,Ze]),xn=D(function(){return Cl(Object(q.a)({scrollWindow:Eo,scrollDroppable:gn.scrollDroppable},Object(K.b)({move:Jn},Ve)))},[gn.scrollDroppable,Ve]),$n=Lo(N),ir=D(function(){return Ni({announce:nt,autoScroller:xn,dimensionMarshal:gn,focusMarshal:$n,getResponders:ze,styleMarshal:Xe})},[nt,xn,gn,$n,ze,Xe]);Ae.current=ir;var Tr=m(function(){var e=bi(Ae),n=e.getState();n.phase!=="IDLE"&&e.dispatch(kr())},[]),rr=m(function(){var e=bi(Ae).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),Mr=D(function(){return{isDragging:rr,tryAbort:Tr}},[rr,Tr]);X(Mr);var Pr=m(function(e){return Ms(bi(Ae).getState(),e)},[]),Br=m(function(){return vr(bi(Ae).getState())},[]),$r=D(function(){return{marshal:gn,focus:$n,contextId:N,canLift:Pr,isMovementAllowed:Br,dragHandleUsageInstructionsId:it,registry:yt}},[N,gn,it,$n,Pr,Br,yt]);return Ml({contextId:N,store:ir,registry:yt,customSensors:re,enableDefaultSensors:I.enableDefaultSensors!==!1}),Object(ne.useEffect)(function(){return Tr},[Tr]),Q.a.createElement(rs.Provider,{value:$r},Q.a.createElement(M.a,{context:Aa,store:ir},I.children))}var ya=0;function Nl(){ya=0}function il(){return D(function(){return""+ya++},[])}function iu(){Nl(),Ol()}function Ul(I){var N=il(),X=I.dragHandleUsageInstructions||He.dragHandleUsageInstructions;return Q.a.createElement(L,null,function(re){return Q.a.createElement(_a,{nonce:I.nonce,contextId:N,setCallbacks:re,dragHandleUsageInstructions:X,enableDefaultSensors:I.enableDefaultSensors,sensors:I.sensors,onBeforeCapture:I.onBeforeCapture,onBeforeDragStart:I.onBeforeDragStart,onDragStart:I.onDragStart,onDragUpdate:I.onDragUpdate,onDragEnd:I.onDragEnd},I.children)})}var Ys=function(N){return function(X){return N===X}},ui=Ys("scroll"),al=Ys("auto"),Fl=Ys("visible"),sl=function(N,X){return X(N.overflowX)||X(N.overflowY)},Bl=function(N,X){return X(N.overflowX)&&X(N.overflowY)},Qs=function(N){var X=window.getComputedStyle(N),re={overflowX:X.overflowX,overflowY:X.overflowY};return sl(re,ui)||sl(re,al)},ol=function(){return!1;var N,X;if(!Qs(N))return!1;var re,pe;if(Bl(pe,Fl))return!1},Js=function I(N){return N==null?null:N===document.body?ol()?N:null:N===document.documentElement?null:Qs(N)?N:I(N.parentElement)},au=function(I){if(!I)return;var N=Js(I.parentElement);if(!N)return},Zs=function(I){return{x:I.scrollLeft,y:I.scrollTop}},jl=function I(N){if(!N)return!1;var X=window.getComputedStyle(N);return X.position==="fixed"?!0:I(N.parentElement)},Wi=function(I){var N=Js(I),X=jl(I);return{closestScrollable:N,isFixedOnPage:X}},Na=function(I){var N=I.descriptor,X=I.isEnabled,re=I.isCombineEnabled,pe=I.isFixedOnPage,me=I.direction,Ae=I.client,De=I.page,ze=I.closest,nt=function(){if(!ze)return null;var Ze=ze.scrollSize,yt=ze.client,gn=Ls({scrollHeight:Ze.scrollHeight,scrollWidth:Ze.scrollWidth,height:yt.paddingBox.height,width:yt.paddingBox.width});return{pageMarginBox:ze.page.marginBox,frameClient:yt,scrollSize:Ze,shouldClipSubject:ze.shouldClipSubject,scroll:{initial:ze.scroll,current:ze.scroll,max:gn,diff:{value:Ke,displacement:Ke}}}}(),it=me==="vertical"?Pn:Zn,Xe=de({page:De,withPlaceholder:null,axis:it,frame:nt}),Ve={descriptor:N,isCombineEnabled:re,isFixedOnPage:pe,axis:it,isEnabled:X,client:Ae,page:De,frame:nt,subject:Xe};return Ve},hs=function(N,X){var re=A(N);if(!X)return re;if(N!==X)return re;var pe=re.paddingBox.top-X.scrollTop,me=re.paddingBox.left-X.scrollLeft,Ae=pe+X.scrollHeight,De=me+X.scrollWidth,ze={top:pe,right:De,bottom:Ae,left:me},nt=a(ze,re.border),it=t({borderBox:nt,margin:re.margin,border:re.border,padding:re.padding});return it},Ua=function(I){var N=I.ref,X=I.descriptor,re=I.env,pe=I.windowScroll,me=I.direction,Ae=I.isDropDisabled,De=I.isCombineEnabled,ze=I.shouldClipSubject,nt=re.closestScrollable,it=hs(N,nt),Xe=S(it,pe),Ve=function(){if(!nt)return null;var yt=A(nt),gn={scrollHeight:nt.scrollHeight,scrollWidth:nt.scrollWidth};return{client:yt,page:S(yt,pe),scroll:Zs(nt),scrollSize:gn,shouldClipSubject:ze}}(),Ze=Na({descriptor:X,isEnabled:!Ae,isCombineEnabled:De,isFixedOnPage:re.isFixedOnPage,direction:me,client:it,page:Xe,closest:Ve});return Ze},Li={passive:!1},Wl={passive:!0},ll=function(I){return I.shouldPublishImmediately?Li:Wl};function Ii(I){var N=Object(ne.useContext)(I);return N||v(!1),N}var Fa=function(N){return N&&N.env.closestScrollable||null};function ul(I){var N=Object(ne.useRef)(null),X=Ii(rs),re=ua("droppable"),pe=X.registry,me=X.marshal,Ae=La(I),De=D(function(){return{id:I.droppableId,type:I.type,mode:I.mode}},[I.droppableId,I.mode,I.type]),ze=Object(ne.useRef)(De),nt=D(function(){return f(function(rr,Mr){N.current||v(!1);var Pr={x:rr,y:Mr};me.updateDroppableScroll(De.id,Pr)})},[De.id,me]),it=m(function(){var rr=N.current;return!rr||!rr.env.closestScrollable?Ke:Zs(rr.env.closestScrollable)},[]),Xe=m(function(){var rr=it();nt(rr.x,rr.y)},[it,nt]),Ve=D(function(){return x(Xe)},[Xe]),Ze=m(function(){var rr=N.current,Mr=Fa(rr);rr&&Mr||v(!1);var Pr=rr.scrollOptions;if(Pr.shouldPublishImmediately){Xe();return}Ve()},[Ve,Xe]),yt=m(function(rr,Mr){N.current&&v(!1);var Pr=Ae.current,Br=Pr.getDroppableRef();Br||v(!1);var $r=Wi(Br),e={ref:Br,descriptor:De,env:$r,scrollOptions:Mr};N.current=e;var n=Ua({ref:Br,descriptor:De,env:$r,windowScroll:rr,direction:Pr.direction,isDropDisabled:Pr.isDropDisabled,isCombineEnabled:Pr.isCombineEnabled,shouldClipSubject:!Pr.ignoreContainerClipping}),d=$r.closestScrollable;return d&&(d.setAttribute(Do.contextId,X.contextId),d.addEventListener("scroll",Ze,ll(e.scrollOptions))),n},[X.contextId,De,Ze,Ae]),gn=m(function(){var rr=N.current,Mr=Fa(rr);return rr&&Mr||v(!1),Zs(Mr)},[]),xn=m(function(){var rr=N.current;rr||v(!1);var Mr=Fa(rr);if(N.current=null,!Mr)return;Ve.cancel(),Mr.removeAttribute(Do.contextId),Mr.removeEventListener("scroll",Ze,ll(rr.scrollOptions))},[Ze,Ve]),$n=m(function(rr){var Mr=N.current;Mr||v(!1);var Pr=Fa(Mr);Pr||v(!1),Pr.scrollTop+=rr.y,Pr.scrollLeft+=rr.x},[]),ir=D(function(){return{getDimensionAndWatchScroll:yt,getScrollWhileDragging:gn,dragStopped:xn,scroll:$n}},[xn,yt,gn,$n]),Tr=D(function(){return{uniqueId:re,descriptor:De,callbacks:ir}},[ir,De,re]);ti(function(){return ze.current=Tr.descriptor,pe.droppable.register(Tr),function(){N.current&&xn(),pe.droppable.unregister(Tr)}},[ir,De,xn,Tr,me,pe.droppable]),ti(function(){if(!N.current)return;me.updateDroppableIsEnabled(ze.current.id,!I.isDropDisabled)},[I.isDropDisabled,me]),ti(function(){if(!N.current)return;me.updateDroppableIsCombineEnabled(ze.current.id,I.isCombineEnabled)},[I.isCombineEnabled,me])}function fs(){}var Ba={width:0,height:0,margin:ie},ba=function(N){var X=N.isAnimatingOpenOnMount,re=N.placeholder,pe=N.animate;return X||pe==="close"?Ba:{height:re.client.borderBox.height,width:re.client.borderBox.width,margin:re.client.margin}},qs=function(N){var X=N.isAnimatingOpenOnMount,re=N.placeholder,pe=N.animate,me=ba({isAnimatingOpenOnMount:X,placeholder:re,animate:pe});return{display:re.display,boxSizing:"border-box",width:me.width,height:me.height,marginTop:me.margin.top,marginRight:me.margin.right,marginBottom:me.margin.bottom,marginLeft:me.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:pe!=="none"?Ji.placeholder:null}};function eo(I){var N=Object(ne.useRef)(null),X=m(function(){if(!N.current)return;clearTimeout(N.current),N.current=null},[]),re=I.animate,pe=I.onTransitionEnd,me=I.onClose,Ae=I.contextId,De=Object(ne.useState)(I.animate==="open"),ze=De[0],nt=De[1];Object(ne.useEffect)(function(){return ze?re!=="open"?(X(),nt(!1),fs):N.current?fs:(N.current=setTimeout(function(){N.current=null,nt(!1)}),X):fs},[re,ze,X]);var it=m(function(Ve){if(Ve.propertyName!=="height")return;pe(),re==="close"&&me()},[re,me,pe]),Xe=qs({isAnimatingOpenOnMount:ze,animate:I.animate,placeholder:I.placeholder});return Q.a.createElement(I.placeholder.tagName,{style:Xe,"data-rbd-placeholder-context-id":Ae,onTransitionEnd:it,ref:I.innerRef})}var to=Q.a.memo(eo),no=Q.a.createContext(null);function Ea(I){I&&Oa(I)||v(!1)}function ps(I){return typeof I=="boolean"}function ro(I,N){N.forEach(function(X){return X(I)})}var dl=[function(N){var X=N.props;X.droppableId||v(!1),typeof X.droppableId=="string"||v(!1)},function(N){var X=N.props;ps(X.isDropDisabled)||v(!1),ps(X.isCombineEnabled)||v(!1),ps(X.ignoreContainerClipping)||v(!1)},function(N){var X=N.getDroppableRef;Ea(X())}],ms=[function(N){var X=N.props,re=N.getPlaceholderRef;if(!X.placeholder)return;var pe=re();if(pe)return}],Hl=[function(N){var X=N.props;X.renderClone||v(!1)},function(N){var X=N.getPlaceholderRef;X()&&v(!1)}];function Kl(I){da(function(){ro(I,dl),I.props.mode==="standard"&&ro(I,ms),I.props.mode==="virtual"&&ro(I,Hl)})}var ja=function(I){Object(B.a)(N,I);function N(){for(var re,pe=arguments.length,me=new Array(pe),Ae=0;Ae<pe;Ae++)me[Ae]=arguments[Ae];return re=I.call.apply(I,[this].concat(me))||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}N.getDerivedStateFromProps=function(pe,me){return pe.shouldAnimate?pe.on?{isVisible:!0,data:pe.on,animate:"open"}:me.isVisible?{isVisible:!0,data:me.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(pe.on),data:pe.on,animate:"none"}};var X=N.prototype;return X.render=function(){if(!this.state.isVisible)return null;var pe={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(pe)},N}(Q.a.PureComponent),io={dragging:5e3,dropAnimating:4500},cl=function(N,X){return X?Ji.drop(X.duration):N?Ji.snap:Ji.fluid},Gl=function(N,X){return N?X?Ki.opacity.drop:Ki.opacity.combining:null},ao=function(N){return N.forceShouldAnimate!=null?N.forceShouldAnimate:N.mode==="SNAP"};function hl(I){var N=I.dimension,X=N.client,re=I.offset,pe=I.combineWith,me=I.dropping,Ae=Boolean(pe),De=ao(I),ze=Boolean(me),nt=ze?bs.drop(re,Ae):bs.moveTo(re),it={position:"fixed",top:X.marginBox.top,left:X.marginBox.left,boxSizing:"border-box",width:X.borderBox.width,height:X.borderBox.height,transition:cl(De,me),transform:nt,opacity:Gl(Ae,ze),zIndex:ze?io.dropAnimating:io.dragging,pointerEvents:"none"};return it}function zl(I){return{transform:bs.moveTo(I.offset),transition:I.shouldAnimateDisplacement?null:"none"}}function fl(I){return I.type==="DRAGGING"?hl(I):zl(I)}function pl(I,N,X){X===void 0&&(X=Ke);var re=window.getComputedStyle(N),pe=N.getBoundingClientRect(),me=R(pe,re),Ae=S(me,X),De={client:me,tagName:N.tagName.toLowerCase(),display:re.display},ze={x:me.marginBox.width,y:me.marginBox.height},nt={descriptor:I,placeholder:De,displaceBy:ze,client:me,page:Ae};return nt}function Vl(I){var N=ua("draggable"),X=I.descriptor,re=I.registry,pe=I.getDraggableRef,me=I.canDragInteractiveElements,Ae=I.shouldRespectForcePress,De=I.isEnabled,ze=D(function(){return{canDragInteractiveElements:me,shouldRespectForcePress:Ae,isEnabled:De}},[me,De,Ae]),nt=m(function(Ze){var yt=pe();return yt||v(!1),pl(X,yt,Ze)},[X,pe]),it=D(function(){return{uniqueId:N,descriptor:X,options:ze,getDimension:nt}},[X,nt,ze,N]),Xe=Object(ne.useRef)(it),Ve=Object(ne.useRef)(!0);ti(function(){return re.draggable.register(Xe.current),function(){return re.draggable.unregister(Xe.current)}},[re.draggable]),ti(function(){if(Ve.current){Ve.current=!1;return}var Ze=Xe.current;Xe.current=it,re.draggable.update(it,Ze)},[it,re.draggable])}function so(I,N,X){da(function(){function re(me){return"Draggable[id: "+me+"]: "}var pe=I.draggableId;if(pe||v(!1),typeof pe=="string"||v(!1),Oe(I.index)||v(!1),I.mapped.type==="DRAGGING")return;Ea(X()),I.isEnabled&&(ns(N,pe)||v(!1))})}function Wa(I){Pa(function(){var N=Object(ne.useRef)(I);da(function(){I===N.current||v(!1)},[I])})}function Ha(I){I.preventDefault()}function Xl(I){var N=Object(ne.useRef)(null),X=m(function(e){N.current=e},[]),re=m(function(){return N.current},[]),pe=Ii(rs),me=pe.contextId,Ae=pe.dragHandleUsageInstructionsId,De=pe.registry,ze=Ii(no),nt=ze.type,it=ze.droppableId,Xe=D(function(){return{id:I.draggableId,index:I.index,type:nt,droppableId:it}},[I.draggableId,I.index,nt,it]),Ve=I.children,Ze=I.draggableId,yt=I.isEnabled,gn=I.shouldRespectForcePress,xn=I.canDragInteractiveElements,$n=I.isClone,ir=I.mapped,Tr=I.dropAnimationFinished;if(so(I,me,re),Wa($n),!$n){var rr=D(function(){return{descriptor:Xe,registry:De,getDraggableRef:re,canDragInteractiveElements:xn,shouldRespectForcePress:gn,isEnabled:yt}},[Xe,De,re,xn,gn,yt]);Vl(rr)}var Mr=D(function(){return yt?{tabIndex:0,role:"button","aria-describedby":Ae,"data-rbd-drag-handle-draggable-id":Ze,"data-rbd-drag-handle-context-id":me,draggable:!1,onDragStart:Ha}:null},[me,Ae,Ze,yt]),Pr=m(function(e){if(ir.type!=="DRAGGING")return;if(!ir.dropping)return;if(e.propertyName!=="transform")return;Tr()},[Tr,ir]),Br=D(function(){var e=fl(ir),n=ir.type==="DRAGGING"&&ir.dropping?Pr:null,d={innerRef:X,draggableProps:{"data-rbd-draggable-context-id":me,"data-rbd-draggable-id":Ze,style:e,onTransitionEnd:n},dragHandleProps:Mr};return d},[me,Mr,Ze,ir,Pr,X]),$r=D(function(){return{draggableId:Xe.id,type:Xe.type,source:{index:Xe.index,droppableId:Xe.droppableId}}},[Xe.droppableId,Xe.id,Xe.index,Xe.type]);return Ve(Br,ir.snapshot,$r)}var oo=function(I,N){return I===N},ml=function(I){var N=I.combine,X=I.destination;return X?X.droppableId:N?N.droppableId:null},$l=function(N){return N.combine?N.combine.draggableId:null},Yl=function(N){return N.at&&N.at.type==="COMBINE"?N.at.combine.draggableId:null};function Ql(){var I=f(function(pe,me){return{x:pe,y:me}}),N=f(function(pe,me,Ae,De,ze){return{isDragging:!0,isClone:me,isDropAnimating:Boolean(ze),dropAnimation:ze,mode:pe,draggingOver:Ae,combineWith:De,combineTargetFor:null}}),X=f(function(pe,me,Ae,De,ze,nt,it){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:ze,combineWith:nt,mode:me,offset:pe,dimension:Ae,forceShouldAnimate:it,snapshot:N(me,De,ze,nt,null)}}}),re=function(me,Ae){if(me.isDragging){if(me.critical.draggable.id!==Ae.draggableId)return null;var De=me.current.client.offset,ze=me.dimensions.draggables[Ae.draggableId],nt=cn(me.impact),it=Yl(me.impact),Xe=me.forceShouldAnimate;return X(I(De.x,De.y),me.movementMode,ze,Ae.isClone,nt,it,Xe)}if(me.phase==="DROP_ANIMATING"){var Ve=me.completed;if(Ve.result.draggableId!==Ae.draggableId)return null;var Ze=Ae.isClone,yt=me.dimensions.draggables[Ae.draggableId],gn=Ve.result,xn=gn.mode,$n=ml(gn),ir=$l(gn),Tr=me.dropDuration,rr={duration:Tr,curve:Xa.drop,moveTo:me.newHomeClientOffset,opacity:ir?Ki.opacity.drop:null,scale:ir?Ki.scale.drop:null};return{mapped:{type:"DRAGGING",offset:me.newHomeClientOffset,dimension:yt,dropping:rr,draggingOver:$n,combineWith:ir,mode:xn,forceShouldAnimate:null,snapshot:N(xn,Ze,$n,ir,rr)}}}return null};return re}function lo(I){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:I,combineWith:null}}var Jl={mapped:{type:"SECONDARY",offset:Ke,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:lo(null)}};function Zl(){var I=f(function(Ae,De){return{x:Ae,y:De}}),N=f(lo),X=f(function(Ae,De,ze){return De===void 0&&(De=null),{mapped:{type:"SECONDARY",offset:Ae,combineTargetFor:De,shouldAnimateDisplacement:ze,snapshot:N(De)}}}),re=function(De){return De?X(Ke,De,!0):null},pe=function(De,ze,nt,it){var Xe=nt.displaced.visible[De],Ve=Boolean(it.inVirtualList&&it.effected[De]),Ze=nn(nt),yt=Ze&&Ze.draggableId===De?ze:null;if(!Xe){if(!Ve)return re(yt);if(nt.displaced.invisible[De])return null;var gn=Ft(it.displacedBy.point),xn=I(gn.x,gn.y);return X(xn,yt,!0)}if(Ve)return re(yt);var $n=nt.displacedBy.point,ir=I($n.x,$n.y);return X(ir,yt,Xe.shouldAnimate)},me=function(De,ze){if(De.isDragging)return De.critical.draggable.id===ze.draggableId?null:pe(ze.draggableId,De.critical.draggable.id,De.impact,De.afterCritical);if(De.phase==="DROP_ANIMATING"){var nt=De.completed;return nt.result.draggableId===ze.draggableId?null:pe(ze.draggableId,nt.result.draggableId,nt.impact,nt.afterCritical)}return null};return me}var gl=function(){var N=Ql(),X=Zl(),re=function(me,Ae){return N(me,Ae)||X(me,Ae)||Jl};return re},uo={dropAnimationFinished:ei},vl=Object(M.c)(gl,uo,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(Xl);function _l(I){var N=Ii(no),X=N.isUsingCloneFor;return X===I.draggableId&&!I.isClone?null:Q.a.createElement(vl,I)}function yl(I){var N=typeof I.isDragDisabled=="boolean"?!I.isDragDisabled:!0,X=Boolean(I.disableInteractiveElementBlocking),re=Boolean(I.shouldRespectForcePress);return Q.a.createElement(_l,Object(q.a)({},I,{isClone:!1,isEnabled:N,canDragInteractiveElements:X,shouldRespectForcePress:re}))}function xa(I){var N=Object(ne.useContext)(rs);N||v(!1);var X=N.contextId,re=N.isMovementAllowed,pe=Object(ne.useRef)(null),me=Object(ne.useRef)(null),Ae=I.children,De=I.droppableId,ze=I.type,nt=I.mode,it=I.direction,Xe=I.ignoreContainerClipping,Ve=I.isDropDisabled,Ze=I.isCombineEnabled,yt=I.snapshot,gn=I.useClone,xn=I.updateViewportMaxScroll,$n=I.getContainerForClone,ir=m(function(){return pe.current},[]),Tr=m(function(l){pe.current=l},[]),rr=m(function(){return me.current},[]),Mr=m(function(l){me.current=l},[]);Kl({props:I,getDroppableRef:ir,getPlaceholderRef:rr});var Pr=m(function(){re()&&xn({maxScroll:Is()})},[re,xn]);ul({droppableId:De,type:ze,mode:nt,direction:it,isDropDisabled:Ve,isCombineEnabled:Ze,ignoreContainerClipping:Xe,getDroppableRef:ir});var Br=Q.a.createElement(ja,{on:I.placeholder,shouldAnimate:I.shouldAnimatePlaceholder},function(l){var b=l.onClose,G=l.data,te=l.animate;return Q.a.createElement(to,{placeholder:G,onClose:b,innerRef:Mr,animate:te,contextId:X,onTransitionEnd:Pr})}),$r=D(function(){return{innerRef:Tr,placeholder:Br,droppableProps:{"data-rbd-droppable-id":De,"data-rbd-droppable-context-id":X}}},[X,De,Br,Tr]),e=gn?gn.dragging.draggableId:null,n=D(function(){return{droppableId:De,type:ze,isUsingCloneFor:e}},[De,e,ze]);function d(){if(!gn)return null;var l=gn.dragging,b=gn.render,G=Q.a.createElement(_l,{draggableId:l.draggableId,index:l.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(te,se){return b(te,se,l)});return j.a.createPortal(G,$n())}return Q.a.createElement(no.Provider,{value:n},Ae($r,yt),d())}var gs=function(N,X){return N===X.droppable.type},Ka=function(N,X){return X.draggables[N.draggable.id]},ql=function(){var N={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},X=Object(q.a)({},N,{shouldAnimatePlaceholder:!1}),re=f(function(Ae){return{draggableId:Ae.id,type:Ae.type,source:{index:Ae.index,droppableId:Ae.droppableId}}}),pe=f(function(Ae,De,ze,nt,it,Xe){var Ve=it.descriptor.id,Ze=it.descriptor.droppableId===Ae;if(Ze){var yt=Xe?{render:Xe,dragging:re(it.descriptor)}:null,gn={isDraggingOver:ze,draggingOverWith:ze?Ve:null,draggingFromThisWith:Ve,isUsingPlaceholder:!0};return{placeholder:it.placeholder,shouldAnimatePlaceholder:!1,snapshot:gn,useClone:yt}}if(!De)return X;if(!nt)return N;var xn={isDraggingOver:ze,draggingOverWith:Ve,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:it.placeholder,shouldAnimatePlaceholder:!0,snapshot:xn,useClone:null}}),me=function(De,ze){var nt=ze.droppableId,it=ze.type,Xe=!ze.isDropDisabled,Ve=ze.renderClone;if(De.isDragging){var Ze=De.critical;if(!gs(it,Ze))return X;var yt=Ka(Ze,De.dimensions),gn=cn(De.impact)===nt;return pe(nt,Xe,gn,gn,yt,Ve)}if(De.phase==="DROP_ANIMATING"){var xn=De.completed;if(!gs(it,xn.critical))return X;var $n=Ka(xn.critical,De.dimensions);return pe(nt,Xe,ml(xn.result)===nt,cn(xn.impact)===nt,$n,Ve)}if(De.phase==="IDLE"&&De.completed&&!De.shouldFlush){var ir=De.completed;if(!gs(it,ir.critical))return X;var Tr=cn(ir.impact)===nt,rr=Boolean(ir.impact.at&&ir.impact.at.type==="COMBINE"),Mr=ir.critical.droppable.id===nt;return Tr?rr?N:X:Mr?N:X}return X};return me},eu={updateViewportMaxScroll:br};function tu(){return document.body||v(!1),document.body}var Hr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(M.c)(ql,eu,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(xa);bl.defaultProps=Hr},nnTU:function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return Y}),U.d(Pe,"a",function(){return V});var ne=U("MI8n"),Q=U("JYp7"),B=U("pmY6"),q=U("24hK"),K=U("746U"),M=U("Cg/j");const Y=Object(M.c)("commandService"),V=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.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 p=this._commands.get(m);p||(p=new q.a,this._commands.set(m,p));let g=p.unshift(r),a=Object(B.i)(()=>{g();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 V.registerCommand(r,(m,...p)=>m.get(Y).executeCommand(D,...p))}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}};V.registerCommand("noop",()=>{})},osHv:function(wt,Pe,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";var Q=ne.Pos;function B(i,t){return i.line-t.line||i.ch-t.ch}var q="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",K=q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+q+"]["+K+"]*)","g");function Y(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 V(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(!V(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 p(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!V(i,t+1)){i.ch=t;continue}M.lastIndex=t,i.ch=t;var u=M.exec(i.text);if(u&&u.index==t)return u}}function g(i){for(;;){M.lastIndex=i.ch;var t=M.exec(i.text);if(!t){if(r(i))continue;return}if(!V(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(!V(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=g(i),O,S=i.line,R=i.ch-(o?o[0].length:0);if(!o||!(O=m(i)))return;if(O=="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(S,R),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"){p(i);continue}var O=i.line,S=i.ch,R=p(i);if(!R)return;if(R[1])u.push(R[2]);else{for(var A=u.length-1;A>=0;--A)if(u[A]==R[2]){u.length=A;break}if(A<0&&(!t||t==R[2]))return{tag:R[2],from:Q(i.line,i.ch),to:Q(O,S)}}}}ne.registerHelper("fold","xml",function(i,t){for(var u=new Y(i,t.line,0);;){var o=g(u);if(!o||u.line!=t.line)return;var O=m(u);if(!O)return;if(!o[1]&&O!="selfClose"){var S=Q(u.line,u.ch),R=c(u,o[2]);return R&&B(R.from,S)>0?{from:S,to:R.from}:null}}}),ne.findMatchingTag=function(i,t,u){var o=new Y(i,t.line,t.ch,u);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var O=m(o),S=O&&Q(o.line,o.ch),R=O&&p(o);if(!O||!R||B(o,t)>0)return;var A={from:Q(o.line,o.ch),to:S,tag:R[2]};return O=="selfClose"?{open:A,close:null,at:"open"}:R[1]?{open:s(o,R[2]),close:A,at:"close"}:(o=new Y(i,S.line,S.ch,u),{open:A,close:c(o,R[2]),at:"open"})},ne.findEnclosingTag=function(i,t,u,o){for(var O=new Y(i,t.line,t.ch,u);;){var S=s(O,o);if(!S)break;var R=new Y(i,t.line,t.ch,u),A=c(R,S.tag);if(A)return{open:S,close:A}}},ne.scanForClosingTag=function(i,t,u,o){var O=new Y(i,t.line,t.ch,o?{from:0,to:o}:null);return c(O,u)}})},p5ED:function(wt,Pe,U){"use strict";var ne=U("+L6B"),Q=U("2/Rp"),B=U("5Dmo"),q=U("3S7+"),K=U("k1fw"),M=U("9og8"),Y=U("tJVT"),V=U("WmNS"),r=U.n(V),D=U("q1tI"),m=U.n(D),p=U("vHTk"),g=U.n(p),a=U("yEEn"),c=U("ZW9T"),s=U("1vsH"),i=U("V0Rq"),t=U("m3rI");Pe.a=function(u){var o,O,S,R,A,P,w,E=u.editOffice,h=E===void 0?"view":E,f=u.data,T=u.theme,x=u.type,_=u.filename,j=u.monacoEditor,W=u.className,C=u.style,F=u.close,k=u.onClose,y=u.hasMask,H=u.disabledDownload,J=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(Y.a)(J,2),fe=ae[0],ge=ae[1],Te=Object(D.useState)(""),Ue=Object(Y.a)(Te,2),Se=Ue[0],Le=Ue[1],ye=Object(D.useState)(),Z=Object(Y.a)(ye,2),v=Z[0],L=Z[1],z=window.ENV==="build"?"/react/build":"",ee=t.a.PROXY_SERVER||location.origin,$,Ee=1024*1024,Fe=10*Ee,qe=Object(D.useRef)();(o=f)!==null&&o!==void 0&&o.startsWith("/api")&&x!=="txt"&&(f=(t.a.API_SERVER||location.origin)+f),x==="office"&&($=Object(s.T)(f).filesize,$>Fe&&(x="other")),_&&j&&(j.filename=_),Object(D.useEffect)(function(){var Ke,ut,bt=(Ke=document.cookie)===null||Ke===void 0||((ut=Ke.replace(/\s/g,""))===null||ut===void 0)?void 0:ut.split(";");bt==null||bt.map(function(Lt){var Ft=Lt.split("=");Ft[0]==="_educoder_session"&&Le(Ft[1])})},[]),Object(D.useEffect)(function(){x==="office"&&Ce()},[x,f]);var Ce=function(){var Ke=Object(M.a)(r.a.mark(function ut(){var bt,Lt,Ft;return r.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return console.log("data:",f),bt=f,f.startsWith("http")||(bt=location.origin+bt),Lt=new URL(bt).pathname.split("/").pop(),Xt.next=6,Object(i.V)({attachment_id:Lt});case 6:Ft=Xt.sent,L(Ft);case 8:case"end":return Xt.stop()}},ut)}));return function(){return Ke.apply(this,arguments)}}(),Me=function(){if(f.startsWith("http")||f.startsWith("blob:")){He();return}Object(s.z)(_||"educoder",f,_)},He=function(){Object(s.x)(_||"educoder",decodeURIComponent(f))};return m.a.createElement("div",{style:Object(K.a)({},C||{}),className:"".concat(y&&g.a.bgBlack," ").concat(x?g.a.wrp:"hide")},F&&m.a.createElement("div",{className:g.a.close,ref:qe},!H&&m.a.createElement(q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return qe.current}},m.a.createElement("span",{onClick:He},m.a.createElement("i",{className:"icon-quxiaozhiding"}))),m.a.createElement(q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return qe.current}},m.a.createElement("span",{className:"",onClick:k},m.a.createElement("i",{className:"icon-guanbi1"})))),m.a.createElement("div",{className:"".concat(g.a[W]," ").concat(W," ").concat(g.a.monaco," ").concat(x==="txt"?"show":"hide")},x==="txt"&&m.a.createElement(c.b,j)),x==="audio"&&m.a.createElement("audio",{src:"".concat(((O=f)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((S=f)===null||S===void 0?void 0:S.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),x==="video"&&m.a.createElement(m.a.Fragment,null,((R=f)===null||R===void 0?void 0:R.indexOf("http"))>-1?m.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):m.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),x==="office"&&v&&m.a.createElement("iframe",{src:"".concat(z,"/office.html?key=").concat(v.key,"&url=").concat(ee+v.url,"&callbackUrl=").concat(ee+v.callbackUrl,"&fileType=").concat(v.fileType,"&title=").concat(v.title,"&model=").concat(h,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),x==="html"&&m.a.createElement("iframe",{src:f+"&disposition=inline"}),x==="pdf"&&m.a.createElement("iframe",{src:"".concat(z,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!H)}),x==="image"&&m.a.createElement("img",{src:"".concat(((A=f)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((P=f)===null||P===void 0?void 0:P.indexOf("https://"))>-1||(w=f)!==null&&w!==void 0&&w.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),x==="other"&&m.a.createElement("div",null,m.a.createElement(Q.a,{type:"primary",size:"large",onClick:Me},m.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),x==="download"&&m.a.createElement(Q.a,{type:"primary",size:"large",onClick:Me},m.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(wt,Pe,U){},pmY6:function(wt,Pe,U){"use strict";U.d(Pe,"h",function(){return D}),U.d(Pe,"g",function(){return p}),U.d(Pe,"f",function(){return g}),U.d(Pe,"e",function(){return a}),U.d(Pe,"i",function(){return c}),U.d(Pe,"b",function(){return s}),U.d(Pe,"a",function(){return i}),U.d(Pe,"d",function(){return t}),U.d(Pe,"c",function(){return u});var ne=U("C/vA"),Q=U("JYp7");const B=!1;let q=null;function K(o){q=o}if(B){const o="__is_disposable_tracked__";K(new class{trackDisposable(O){const S=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[o]||console.log(S)},3e3)}setParent(O,S){if(O&&O!==i.None)try{O[o]=!0}catch(R){}}markAsDisposed(O){if(O&&O!==i.None)try{O[o]=!0}catch(S){}}markAsSingleton(O){}})}function M(o){return q==null||q.trackDisposable(o),o}function Y(o){q==null||q.markAsDisposed(o)}function V(o,O){q==null||q.setParent(o,O)}function r(o,O){if(!q)return;for(const S of o)q.setParent(S,O)}function D(o){return q==null||q.markAsSingleton(o),o}class m extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function p(o){return typeof o.dispose=="function"&&o.dispose.length===0}function g(o){if(Q.a.is(o)){let O=[];for(const S of o)if(S)try{S.dispose()}catch(R){O.push(R)}if(O.length===1)throw O[0];if(O.length>1)throw new m(O);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function a(...o){const O=c(()=>g(o));return r(o,O),O}function c(o){const O=M({dispose:Object(ne.a)(()=>{Y(O),o()})});return O}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;Y(this),this._isDisposed=!0,this.clear()}clear(){try{g(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 V(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,M(this),V(this._store,this)}dispose(){Y(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,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var O;if(this._isDisposed||o===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),o&&V(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,Y(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&&V(o,null),o}}class u{constructor(o){this.object=o}dispose(){}}},psGv:function(wt,Pe,U){var ne,Q;(function(){var B;(function(){"use strict";var Y=[,,function(m){function p(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=[]}p.prototype.clone_empty=function(){var c=new p(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},p.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},p.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},p.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))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},p.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var 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 g(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}g.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},g.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},g.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},g.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 g(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 p(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 p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=a},function(m){function p(g,a,c,s){this.type=g,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=p},,,function(m){function p(c,s){this.raw_options=g(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"])}p.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},p.prototype._get_boolean=function(c,s){var i=this.raw_options[c],t=i===void 0?!!s:!!i;return t},p.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},p.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},p.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]},p.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},p.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function g(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=p,m.exports.normalizeOpts=a,m.exports.mergeOpts=g},,function(m){var p=RegExp.prototype.hasOwnProperty("sticky");function g(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},g.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},g.prototype.__match=function(a,c){a.lastIndex=c;var s=a.exec(this.__input);return s&&!(p&&a.sticky)&&(s.index!==c&&(s=null)),s},g.prototype.test=function(a,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(a,c):!1},g.prototype.testChar=function(a,c){var s=this.peek(c);return a.lastIndex=0,s!==null&&a.test(s)},g.prototype.match=function(a){var c=this.__match(a,this.__position);return c?this.__position+=c[0].length:c=null,c},g.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},g.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},g.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},g.prototype.get_regexp=function(a,c){var s=null,i="g";return c&&p&&(i="y"),typeof a=="string"&&a!==""?s=new RegExp(a,i):a&&(s=new RegExp(a.source,i)),s},g.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(a){var c=this.__position,s=this.readUntilAfter(a);return this.__position=c,s},g.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=g},function(m,p,g){var a=g(8).InputScanner,c=g(3).Token,s=g(10).TokenStream,i=g(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,O){this._input=new a(o),this._options=O||{},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,O=new c(t.START,""),S=null,R=[],A=new s;O.type!==t.EOF;){for(o=this._get_next_token(O,S);this._is_comment(o);)A.add(o),o=this._get_next_token(O,S);A.isEmpty()||(o.comments_before=A,A=new s),o.parent=S,this._is_opening(o)?(R.push(S),S=o):S&&this._is_closing(o,S)&&(o.opened=S,S.closed=o,S=R.pop(),o.parent=S),o.previous=O,O.next=o,this.__tokens.add(o),O=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,O){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(t.RAW,S):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,O){return!1},u.prototype._create_token=function(o,O){var S=new c(o,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=u,m.exports.TOKEN=t},function(m){function p(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},p.prototype.peek=function(g){var a=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(a=this.__tokens[g]),a},p.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},m.exports.TokenStream=p},function(m,p,g){var a=g(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 p(g,a){this._input=g,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)}p.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(g){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(g),a._update(),a},p.prototype.until=function(g){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(g),a._update(),a},p.prototype.starting_with=function(g){var a=this._create();return a._starting_pattern=this._input.get_regexp(g,!0),a._update(),a},p.prototype.matching=function(g){var a=this._create();return a._match_pattern=this._input.get_regexp(g,!0),a._update(),a},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},m.exports.Pattern=p},function(m){function p(g,a){g=typeof g=="string"?g:g.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+a,"g")}p.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(g);c;)a[c[1]]=c[2],c=this.__directive_pattern.exec(g);return a},p.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=p},function(m,p,g){var a=g(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,p,g){var a=g(19).Beautifier,c=g(20).Options;function s(i,t,u,o){var O=new a(i,t,u,o);return O.beautify()}m.exports=s,m.exports.defaultOptions=function(){return new c}},function(m,p,g){var a=g(20).Options,c=g(2).Output,s=g(21).Tokenizer,i=g(21).TOKEN,t=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,o=function(T,x){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new c(T,x)};o.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},o.prototype.set_space_before_token=function(T,x){this._output.space_before_token=T,this._output.non_breaking_space=x},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(T){this._output.add_raw_token(T)},o.prototype.print_preserved_newlines=function(T){var x=0;T.type!==i.TEXT&&T.previous.type!==i.TEXT&&(x=T.newlines?1:0),this.preserve_newlines&&(x=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var _=0;_<x;_++)this.print_newline(_>0);return x!==0},o.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(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(T){this._output.add_new_line(T)},o.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var O=function(T){for(var x=null,_=T.next;_.type!==i.EOF&&T.closed!==_;){if(_.type===i.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===i.EQUALS&&_.next.next&&_.next.next.type===i.VALUE&&(x=_.next.next.text);break}_=_.next}return x},S=function(T,x){var _=null,j=null;return x.closed?(T==="script"?_="text/javascript":T==="style"&&(_="text/css"),_=O(x)||_,_.search("text/css")>-1?j="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":_.search(/test\/null/)>-1&&(j="null"),j):null};function R(T,x){return x.indexOf(T)!==-1}function A(T,x,_){this.parent=T||null,this.tag=x?x.tag_name:"",this.indent_level=_||0,this.parser_token=x||null}function P(T){this._printer=T,this._current_frame=null}P.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},P.prototype.record_tag=function(T){var x=new A(this._current_frame,T,this._printer.indent_level);this._current_frame=x},P.prototype._try_pop_frame=function(T){var x=null;return T&&(x=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),x},P.prototype._get_frame=function(T,x){for(var _=this._current_frame;_&&!(T.indexOf(_.tag)!==-1);){if(x&&x.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},P.prototype.try_pop=function(T,x){var _=this._get_frame([T],x);return this._try_pop_frame(_)},P.prototype.indent_to_tag=function(T){var x=this._get_frame(T);x&&(this._printer.indent_level=x.indent_level)};function w(T,x,_,j){this._source_text=T||"",x=x||{},this._js_beautify=_,this._css_beautify=j,this._tag_stack=null;var W=new a(x,"html");this._options=W,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"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,x=this._options.eol;this._options.eol==="auto"&&(x=`
|
|
`,T&&t.test(T)&&(x=T.match(t)[0])),T=T.replace(u,`
|
|
`);var _=T.match(/^[\t ]*/)[0],j={text:"",type:""},W=new E,C=new o(this._options,_),F=new s(T,this._options).tokenize();this._tag_stack=new P(C);for(var k=null,y=F.next();y.type!==i.EOF;)y.type===i.TAG_OPEN||y.type===i.COMMENT?(k=this._handle_tag_open(C,y,W,j),W=k):y.type===i.ATTRIBUTE||y.type===i.EQUALS||y.type===i.VALUE||y.type===i.TEXT&&!W.tag_complete?k=this._handle_inside_tag(C,y,W,F):y.type===i.TAG_CLOSE?k=this._handle_tag_close(C,y,W):y.type===i.TEXT?k=this._handle_text(C,y,W):C.add_raw_token(y),j=k,y=F.next();var H=C._output.get_code(x);return H},w.prototype._handle_tag_close=function(T,x,_){var j={text:x.text,type:x.type};return T.alignment_size=0,_.tag_complete=!0,T.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),_.is_unformatted?T.add_raw_token(x):(_.tag_start_char==="<"&&(T.set_space_before_token(x.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(x)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(T.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&T.set_wrap_point(),j},w.prototype._handle_inside_tag=function(T,x,_,j){var W=_.has_wrapped_attrs,C={text:x.text,type:x.type};if(T.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),_.is_unformatted)T.add_raw_token(x);else if(_.tag_start_char==="{"&&x.type===i.TEXT)T.print_preserved_newlines(x)?(x.newlines=0,T.add_raw_token(x)):T.print_token(x);else{if(x.type===i.ATTRIBUTE?(T.set_space_before_token(!0),_.attr_count+=1):(x.type===i.EQUALS||x.type===i.VALUE&&x.previous.type===i.EQUALS)&&T.set_space_before_token(!1),x.type===i.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(x),W=W||x.newlines!==0),this._is_wrap_attributes_force)){var F=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var k=!0,y=0,H;do{if(H=j.peek(y),H.type===i.ATTRIBUTE){k=!1;break}y+=1}while(y<4&&H.type!==i.EOF&&H.type!==i.TAG_CLOSE);F=!k}F&&(T.print_newline(!1),W=!0)}T.print_token(x),W=W||T.previous_token_wrapped(),_.has_wrapped_attrs=W}return C},w.prototype._handle_text=function(T,x,_){var j={text:x.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(T,x,_):_.is_unformatted||_.is_content_unformatted?T.add_raw_token(x):(T.traverse_whitespace(x),T.print_token(x)),j},w.prototype._print_custom_beatifier_text=function(T,x,_){var j=this;if(x.text!==""){var W=x.text,C,F=1,k="",y="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?C=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?C=this._css_beautify:_.custom_beautifier_name==="html"&&(C=function(Te,Ue){var Se=new w(Te,Ue,j._js_beautify,j._css_beautify);return Se.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-T.indent_level);var H=T.get_full_indent(F);if(W=W.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!J){T.add_raw_token(x);return}k=H+J[1]+`
|
|
`,W=J[4],J[5]&&(y=H+J[5]),W=W.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
|
|
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(x.whitespace_before=J[0]))}if(W)if(C){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var fe=new ae;W=C(H+W,fe)}else{var ge=x.whitespace_before;ge&&(W=W.replace(new RegExp(`
|
|
(`+ge+")?","g"),`
|
|
`)),W=H+W.replace(/\n/g,`
|
|
`+H)}k&&(W?W=k+W+`
|
|
`+y:W=k+y),T.print_newline(!1),W&&(x.text=W,x.whitespace_before="",x.newlines=0,T.add_raw_token(x),T.print_newline(!0))}},w.prototype._handle_tag_open=function(T,x,_,j){var W=this._get_tag_open_token(x);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&x.type===i.TAG_OPEN&&x.text.indexOf("</")===0?(T.add_raw_token(x),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(T.traverse_whitespace(x),this._set_tag_position(T,x,W,_,j),W.is_inline_element||T.set_wrap_point(),T.print_token(x)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=x.text.length+1),!W.tag_complete&&!W.is_unformatted&&(T.alignment_size=W.alignment_size),W};var E=function(T,x){if(this.parent=T||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="",!x)this.tag_complete=!0;else{var _;this.tag_start_char=x.text[0],this.text=x.text,this.tag_start_char==="<"?(_=x.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=x.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(x.text.startsWith("{{#>")||x.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&x.next!==null?this.tag_check=x.next.text.split(" ")[0]:this.tag_check=x.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),x.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||x.closed&&x.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};w.prototype._get_tag_open_token=function(T){var x=new E(this._tag_stack.get_parser_token(),T);return x.alignment_size=this._options.wrap_attributes_indent_size,x.is_end_tag=x.is_end_tag||R(x.tag_check,this._options.void_elements),x.is_empty_element=x.tag_complete||x.is_start_tag&&x.is_end_tag,x.is_unformatted=!x.tag_complete&&R(x.tag_check,this._options.unformatted),x.is_content_unformatted=!x.is_empty_element&&R(x.tag_check,this._options.content_unformatted),x.is_inline_element=R(x.tag_name,this._options.inline)||x.tag_name.includes("-")||x.tag_start_char==="{",x},w.prototype._set_tag_position=function(T,x,_,j,W){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||T.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=S(_.tag_check,x)))),R(_.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.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 C=T.current_line_has_match(/{{#if/);C||T.print_newline(!1)}_.tag_name==="!--"&&W.type===i.TAG_CLOSE&&j.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,_))}else if(_.is_end_tag){var F=!1;F=_.start_tag_token&&_.start_tag_token.multiline_content,F=F||!_.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(W.type===i.TAG_CLOSE&&_.start_tag_token===j)&&W.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(F=!1),F&&T.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)&&(W.type!=="TK_CONTENT"||_.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,_)},w.prototype._calcluate_parent_multiline=function(T,x){x.parent&&T._output.just_added_newline()&&!((x.is_inline_element||x.is_unformatted)&&x.parent.is_inline_element)&&(x.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"];w.prototype._do_optional_end_element=function(T){var x=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")x=x||this._tag_stack.try_pop("head");else if(T.tag_name==="li")x=x||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")x=x||this._tag_stack.try_pop("dt",["dl"]),x=x||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&h.indexOf(T.tag_name)!==-1){var _=T.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(x=x||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(x=x||this._tag_stack.try_pop("rt",["ruby","rtc"]),x=x||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?x=x||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?x=x||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?x=x||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("thead",["table"]),x=x||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(x=x||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),x=x||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),x},m.exports.Beautifier=w},function(m,p,g){var a=g(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,p,g){var a=g(9).Tokenizer,c=g(9).TOKEN,s=g(13).Directives,i=g(14).TemplatablePattern,t=g(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(/<\!--/,/-->/),O=function(S,R){a.call(this,S,R),this._current_tag_name="";var A=new i(this._input).read_options(this._options),P=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:P.starting_with(/{{!--/).until_after(/--}}/),handlebars:P.starting_with(/{{/).until_after(/}}/),handlebars_open:P.until(/[\n\r\t }]/),handlebars_raw_close:P.until(/}}/),comment:P.starting_with(/<!--/).until_after(/-->/),cdata:P.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:P.starting_with(/<!\[/).until_after(/]>/),processing:P.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 w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=P.matching(w).until_after(w)}};O.prototype=new a,O.prototype._is_comment=function(S){return!1},O.prototype._is_opening=function(S){return S.type===u.TAG_OPEN},O.prototype._is_closing=function(S,R){return S.type===u.TAG_CLOSE&&R&&((S.text===">"||S.text==="/>")&&R.text[0]==="<"||S.text==="}}"&&R.text[0]==="{"&&R.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(S,R){var A=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(u.EOF,""):(A=A||this._read_open_handlebars(P,R),A=A||this._read_attribute(P,S,R),A=A||this._read_close(P,R),A=A||this._read_raw_content(P,S,R),A=A||this._read_content_word(P),A=A||this._read_comment_or_cdata(P),A=A||this._read_processing(P),A=A||this._read_open(P,R),A=A||this._create_token(u.UNKNOWN,this._input.next()),A)},O.prototype._read_comment_or_cdata=function(S){var R=null,A=null,P=null;if(S==="<"){var w=this._input.peek(1);w==="!"&&(A=this.__patterns.comment.read(),A?(P=o.get_directives(A),P&&P.ignore==="start"&&(A+=o.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(R=this._create_token(u.COMMENT,A),R.directives=P)}return R},O.prototype._read_processing=function(S){var R=null,A=null,P=null;if(S==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(R=this._create_token(u.COMMENT,A),R.directives=P)}return R},O.prototype._read_open=function(S,R){var A=null,P=null;return R||S==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),P=this._create_token(u.TAG_OPEN,A)),P},O.prototype._read_open_handlebars=function(S,R){var A=null,P=null;return R||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),P=this._create_token(u.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),P=this._create_token(u.TAG_OPEN,A))),P},O.prototype._read_close=function(S,R){var A=null,P=null;return R&&(R.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(A=this._input.next(),S==="/"&&(A+=this._input.next()),P=this._create_token(u.TAG_CLOSE,A)):R.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),P=this._create_token(u.TAG_CLOSE,"}}"))),P},O.prototype._read_attribute=function(S,R,A){var P=null,w="";if(A&&A.text[0]==="<")if(S==="=")P=this._create_token(u.EQUALS,this._input.next());else if(S==='"'||S==="'"){var E=this._input.next();S==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),P=this._create_token(u.VALUE,E)}else w=this.__patterns.attribute.read(),w&&(R.type===u.EQUALS?P=this._create_token(u.VALUE,w):P=this._create_token(u.ATTRIBUTE,w));return P},O.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},O.prototype._read_raw_content=function(S,R,A){var P="";if(A&&A.text[0]==="{")P=this.__patterns.handlebars_raw_close.read();else if(R.type===u.TAG_CLOSE&&R.opened.text[0]==="<"&&R.text[0]!=="/"){var w=R.opened.text.substr(1).toLowerCase();if(w==="script"||w==="style"){var E=this._read_comment_or_cdata(S);if(E)return E.type=u.TEXT,E;P=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(w)&&(P=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return P?this._create_token(u.TEXT,P):null},O.prototype._read_content_word=function(S){var R="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(R=this.__patterns.unformatted_content_delimiter.read())),R||(R=this.__patterns.word.read()),R)return this._create_token(u.TEXT,R)},m.exports.Tokenizer=O,m.exports.TOKEN=u}],V={};function r(m){var p=V[m];if(p!==void 0)return p.exports;var g=V[m]={exports:{}};return Y[m](g,g.exports,r),g.exports}var D=r(18);B=D})();var q=B;if(!0)!(ne=[U,U("6UM0"),U("TXwP")],Q=function(Y){var V=U("6UM0"),r=U("TXwP");return{html_beautify:function(D,m){return q(D,m,V.js_beautify,r.css_beautify)}}}.apply(Pe,ne),Q!==void 0&&(wt.exports=Q));else var K,M})()},"rAM+":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Q});var ne=U("Qw5x");function Q(B,q){var K;if(typeof Symbol=="undefined"||B[Symbol.iterator]==null){if(Array.isArray(B)||(K=Object(ne.a)(B))||q&&B&&typeof B.length=="number"){K&&(B=K);var M=0,Y=function(){};return{s:Y,n:function(){return M>=B.length?{done:!0}:{done:!1,value:B[M++]}},e:function(p){throw p},f:Y}}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 V=!0,r=!1,D;return{s:function(){K=B[Symbol.iterator]()},n:function(){var p=K.next();return V=p.done,p},e:function(p){r=!0,D=p},f:function(){try{!V&&K.return!=null&&K.return()}finally{if(r)throw D}}}}},rUJ1:function(wt,Pe){const U=/[&<>"']/,ne=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,q={"&":"&","<":"<",">":">",'"':""","'":"'"},K=P=>q[P];function M(P,w){if(w){if(U.test(P))return P.replace(ne,K)}else if(Q.test(P))return P.replace(B,K);return P}const Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function V(P){return P.replace(Y,(w,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const r=/(^|[^\[])\^/g;function D(P,w){P=P.source||P,w=w||"";const E={replace:(h,f)=>(f=f.source||f,f=f.replace(r,"$1"),P=P.replace(h,f),E),getRegex:()=>new RegExp(P,w)};return E}const m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(P,w,E){if(P){let h;try{h=decodeURIComponent(V(E)).replace(m,"").toLowerCase()}catch(f){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}w&&!p.test(E)&&(E=t(w,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(h){return null}return E}const a={},c=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(P,w){a[" "+P]||(c.test(P)?a[" "+P]=P+"/":a[" "+P]=S(P,"/",!0)),P=a[" "+P];const E=P.indexOf(":")===-1;return w.substring(0,2)==="//"?E?w:P.replace(s,"$1")+w:w.charAt(0)==="/"?E?w:P.replace(i,"$1")+w:P+w}const u={exec:function(){}};function o(P){let w=1,E,h;for(;w<arguments.length;w++){E=arguments[w];for(h in E)Object.prototype.hasOwnProperty.call(E,h)&&(P[h]=E[h])}return P}function O(P,w){const E=P.replace(/\|/g,(T,x,_)=>{let j=!1,W=x;for(;--W>=0&&_[W]==="\\";)j=!j;return j?"|":" |"}),h=E.split(/ \|/);let f=0;if(h.length>w)h.splice(w);else for(;h.length<w;)h.push("");for(;f<h.length;f++)h[f]=h[f].trim().replace(/\\\|/g,"|");return h}function S(P,w,E){const h=P.length;if(h===0)return"";let f=0;for(;f<h;){const T=P.charAt(h-f-1);if(T===w&&!E)f++;else if(T!==w&&E)f++;else break}return P.substr(0,h-f)}function R(P,w){if(P.indexOf(w[1])===-1)return-1;const E=P.length;let h=0,f=0;for(;f<E;f++)if(P[f]==="\\")f++;else if(P[f]===w[0])h++;else if(P[f]===w[1]&&(h--,h<0))return f;return-1}function A(P){P&&P.sanitize&&!P.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}wt.exports={escape:M,unescape:V,edit:D,cleanUrl:g,resolveUrl:t,noopTest:u,merge:o,splitCells:O,rtrim:S,findClosingBracket:R,checkSanitizeDeprecation:A}},sR1s:function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return q}),U.d(Pe,"a",function(){return K}),U.d(Pe,"c",function(){return M}),U.d(Pe,"d",function(){return Y});var ne=U("U8pU"),Q="RC_TABLE_KEY";function B(V){return V==null?[]:Array.isArray(V)?V:[V]}function q(V,r){if(!r&&typeof r!="number")return V;for(var D=B(r),m=V,p=0;p<D.length;p+=1){if(!m)return null;var g=D[p];m=m[g]}return m}function K(V){var r=[],D={};return V.forEach(function(m){for(var p=m||{},g=p.key,a=p.dataIndex,c=g||B(a).join("-")||Q;D[c];)c="".concat(c,"_next");D[c]=!0,r.push(c)}),r}function M(){var V={};function r(g,a){a&&Object.keys(a).forEach(function(c){var s=a[c];s&&Object(ne.a)(s)==="object"?(g[c]=g[c]||{},r(g[c],s)):g[c]=s})}for(var D=arguments.length,m=new Array(D),p=0;p<D;p++)m[p]=arguments[p];return m.forEach(function(g){r(V,g)}),V}function Y(V){return V!=null}},sZF6:function(wt,Pe,U){"use strict";var ne=U("2qtc"),Q=U("kLXV"),B=U("DZo9"),q=U("8z0m"),K=U("+L6B"),M=U("2/Rp"),Y=U("tJVT"),V=U("q1tI"),r=U.n(V),D=U("xvlK"),m=U("m3rI"),p=U("1vsH"),g=U("Ty5D"),a=U("69hG"),c=U.n(a),s=function(t){var u=t.visible,o=t.onOk,O=t.onCancel,S=Object(V.useState)([]),R=Object(Y.a)(S,2),A=R[0],P=R[1],w=Object(V.useState)(!1),E=Object(Y.a)(w,2),h=E[0],f=E[1],T=Object(g.i)();Object(V.useEffect)(function(){u||(P([]),f(!1))},[u]);var x=function(){f(!0),o(A,function(){f(!1)})},_=function(){O()},j=function(){console.log(T,444);var k="".concat(m.a.API_SERVER,"/api/courses/").concat(T.coursesId,"/exercises/down_template");Object(p.x)(null,k)},W=function(k){var y={name:k.name,uid:k.uid,file:k};return P([y]),!1},C=function(){P([])};return r.a.createElement(Q.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:u,onOk:x,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:j},"\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(q.a,{action:"".concat(m.a.API_SERVER,"/api/attachments.json"),beforeUpload:W,onRemove:C,withCredentials:!0,fileList:A,accept:".xls,.xlsx"},r.a.createElement(M.a,{className:c.a.upload,type:"primary",icon:r.a.createElement(D.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};Pe.a=s},sboe:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return B});var ne=U("q1tI"),Q=U.n(ne),B=ne.createContext(null)},t23M:function(wt,Pe,U){"use strict";var ne=U("VTBJ"),Q=U("1OyB"),B=U("vuIU"),q=U("Ji7U"),K=U("LK+K"),M=U("q1tI"),Y=U.n(M),V=U("m+aA"),r=U("Zm9Q"),D=U("Kwbf"),m=U("c+Xe"),p=U("bdgK"),g="rc-observer-key",a=function(c){Object(q.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,O=u[0].target,S=O.getBoundingClientRect(),R=S.width,A=S.height,P=O.offsetWidth,w=O.offsetHeight,E=Math.floor(R),h=Math.floor(A);if(t.state.width!==E||t.state.height!==h||t.state.offsetWidth!==P||t.state.offsetHeight!==w){var f={width:E,height:h,offsetWidth:P,offsetHeight:w};t.setState(f),o&&Promise.resolve().then(function(){o(Object(ne.a)(Object(ne.a)({},f),{},{offsetWidth:P,offsetHeight:w}))})}},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(V.a)(this.childNode||this),O=o!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new p.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 O=o[0];if(M.isValidElement(O)&&Object(m.c)(O)){var S=O.ref;o[0]=M.cloneElement(O,{ref:Object(m.a)(S,this.setChildNode)})}return o.length===1?o[0]:o.map(function(R,A){return!M.isValidElement(R)||"key"in R&&R.key!==null?R:M.cloneElement(R,{key:"".concat(g,"-").concat(A)})})}}]),i}(M.Component);a.displayName="ResizeObserver",Pe.a=a},t9D7:function(wt,Pe,U){"use strict";U.d(Pe,"b",function(){return Y}),U.d(Pe,"g",function(){return r}),U.d(Pe,"d",function(){return D}),U.d(Pe,"e",function(){return m}),U.d(Pe,"a",function(){return p}),U.d(Pe,"f",function(){return c}),U.d(Pe,"c",function(){return s});var ne=U("Vhoy"),Q=U("MI8n"),B=U("pmY6"),q=U("Cg/j"),K=U("ic2d"),M=U("nEHx");const Y=Object(q.c)("themeService");var V;(function(i){function t(u){return u&&typeof u=="object"&&typeof u.id=="string"}i.isThemeColor=t})(V||(V={}));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"||V.isThemeColor(A.color))}i.isThemeIcon=t;const u=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function o(A){const P=u.exec(A);if(!P)return;let[,w]=P;return{id:w}}i.fromString=o;function O(A,P){let w=A.id;const E=w.lastIndexOf("~");return E!==-1&&(w=w.substring(0,E)),P&&(w=`${w}~${P}`),{id:w}}i.modify=O;function S(A,P){var w,E;return A.id===P.id&&((w=A.color)===null||w===void 0?void 0:w.id)===((E=P.color)===null||E===void 0?void 0:E.id)}i.isEqual=S;function R(A,P){return{id:A.id,color:P?r(P):void 0}}i.asThemeIcon=R,i.asClassNameArray=ne.a.asClassNameArray,i.asClassName=ne.a.asClassName,i.asCSSSelector=ne.a.asCSSSelector})(D||(D={}));function m(i){switch(i){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class g{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 g;K.a.add(p.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(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return S});var ne=U("miYZ"),Q=U("tsqr"),B=U("9og8"),q=U("5NDa"),K=U("5rEg"),M=U("2qtc"),Y=U("kLXV"),V=U("oBTY"),r=U("tJVT"),D=U("OaEy"),m=U("2fM7"),p=U("WmNS"),g=U.n(p),a=U("q1tI"),c=U.n(a),s=U("ErOA"),i=U("i58Z"),t=U.n(i),u=U("T1X5"),o=U.n(u),O=m.a.Option,S=function(A){var P=A.subId,w=A.value,E=A.selectvalues,h=A.disabled,f=A.knowledgeOptions,T=f===void 0?[]:f,x=A.onChange,_=x===void 0?function(){}:x,j=A.onAddKnowledgeFinish,W=j===void 0?function(){}:j,C=Object(a.useRef)(),F=Object(a.useState)([]),k=Object(r.a)(F,2),y=k[0],H=k[1];w=w||[];var J=function(ge,Te){ge?(H([Te.key]),_([Te.key])):(H([]),_([]))};Object(a.useEffect)(function(){(E==null?void 0:E.length)>0&&(H(Object(V.a)(E)),_(Object(V.a)(E)))},[T]),Object(a.useEffect)(function(){var fe;((fe=w)===null||fe===void 0?void 0:fe.length)>0&&_(Object(V.a)(w))},[T]);var ae=function(ge){ge.preventDefault(),C.current="",Y.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:C.current,onChange:function(Ue){C.current=Ue.target.value}})),onOk:function(){return new Promise(function(){var Ue=Object(B.a)(g.a.mark(function Se(Le,ye){var Z,v;return g.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(C.current){z.next=3;break}return Q.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),z.abrupt("return",ye());case 3:if(!(C.current.length>20)){z.next=6;break}return Q.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),z.abrupt("return",ye());case 6:return z.next=8,Object(s.a)("/api/tag_disciplines.json",{method:"post",body:{name:C.current,sub_discipline_id:P}});case 8:return Z=z.sent,(Z==null?void 0:Z.status)===0&&(W({id:Z.tag_discipline_id,name:C.current,type:"personal"}),v=[],v.push(Z.tag_discipline_id),_([].concat(v)),H([Z.tag_discipline_id]),_([].concat(v))),z.abrupt("return",Le());case 11:case"end":return z.stop()}},Se)}));return function(Se,Le){return Ue.apply(this,arguments)}}())}})};return c.a.createElement("div",{className:t.a.wrap},c.a.createElement(m.a,{disabled:!P||h,className:"mr5",style:{width:"242px"},onChange:J,showSearch:!0,allowClear:!0,value:T==null?void 0:T.filter(function(fe){return(y==null?void 0:y.includes(fe==null?void 0:fe.id))||(y==null?void 0:y.includes((fe==null?void 0:fe.id)+""))}).map(function(fe){return fe.name})},T==null?void 0:T.map(function(fe){return c.a.createElement(O,{key:fe.id,value:fe.name},c.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},c.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},fe.name),c.a.createElement("span",null,fe.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),c.a.createElement("button",{disabled:!P,className:"".concat(t.a.addKnowledge," ").concat(P?"":t.a.disabled),onClick:ae},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(wt,Pe,U){(function(ne,Q){wt.exports=Q()})(this,function(){"use strict";function ne(Q,B,q){q=q||{},q.childrenKeyName=q.childrenKeyName||"children";var K=Q||[],M=[],Y=0;do{var V=K.filter(function(r){return B(r,Y)})[0];if(!V)break;M.push(V),K=V[q.childrenKeyName]||[],Y+=1}while(K.length>0);return M}return ne})},ulZh:function(wt,Pe,U){typeof window!="undefined"&&function(Q,B){wt.exports=B()}(this,function(){return function(ne){var Q={};function B(q){if(Q[q])return Q[q].exports;var K=Q[q]={i:q,l:!1,exports:{}};return ne[q].call(K.exports,K,K.exports,B),K.l=!0,K.exports}return B.m=ne,B.c=Q,B.d=function(q,K,M){B.o(q,K)||Object.defineProperty(q,K,{enumerable:!0,get:M})},B.r=function(q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(q,"__esModule",{value:!0})},B.t=function(q,K){if(K&1&&(q=B(q)),K&8)return q;if(K&4&&typeof q=="object"&&q&&q.__esModule)return q;var M=Object.create(null);if(B.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:q}),K&2&&typeof q!="string")for(var Y in q)B.d(M,Y,function(V){return q[V]}.bind(null,Y));return M},B.n=function(q){var K=q&&q.__esModule?function(){return q.default}:function(){return q};return B.d(K,"a",K),K},B.o=function(q,K){return Object.prototype.hasOwnProperty.call(q,K)},B.p="/dist/",B(B.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,Q,B){"use strict";var q=Object.prototype.hasOwnProperty,K="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(K=!1));function Y(m,p,g){this.fn=m,this.context=p,this.once=g||!1}function V(m,p,g,a,c){if(typeof g!="function")throw new TypeError("The listener must be a function");var s=new Y(g,a||m,c),i=K?K+p:p;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,p){--m._eventsCount===0?m._events=new M:delete m._events[p]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],g,a;if(this._eventsCount===0)return p;for(a in g=this._events)q.call(g,a)&&p.push(K?a.slice(1):a);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(g)):p},D.prototype.listeners=function(p){var g=K?K+p:p,a=this._events[g];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(p){var g=K?K+p:p,a=this._events[g];return a?a.fn?1:a.length:0},D.prototype.emit=function(p,g,a,c,s,i){var t=K?K+p:p;if(!this._events[t])return!1;var u=this._events[t],o=arguments.length,O,S;if(u.fn){u.once&&this.removeListener(p,u.fn,void 0,!0);switch(o){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,g),!0;case 3:return u.fn.call(u.context,g,a),!0;case 4:return u.fn.call(u.context,g,a,c),!0;case 5:return u.fn.call(u.context,g,a,c,s),!0;case 6:return u.fn.call(u.context,g,a,c,s,i),!0}for(S=1,O=new Array(o-1);S<o;S++)O[S-1]=arguments[S];u.fn.apply(u.context,O)}else{var R=u.length,A;for(S=0;S<R;S++){u[S].once&&this.removeListener(p,u[S].fn,void 0,!0);switch(o){case 1:u[S].fn.call(u[S].context);break;case 2:u[S].fn.call(u[S].context,g);break;case 3:u[S].fn.call(u[S].context,g,a);break;case 4:u[S].fn.call(u[S].context,g,a,c);break;default:if(!O)for(A=1,O=new Array(o-1);A<o;A++)O[A-1]=arguments[A];u[S].fn.apply(u[S].context,O)}}}return!0},D.prototype.on=function(p,g,a){return V(this,p,g,a,!1)},D.prototype.once=function(p,g,a){return V(this,p,g,a,!0)},D.prototype.removeListener=function(p,g,a,c){var s=K?K+p:p;if(!this._events[s])return this;if(!g)return r(this,s),this;var i=this._events[s];if(i.fn)i.fn===g&&(!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!==g||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(p){var g;return p?(g=K?K+p:p,this._events[g]&&r(this,g)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=K,D.EventEmitter=D,ne.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,Q,B){(function(q){var K=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,Y=/(?:\/|^)\.(?=\/)/g,V=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(D,m,p){if(p=p||{},D=D.trim(),m=m.trim(),!m){if(!p.alwaysNormalize)return D;var g=r.parseURL(D);if(!g)throw new Error("Error trying to parse base URL.");return g.path=r.normalizePath(g.path),r.buildURLFromParts(g)}var a=r.parseURL(m);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return p.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=M.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=p.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(Y,"");D.length!==(D=D.replace(V,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ne.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,Q,B){function q(p){var g={};function a(s){if(g[s])return g[s].exports;var i=g[s]={i:s,l:!1,exports:{}};return p[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=p,a.c=g,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|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+K+").*?\\)";function Y(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function V(p){return!isNaN(1*p)}function r(p,g,a){var c={};c[a]=[];var s=g.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)"+Y(t)+M,"g"),o;o=u.exec(s);){if(o[3]==="dll-reference")continue;c[a].push(o[3])}for(u=new RegExp("\\("+Y(t)+'\\("(dll-reference\\s('+K+'))"\\)\\)'+M,"g");o=u.exec(s);)p[o[2]]||(c[a].push(o[1]),p[o[2]]=B(o[1]).m),c[o[2]]=c[o[2]]||[],c[o[2]].push(o[4]);for(var O=Object.keys(c),S=0;S<O.length;S++)for(var R=0;R<c[O[S]].length;R++)V(c[O[S]][R])&&(c[O[S]][R]=1*c[O[S]][R]);return c}function D(p){var g=Object.keys(p);return g.reduce(function(a,c){return a||p[c].length>0},!1)}function m(p,g){for(var a={main:[g]},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],O=o.pop();if(s[u]=s[u]||{},s[u][O]||!p[u][O])continue;s[u][O]=!0,c[u]=c[u]||[],c[u].push(O);for(var S=r(p,p[u][O],u),R=Object.keys(S),A=0;A<R.length;A++)a[R[A]]=a[R[A]]||[],a[R[A]]=a[R[A]].concat(S[R[A]])}return c}ne.exports=function(p,g){g=g||{};var a={main:B.m},c=g.all?{main:Object.keys(a.main)}:m(a,p),s="";Object.keys(c).filter(function(O){return O!=="main"}).forEach(function(O){for(var S=0;c[O][S];)S++;c[O].push(S),a[O][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+O+" = ("+q.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+c[O].map(function(R){return""+JSON.stringify(R)+": "+a[O][R].toString()}).join(",")+`});
|
|
`}),s=s+"new (("+q.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+c.main.map(function(O){return""+JSON.stringify(O)+": "+a.main[O].toString()}).join(",")+"}))(self);";var i=new window.Blob([s],{type:"text/javascript"});if(g.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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"hlsDefaultConfig",function(){return A}),B.d(Q,"mergeConfig",function(){return w}),B.d(Q,"enableStreamingMode",function(){return E});var q=B("./src/controller/abr-controller.ts"),K=B("./src/controller/audio-stream-controller.ts"),M=B("./src/controller/audio-track-controller.ts"),Y=B("./src/controller/subtitle-stream-controller.ts"),V=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"),p=B("./src/controller/fps-controller.ts"),g=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 T=arguments[f];for(var x in T)Object.prototype.hasOwnProperty.call(T,x)&&(h[x]=T[x])}return h},o.apply(this,arguments)}function O(h,f){var T=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);f&&(x=x.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),T.push.apply(T,x)}return T}function S(h){for(var f=1;f<arguments.length;f++){var T=arguments[f]!=null?arguments[f]:{};f%2?O(Object(T),!0).forEach(function(x){R(h,x,T[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(T)):O(Object(T)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(T,x))})}return h}function R(h,f,T){return f in h?Object.defineProperty(h,f,{value:T,enumerable:!0,configurable:!0,writable:!0}):h[f]=T,h}var A=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:c.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:q.default,bufferController:r.default,capLevelController:m.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},P()),{},{subtitleStreamController:Y.SubtitleStreamController,subtitleTrackController:V.default,timelineController:D.TimelineController,audioStreamController:K.default,audioTrackController:M.default,emeController:g.default,cmcdController:a.default});function P(){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 w(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 E(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 T=Object(s.fetchSupported)();T&&(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(ne,Q,B){"use strict";B.r(Q);var q=B("./src/polyfills/number.ts"),K=B("./src/utils/ewma-bandwidth-estimator.ts"),M=B("./src/events.ts"),Y=B("./src/utils/buffer-helper.ts"),V=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 p(a,c,s){return c&&m(a.prototype,c),s&&m(a,s),a}var g=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(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(M.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(M.Events.ERROR,this.onError,this)},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,O=u.config,S=u.media;if(!i||!S)return;var R=t?t.stats:i.stats,A=t?t.duration:i.duration;if(R.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||S.paused||!S.playbackRate||!S.readyState)return;var P=performance.now()-R.loading.start,w=Math.abs(S.playbackRate);if(P<=500*A/w)return;var E=u.levels,h=u.minAutoLevel,f=E[i.level],T=R.total||Math.max(R.loaded,Math.round(A*f.maxBitrate/8)),x=Math.max(1,R.bwEstimate?R.bwEstimate/8:R.loaded*1e3/P),_=(T-R.loaded)/x,j=S.currentTime,W=(Y.BufferHelper.bufferInfo(S,j,O.maxBufferHole).end-j)/w;if(W>=2*A/w||_<=W)return;var C=Number.POSITIVE_INFINITY,F;for(F=i.level-1;F>h;F--){var k=E[F].maxBitrate;if(C=A*k/(8*.8*x),C<W)break}if(C>=_)return;var y=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(q.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+C.toFixed(3)+` s
|
|
Time to underbuffer: `+W.toFixed(3)+" s"),u.nextLoadLevel=F,this.bwEstimator.sample(P,R.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),u.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:R})},c.onFragLoaded=function(i,t){var u=t.frag,o=t.part;if(u.type===r.PlaylistLevelType.MAIN&&Object(q.isFiniteNumber)(u.sn)){var O=o?o.stats:u.stats,S=o?o.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var R=this.hls.levels[u.level],A=(R.loaded?R.loaded.bytes:0)+O.loaded,P=(R.loaded?R.loaded.duration:0)+S;R.loaded={bytes:A,duration:P},R.realBitrate=Math.round(8*A/P)}if(u.bitrateTest){var w={stats:O,frag:u,part:o,id:u.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,w),u.bitrateTest=!1}}},c.onFragBuffered=function(i,t){var u=t.frag,o=t.part,O=o?o.stats:u.stats;if(O.aborted)return;if(u.type!==r.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var S=O.parsing.end-O.loading.start;this.bwEstimator.sample(S,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},c.onError=function(i,t){switch(t.details){case V.ErrorDetails.FRAG_LOAD_ERROR:case V.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,O=u.config,S=u.minAutoLevel,R=u.media,A=t?t.duration:i?i.duration:0,P=R?R.currentTime:0,w=R&&R.playbackRate!==0?Math.abs(R.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,h=(Y.BufferHelper.bufferInfo(R,P,O.maxBufferHole).end-P)/w,f=this.findBestLevel(E,S,o,h,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=A?Math.min(A,O.maxStarvationDelay):O.maxStarvationDelay,x=O.abrBandWidthFactor,_=O.abrBandWidthUpFactor;if(!h){var j=this.bitrateTestDelay;if(j){var W=A?Math.min(A,O.maxLoadingDelay):O.maxLoadingDelay;T=W-j,D.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),x=_=1}}return f=this.findBestLevel(E,S,o,h+T,x,_),Math.max(f,0)},c.findBestLevel=function(i,t,u,o,O,S){for(var R,A=this.fragCurrent,P=this.partCurrent,w=this.lastLoadedFragLevel,E=this.hls.levels,h=E[w],f=!!(h!=null&&(R=h.details)!==null&&R!==void 0&&R.live),T=h==null?void 0:h.codecSet,x=P?P.duration:A?A.duration:0,_=u;_>=t;_--){var j=E[_];if(!j||T&&j.codecSet!==T)continue;var W=j.details,C=(P?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||x,F=void 0;_<=w?F=O*i:F=S*i;var k=E[_].maxBitrate,y=k*C/F;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(F)+"/"+k+"/"+C+"/"+o+"/"+y),F>k&&(!y||f&&!this.bitrateTestDelay||y<o))return _}return-1},p(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=g},"./src/controller/audio-stream-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),M=B("./src/events.ts"),Y=B("./src/utils/buffer-helper.ts"),V=B("./src/controller/fragment-tracker.ts"),r=B("./src/types/level.ts"),D=B("./src/types/loader.ts"),m=B("./src/loader/fragment.ts"),p=B("./src/demux/chunk-cache.ts"),g=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 P=1;P<arguments.length;P++){var w=arguments[P];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(A[E]=w[E])}return A},u.apply(this,arguments)}function o(A,P){A.prototype=Object.create(P.prototype),A.prototype.constructor=A,O(A,P)}function O(A,P){return O=Object.setPrototypeOf||function(E,h){return E.__proto__=h,E},O(A,P)}var S=100,R=function(A){o(P,A);function P(E,h){var f;return f=A.call(this,E,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 w=P.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var h=this.hls;h.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(M.Events.ERROR,this.onError,this),h.on(M.Events.BUFFER_RESET,this.onBufferReset,this),h.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var h=this.hls;h.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(M.Events.ERROR,this.onError,this),h.off(M.Events.BUFFER_RESET,this.onBufferReset,this),h.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(h,f){var T=f.frag,x=f.id,_=f.initPTS;if(x==="main"){var j=T.cc;this.initPTS[T.cc]=_,this.log("InitPTS for cc: "+j+" found from main: "+_),this.videoTrackCC=j,this.state===K.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=K.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),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()},w.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var h,f=this.levels,T=this.trackId,x=f==null||((h=f[T])===null||h===void 0)?void 0:h.details;if(x){if(this.waitForCdnTuneIn(x))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var _,j=performance.now(),W=this.retryDate;(!W||j>=W||(_=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 C=this.waitingData;if(C){var F=C.frag,k=C.part,y=C.cache,H=C.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var J=y.flush(),ae={frag:F,part:k,payload:J,networkDetails:null};this._handleFragmentLoadProgress(ae),H&&A.prototype._handleFragmentLoadComplete.call(this,ae)}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 fe=this.getLoadPosition(),ge=Y.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Te=Object(c.fragmentWithinToleranceTest)(ge.end,this.config.maxFragLookUpTolerance,F);Te<0&&(t.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},w.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:h,T=f.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},w.doTickIdle=function(){var h,f,T=this.hls,x=this.levels,_=this.media,j=this.trackId,W=T.config;if(!x||!x[j])return;if(!_&&(this.startFragRequested||!W.startFragPrefetch))return;var C=x[j],F=C.details;if(!F||F.live&&this.levelLastLoaded!==j||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 k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(k===null)return;var y=k.len,H=this.getMaxBufferLength(),J=this.audioSwitch;if(y>=H&&!J)return;if(!J&&this._streamEnded(k,F)){T.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var ae=F.fragments,fe=ae[0].start,ge=k.end;if(J){var Te=this.getLoadPosition();ge=Te,F.PTSKnown&&Te<fe&&((k.end>fe||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=fe+.05))}var Ue=this.getNextFragment(ge,F);if(!Ue){this.bufferFlushed=!0;return}((h=Ue.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((f=Ue.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Ue,F):this.loadFragment(Ue,F,ge)},w.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)},w.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(h,f){var T=f.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(x){return new r.Level(x)})},w.onAudioTrackSwitching=function(h,f){var T=!!f.url;this.trackId=f.id;var x=this.fragCurrent;x!=null&&x.loader&&x.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(S):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(h,f){this.mainDetails=f.details},w.onAudioTrackLoaded=function(h,f){var T,x=this.levels,_=f.details,j=f.id;if(!x){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var W=x[j],C=0;if(_.live||(T=W.details)!==null&&T!==void 0&&T.live){var F=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!F)return;!W.details&&_.hasProgramDateTime&&F.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(_,F),C=_.fragments[0].start):C=this.alignPlaylists(_,W.details)}W.details=_,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(W.details,C),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=K.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(h){var f,T=h.frag,x=h.part,_=h.payload,j=this.config,W=this.trackId,C=this.levels;if(!C){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var F=C[W];console.assert(F,"Audio track is defined on fragment load progress");var k=F.details;console.assert(k,"Audio track details are defined on fragment load progress");var y=j.defaultAudioCodec||F.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new g.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[T.cc],ae=(f=T.initSegment)===null||f===void 0?void 0:f.data;if(J!==void 0){var fe=!1,ge=x?x.index:-1,Te=ge!==-1,Ue=new a.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,_.byteLength,ge,Te);H.push(_,ae,y,"",T,x,k.totalduration,fe,Ue,J)}else{t.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+W);var Se=this.waitingData=this.waitingData||{frag:T,part:x,cache:new p.default,complete:!1},Le=Se.cache;Le.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,h)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(h,f){var T=f.tracks.audio;T&&(this.mediaBuffer=T.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},w.onFragBuffered=function(h,f){var T=f.frag,x=f.part;if(T.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(x?" p: "+x.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,x)},w.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 T=!0,x=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);x&&x.len>.5&&(T=!this.reduceMaxBufferLength(x.len)),T&&(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}},w.onBufferFlushed=function(h,f){var T=f.type;T===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(h){var f,T="audio",x=this.hls,_=h.remuxResult,j=h.chunkMeta,W=this.getCurrentContext(j);if(!W){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var C=W.frag,F=W.part,k=_.audio,y=_.text,H=_.id3,J=_.initSegment;if(this.fragContextChanged(C))return;if(this.state=K.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,C,j),x.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:T,tracks:J.tracks})),k){var ae=k.startPTS,fe=k.endPTS,ge=k.startDTS,Te=k.endDTS;F&&(F.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:fe,startDTS:ge,endDTS:Te}),C.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ae,fe,ge,Te),this.bufferFragmentData(k,C,F,j)}if(H!=null&&(f=H.samples)!==null&&f!==void 0&&f.length){var Ue=u({frag:C,id:T},H);x.trigger(M.Events.FRAG_PARSING_METADATA,Ue)}if(y){var Se=u({frag:C,id:T},y);x.trigger(M.Events.FRAG_PARSING_USERDATA,Se)}},w._bufferInitSegment=function(h,f,T){if(this.state!==K.State.PARSING)return;h.video&&delete h.video;var x=h.audio;if(!x)return;x.levelCodec=x.codec,x.id="audio",this.log("Init audio buffer, container:"+x.container+", codecs[parsed]=["+x.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,h);var _=x.initSegment;if(_!=null&&_.byteLength){var j={type:"audio",frag:f,part:null,chunkMeta:T,parent:f.type,data:_};this.hls.trigger(M.Events.BUFFER_APPENDING,j)}this.tick()},w.loadFragment=function(h,f,T){var x=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||x===V.FragmentState.NOT_LOADED||x===V.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):f.live&&!Object(q.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,T)))},w.completeAudioSwitch=function(){var h=this.hls,f=this.media,T=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(M.Events.AUDIO_TRACK_SWITCHED,{id:T})},P}(K.default);Q.default=R},"./src/controller/audio-track-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts"),K=B("./src/errors.ts"),M=B("./src/controller/base-playlist-controller.ts"),Y=B("./src/types/loader.ts");function V(g,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(g,s.key,s)}}function r(g,a,c){return a&&V(g.prototype,a),c&&V(g,c),g}function D(g,a){g.prototype=Object.create(a.prototype),g.prototype.constructor=g,m(g,a)}function m(g,a){return m=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},m(g,a)}var p=function(g){D(a,g);function a(s){var i;return i=g.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(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(q.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(q.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(q.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(q.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,g.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,O=this.tracksInGroup[u];if(!O){this.warn("Invalid audio track id "+u);return}var S=O.details;O.details=t.details,this.log("audioTrack "+u+" loaded ["+o.startSN+"-"+o.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,t,S))},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(S){return!u||S.groupId===u});this.selectDefaultTrack&&!o.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var O={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(q.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},c.onError=function(i,t){if(g.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===Y.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],O=o.id,S=o.groupId,R=S===void 0?"":S,A=o.name,P=o.type,w=o.url;if(this.trackId=i,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(q.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:R,name:A,type:P,url:w}),o.details&&!o.details.live)return;var E=this.switchParams(o.url,u==null?void 0:u.details);this.loadPlaylist(E)},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(q.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,O=t.url;if(i)try{O=i.addDirectives(O)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(q.Events.AUDIO_TRACK_LOADING,{url:O,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}(M.default);Q.default=p},"./src/controller/base-playlist-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var q=B("./src/polyfills/number.ts"),K=B("./src/types/level.ts"),M=B("./src/controller/level-helper.ts"),Y=B("./src/utils/logger.ts"),V=B("./src/errors.ts"),r=function(){function D(p,g){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=Y.logger.log.bind(Y.logger,g+":"),this.warn=Y.logger.warn.bind(Y.logger,g+":"),this.hls=p}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(g,a){a.fatal&&a.type===V.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(g,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===g.substr(-t.length)){var u=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var O=Math.min(a.age-a.partTarget,a.targetduration);o!==void 0&&O>a.partTarget&&(o+=1)}if(Object(q.isFiniteNumber)(u))return new K.HlsUrlParameters(u,Object(q.isFiniteNumber)(o)?o:void 0,K.HlsSkip.No)}}},m.loadPlaylist=function(g){},m.shouldLoadTrack=function(g){return this.canLoad&&g&&!!g.url&&(!g.details||g.details.live)},m.playlistLoaded=function(g,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 "+g+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),c&&i.fragments.length>0&&Object(M.mergeDetails)(c,i),!this.canLoad||!i.live)return;var o,O=void 0,S=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var R=this.hls.config.lowLatencyMode,A=i.lastPartSn,P=i.endSN,w=i.lastPartIndex,E=w!==-1,h=A===P,f=R?0:w;E?(O=h?P+1:A,S=h?f:w+1):O=P+1;var T=i.age,x=T+i.ageHeader,_=Math.min(x-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 j=Math.floor(_/i.targetduration);if(O+=j,S!==void 0){var W=Math.round(_%i.targetduration/i.partTarget);S+=W}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+_+" skip sn "+j+" to part "+S)}i.tuneInGoal=_}if(o=this.getDeliveryDirectives(i,a.deliveryDirectives,O,S),R||!h){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,a.deliveryDirectives,O,S);var C=Object(M.computeReloadInterval)(i,t);O!==void 0&&i.canBlockReload&&(C-=i.partTarget||1),this.log("reload live playlist "+g+" in "+Math.round(C)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(o)},C)}else this.clearTimer()},m.getDeliveryDirectives=function(g,a,c,s){var i=Object(K.getSkipValue)(g,c);return a!=null&&a.skip&&g.deltaUpdateFailed&&(c=a.msn,s=a.part,i=K.HlsSkip.No),new K.HlsUrlParameters(c,s,i)},m.retryLoadingOrFail=function(g){var a=this,c=this.hls.config,s=this.retryCount<c.levelLoadingMaxRetry;if(s){var i;if(this.retryCount++,g.details.indexOf("LoadTimeOut")>-1&&(i=g.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+g.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 "'+g.details+'"')}}else this.warn('cannot recover from error "'+g.details+'"'),this.clearTimer(),g.fatal=!0;return s},D}()},"./src/controller/base-stream-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"State",function(){return P}),B.d(Q,"default",function(){return w});var q=B("./src/polyfills/number.ts"),K=B("./src/task-loop.ts"),M=B("./src/controller/fragment-tracker.ts"),Y=B("./src/utils/buffer-helper.ts"),V=B("./src/utils/logger.ts"),r=B("./src/events.ts"),D=B("./src/errors.ts"),m=B("./src/types/transmuxer.ts"),p=B("./src/utils/mp4-tools.ts"),g=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(E,h){for(var f=0;f<h.length;f++){var T=h[f];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}function O(E,h,f){return h&&o(E.prototype,h),f&&o(E,f),E}function S(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function R(E,h){E.prototype=Object.create(h.prototype),E.prototype.constructor=E,A(E,h)}function A(E,h){return A=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},A(E,h)}var P={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"},w=function(E){R(h,E);function h(T,x,_){var j;return j=E.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=P.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=_,j.log=V.logger.log.bind(V.logger,_+":"),j.warn=V.logger.warn.bind(V.logger,_+":"),j.hls=T,j.fragmentLoader=new s.default(T.config),j.fragmentTracker=x,j.config=T.config,j.decrypter=new i.default(T,T.config),T.on(r.Events.KEY_LOADED,j.onKeyLoaded,S(j)),j}var f=h.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(x){},f.stopLoad=function(){this.fragmentLoader.abort();var x=this.fragCurrent;x&&this.fragmentTracker.removeFragment(x),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=P.STOPPED},f._streamEnded=function(x,_){var j=this.fragCurrent,W=this.fragmentTracker;if(!_.live&&j&&j.sn===_.endSN&&!x.nextStart){var C=W.getState(j);return C===M.FragmentState.PARTIAL||C===M.FragmentState.OK}return!1},f.onMediaAttached=function(x,_){var j=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===P.STOPPED&&this.startLoad(W.startPosition)},f.onMediaDetaching=function(){var x=this.media;x!=null&&x.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),x&&(x.removeEventListener("seeking",this.onvseeking),x.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 x=this.config,_=this.fragCurrent,j=this.media,W=this.mediaBuffer,C=this.state,F=j?j.currentTime:0,k=Y.BufferHelper.bufferInfo(W||j,F,x.maxBufferHole);if(this.log("media seeking to "+(Object(q.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+C),C===P.ENDED)this.resetLoadingState();else if(_&&!k.len){var y=x.maxFragLookUpTolerance,H=_.start-y,J=_.start+_.duration+y,ae=F>J;(F<H||ae)&&(ae&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=F),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(x,_){if(this.state!==P.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=P.IDLE;var j=this.levels[_.frag.level].details;j&&this.loadFragment(_.frag,j,_.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=P.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(x,_){this.log("Loading key for "+x.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level),this.state=P.KEY_LOADING,this.fragCurrent=x,this.hls.trigger(r.Events.KEY_LOADING,{frag:x})},f.loadFragment=function(x,_,j){this._loadFragForPlayback(x,_,j)},f._loadFragForPlayback=function(x,_,j){var W=this,C=function(k){if(W.fragContextChanged(x)){W.warn("Fragment "+x.sn+(k.part?" p: "+k.part.index:"")+" of level "+x.level+" was dropped during download."),W.fragmentTracker.removeFragment(x);return}x.stats.chunkCount++,W._handleFragmentLoadProgress(k)};this._doFragLoad(x,_,j,C).then(function(F){if(!F)return;W.fragLoadError=0;var k=W.state;if(W.fragContextChanged(x)){(k===P.FRAG_LOADING||k===P.BACKTRACKING||!W.fragCurrent&&k===P.PARSING)&&(W.fragmentTracker.removeFragment(x),W.state=P.IDLE);return}if("payload"in F&&(W.log("Loaded fragment "+x.sn+" of level "+x.level),W.hls.trigger(r.Events.FRAG_LOADED,F),W.state===P.BACKTRACKING)){W.fragmentTracker.backtrack(x,F),W.resetFragmentLoading(x);return}W._handleFragmentLoadComplete(F)}).catch(function(F){W.warn(F),W.resetFragmentLoading(x)})},f.flushMainBuffer=function(x,_,j){if(j===void 0&&(j=null),!(x-_))return;var W={startOffset:x,endOffset:_,type:j};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,W)},f._loadInitSegment=function(x){var _=this;this._doFragLoad(x).then(function(j){if(!j||_.fragContextChanged(x)||!_.levels)throw new Error("init load aborted");return j}).then(function(j){var W=_.hls,C=j.payload,F=x.decryptdata;if(C&&C.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var k=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(C),F.key.buffer,F.iv.buffer).then(function(y){var H=self.performance.now();return W.trigger(r.Events.FRAG_DECRYPTED,{frag:x,payload:y,stats:{tstart:k,tdecrypt:H}}),j.payload=y,j})}return j}).then(function(j){var W=_.fragCurrent,C=_.hls,F=_.levels;if(!F)throw new Error("init load aborted, missing levels");var k=F[x.level].details;console.assert(k,"Level details are defined when init segment is loaded");var y=x.stats;_.state=P.IDLE,_.fragLoadError=0,x.data=new Uint8Array(j.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),j.frag===W&&C.trigger(r.Events.FRAG_BUFFERED,{stats:y,frag:W,part:null,id:x.type}),_.tick()}).catch(function(j){_.warn(j),_.resetFragmentLoading(x)})},f.fragContextChanged=function(x){var _=this.fragCurrent;return!x||!_||x.level!==_.level||x.sn!==_.sn||x.urlId!==_.urlId},f.fragBufferedComplete=function(x,_){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+x.type+" sn: "+x.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level+" "+t.default.toString(Y.BufferHelper.getBuffered(j))),this.state=P.IDLE,this.tick()},f._handleFragmentLoadComplete=function(x){var _=this.transmuxer;if(!_)return;var j=x.frag,W=x.part,C=x.partsLoaded,F=!C||C.length===0||C.some(function(y){return!y}),k=new m.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,W?W.index:-1,!F);_.flush(k)},f._handleFragmentLoadProgress=function(x){},f._doFragLoad=function(x,_,j,W){var C=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(x.start,j||0),this.config.lowLatencyMode&&_){var F=_.partList;if(F&&W){j>x.end&&_.fragmentHint&&(x=_.fragmentHint);var k=this.getNextPart(F,x,j);if(k>-1){var y=F[k];return this.log("Loading part sn: "+x.sn+" p: "+y.index+" cc: "+x.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+k+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=P.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:x,part:F[k],targetBufferTime:j}),this.doFragPartsLoad(x,F,k,W).catch(function(H){return C.handleFragLoadError(H)})}else if(!x.url||this.loadedEndOfParts(F,j))return Promise.resolve(null)}}return this.log("Loading fragment "+x.sn+" cc: "+x.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(j.toFixed(3))),Object(q.isFiniteNumber)(x.sn)&&!this.bitrateTest&&(this.nextLoadPosition=x.start+x.duration),this.state=P.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:x,targetBufferTime:j}),this.fragmentLoader.load(x,W).catch(function(H){return C.handleFragLoadError(H)})},f.doFragPartsLoad=function(x,_,j,W){var C=this;return new Promise(function(F,k){var y=[],H=function J(ae){var fe=_[ae];C.fragmentLoader.loadPart(x,fe,W).then(function(ge){y[fe.index]=ge;var Te=ge.part;C.hls.trigger(r.Events.FRAG_LOADED,ge);var Ue=_[ae+1];if(Ue&&Ue.fragment===x)J(ae+1);else return F({frag:x,part:Te,partsLoaded:y})}).catch(k)};H(j)})},f.handleFragLoadError=function(x){var _=x.data;return _&&_.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(r.Events.ERROR,_),null},f._handleTransmuxerFlush=function(x){var _=this.getCurrentContext(x);if(!_||this.state!==P.PARSING){this.fragCurrent||(this.state=P.IDLE);return}var j=_.frag,W=_.part,C=_.level,F=self.performance.now();j.stats.parsing.end=F,W&&(W.stats.parsing.end=F),this.updateLevelTiming(j,W,C,x.partial)},f.getCurrentContext=function(x){var _=this.levels,j=x.level,W=x.sn,C=x.part;if(!_||!_[j])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+j+". The current chunk will not be buffered."),null;var F=_[j],k=C>-1?Object(c.getPartWith)(F,W,C):null,y=k?k.fragment:Object(c.getFragmentWithSN)(F,W,this.fragCurrent);return y?{frag:y,part:k,level:F}:null},f.bufferFragmentData=function(x,_,j,W){if(!x||this.state!==P.PARSING)return;var C=x.data1,F=x.data2,k=C;if(C&&F&&(k=Object(p.appendUint8Array)(C,F)),!k||!k.length)return;var y={type:x.type,frag:_,part:j,chunkMeta:W,parent:_.type,data:k};this.hls.trigger(r.Events.BUFFER_APPENDING,y),x.dropped&&x.independent&&!j&&this.flushBufferGap(_)},f.flushBufferGap=function(x){var _=this.media;if(!_)return;if(!Y.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,x.start);return}var j=_.currentTime,W=Y.BufferHelper.bufferInfo(_,j,0),C=x.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,C*.25),k=Math.max(Math.min(x.start-F,W.end-F),j+F);x.start-k>F&&this.flushMainBuffer(k,x.start)},f.getFwdBufferInfo=function(x,_){var j=this.config,W=this.getLoadPosition();if(!Object(q.isFiniteNumber)(W))return null;var C=Y.BufferHelper.bufferInfo(x,W,j.maxBufferHole);if(C.len===0&&C.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(W,_);if(F&&C.nextStart<F.end)return Y.BufferHelper.bufferInfo(x,W,Math.max(C.nextStart,j.maxBufferHole))}return C},f.getMaxBufferLength=function(x){var _=this.config,j;return x?j=Math.max(8*_.maxBufferSize/x,_.maxBufferLength):j=_.maxBufferLength,Math.min(j,_.maxMaxBufferLength)},f.reduceMaxBufferLength=function(x){var _=this.config,j=x||_.maxBufferLength;return _.maxMaxBufferLength>=j?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(x,_){var j,W,C=_.fragments,F=C.length;if(!F)return null;var k=this.config,y=C[0].start,H;if(_.live){var J=k.initialLiveManifestSize;if(F<J)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+J+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(_,C),this.startPosition=H?this.hls.liveSyncPosition||H.start:x)}else x<=y&&(H=C[0]);if(!H){var ae=k.lowLatencyMode?_.partEnd:_.fragmentEnd;H=this.getFragmentAtPosition(x,ae,_)}return(j=H)!==null&&j!==void 0&&j.initSegment&&!((W=H)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},f.getNextPart=function(x,_,j){for(var W=-1,C=!1,F=!0,k=0,y=x.length;k<y;k++){var H=x[k];if(F=F&&!H.independent,W>-1&&j<H.start)break;var J=H.loaded;!J&&(C||H.independent||F)&&H.fragment===_&&(W=k),C=J}return W},f.loadedEndOfParts=function(x,_){var j=x[x.length-1];return j&&_>j.start&&j.loaded},f.getInitialLiveFragment=function(x,_){var j=this.fragPrevious,W=null;if(j){if(x.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),W=Object(a.findFragmentByPDT)(_,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var C=j.sn+1;if(C>=x.startSN&&C<=x.endSN){var F=_[C-x.startSN];j.cc===F.cc&&(W=F,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(a.findFragWithCC)(_,j.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(W=this.getFragmentAtPosition(k,this.bitrateTest?x.fragmentEnd:x.edge,x))}return W},f.getFragmentAtPosition=function(x,_,j){var W=this.config,C=this.fragPrevious,F=j.fragments,k=j.endSN,y=j.fragmentHint,H=W.maxFragLookUpTolerance,J=!!(W.lowLatencyMode&&j.partList&&y);J&&y&&!this.bitrateTest&&(F=F.concat(y),k=y.sn);var ae;if(x<_){var fe=x>_-H?0:H;ae=Object(a.findFragmentByPTS)(C,F,x,fe)}else ae=F[F.length-1];if(ae){var ge=ae.sn-j.startSN,Te=C&&ae.level===C.level,Ue=F[ge+1],Se=this.fragmentTracker.getState(ae);if(Se===M.FragmentState.BACKTRACKED){ae=null;for(var Le=ge;F[Le]&&this.fragmentTracker.getState(F[Le])===M.FragmentState.BACKTRACKED;)C?ae=F[Le--]:ae=F[--Le];ae||(ae=Ue)}else C&&ae.sn===C.sn&&!J&&(Te&&(ae.sn<k&&this.fragmentTracker.getState(Ue)!==M.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Ue.sn),ae=Ue):ae=null))}return ae},f.synchronizeToLiveEdge=function(x){var _=this.config,j=this.media;if(!j)return;var W=this.hls.liveSyncPosition,C=j.currentTime,F=x.fragments[0].start,k=x.edge,y=C>=F-_.maxFragLookUpTolerance&&C<=k;if(W!==null&&j.duration>W&&(C<W||!y)){var H=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*x.targetduration;(!y&&j.readyState<4||C<k-H)&&(this.loadedmetadata||(this.nextLoadPosition=W),j.readyState&&(this.warn("Playback: "+C.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+W.toFixed(3)),j.currentTime=W))}},f.alignPlaylists=function(x,_){var j=this.levels,W=this.levelLastLoaded,C=this.fragPrevious,F=W!==null?j[W]:null,k=x.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var y=x.fragments[0].start,H=!_,J=x.alignedSliding&&Object(q.isFiniteNumber)(y);if(H||!J&&!y){Object(g.alignStream)(C,F,x);var ae=x.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+x.startSN+" prev-sn: "+(C?C.sn:"na")+" fragments: "+k),ae}return y},f.waitForCdnTuneIn=function(x){var _=3;return x.live&&x.canBlockReload&&x.tuneInGoal>Math.max(x.partHoldBack,x.partTarget*_)},f.setStartPosition=function(x,_){var j=this.startPosition;if(j<_&&(j=-1),j===-1||this.lastCurrentTime===-1){var W=x.startTimeOffset;Object(q.isFiniteNumber)(W)?(j=_+W,W<0&&(j+=x.totalduration),j=Math.min(Math.max(_,j),_+x.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+j),this.startPosition=j):x.live?j=this.hls.liveSyncPosition||_:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},f.getLoadPosition=function(){var x=this.media,_=0;return this.loadedmetadata&&x?_=x.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},f.handleFragLoadAborted=function(x,_){this.transmuxer&&x.sn!=="initSegment"&&x.stats.aborted&&(this.warn("Fragment "+x.sn+(_?" part"+_.index:"")+" of level "+x.level+" was aborted"),this.resetFragmentLoading(x))},f.resetFragmentLoading=function(x){(!this.fragCurrent||!this.fragContextChanged(x))&&(this.state=P.IDLE)},f.onFragmentOrKeyLoadError=function(x,_){if(_.fatal)return;var j=_.frag;if(!j||j.type!==x)return;var W=this.fragCurrent;console.assert(W&&j.sn===W.sn&&j.level===W.level&&j.urlId===W.urlId,"Frag load error must match current frag to retry");var C=this.config;if(this.fragLoadError+1<=C.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*C.fragLoadingRetryDelay,C.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+x+" "+j.level+" failed to load, retrying in "+F+"ms"),this.retryDate=self.performance.now()+F,this.fragLoadError++,this.state=P.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(x===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=P.IDLE):(V.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=P.ERROR)},f.afterBufferFlushed=function(x,_,j){if(!x)return;var W=Y.BufferHelper.getBuffered(x);this.fragmentTracker.detectEvictedFragments(_,W,j),this.state===P.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=P.IDLE},f.resetLiveStartWhenNotLoaded=function(x){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[x].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(x,_,j,W){var C=this,F=j.details;console.assert(!!F,"level.details must be defined");var k=Object.keys(x.elementaryStreams).reduce(function(y,H){var J=x.elementaryStreams[H];if(J){var ae=J.endPTS-J.startPTS;if(ae<=0)return C.warn("Could not parse fragment "+x.sn+" "+H+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),C.resetTransmuxer(),y||!1;var fe=W?0:Object(c.updateFragPTSDTS)(F,x,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return C.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:F,level:j,drift:fe,type:H,frag:x,start:J.startPTS,end:J.endPTS}),!0}return y},!1);k?(this.state=P.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:x,part:_})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(h,[{key:"state",get:function(){return this._state},set:function(x){var _=this._state;_!==x&&(this._state=x,this.log(_+"->"+x))}}]),h}(K.default)},"./src/controller/buffer-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var q=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),M=B("./src/utils/logger.ts"),Y=B("./src/errors.ts"),V=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"),p=Object(r.getMediaSource)(),g=/([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,O=t.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),o&&(t.updateMediaElementDuration(),u.trigger(K.Events.MEDIA_ATTACHED,{media:o})),O&&O.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var 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,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(t,u){var o=this.media=u.media;if(o&&p){var O=this.mediaSource=new p;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(O),this._objectUrl=o.src}},s.onMediaDetaching=function(){var t=this.media,u=this.mediaSource,o=this._objectUrl;if(u){if(M.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(O){M.logger.warn("[buffer-controller]: onMediaDetaching: "+O.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()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(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(O){M.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",O)}}),this._initSourceBuffer()},s.onBufferCodecs=function(t,u){var o=this,O=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(S){if(O){var R=o.tracks[S];if(R&&typeof R.buffer.changeType=="function"){var A=u[S],P=A.codec,w=A.levelCodec,E=A.container,h=(R.levelCodec||R.codec).replace(g,"$1"),f=(w||P).replace(g,"$1");if(h!==f){var T=E+";codecs="+(w||P);o.appendChangeType(S,T)}}}else o.pendingTracks[S]=u[S]}),O)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,O=this.operationQueue,S={execute:function(){var A=o.sourceBuffer[t];A&&(M.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+u),A.changeType(u)),O.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(A){M.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",A)}};O.append(S,t)},s.onBufferAppending=function(t,u){var o=this,O=this.hls,S=this.operationQueue,R=this.tracks,A=u.data,P=u.type,w=u.frag,E=u.part,h=u.chunkMeta,f=h.buffering[P],T=self.performance.now();f.start=T;var x=w.stats.buffering,_=E?E.stats.buffering:null;x.start===0&&(x.start=T),_&&_.start===0&&(_.start=T);var j=R.audio,W=P==="audio"&&h.id===1&&(j==null?void 0:j.container)==="audio/mpeg",C={execute:function(){if(f.executeStart=self.performance.now(),W){var k=o.sourceBuffer[P];if(k){var y=w.start-k.timestampOffset;Math.abs(y)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+y+") sn: "+w.sn+")"),k.timestampOffset=w.start)}}o.appendExecutor(A,P)},onStart:function(){},onComplete:function(){var k=self.performance.now();f.executeEnd=f.end=k,x.first===0&&(x.first=k),_&&_.first===0&&(_.first=k);var y=o.sourceBuffer,H={};for(var J in y)H[J]=V.BufferHelper.getBuffered(y[J]);o.appendError=0,o.hls.trigger(K.Events.BUFFER_APPENDED,{type:P,frag:w,part:E,chunkMeta:h,parent:w.type,timeRanges:H})},onError:function(k){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+P+" SourceBuffer",k);var y={type:Y.ErrorTypes.MEDIA_ERROR,parent:w.type,details:Y.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=Y.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,y.details=Y.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>O.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),O.trigger(K.Events.ERROR,y)}};S.append(C,P)},s.onBufferFlushing=function(t,u){var o=this,O=this.operationQueue,S=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(w){M.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",w)}}};u.type?O.append(S(u.type),u.type):this.getSourceBufferTypes().forEach(function(R){O.append(S(R),R)})},s.onFragParsed=function(t,u){var o=this,O=u.frag,S=u.part,R=[],A=S?S.elementaryStreams:O.elementaryStreams;A[D.ElementaryStreamTypes.AUDIOVIDEO]?R.push("audiovideo"):(A[D.ElementaryStreamTypes.AUDIO]&&R.push("audio"),A[D.ElementaryStreamTypes.VIDEO]&&R.push("video"));var P=function(){var E=self.performance.now();O.stats.buffering.end=E,S&&(S.stats.buffering.end=E);var h=S?S.stats:O.stats;o.hls.trigger(K.Events.FRAG_BUFFERED,{frag:O,part:S,stats:h,id:O.type})};R.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(P,R)},s.onFragChanged=function(t,u){this.flushBackBuffer()},s.onBufferEos=function(t,u){var o=this,O=this.getSourceBufferTypes().reduce(function(S,R){var A=o.sourceBuffer[R];return(!u.type||u.type===R)&&(A&&!A.ended&&(A.ended=!0,M.logger.log("[buffer-controller]: "+R+" sourceBuffer now EOS"))),S&&!!(!A||A.ended)},!0);O&&this.blockBuffers(function(){var S=o.mediaSource;if(!S||S.readyState!=="open")return;S.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,O=this.sourceBuffer;if(!o||u===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var R=u.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(q.isFiniteNumber)(R)||R<0)return;var A=o.currentTime,P=u.levelTargetDuration,w=Math.max(R,P),E=Math.floor(A/P)*P-w;S.forEach(function(h){var f=O[h];if(f){var T=V.BufferHelper.getBuffered(f);T.length>0&&E>T.start(0)&&(t.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),u.live&&t.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),t.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,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,O=this.mediaSource,S=t.fragments[0].start+t.totalduration,R=o.duration,A=Object(q.isFiniteNumber)(O.duration)?O.duration:0;t.live&&u.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(t)):(S>A&&S>R||!Object(q.isFiniteNumber)(R))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),O.duration=S)},s.updateSeekableRange=function(t){var u=this.mediaSource,o=t.fragments,O=o.length;if(O&&t.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var S=Math.max(0,o[0].start),R=Math.max(S,S+t.totalduration);u.setLiveSeekableRange(S,R)}},s.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,u=this.operationQueue,o=this.pendingTracks,O=Object.keys(o).length;if(O&&!t||O===2){this.createSourceBuffers(o),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(K.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(R){u.executeNext(R)})}},s.createSourceBuffers=function(t){var u=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var S in t)if(!u[S]){var R=t[S];if(!R)throw Error("source buffer exists for track "+S+", however track does not");var A=R.levelCodec||R.codec,P=R.container+";codecs="+A;M.logger.log("[buffer-controller]: creating sourceBuffer("+P+")");try{var w=u[S]=o.addSourceBuffer(P),E=S;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[S]={buffer:w,codec:A,container:R.container,levelCodec:R.levelCodec,id:R.id},O++}catch(h){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(K.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:P})}}O&&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){M.logger.error("[buffer-controller]: "+t+" SourceBuffer error",u),this.hls.trigger(K.Events.ERROR,{type:Y.ErrorTypes.MEDIA_ERROR,details:Y.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(t);o&&o.onError(u)},s.removeExecutor=function(t,u,o){var O=this.media,S=this.mediaSource,R=this.operationQueue,A=this.sourceBuffer,P=A[t];if(!O||!S||!P){M.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),R.shiftAndExecuteNext(t);return}var w=Object(q.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(q.isFiniteNumber)(S.duration)?S.duration:Infinity,h=Math.max(0,u),f=Math.min(o,w,E);f>h?(M.logger.log("[buffer-controller]: Removing ["+h+","+f+"] from the "+t+" SourceBuffer"),console.assert(!P.updating,t+" sourceBuffer must not be updating"),P.remove(h,f)):R.shiftAndExecuteNext(t)},s.appendExecutor=function(t,u){var o=this.operationQueue,O=this.sourceBuffer,S=O[u];if(!S){M.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(u);return}S.ended=!1,console.assert(!S.updating,u+" sourceBuffer must not be updating"),S.appendBuffer(t)},s.blockBuffers=function(t,u){var o=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var O=this.operationQueue,S=u.map(function(R){return O.appendBlocker(R)});Promise.all(S).then(function(){t(),u.forEach(function(R){var A=o.sourceBuffer[R];(!A||!A.updating)&&O.shiftAndExecuteNext(R)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(t,u,o){var O=this.sourceBuffer[t];if(!O)return;var S=o.bind(this,t);this.listeners[t].push({event:u,listener:S}),O.addEventListener(u,S)},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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return K});var q=B("./src/utils/logger.ts"),K=function(){function M(V){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=V}var Y=M.prototype;return Y.append=function(r,D){var m=this.queues[D];m.push(r),m.length===1&&this.buffers[D]&&this.executeNext(D)},Y.insertAbort=function(r,D){var m=this.queues[D];m.unshift(r),this.executeNext(D)},Y.appendBlocker=function(r){var D,m=new Promise(function(g){D=g}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,r),m},Y.executeNext=function(r){var D=this.buffers,m=this.queues,p=D[r],g=m[r];if(g.length){var a=g[0];try{a.execute()}catch(c){q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(c),(!p||!p.updating)&&(g.shift(),this.executeNext(r))}}},Y.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},Y.current=function(r){return this.queues[r][0]},M}()},"./src/controller/cap-level-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts");function K(V,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(V,m.key,m)}}function M(V,r,D){return r&&K(V.prototype,r),D&&K(V,D),V}var Y=function(){function V(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=V.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(q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(q.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var m=this.hls;m.off(q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(q.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(m,p){V.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},r.onMediaAttaching=function(m,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},r.onManifestParsed=function(m,p){var g=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,g.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onBufferCodecs=function(m,p){var g=this.hls;g.config.capLevelToPlayerSize&&p.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 p=this.hls;p.autoLevelCapping=this.getMaxLevel(m.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},r.getMaxLevel=function(m){var p=this,g=this.hls.levels;if(!g.length)return-1;var a=g.filter(function(c,s){return V.isLevelAllowed(s,p.restrictedLevels)&&s<=m});return this.clientRect=null,V.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,p={width:0,height:0};if(m){var g=m.getBoundingClientRect();p.width=g.width,p.height=g.height,!p.width&&!p.height&&(p.width=g.right-g.left||m.width||0,p.height=g.bottom-g.top||m.height||0)}return this.clientRect=p,p},V.isLevelAllowed=function(m,p){return p===void 0&&(p=[]),p.indexOf(m)===-1},V.getMaxLevelByMediaSize=function(m,p,g){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>=p||i.height>=g)&&a(i,m[s+1])){c=s;break}}return c},M(V,[{key:"mediaWidth",get:function(){return this.getDimensions().width*V.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*V.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(p){}return m}}]),V}();Q.default=Y},"./src/controller/cmcd-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var q=B("./src/events.ts"),K=B("./src/types/cmcd.ts"),M=B("./src/utils/buffer-helper.ts"),Y=B("./src/utils/logger.ts");function V(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&&V(c.prototype,s),i&&V(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 p(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 p(c,s)}function p(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 g(){return g=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},g.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(O){try{t.apply(O,{ot:K.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(S){Y.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(O){try{var S=O.frag,R=t.hls.levels[S.level],A=t.getObjectType(S),P={d:S.duration*1e3,ot:A};(A===K.CMCDObjectType.VIDEO||A===K.CMCDObjectType.AUDIO||A==K.CMCDObjectType.MUXED)&&(P.br=R.bitrate/1e3,P.tb=t.getTopBandwidth(A),P.bl=t.getBufferLength(A)),t.apply(O,P)}catch(w){Y.logger.warn("Could not generate segment CMCD data.",w)}},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(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(q.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(q.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var t=this.hls;t.off(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(q.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(q.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},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,O;this.audioBuffer=(o=u.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(O=u.tracks.video)===null||O===void 0?void 0:O.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={}),g(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 O=c.toHeaders(u);if(!Object.keys(O).length)return;t.headers||(t.headers={}),g(t.headers,O)}else{var S=c.toQuery(u);if(!S)return;t.url=c.appendQueryToUri(t.url,S)}},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,O=D(o),S;!(S=O()).done;){var R=S.value;R.bitrate>u&&(u=R.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 O=M.BufferHelper.bufferInfo(o,u.currentTime,this.config.maxBufferHole);return O.len*1e3},s.createPlaylistLoader=function(){var t=this.config.pLoader,u=this.applyPlaylistData,o=t||this.config.loader;return function(){function O(R){this.loader=void 0,this.loader=new o(R)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,P,w){u(A),this.loader.load(A,P,w)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},s.createFragmentLoader=function(){var t=this.config.fLoader,u=this.applyFragmentData,o=t||this.config.loader;return function(){function O(R){this.loader=void 0,this.loader=new o(R)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,P,w){u(A),this.loader.load(A,P,w)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},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(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},O=function(W){return Math.round(W)},S=function(W){return O(W/100)*100},R=function(W){return encodeURIComponent(W)},A={br:O,d:O,bl:S,dl:S,mtp:S,nor:R,rtp:S,tb:O},P=Object.keys(t||{}).sort(),w=D(P),E;!(E=w()).done;){var h=E.value,f=t[h];if(!o(f))continue;if(h==="v"&&f===1)continue;if(h=="pr"&&f===1)continue;var T=A[h];T&&(f=T(f));var x=typeof f,_=void 0;h==="ot"||h==="sf"||h==="st"?_=h+"="+f:x==="boolean"?_=h:x==="number"?_=h+"="+f:_=h+"="+JSON.stringify(f),u.push(_)}return u.join(",")},c.toHeaders=function(t){for(var u=Object.keys(t),o={},O=["Object","Request","Session","Status"],S=[{},{},{},{}],R={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,P=u;A<P.length;A++){var w=P[A],E=R[w]!=null?R[w]:1;S[E][w]=t[w]}for(var h=0;h<S.length;h++){var f=c.serialize(S[h]);f&&(o["CMCD-"+O[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(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts"),K=B("./src/errors.ts"),M=B("./src/utils/logger.ts"),Y=B("./src/utils/mediakeys-helper.ts");function V(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&&V(a.prototype,c),s&&V(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]},p=function(c,s,i,t){switch(c){case Y.KeySystems.WIDEVINE:return m(s,i,t);default:throw new Error("Unknown key-system: "+c)}},g=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(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(i){switch(i){case Y.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,O=p(i,t,u,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(i,O);this.mediaKeysPromise=S.then(function(R){return o._onMediaKeySystemAccessObtained(i,R)}),S.catch(function(R){M.logger.error('Failed to obtain key-system "'+i+'" access:',R)})},c._onMediaKeySystemAccessObtained=function(i,t){var u=this;M.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var O=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(S){return o.mediaKeys=S,M.logger.log('Media-keys created for key-system "'+i+'"'),u._onMediaKeysCreated(),S});return O.catch(function(S){M.logger.error("Failed to create media-keys:",S)}),O},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;M.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(u){t._onKeySessionMessage(i,u.message)},!1)},c._onKeySessionMessage=function(i,t){M.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(u){M.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),i.update(u)})},c.onMediaEncrypted=function(i){var t=this;if(M.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(O){if(!t._media)return;t._attemptSetMediaKeys(O),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){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.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){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var O=o.mediaKeysSession;if(!O){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,O.generateRequest(i,t).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(S){M.logger.error("Error generating key-session request:",S),u.hls.trigger(q.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 O=this._licenseXhrSetup;if(O)try{O.call(this.hls,o,i),O=void 0}catch(S){M.logger.error(S)}try{o.readyState||o.open("POST",i,!0),O&&O.call(this.hls,o,i)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return o},c._onLicenseRequestReadyStageChange=function(i,t,u,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var O=i.response,S=this._licenseResponseCallback;if(S)try{O=S.call(this.hls,i,t)}catch(A){M.logger.error(A)}o(O)}else{if(M.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(u,o)}break}},c._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case Y.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},c._requestLicense=function(i,t){M.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(q.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),O=this._createLicenseXhr(o,i,t);M.logger.log("Sending license request to URL: "+o);var S=this._generateLicenseRequestChallenge(u,i);O.send(S)}catch(R){M.logger.error("Failure requesting DRM license: "+R),this.hls.trigger(q.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(O){return O.audioCodec}).filter(function(O){return!!O}),o=t.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(Y.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=g},"./src/controller/fps-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts"),K=B("./src/utils/logger.ts"),M=function(){function Y(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 V=Y.prototype;return V.setStreamController=function(D){this.streamController=D},V.registerListeners=function(){this.hls.on(q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},V.unregisterListeners=function(){this.hls.off(q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},V.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},V.onMediaAttaching=function(D,m){var p=this.hls.config;if(p.capLevelOnFPSDrop){var g=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=g,g&&typeof g.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},V.checkFPS=function(D,m,p){var g=performance.now();if(m){if(this.lastTime){var a=g-this.lastTime,c=p-this.lastDroppedFrames,s=m-this.lastDecodedFrames,i=1e3*c/a,t=this.hls;if(t.trigger(q.Events.FPS_DROP,{currentDropped:c,currentDecoded:s,totalDroppedFrames:p}),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(q.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:t.currentLevel}),t.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=g,this.lastDroppedFrames=p,this.lastDecodedFrames=m}},V.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)},Y}();Q.default=M},"./src/controller/fragment-finders.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"findFragmentByPDT",function(){return M}),B.d(Q,"findFragmentByPTS",function(){return Y}),B.d(Q,"fragmentWithinToleranceTest",function(){return V}),B.d(Q,"pdtWithinToleranceTest",function(){return r}),B.d(Q,"findFragWithCC",function(){return D});var q=B("./src/polyfills/number.ts"),K=B("./src/utils/binary-search.ts");function M(m,p,g){if(p===null||!Array.isArray(m)||!m.length||!Object(q.isFiniteNumber)(p))return null;var a=m[0].programDateTime;if(p<(a||0))return null;var c=m[m.length-1].endProgramDateTime;if(p>=(c||0))return null;g=g||0;for(var s=0;s<m.length;++s){var i=m[s];if(r(p,g,i))return i}return null}function Y(m,p,g,a){g===void 0&&(g=0),a===void 0&&(a=0);var c=null;if(m?c=p[m.sn-p[0].sn+1]||null:g===0&&p[0].start===0&&(c=p[0]),c&&V(g,a,c)===0)return c;var s=K.default.search(p,V.bind(null,g,a));return s||c}function V(m,p,g){m===void 0&&(m=0),p===void 0&&(p=0);var a=Math.min(p,g.duration+(g.deltaPTS?g.deltaPTS:0));return g.start+g.duration-a<=m?1:g.start-a>m&&g.start?-1:0}function r(m,p,g){var a=Math.min(p,g.duration+(g.deltaPTS?g.deltaPTS:0))*1e3,c=g.endProgramDateTime||0;return c-a>m}function D(m,p){return K.default.search(m,function(g){return g.cc<p?1:g.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"FragmentState",function(){return M}),B.d(Q,"FragmentTracker",function(){return Y});var q=B("./src/events.ts"),K=B("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var Y=function(){function D(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var m=D.prototype;return m._registerListeners=function(){var g=this.hls;g.on(q.Events.BUFFER_APPENDED,this.onBufferAppended,this),g.on(q.Events.FRAG_BUFFERED,this.onFragBuffered,this),g.on(q.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var g=this.hls;g.off(q.Events.BUFFER_APPENDED,this.onBufferAppended,this),g.off(q.Events.FRAG_BUFFERED,this.onFragBuffered,this),g.off(q.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(g,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<=g&&u!==void 0&&g<=u)return i>9&&(this.activeParts=s.slice(i-9)),t}else if(c.start<=g&&c.appendedPTS!==void 0&&g<=c.appendedPTS)return c}return this.getBufferedFrag(g,a)},m.getBufferedFrag=function(g,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<=g&&g<=u.end)return u}}return null},m.detectEvictedFragments=function(g,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[g];if(!u)return;u.time.some(function(o){var O=!s.isTimeBuffered(o.startPTS,o.endPTS,a);return O&&s.removeFragment(t.body),O})})},m.detectPartialFragments=function(g){var a=this,c=this.timeRanges,s=g.frag,i=g.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 O=s.elementaryStreams[o];if(!O)return;var S=c[o],R=i!==null||O.partial===!0;u.range[o]=a.getBufferedTimes(s,i,R,S)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},m.fragBuffered=function(g){var a=r(g),c=this.fragments[a];c&&(c.backtrack=c.loaded=null,c.buffered=!0)},m.getBufferedTimes=function(g,a,c,s){for(var i={time:[],partial:c},t=a?a.start:g.start,u=a?a.end:g.end,o=g.minEndPTS||u,O=g.maxStartPTS||t,S=0;S<s.length;S++){var R=s.start(S)-this.bufferPadding,A=s.end(S)+this.bufferPadding;if(O>=R&&o<=A){i.time.push({startPTS:Math.max(t,s.start(S)),endPTS:Math.min(u,s.end(S))});break}else if(t<A&&u>R)i.partial=!0,i.time.push({startPTS:Math.max(t,s.start(S)),endPTS:Math.min(u,s.end(S))});else if(u<=R)break}return i},m.getPartialFragment=function(g){var a=null,c,s,i,t=0,u=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(O){var S=o[O];if(!S)return;V(S)&&(s=S.body.start-u,i=S.body.end+u,g>=s&&g<=i&&(c=Math.min(g-s,i-g),t<=c&&(a=S.body,t=c)))}),a},m.getState=function(g){var a=r(g),c=this.fragments[a];return c?c.buffered?V(c)?M.PARTIAL:M.OK:c.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},m.backtrack=function(g,a){var c=r(g),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(g){var a=r(g),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(g)}return null},m.isTimeBuffered=function(g,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,g>=s&&a<=i)return!0;if(a<=s)return!1}return!1},m.onFragLoaded=function(g,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(g,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 O=t[o];if(c.detectEvictedFragments(o,O),!i)for(var S=0;S<O.length;S++)s.appendedPTS=Math.max(O.end(S),s.appendedPTS||0)})},m.onFragBuffered=function(g,a){this.detectPartialFragments(a)},m.hasFragment=function(g){var a=r(g);return!!this.fragments[a]},m.removeFragmentsInRange=function(g,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>g&&s.removeFragment(u)}})},m.removeFragment=function(g){var a=r(g);g.stats.loaded=0,g.clearElementaryStreamInfo(),delete this.fragments[a]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function V(D){var m,p;return D.buffered&&(((m=D.range.video)===null||m===void 0?void 0:m.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function r(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return V}),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 p});var q=B("./src/utils/buffer-helper.ts"),K=B("./src/errors.ts"),M=B("./src/events.ts"),Y=B("./src/utils/logger.ts"),V=250,r=2,D=.1,m=.05,p=function(){function g(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=g.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,O=t.seeking,S=this.seeking&&!O,R=!this.seeking&&O;if(this.seeking=O,o!==s){if(this.moved=!0,u!==null){if(this.stallReported){var A=self.performance.now()-u;Y.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((R||S)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!q.BufferHelper.getBuffered(t).length)return;var P=q.BufferHelper.bufferInfo(t,o,0),w=P.len>0,E=P.nextStart||0;if(!w&&!E)return;if(O){var h=P.len>r,f=!E||E-o>r&&!this.fragmentTracker.getPartialFragment(o);if(h||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,x=Math.max(E,P.start||0)-o,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=_==null||((T=_.details)===null||T===void 0)?void 0:T.live,W=j?_.details.targetduration*2:r;if(x>0&&x<=W){this._trySkipBufferHole(null);return}}var C=self.performance.now();if(u===null){this.stalled=C;return}var F=C-u;!O&&F>=V&&this._reportStall(P.len);var k=q.BufferHelper.bufferInfo(t,o,i.maxBufferHole);this._tryFixBufferStall(k,F)},a._tryFixBufferStall=function(s,i){var t=this.config,u=this.fragmentTracker,o=this.media,O=o.currentTime,S=u.getPartialFragment(O);if(S){var R=this._trySkipBufferHole(S);if(R)return}s.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&(Y.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,Y.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+s+")"),i.trigger(M.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,O=0,S=q.BufferHelper.getBuffered(u),R=0;R<S.length;R++){var A=S.start(R);if(o+i.maxBufferHole>=O&&o<A){var P=Math.max(A+m,u.currentTime+D);return Y.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+P),this.moved=!0,this.stalled=null,u.currentTime=P,s&&t.trigger(M.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 "+P,frag:s}),P}O=S.end(R)}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 O=u+o*s.nudgeOffset;Y.logger.warn("Nudging 'currentTime' from "+u+" to "+O),t.currentTime=O,i.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else Y.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+s.nudgeMaxRetry+" nudges"),i.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},g}()},"./src/controller/id3-track-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),M=B("./src/demux/id3.ts"),Y=.25,V=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 p=this.hls;p.on(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var p=this.hls;p.off(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(p,g){this.media=g.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(K.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(p){if(!this.media)return;for(var g=0;g<p.length;g++){var a=p[g];if(a.kind==="metadata"&&a.label==="id3")return Object(K.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,g){if(!this.media)return;var a=g.frag,c=g.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=M.getID3Frames(c[i].data);if(t){var u=c[i].pts,o=i<c.length-1?c[i+1].pts:a.end,O=o-u;O<=0&&(o=u+Y);for(var S=0;S<t.length;S++){var R=t[S];if(!M.isTimeStampFrame(R)){var A=new s(u,o,"");A.value=R,this.id3Track.addCue(A)}}}}},D.onBufferFlushing=function(p,g){var a=g.startOffset,c=g.endOffset,s=g.type;if(!s||s==="audio"){var i=this.id3Track;i&&Object(K.removeCuesInRange)(i,a,c)}},r}();Q.default=V},"./src/controller/latency-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var q=B("./src/errors.ts"),K=B("./src/events.ts"),M=B("./src/utils/logger.ts");function Y(D,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(D,g.key,g)}}function V(D,m,p){return m&&Y(D.prototype,m),p&&Y(D,p),D}var r=function(){function D(p){var g=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 g.timeupdate()},this.hls=p,this.config=p.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(g,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(g,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(g,a){if(a.details!==q.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var g=this.media,a=this.levelDetails;if(!g||!a)return;this.currentTime=g.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,O=Math.min(this.maxLatency,u+a.targetduration),S=o<O;if(a.live&&S&&o>.05&&this.forwardBufferLength>1){var R=Math.min(2,Math.max(1,t)),A=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;g.playbackRate=Math.min(R,Math.max(1,A))}else g.playbackRate!==1&&g.playbackRate!==0&&(g.playbackRate=1)},m.estimateLiveEdge=function(){var g=this.levelDetails;return g===null?null:g.edge+g.age},m.computeLatency=function(){var g=this.estimateLiveEdge();return g===null?null:g-this.currentTime},V(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var g=this.config,a=this.levelDetails;return g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:a?g.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var g=this.levelDetails;if(g===null)return null;var a=g.holdBack,c=g.partHoldBack,s=g.targetduration,i=this.config,t=i.liveSyncDuration,u=i.liveSyncDurationCount,o=i.lowLatencyMode,O=this.hls.userConfig,S=o&&c||a;(O.liveSyncDuration||O.liveSyncDurationCount||S===0)&&(S=t!==void 0?t:u*s);var R=s,A=1;return S+Math.min(this.stallCount*A,R)}},{key:"liveSyncPosition",get:function(){var g=this.estimateLiveEdge(),a=this.targetLatency,c=this.levelDetails;if(g===null||a===null||c===null)return null;var s=c.edge,i=g-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 g=this.levelDetails;return g===null?1:g.drift}},{key:"edgeStalled",get:function(){var g=this.levelDetails;if(g===null)return 0;var a=(this.config.lowLatencyMode&&g.partTarget||g.targetduration)*3;return Math.max(g.age-a,0)}},{key:"forwardBufferLength",get:function(){var g=this.media,a=this.levelDetails;if(!g||!a)return 0;var c=g.buffered.length;return c?g.buffered.end(c-1):a.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return i});var q=B("./src/types/level.ts"),K=B("./src/events.ts"),M=B("./src/errors.ts"),Y=B("./src/utils/codecs.ts"),V=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 O in o)Object.prototype.hasOwnProperty.call(o,O)&&(t[O]=o[O])}return t},m.apply(this,arguments)}function p(t,u){for(var o=0;o<u.length;o++){var O=u[o];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(t,O.key,O)}}function g(t,u,o){return u&&p(t.prototype,u),o&&p(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(O,S){return O.__proto__=S,O},c(t,u)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){a(u,t);function u(O){var S;return S=t.call(this,O,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var o=u.prototype;return o._registerListeners=function(){var S=this.hls;S.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(K.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var S=this.hls;S.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),S.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 S=this._levels;S.forEach(function(R){R.loadError=0}),t.prototype.startLoad.call(this)},o.onManifestLoaded=function(S,R){var A=[],P=[],w=[],E,h={},f,T=!1,x=!1,_=!1;if(R.levels.forEach(function(F){var k=F.attrs;T=T||!!(F.width&&F.height),x=x||!!F.videoCodec,_=_||!!F.audioCodec,s&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var y=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;f=h[y],f?f.url.push(F.url):(f=new q.Level(F),h[y]=f,A.push(f)),k&&(k.AUDIO&&Object(V.addGroupId)(f,"audio",k.AUDIO),k.SUBTITLES&&Object(V.addGroupId)(f,"text",k.SUBTITLES))}),(T||x)&&_&&(A=A.filter(function(F){var k=F.videoCodec,y=F.width,H=F.height;return!!k||!!(y&&H)})),A=A.filter(function(F){var k=F.audioCodec,y=F.videoCodec;return(!k||Object(Y.isCodecSupportedInMp4)(k,"audio"))&&(!y||Object(Y.isCodecSupportedInMp4)(y,"video"))}),R.audioTracks&&(P=R.audioTracks.filter(function(F){return!F.audioCodec||Object(Y.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(V.assignTrackIdsByGroup)(P)),R.subtitles&&(w=R.subtitles,Object(V.assignTrackIdsByGroup)(w)),A.length>0){E=A[0].bitrate,A.sort(function(F,k){return F.bitrate-k.bitrate}),this._levels=A;for(var j=0;j<A.length;j++)if(A[j].bitrate===E){this._firstLevel=j,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+E);break}var W=_&&!x,C={levels:A,audioTracks:P,subtitleTracks:w,firstLevel:this._firstLevel,stats:R.stats,audio:_,video:x,altAudio:!W&&P.some(function(F){return!!F.url})};this.hls.trigger(K.Events.MANIFEST_PARSED,C),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:R.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(S,R){if(t.prototype.onError.call(this,S,R),R.fatal)return;var A=R.context,P=this._levels[this.currentLevelIndex];if(A&&(A.type===D.PlaylistContextType.AUDIO_TRACK&&P.audioGroupIds&&A.groupId===P.audioGroupIds[P.urlId]||A.type===D.PlaylistContextType.SUBTITLE_TRACK&&P.textGroupIds&&A.groupId===P.textGroupIds[P.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,E=!0,h;switch(R.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(R.frag){var f=this._levels[R.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=R.frag.level)):h=R.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(E=!1),h=A.level),w=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:h=R.level,w=!0;break}h!==void 0&&this.recoverLevel(R,h,w,E)},o.recoverLevel=function(S,R,A,P){var w=S.details,E=this._levels[R];if(E.loadError++,A){var h=this.retryLoadingOrFail(S);if(h)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(P){var f=E.url.length;if(f>1&&E.loadError<f)S.levelRetry=!0,this.redundantFailover(R);else if(this.manualLevelIndex===-1){var T=R===0?this._levels.length-1:R-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(w+": switch to "+T),S.levelRetry=!0,this.hls.nextAutoLevel=T)}}},o.redundantFailover=function(S){var R=this._levels[S],A=R.url.length;if(A>1){var P=(R.urlId+1)%A;this.warn("Switching to redundant URL-id "+P),this._levels.forEach(function(w){w.urlId=P}),this.level=S}},o.onFragLoaded=function(S,R){var A=R.frag;if(A!==void 0&&A.type===D.PlaylistLevelType.MAIN){var P=this._levels[A.level];P!==void 0&&(P.fragmentError=0,P.loadError=0)}},o.onLevelLoaded=function(S,R){var A,P=R.level,w=R.details,E=this._levels[P];if(!E){var h;this.warn("Invalid level index "+P),(h=R.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(w.deltaUpdateFailed=!0);return}P===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(P,R,E.details)):(A=R.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(w.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(S,R){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var P=-1,w=this.hls.audioTracks[R.id].groupId,E=0;E<A.audioGroupIds.length;E++)if(A.audioGroupIds[E]===w){P=E;break}P!==A.urlId&&(A.urlId=P,this.startLoad())}},o.loadPlaylist=function(S){var R=this.currentLevelIndex,A=this._levels[R];if(this.canLoad&&A&&A.url.length>0){var P=A.urlId,w=A.url[P];if(S)try{w=S.addDirectives(w)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+R+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+P+" "+w),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:w,level:R,id:P,deliveryDirectives:S||null})}},o.removeLevel=function(S,R){var A=function(E,h){return h!==R},P=this._levels.filter(function(w,E){return E!==S?!0:w.url.length>1&&R!==void 0?(w.url=w.url.filter(A),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(A)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(A)),w.urlId=0,!0):!1}).map(function(w,E){var h=w.details;return h!=null&&h.fragments&&h.fragments.forEach(function(f){f.level=E}),w});this._levels=P,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:P})},g(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var R,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===S&&(R=A[S])!==null&&R!==void 0&&R.details)return;if(S<0||S>=A.length){var P=S<0;if(this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:P,reason:"invalid level idx"}),P)return;S=Math.min(S,A.length-1)}this.clearTimer();var w=this.currentLevelIndex,E=A[w],h=A[S];this.log("switching to level "+S+" from "+w),this.currentLevelIndex=S;var f=m({},h,{level:S,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete f._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,f);var T=h.details;if(!T||T.live){var x=this.switchParams(h.uri,E==null?void 0:E.details);this.loadPlaylist(x)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),u}(r.default)},"./src/controller/level-helper.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"addGroupId",function(){return M}),B.d(Q,"assignTrackIdsByGroup",function(){return Y}),B.d(Q,"updatePTS",function(){return V}),B.d(Q,"updateFragPTSDTS",function(){return D}),B.d(Q,"mergeDetails",function(){return m}),B.d(Q,"mapPartIntersection",function(){return p}),B.d(Q,"mapFragmentIntersection",function(){return g}),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 q=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts");function M(u,o,O){switch(o){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(O);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(O);break}}function Y(u){var o={};u.forEach(function(O){var S=O.groupId||"";O.id=o[S]=o[S]||0,o[S]++})}function V(u,o,O){var S=u[o],R=u[O];r(S,R)}function r(u,o){var O=o.startPTS;if(Object(q.isFiniteNumber)(O)){var S=0,R;o.sn>u.sn?(S=O-u.start,R=u):(S=u.start-O,R=o),R.duration!==S&&(R.duration=S)}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,O,S,R,A){var P=S-O;P<=0&&(K.logger.warn("Fragment should have a positive duration",o),S=O+o.duration,A=R+o.duration);var w=O,E=S,h=o.startPTS,f=o.endPTS;if(Object(q.isFiniteNumber)(h)){var T=Math.abs(h-O);Object(q.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(T,o.deltaPTS):o.deltaPTS=T,w=Math.max(O,h),O=Math.min(O,h),R=Math.min(R,o.startDTS),E=Math.min(S,f),S=Math.max(S,f),A=Math.max(A,o.endDTS)}o.duration=S-O;var x=O-o.start;o.appendedPTS=S,o.start=o.startPTS=O,o.maxStartPTS=w,o.startDTS=R,o.endPTS=S,o.minEndPTS=E,o.endDTS=A;var _=o.sn;if(!u||_<u.startSN||_>u.endSN)return 0;var j,W=_-u.startSN,C=u.fragments;for(C[W]=o,j=W;j>0;j--)r(C[j],C[j-1]);for(j=W;j<C.length-1;j++)r(C[j],C[j+1]);return u.fragmentHint&&r(C[C.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,x}function m(u,o){for(var O=null,S=u.fragments,R=S.length-1;R>=0;R--){var A=S[R].initSegment;if(A){O=A;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var P=0,w;if(g(u,o,function(j,W){j.relurl&&(P=j.cc-W.cc),Object(q.isFiniteNumber)(j.startPTS)&&Object(q.isFiniteNumber)(j.endPTS)&&(W.start=W.startPTS=j.startPTS,W.startDTS=j.startDTS,W.appendedPTS=j.appendedPTS,W.maxStartPTS=j.maxStartPTS,W.endPTS=j.endPTS,W.endDTS=j.endDTS,W.minEndPTS=j.minEndPTS,W.duration=j.endPTS-j.startPTS,W.duration&&(w=W),o.PTSKnown=o.alignedSliding=!0),W.elementaryStreams=j.elementaryStreams,W.loader=j.loader,W.stats=j.stats,W.urlId=j.urlId,j.initSegment&&(W.initSegment=j.initSegment,O=j.initSegment)}),O){var E=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;E.forEach(function(j){var W;(!j.initSegment||j.initSegment.relurl===((W=O)===null||W===void 0?void 0:W.relurl))&&(j.initSegment=O)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(j){return!j}),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(P){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<f.length;T++)f[T].cc+=P}o.skippedSegments&&(o.startCC=o.fragments[0].cc),p(u.partList,o.partList,function(j,W){W.elementaryStreams=j.elementaryStreams,W.stats=j.stats}),w?D(o,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):a(u,o),f.length&&(o.totalduration=o.edge-f[0].start),o.driftStartTime=u.driftStartTime,o.driftStart=u.driftStart;var x=o.advancedDateTime;if(o.advanced&&x){var _=o.edge;o.driftStart||(o.driftStartTime=x,o.driftStart=_),o.driftEndTime=x,o.driftEnd=_}else o.driftEndTime=u.driftEndTime,o.driftEnd=u.driftEnd,o.advancedDateTime=u.advancedDateTime}function p(u,o,O){if(u&&o)for(var S=0,R=0,A=u.length;R<=A;R++){var P=u[R],w=o[R+S];P&&w&&P.index===w.index&&P.fragment.sn===w.fragment.sn?O(P,w):S--}}function g(u,o,O){for(var S=o.skippedSegments,R=Math.max(u.startSN,o.startSN)-o.startSN,A=(u.fragmentHint?1:0)+(S?o.endSN:Math.min(u.endSN,o.endSN))-o.startSN,P=o.startSN-u.startSN,w=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,E=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,h=R;h<=A;h++){var f=E[P+h],T=w[h];S&&!T&&h<S&&(T=o.fragments[h]=f),f&&T&&O(f,T)}}function a(u,o){var O=o.startSN+o.skippedSegments-u.startSN,S=u.fragments;if(O<0||O>=S.length)return;c(o,S[O].start)}function c(u,o){if(o){for(var O=u.fragments,S=u.skippedSegments;S<O.length;S++)O[S].start+=o;u.fragmentHint&&(u.fragmentHint.start+=o)}}function s(u,o){var O=1e3*u.levelTargetDuration,S=O/2,R=u.age,A=R>0&&R<O*3,P=o.loading.end-o.loading.start,w,E=u.availabilityDelay;if(u.updated===!1)if(A){var h=333*u.misses;w=Math.max(Math.min(S,P*2),h),u.availabilityDelay=(u.availabilityDelay||0)+w}else w=S;else A?(E=Math.min(E||O/2,R),u.availabilityDelay=E,w=E+O-R):w=O-P;return Math.round(w)}function i(u,o,O){if(!u||!u.details)return null;var S=u.details,R=S.fragments[o-S.startSN];return R||(R=S.fragmentHint,R&&R.sn===o?R:o<S.startSN&&O&&O.sn===o?O:null)}function t(u,o,O){if(!u||!u.details)return null;var S=u.details.partList;if(S)for(var R=S.length;R--;){var A=S[R];if(A.index===O&&A.fragment.sn===o)return A}return null}},"./src/controller/stream-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return S});var q=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),M=B("./src/is-supported.ts"),Y=B("./src/events.ts"),V=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"),p=B("./src/demux/transmuxer-interface.ts"),g=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(R,A){for(var P=0;P<A.length;P++){var w=A[P];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(R,w.key,w)}}function t(R,A,P){return A&&i(R.prototype,A),P&&i(R,P),R}function u(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,o(R,A)}function o(R,A){return o=Object.setPrototypeOf||function(w,E){return w.__proto__=E,w},o(R,A)}var O=100,S=function(R){u(A,R);function A(w,E){var h;return h=R.call(this,w,E,"[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 P=A.prototype;return P._registerListeners=function(){var E=this.hls;E.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(Y.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(Y.Events.ERROR,this.onError,this),E.on(Y.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(Y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(Y.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(Y.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P._unregisterListeners=function(){var E=this.hls;E.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(Y.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(Y.Events.ERROR,this.onError,this),E.off(Y.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(Y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(Y.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(Y.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},P.startLoad=function(E){if(this.levels){var h=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=f.startLevel;T===-1&&(f.config.testBandwidth?(T=0,this.bitrateTest=!0):T=f.nextAutoLevel),this.level=f.nextLoadLevel=T,this.loadedmetadata=!1}h>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),E=h),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},P.stopLoad=function(){this._forceStartLoad=!1,R.prototype.stopLoad.call(this)},P.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var E,h=this.levels,f=this.level,T=h==null||((E=h[f])===null||E===void 0)?void 0:E.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var x,_=self.performance.now(),j=this.retryDate;(!j||_>=j||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},P.onTickEnd=function(){R.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},P.doTickIdle=function(){var E,h,f=this.hls,T=this.levelLastLoaded,x=this.levels,_=this.media,j=f.config,W=f.nextLoadLevel;if(T===null||!_&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!x||!x[W])return;var C=x[W];this.level=f.nextLoadLevel=W;var F=C.details;if(!F||this.state===K.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==W){this.state=K.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,D.PlaylistLevelType.MAIN);if(k===null)return;var y=k.len,H=this.getMaxBufferLength(C.maxBitrate);if(y>=H)return;if(this._streamEnded(k,F)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(Y.Events.BUFFER_EOS,J),this.state=K.State.ENDED;return}var ae=k.end,fe=this.getNextFragment(ae,F);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var ge=fe.sn-F.startSN;ge>1&&(fe=F.fragments[ge-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===r.FragmentState.OK&&this.nextLoadPosition>ae){var Te=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,Te,D.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,F)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((E=fe.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((h=fe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(fe,F):this.loadFragment(fe,F,ae)},P.loadFragment=function(E,h,f){var T,x=this.fragmentTracker.getState(E);if(this.fragCurrent=E,x===r.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(E);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else x=r.FragmentState.NOT_LOADED}x===r.FragmentState.NOT_LOADED||x===r.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,E,h,f)):x===r.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},P.getAppendedFrag=function(E){var h=this.fragmentTracker.getAppendedFrag(E,D.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},P.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,D.PlaylistLevelType.MAIN)},P.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},P.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},P.nextLevelSwitch=function(){var E=this.levels,h=this.media;if(h!=null&&h.readyState){var f,T=this.getAppendedFrag(h.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!h.paused&&E){var x=this.hls.nextLoadLevel,_=E[x],j=this.fragLastKbps;j&&this.fragCurrent?f=this.fragCurrent.duration*_.maxBitrate/(1e3*j)+1:f=0}else f=0;var W=this.getBufferedFrag(h.currentTime+f);if(W){var C=this.followingBufferedFrag(W);if(C){this.abortCurrentFrag();var F=C.maxStartPTS?C.maxStartPTS:C.start,k=C.duration,y=Math.max(W.end,F+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},P.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},P.flushMainBuffer=function(E,h){R.prototype.flushMainBuffer.call(this,E,h,this.altAudio?"video":null)},P.onMediaAttached=function(E,h){R.prototype.onMediaAttached.call(this,E,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)},P.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),R.prototype.onMediaDetaching.call(this)},P.onMediaPlaying=function(){this.tick()},P.onMediaSeeked=function(){var E=this.media,h=E?E.currentTime:null;Object(q.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},P.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(Y.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},P.onManifestParsed=function(E,h){var f=!1,T=!1,x;h.levels.forEach(function(_){x=_.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(f=!0),x.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=f&&T&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},P.onLevelLoading=function(E,h){var f=this.levels;if(!f||this.state!==K.State.IDLE)return;var T=f[h.level];(!T.details||T.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(T.details))&&(this.state=K.State.WAITING_LEVEL)},P.onLevelLoaded=function(E,h){var f,T=this.levels,x=h.level,_=h.details,j=_.totalduration;if(!T){this.warn("Levels were reset while loading level "+x);return}this.log("Level "+x+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+j);var W=this.fragCurrent;W&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==h.level&&W.loader&&(this.state=K.State.IDLE,W.loader.abort()));var C=T[x],F=0;if(_.live||(f=C.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;F=this.alignPlaylists(_,C.details)}if(C.details=_,this.levelLastLoaded=x,this.hls.trigger(Y.Events.LEVEL_UPDATED,{details:_,level:x}),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()},P._handleFragmentLoadProgress=function(E){var h,f=E.frag,T=E.part,x=E.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 j=_[f.level],W=j.details;if(!W){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var C=j.videoCodec,F=W.PTSKnown||!W.live,k=(h=f.initSegment)===null||h===void 0?void 0:h.data,y=this._getAudioCodec(j),H=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=T?T.index:-1,ae=J!==-1,fe=new g.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,x.byteLength,J,ae),ge=this.initPTS[f.cc];H.push(x,k,y,C,f,T,W.totalduration,F,fe,ge)},P.onAudioTrackSwitching=function(E,h){var f=this.altAudio,T=!!h.url,x=h.id;if(!T){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 j=this.hls;f&&j.trigger(Y.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(Y.Events.AUDIO_TRACK_SWITCHED,{id:x})}},P.onAudioTrackSwitched=function(E,h){var f=h.id,T=!!this.hls.audioTracks[f].url;if(T){var x=this.videoBuffer;x&&this.mediaBuffer!==x&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=x)}this.altAudio=T,this.tick()},P.onBufferCreated=function(E,h){var f=h.tracks,T,x,_=!1;for(var j in f){var W=f[j];if(W.id==="main"){if(x=j,T=W,j==="video"){var C=f[j];C&&(this.videoBuffer=C.buffer)}}else _=!0}_&&T?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},P.onFragBuffered=function(E,h){var f=h.frag,T=h.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(T?" p: "+T.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 x=T?T.stats:f.stats;this.fragLastKbps=Math.round(8*x.total/(x.buffering.end-x.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,T)},P.onError=function(E,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,T=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);T&&T.len>.5&&(f=!this.reduceMaxBufferLength(T.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},P.checkBuffer=function(){var E=this.media,h=this.gapController;if(!E||!h||!E.readyState)return;var f=V.BufferHelper.getBuffered(E);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},P.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},P.onBufferFlushed=function(E,h){var f=h.type;if(f!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(f===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,f,D.PlaylistLevelType.MAIN)}},P.onLevelsUpdated=function(E,h){this.levels=h.levels},P.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},P.seekToStartPos=function(){var E=this.media,h=E.currentTime,f=this.startPosition;if(f>=0&&h<f){if(E.seeking){s.logger.log("could not seek to "+f+", already seeking at "+h);return}var T=V.BufferHelper.getBuffered(E),x=T.length?T.start(0):0,_=x-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),E.currentTime=f}},P._getAudioCodec=function(E){var h=this.config.defaultAudioCodec||E.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},P._loadBitrateTestFrag=function(E){var h=this;this._doFragLoad(E).then(function(f){var T=h.hls;if(!f||T.nextLoadLevel||h.fragContextChanged(E))return;h.fragLoadError=0,h.state=K.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var x=E.stats;x.parsing.start=x.parsing.end=x.buffering.start=x.buffering.end=self.performance.now(),T.trigger(Y.Events.FRAG_LOADED,f)})},P._handleTransmuxComplete=function(E){var h,f="main",T=this.hls,x=E.remuxResult,_=E.chunkMeta,j=this.getCurrentContext(_);if(!j){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var W=j.frag,C=j.part,F=j.level,k=x.video,y=x.text,H=x.id3,J=x.initSegment,ae=this.altAudio?void 0:x.audio;if(this.fragContextChanged(W))return;if(this.state=K.State.PARSING,J){J.tracks&&(this._bufferInitSegment(F,J.tracks,W,_),T.trigger(Y.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:f,tracks:J.tracks}));var fe=J.initPTS,ge=J.timescale;Object(q.isFiniteNumber)(fe)&&(this.initPTS[W.cc]=fe,T.trigger(Y.Events.INIT_PTS_FOUND,{frag:W,id:f,initPTS:fe,timescale:ge}))}if(k&&x.independent!==!1){if(F.details){var Te=k.startPTS,Ue=k.endPTS,Se=k.startDTS,Le=k.endDTS;if(C)C.elementaryStreams[k.type]={startPTS:Te,endPTS:Ue,startDTS:Se,endDTS:Le};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<Te){this.backtrack(W);return}W.setElementaryStreamInfo(k.type,W.start,Ue,W.start,Le,!0)}W.setElementaryStreamInfo(k.type,Te,Ue,Se,Le),this.bufferFragmentData(k,W,C,_)}}else if(x.independent===!1){this.backtrack(W);return}if(ae){var Z=ae.startPTS,v=ae.endPTS,L=ae.startDTS,z=ae.endDTS;C&&(C.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:v,startDTS:L,endDTS:z}),W.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,Z,v,L,z),this.bufferFragmentData(ae,W,C,_)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var ee={frag:W,id:f,samples:H.samples};T.trigger(Y.Events.FRAG_PARSING_METADATA,ee)}if(y){var $={frag:W,id:f,samples:y.samples};T.trigger(Y.Events.FRAG_PARSING_USERDATA,$)}},P._bufferInitSegment=function(E,h,f,T){var x=this;if(this.state!==K.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var _=h.audio,j=h.video,W=h.audiovideo;if(_){var C=E.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(C&&(C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),_.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(C="mp4a.40.5")),F.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(C="mp4a.40.2",this.log("Android: force audio codec to "+C)),E.audioCodec&&E.audioCodec!==C&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+C+'"'),_.levelCodec=C,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(C||"")+"/"+(E.audioCodec||"")+"/"+_.codec+"]")}j&&(j.levelCodec=E.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+j.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(Y.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(k){var y=h[k],H=y.initSegment;H!=null&&H.byteLength&&x.hls.trigger(Y.Events.BUFFER_APPENDING,{type:k,data:H,frag:f,part:null,chunkMeta:T,parent:f.type})}),this.tick()},P.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var h=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,h?this.resetFragmentLoading(E):this.state=K.State.BACKTRACKING},P.checkFragmentChanged=function(){var E=this.media,h=null;if(E&&E.readyState>1&&E.seeking===!1){var f=E.currentTime;if(V.BufferHelper.isBuffered(E,f)?h=this.getAppendedFrag(f):V.BufferHelper.isBuffered(E,f+.1)&&(h=this.getAppendedFrag(f+.1)),h){var T=this.fragPlaying,x=h.level;(!T||h.sn!==T.sn||T.level!==x||h.urlId!==T.urlId)&&(this.hls.trigger(Y.Events.FRAG_CHANGED,{frag:h}),(!T||T.level!==x)&&this.hls.trigger(Y.Events.LEVEL_SWITCHED,{level:x}),this.fragPlaying=h)}}},t(A,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var h=this.getAppendedFrag(E.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var h=this.getAppendedFrag(E.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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"SubtitleStreamController",function(){return u});var q=B("./src/events.ts"),K=B("./src/utils/logger.ts"),M=B("./src/utils/buffer-helper.ts"),Y=B("./src/controller/fragment-finders.ts"),V=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"),p=B("./src/types/loader.ts"),g=B("./src/types/level.ts");function a(o,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(o,R.key,R)}}function c(o,O,S){return O&&a(o.prototype,O),S&&a(o,S),o}function s(o,O){o.prototype=Object.create(O.prototype),o.prototype.constructor=o,i(o,O)}function i(o,O){return i=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},i(o,O)}var t=500,u=function(o){s(O,o);function O(R,A){var P;return P=o.call(this,R,A,"[subtitle-stream-controller]")||this,P.levels=[],P.currentTrackId=-1,P.tracksBuffered=[],P.mainDetails=null,P._registerListeners(),P}var S=O.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var A=this.hls;A.on(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(q.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(q.Events.ERROR,this.onError,this),A.on(q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var A=this.hls;A.off(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(q.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(q.Events.ERROR,this.onError,this),A.off(q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(t),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(A,P){this.mainDetails=P.details},S.onSubtitleFragProcessed=function(A,P){var w=P.frag,E=P.success;if(this.fragPrevious=w,this.state=m.State.IDLE,!E)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var f,T=w.start,x=0;x<h.length;x++)if(T>=h[x].start&&T<=h[x].end){f=h[x];break}var _=w.start+w.duration;f?f.end=_:(f={start:T,end:_},h.push(f)),this.fragmentTracker.fragBuffered(w)},S.onBufferFlushing=function(A,P){var w=P.startOffset,E=P.endOffset;if(w===0&&E!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,f=this.levels;if(!f.length||!f[h]||!f[h].details)return;var T=f[h].details,x=T.targetduration,_=E-x;if(_<=0)return;P.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(j){for(var W=0;W<j.length;){if(j[W].end<=_){j.shift();continue}else if(j[W].start<_)j[W].start=_;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(w,_,p.PlaylistLevelType.SUBTITLE)}},S.onError=function(A,P){var w,E=P.frag;if(!E||E.type!==p.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},S.onSubtitleTracksUpdated=function(A,P){var w=this,E=P.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(h){return new g.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){w.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(A,P){if(this.currentTrackId=P.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(t)},S.onSubtitleTrackLoaded=function(A,P){var w,E=P.details,h=P.id,f=this.currentTrackId,T=this.levels;if(!T.length)return;var x=T[f];if(h>=T.length||h!==f||!x)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(w=x.details)!==null&&w!==void 0&&w.live){var _=this.mainDetails;if(E.deltaUpdateFailed||!_)return;var j=_.fragments[0];if(!x.details)E.hasProgramDateTime&&_.hasProgramDateTime?Object(V.alignMediaPlaylistByPDT)(E,_):j&&Object(r.addSliding)(E,j.start);else{var W=this.alignPlaylists(E,x.details);W===0&&j&&Object(r.addSliding)(E,j.start)}}if(x.details=E,this.levelLastLoaded=h,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var C=Object(Y.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);C||(this.warn("Subtitle playlist not aligned with playback"),x.details=void 0)}},S._handleFragmentLoadComplete=function(A){var P=A.frag,w=A.payload,E=P.decryptdata,h=this.hls;if(this.fragContextChanged(P))return;if(w&&w.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),E.key.buffer,E.iv.buffer).then(function(T){var x=performance.now();h.trigger(q.Events.FRAG_DECRYPTED,{frag:P,payload:T,stats:{tstart:f,tdecrypt:x}})})}},S.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var A,P=this.currentTrackId,w=this.levels;if(!w.length||!w[P]||!w[P].details)return;var E=w[P].details,h=E.targetduration,f=this.config,T=this.media,x=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-h,f.maxBufferHole),_=x.end,j=x.len,W=this.getMaxBufferLength()+h;if(j>W)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var C=E.fragments,F=C.length,k=E.edge,y,H=this.fragPrevious;if(_<k){var J=f.maxFragLookUpTolerance;H&&E.hasProgramDateTime&&(y=Object(Y.findFragmentByPDT)(C,H.endProgramDateTime,J)),y||(y=Object(Y.findFragmentByPTS)(H,C,_,J),!y&&H&&H.start<C[0].start&&(y=C[0]))}else y=C[F-1];(A=y)!==null&&A!==void 0&&A.encrypted?(K.logger.log("Loading key for "+y.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(q.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===D.FragmentState.NOT_LOADED&&this.loadFragment(y,E,_)}},S.loadFragment=function(A,P,w){this.fragCurrent=A,o.prototype.loadFragment.call(this,A,P,w)},c(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(m.default)},"./src/controller/subtitle-track-controller.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),M=B("./src/controller/base-playlist-controller.ts"),Y=B("./src/types/loader.ts");function V(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&&V(a.prototype,c),s&&V(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 p=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(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(q.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(q.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var t=this.hls;t.off(q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(q.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(q.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(q.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(q.Events.ERROR,this.onError,this)},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=g(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,O=u.details,S=this.trackId,R=this.tracksInGroup[S];if(!R){this.warn("Invalid subtitle track id "+o);return}var A=R.details;R.details=u.details,this.log("subtitle track "+o+" loaded ["+O.startSN+"-"+O.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 O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(P){return!o||P.groupId===o});this.tracksInGroup=S;var R=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=o;var A={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(q.Events.SUBTITLE_TRACKS_UPDATED,A),R!==-1&&this.setSubtitleTrack(R,O)}},s.findTrackId=function(t){for(var u=this.tracksInGroup,o=0;o<u.length;o++){var O=u[o];if((!this.selectDefaultTrack||O.default)&&(!t||t===O.name))return O.id}return-1},s.onError=function(t,u){if(a.prototype.onError.call(this,t,u),u.fatal||!u.context)return;u.context.type===Y.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,O=u.groupId,S=u.url;if(t)try{S=t.addDirectives(S)}catch(R){this.warn("Could not construct new URL with HLS Delivery Directives: "+R)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(q.Events.SUBTITLE_TRACK_LOADING,{url:S,id:o,groupId:O,deliveryDirectives:t||null})}},s.toggleTrackModes=function(t){var u=this,o=this.media,O=this.subtitleDisplay,S=this.trackId;if(!o)return;var R=g(o.textTracks),A=R.filter(function(E){return E.groupId===u.groupId});if(t===-1)[].slice.call(R).forEach(function(E){E.mode="disabled"});else{var P=A[S];P&&(P.mode="disabled")}var w=A[t];w&&(w.mode=O?"showing":"hidden")},s.setSubtitleTrack=function(t,u){var o,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(o=O[t])!==null&&o!==void 0&&o.details)||t<-1||t>=O.length)return;this.clearTimer();var S=O[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,S){var R=S.id,A=S.groupId,P=A===void 0?"":A,w=S.name,E=S.type,h=S.url;this.hls.trigger(q.Events.SUBTITLE_TRACK_SWITCH,{id:R,groupId:P,name:w,type:E,url:h});var f=this.switchParams(S.url,u==null?void 0:u.details);this.loadPlaylist(f)}else this.hls.trigger(q.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=g(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}(M.default);function g(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=p},"./src/controller/timeline-controller.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"TimelineController",function(){return g});var q=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),M=B("./src/utils/cea-608-parser.ts"),Y=B("./src/utils/output-filter.ts"),V=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"),p=B("./src/utils/logger.ts"),g=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 Y.default(this,"textTrack1"),O=new Y.default(this,"textTrack2"),S=new Y.default(this,"textTrack3"),R=new Y.default(this,"textTrack4");this.cea608Parser1=new M.default(1,o,O),this.cea608Parser2=new M.default(3,S,R)}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,O,S,R,A){for(var P=!1,w=A.length;w--;){var E=A[w],h=c(E[0],E[1],O,S);if(h>=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],S),P=!0,h/(S-O)>.5))return}if(P||A.push([O,S]),this.config.renderTextTracksNatively){var f=this.captionsTracks[o];this.Cues.newCue(f,O,S,R)}else{var T=this.Cues.newCue(null,O,S,R);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:T,track:o})}},t.onInitPtsFound=function(o,O){var S=this,R=O.frag,A=O.id,P=O.initPTS,w=O.timescale,E=this.unparsedVttFrags;A==="main"&&(this.initPTS[R.cc]=P,this.timescale[R.cc]=w),E.length&&(this.unparsedVttFrags=[],E.forEach(function(h){S.onFragLoaded(K.Events.FRAG_LOADED,h)}))},t.getExistingTrack=function(o){var O=this.media;if(O)for(var S=0;S<O.textTracks.length;S++){var R=O.textTracks[S];if(R[o])return R}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 O=this.captionsProperties,S=this.captionsTracks,R=this.media,A=O[o],P=A.label,w=A.languageCode,E=this.getExistingTrack(o);if(E)S[o]=E,Object(r.clearCurrentCues)(S[o]),Object(r.sendAddTrackEvent)(S[o],R);else{var h=this.createTextTrack("captions",P,w);h&&(h[o]=!0,S[o]=h)}},t.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var O=this.captionsProperties[o];if(!O)return;var S=O.label,R={_id:o,label:S,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[o]=R,this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[R]})},t.createTextTrack=function(o,O,S){var R=this.media;return R?R.addTextTrack(o,O,S):void 0},t.onMediaAttaching=function(o,O){this.media=O.media,this._cleanTracks()},t.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(O){Object(r.clearCurrentCues)(o[O]),delete o[O]}),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 O=o.textTracks;if(O)for(var S=0;S<O.length;S++)Object(r.clearCurrentCues)(O[S])},t.onSubtitleTracksUpdated=function(o,O){var S=this;this.textTracks=[];var R=O.subtitleTracks||[],A=R.some(function(h){return h.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var P=this.tracks&&R&&this.tracks.length===R.length;if(this.tracks=R||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,f){var T;if(f<w.length){for(var x=null,_=0;_<w.length;_++)if(a(w[_],h)){x=w[_];break}x&&(T=x)}T?Object(r.clearCurrentCues)(T):(T=S.createTextTrack("subtitles",h.name,h.lang),T&&(T.mode="disabled")),T&&(T.groupId=h.groupId,S.textTracks.push(T))})}else if(!P&&this.tracks&&this.tracks.length){var E=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:E})}}},t.onManifestLoaded=function(o,O){var S=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(R){var A=/(?:CC|SERVICE)([1-4])/.exec(R.instreamId);if(!A)return;var P="textTrack"+A[1],w=S.captionsProperties[P];if(!w)return;w.label=R.name,R.lang&&(w.languageCode=R.lang),w.media=R})},t.onFragLoading=function(o,O){var S=this.cea608Parser1,R=this.cea608Parser2,A=this.lastSn,P=this.lastPartIndex;if(!this.enabled||!(S&&R))return;if(O.frag.type===m.PlaylistLevelType.MAIN){var w,E,h=O.frag.sn,f=(w=O==null||((E=O.part)===null||E===void 0)?void 0:E.index)!=null?w:-1;h===A+1||h===A&&f===P+1||(S.reset(),R.reset()),this.lastSn=h,this.lastPartIndex=f}},t.onFragLoaded=function(o,O){var S=O.frag,R=O.payload,A=this.initPTS,P=this.unparsedVttFrags;if(S.type===m.PlaylistLevelType.SUBTITLE)if(R.byteLength){if(!Object(q.isFiniteNumber)(A[S.cc])){P.push(O),A.length&&this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var w=S.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var E=this.tracks[S.level],h=this.vttCCs;h[S.cc]||(h[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),E&&E.textCodec===D.IMSC1_CODEC?this._parseIMSC1(S,R):this._parseVTTs(S,R,h)}}else this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(o,O){var S=this,R=this.hls;Object(D.parseIMSC1)(O,this.initPTS[o.cc],this.timescale[o.cc],function(A){S._appendCues(A,o.level),R.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){p.logger.log("Failed to parse IMSC1: "+A),R.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},t._parseVTTs=function(o,O,S){var R=this,A=this.hls;Object(V.parseWebVTT)(O,this.initPTS[o.cc],this.timescale[o.cc],S,o.cc,o.start,function(P){R._appendCues(P,o.level),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(P){R._fallbackToIMSC1(o,O),p.logger.log("Failed to parse VTT cue: "+P),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:P})})},t._fallbackToIMSC1=function(o,O){var S=this,R=this.tracks[o.level];R.textCodec||Object(D.parseIMSC1)(O,this.initPTS[o.cc],this.timescale[o.cc],function(){R.textCodec=D.IMSC1_CODEC,S._parseIMSC1(o,O)},function(){R.textCodec="wvtt"})},t._appendCues=function(o,O){var S=this.hls;if(this.config.renderTextTracksNatively){var R=this.textTracks[O];if(R.mode==="disabled")return;o.forEach(function(w){return Object(r.addCueToTrack)(R,w)})}else{var A=this.tracks[O],P=A.default?"default":"subtitles"+O;S.trigger(K.Events.CUES_PARSED,{type:"subtitles",cues:o,track:P})}},t.onFragDecrypted=function(o,O){var S=O.frag;if(S.type===m.PlaylistLevelType.SUBTITLE){if(!Object(q.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(K.Events.FRAG_LOADED,O)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(o,O){var S=this.cea608Parser1,R=this.cea608Parser2;if(!this.enabled||!(S&&R))return;for(var A=0;A<O.samples.length;A++){var P=O.samples[A].bytes;if(P){var w=this.extractCea608Data(P);S.addData(O.samples[A].pts,w[0]),R.addData(O.samples[A].pts,w[1])}}},t.onBufferFlushing=function(o,O){var S=O.startOffset,R=O.endOffset,A=O.endOffsetSubtitles,P=O.type,w=this.media;if(!w||w.currentTime<R)return;if(!P||P==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(f){return Object(r.removeCuesInRange)(E[f],S,R)})}if(this.config.renderTextTracksNatively&&(S===0&&A!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(f){return Object(r.removeCuesInRange)(h[f],S,A)})}},t.extractCea608Data=function(o){for(var O=o[0]&31,S=2,R=[[],[]],A=0;A<O;A++){var P=o[S++],w=127&o[S++],E=127&o[S++],h=(4&P)!==0,f=3&P;if(w===0&&E===0)continue;h&&((f===0||f===1)&&(R[f].push(w),R[f].push(E)))}return R},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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return q});var q=function(){function K(Y,V){this.subtle=void 0,this.aesIV=void 0,this.subtle=Y,this.aesIV=V}var M=K.prototype;return M.decrypt=function(V,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,V)},K}()},"./src/crypt/aes-decryptor.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"removePadding",function(){return K}),B.d(Q,"default",function(){return M});var q=B("./src/utils/typed-array.ts");function K(Y){var V=Y.byteLength,r=V&&new DataView(Y.buffer).getUint8(V-1);return r?Object(q.sliceUint8)(Y,0,V-r):Y}var M=function(){function Y(){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 V=Y.prototype;return V.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),p=new Uint32Array(4),g=0;g<4;g++)p[g]=m.getUint32(g*4);return p},V.initTable=function(){var D=this.sBox,m=this.invSBox,p=this.subMix,g=p[0],a=p[1],c=p[2],s=p[3],i=this.invSubMix,t=i[0],u=i[1],o=i[2],O=i[3],S=new Uint32Array(256),R=0,A=0,P=0;for(P=0;P<256;P++)P<128?S[P]=P<<1:S[P]=P<<1^283;for(P=0;P<256;P++){var w=A^A<<1^A<<2^A<<3^A<<4;w=w>>>8^w&255^99,D[R]=w,m[w]=R;var E=S[R],h=S[E],f=S[h],T=S[w]*257^w*16843008;g[R]=T<<24|T>>>8,a[R]=T<<16|T>>>16,c[R]=T<<8|T>>>24,s[R]=T,T=f*16843009^h*65537^E*257^R*16843008,t[w]=T<<24|T>>>8,u[w]=T<<16|T>>>16,o[w]=T<<8|T>>>24,O[w]=T,R?(R=E^S[S[S[f^E]]],A^=S[S[A]]):R=A=1}},V.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),p=!0,g=0;g<m.length&&p;)p=m[g]===this.key[g],g++;if(p)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,O=this.rcon,S=this.invSubMix,R=S[0],A=S[1],P=S[2],w=S[3],E,h;for(s=0;s<c;s++){if(s<a){E=t[s]=m[s];continue}h=E,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^=O[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]=E=(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]=R[o[h>>>24]]^A[o[h>>>16&255]]^P[o[h>>>8&255]]^w[o[h&255]],u[i]=u[i]>>>0},V.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},V.decrypt=function(D,m,p){for(var g=this.keySize+6,a=this.invKeySchedule,c=this.invSBox,s=this.invSubMix,i=s[0],t=s[1],u=s[2],o=s[3],O=this.uint8ArrayToUint32Array_(p),S=O[0],R=O[1],A=O[2],P=O[3],w=new Int32Array(D),E=new Int32Array(w.length),h,f,T,x,_,j,W,C,F,k,y,H,J,ae,fe=this.networkToHostOrderSwap;m<w.length;){for(F=fe(w[m]),k=fe(w[m+1]),y=fe(w[m+2]),H=fe(w[m+3]),_=F^a[0],j=H^a[1],W=y^a[2],C=k^a[3],J=4,ae=1;ae<g;ae++)h=i[_>>>24]^t[j>>16&255]^u[W>>8&255]^o[C&255]^a[J],f=i[j>>>24]^t[W>>16&255]^u[C>>8&255]^o[_&255]^a[J+1],T=i[W>>>24]^t[C>>16&255]^u[_>>8&255]^o[j&255]^a[J+2],x=i[C>>>24]^t[_>>16&255]^u[j>>8&255]^o[W&255]^a[J+3],_=h,j=f,W=T,C=x,J=J+4;h=c[_>>>24]<<24^c[j>>16&255]<<16^c[W>>8&255]<<8^c[C&255]^a[J],f=c[j>>>24]<<24^c[W>>16&255]<<16^c[C>>8&255]<<8^c[_&255]^a[J+1],T=c[W>>>24]<<24^c[C>>16&255]<<16^c[_>>8&255]<<8^c[j&255]^a[J+2],x=c[C>>>24]<<24^c[_>>16&255]<<16^c[j>>8&255]<<8^c[W&255]^a[J+3],E[m]=fe(h^S),E[m+1]=fe(x^R),E[m+2]=fe(T^A),E[m+3]=fe(f^P),S=F,R=k,A=y,P=H,m=m+4}return E.buffer},Y}()},"./src/crypt/decrypter.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return m});var q=B("./src/crypt/aes-crypto.ts"),K=B("./src/crypt/fast-aes-key.ts"),M=B("./src/crypt/aes-decryptor.ts"),Y=B("./src/utils/logger.ts"),V=B("./src/utils/mp4-tools.ts"),r=B("./src/utils/typed-array.ts"),D=16,m=function(){function p(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(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var g=p.prototype;return g.destroy=function(){this.observer=null},g.isSync=function(){return this.config.enableSoftwareAES},g.flush=function(){var c=this.currentResult;if(!c){this.reset();return}var s=new Uint8Array(c);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(s):s},g.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},g.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)},g.softwareDecrypt=function(c,s,i){var t=this.currentIV,u=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(c=Object(V.appendUint8Array)(o,c),this.remainderData=null);var O=this.getValidChunk(c);if(!O.length)return null;t&&(i=t);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new M.default),S.expandKey(s);var R=u;return this.currentResult=S.decrypt(O.buffer,0,i),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,R||null},g.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 O=new q.default(u,i);return O.decrypt(c.buffer,o)}).catch(function(o){return t.onWebCryptoError(o,c,s,i)})},g.onWebCryptoError=function(c,s,i,t){return Y.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",c),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,i,t)},g.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},g.logOnce=function(c){if(!this.logEnabled)return;Y.logger.log("[decrypter.ts]: "+c),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return q});var q=function(){function K(Y,V){this.subtle=void 0,this.key=void 0,this.subtle=Y,this.key=V}var M=K.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},K}()},"./src/demux/aacdemuxer.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/adts.ts"),M=B("./src/utils/logger.ts"),Y=B("./src/demux/id3.ts");function V(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,r(m,p)}function r(m,p){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,p)}var D=function(m){V(p,m);function p(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 g=p.prototype;return g.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}},p.probe=function(c){if(!c)return!1;for(var s=Y.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if(K.probe(c,i))return M.logger.log("ADTS sync word found !"),!0;return!1},g.canParse=function(c,s){return K.canParse(c,s)},g.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},p}(q.default);D.minProbeByteLength=9,Q.default=D},"./src/demux/adts.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"getAudioConfig",function(){return Y}),B.d(Q,"isHeaderPattern",function(){return V}),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 p}),B.d(Q,"canParse",function(){return g}),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 q=B("./src/utils/logger.ts"),K=B("./src/errors.ts"),M=B("./src/events.ts");function Y(u,o,O,S){var R,A,P,w,E=navigator.userAgent.toLowerCase(),h=S,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];R=((o[O+2]&192)>>>6)+1;var T=(o[O+2]&60)>>>2;if(T>f.length-1){u.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return P=(o[O+2]&1)<<2,P|=(o[O+3]&192)>>>6,q.logger.log("manifest codec:"+S+", ADTS type:"+R+", samplingIndex:"+T),/firefox/i.test(E)?T>=6?(R=5,w=new Array(4),A=T-3):(R=2,w=new Array(2),A=T):E.indexOf("android")!==-1?(R=2,w=new Array(2),A=T):(R=5,w=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&T>=6?A=T-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(T>=6&&P===1||/vivaldi/i.test(E))||!S&&P===1)&&(R=2,w=new Array(2)),A=T)),w[0]=R<<3,w[0]|=(T&14)>>1,w[1]|=(T&1)<<7,w[1]|=P<<3,R===5&&(w[1]|=(A&14)>>1,w[2]=(A&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:f[T],channelCount:P,codec:"mp4a.40."+R,manifestCodec:h}}function V(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 p(u,o){return o+1<u.length&&V(u,o)}function g(u,o){return m(u,o)&&V(u,o)&&D(u,o)<=u.length-o}function a(u,o){if(p(u,o)){var O=r(u,o);if(o+O>=u.length)return!1;var S=D(u,o);if(S<=O)return!1;var R=o+S;return R===u.length||p(u,R)}return!1}function c(u,o,O,S,R){if(!u.samplerate){var A=Y(o,O,S,R);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,q.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function s(u){return 1024*9e4/u}function i(u,o,O,S,R){var A=r(u,o),P=D(u,o);if(P-=A,P>0){var w=O+S*R;return{headerLength:A,frameLength:P,stamp:w}}}function t(u,o,O,S,R){var A=s(u.samplerate),P=i(o,O,S,R,A);if(P){var w=P.frameLength,E=P.headerLength,h=P.stamp,f=E+w,T=Math.max(0,O+f-o.length),x;T?(x=new Uint8Array(f-E),x.set(o.subarray(O+E,o.length),0)):x=o.subarray(O+E,O+f);var _={unit:x,pts:h};return T||u.samples.push(_),{sample:_,length:f,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"initPTSFn",function(){return D});var q=B("./src/polyfills/number.ts"),K=B("./src/demux/id3.ts"),M=B("./src/demux/dummy-demuxed-track.ts"),Y=B("./src/utils/mp4-tools.ts"),V=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 p=m.prototype;return p.resetInitSegment=function(a,c,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(a,c){return!1},p.appendFrame=function(a,c,s){},p.demux=function(a,c){this.cachedData&&(a=Object(Y.appendUint8Array)(this.cachedData,a),this.cachedData=null);var s=K.getID3Data(a,0),i=s?s.length:0,t,u,o=this._audioTrack,O=this._id3Track,S=s?K.getTimeStamp(s):void 0,R=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(S,c)),s&&s.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),u=this.initPTS;i<R;){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=R}else K.canParse(a,i)?(s=K.getID3Data(a,i),O.samples.push({pts:u,dts:u,data:s}),i+=s.length,t=i):i++;if(i===R&&t!==R){var P=Object(V.sliceUint8)(a,t);this.cachedData?this.cachedData=Object(Y.appendUint8Array)(this.cachedData,P):this.cachedData=P}}return{audioTrack:o,avcTrack:Object(M.dummyTrack)(),id3Track:O,textTrack:Object(M.dummyTrack)()}},p.demuxSampleAes=function(a,c,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(a){var c=this.cachedData;return c&&(this.cachedData=null,this.demux(c,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},p.destroy=function(){},m}(),D=function(p,g){return Object(q.isFiniteNumber)(p)?p*90:g*9e4};Q.default=r},"./src/demux/chunk-cache.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return q});var q=function(){function M(){this.chunks=[],this.dataLength=0}var Y=M.prototype;return Y.push=function(r){this.chunks.push(r),this.dataLength+=r.length},Y.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},Y.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function K(M,Y){for(var V=new Uint8Array(Y),r=0,D=0;D<M.length;D++){var m=M[D];V.set(m,r),r+=m.length}return V}},"./src/demux/dummy-demuxed-track.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"dummyTrack",function(){return q});function q(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/utils/logger.ts"),K=function(){function M(V){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=V,this.bytesAvailable=V.byteLength,this.word=0,this.bitsAvailable=0}var Y=M.prototype;return Y.loadWord=function(){var r=this.data,D=this.bytesAvailable,m=r.byteLength-D,p=new Uint8Array(4),g=Math.min(4,D);if(g===0)throw new Error("no bytes available");p.set(r.subarray(m,m+g)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=g*8,this.bytesAvailable-=g},Y.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)},Y.readBits=function(r){var D=Math.min(this.bitsAvailable,r),m=this.word>>>32-D;return r>32&&q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=r-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},Y.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()},Y.skipUEG=function(){this.skipBits(1+this.skipLZ())},Y.skipEG=function(){this.skipBits(1+this.skipLZ())},Y.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},Y.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},Y.readBoolean=function(){return this.readBits(1)===1},Y.readUByte=function(){return this.readBits(8)},Y.readUShort=function(){return this.readBits(16)},Y.readUInt=function(){return this.readBits(32)},Y.skipScalingList=function(r){for(var D=8,m=8,p,g=0;g<r;g++)m!==0&&(p=this.readEG(),m=(D+p+256)%256),D=m===0?D:m},Y.readSPS=function(){var r=0,D=0,m=0,p=0,g,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),O=this.skipEG.bind(this),S=this.skipUEG.bind(this),R=this.skipScalingList.bind(this);s();var A=s();if(i(5),o(3),s(),S(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var P=t();if(P===3&&o(1),S(),S(),o(1),u())for(a=P!==3?8:12,c=0;c<a;c++)u()&&(c<6?R(16):R(64))}S();var w=t();if(w===0)t();else if(w===1)for(o(1),O(),O(),g=t(),c=0;c<g;c++)O();S(),o(1);var E=t(),h=t(),f=i(1);f===0&&o(1),o(1),u()&&(r=t(),D=t(),m=t(),p=t());var T=[1,1];if(u()&&u()){var x=s();switch(x){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((E+1)*16-r*2-D*2),height:(2-f)*(h+1)*16-(f?2:4)*(m+p),pixelRatio:T}},Y.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Q.default=K},"./src/demux/id3.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"isHeader",function(){return q}),B.d(Q,"isFooter",function(){return K}),B.d(Q,"getID3Data",function(){return M}),B.d(Q,"canParse",function(){return V}),B.d(Q,"getTimeStamp",function(){return r}),B.d(Q,"isTimeStampFrame",function(){return D}),B.d(Q,"getID3Frames",function(){return p}),B.d(Q,"decodeFrame",function(){return g}),B.d(Q,"utf8ArrayToStr",function(){return t}),B.d(Q,"testables",function(){return u});var q=function(R,A){return A+10<=R.length&&(R[A]===73&&R[A+1]===68&&R[A+2]===51&&(R[A+3]<255&&R[A+4]<255&&(R[A+6]<128&&R[A+7]<128&&R[A+8]<128&&R[A+9]<128)))},K=function(R,A){return A+10<=R.length&&(R[A]===51&&R[A+1]===68&&R[A+2]===73&&(R[A+3]<255&&R[A+4]<255&&(R[A+6]<128&&R[A+7]<128&&R[A+8]<128&&R[A+9]<128)))},M=function(R,A){for(var P=A,w=0;q(R,A);){w+=10;var E=Y(R,A+6);w+=E,K(R,A+10)&&(w+=10),A+=w}return w>0?R.subarray(P,P+w):void 0},Y=function(R,A){var P=0;return P=(R[A]&127)<<21,P|=(R[A+1]&127)<<14,P|=(R[A+2]&127)<<7,P|=R[A+3]&127,P},V=function(R,A){return q(R,A)&&Y(R,A+6)+10<=R.length-A},r=function(R){for(var A=p(R),P=0;P<A.length;P++){var w=A[P];if(D(w))return i(w)}return},D=function(R){return R&&R.key==="PRIV"&&R.info==="com.apple.streaming.transportStreamTimestamp"},m=function(R){var A=String.fromCharCode(R[0],R[1],R[2],R[3]),P=Y(R,4),w=10;return{type:A,size:P,data:R.subarray(w,w+P)}},p=function(R){for(var A=0,P=[];q(R,A);){var w=Y(R,A+6);A+=10;for(var E=A+w;A+8<E;){var h=m(R.subarray(A)),f=g(h);f&&P.push(f),A+=h.size+10}K(R,A)&&(A+=10)}return P},g=function(R){return R.type==="PRIV"?a(R):R.type[0]==="W"?s(R):c(R)},a=function(R){if(R.size<2)return;var A=t(R.data,!0),P=new Uint8Array(R.data.subarray(A.length+1));return{key:R.type,info:A,data:P.buffer}},c=function(R){if(R.size<2)return;if(R.type==="TXXX"){var A=1,P=t(R.data.subarray(A),!0);A+=P.length+1;var w=t(R.data.subarray(A));return{key:R.type,info:P,data:w}}var E=t(R.data.subarray(1));return{key:R.type,data:E}},s=function(R){if(R.type==="WXXX"){if(R.size<2)return;var A=1,P=t(R.data.subarray(A),!0);A+=P.length+1;var w=t(R.data.subarray(A));return{key:R.type,info:P,data:w}}var E=t(R.data);return{key:R.type,data:E}},i=function(R){if(R.data.byteLength===8){var A=new Uint8Array(R.data),P=A[3]&1,w=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return w/=45,P&&(w+=4772185884e-2),Math.round(w)}return},t=function(R,A){A===void 0&&(A=!1);var P=O();if(P){var w=P.decode(R);if(A){var E=w.indexOf("\0");return E!==-1?w.substring(0,E):w}return w.replace(/\0/g,"")}for(var h=R.length,f,T,x,_="",j=0;j<h;){if(f=R[j++],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:T=R[j++],_+=String.fromCharCode((f&31)<<6|T&63);break;case 14:T=R[j++],x=R[j++],_+=String.fromCharCode((f&15)<<12|(T&63)<<6|(x&63)<<0);break;default:}}return _},u={decodeTextFrame:c},o;function O(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/id3.ts"),M=B("./src/utils/logger.ts"),Y=B("./src/demux/mpegaudio.ts");function V(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,r(m,p)}function r(m,p){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,p)}var D=function(m){V(p,m);function p(){return m.apply(this,arguments)||this}var g=p.prototype;return g.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}},p.probe=function(c){if(!c)return!1;for(var s=K.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if(Y.probe(c,i))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},g.canParse=function(c,s){return Y.canParse(c,s)},g.appendFrame=function(c,s,i){return this.initPTS===null?void 0:Y.appendFrame(c,s,i,this.initPTS,this.frameIndex)},p}(q.default);D.minProbeByteLength=4,Q.default=D},"./src/demux/mp4demuxer.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/utils/mp4-tools.ts"),K=B("./src/demux/dummy-demuxed-track.ts"),M=function(){function Y(r,D){this.remainderData=null,this.config=void 0,this.config=D}var V=Y.prototype;return V.resetTimeStamp=function(){},V.resetInitSegment=function(){},V.resetContiguity=function(){},Y.probe=function(D){return Object(q.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},V.demux=function(D){var m=D,p=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(q.appendUint8Array)(this.remainderData,D));var g=Object(q.segmentValidRange)(m);this.remainderData=g.remainder,p.samples=g.valid||new Uint8Array}else p.samples=m;return{audioTrack:Object(K.dummyTrack)(),avcTrack:p,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},V.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)()}},V.demuxSampleAes=function(D,m,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},V.destroy=function(){},Y}();M.minProbeByteLength=1024,Q.default=M},"./src/demux/mpegaudio.ts":function(ne,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 p}),B.d(Q,"canParse",function(){return g}),B.d(Q,"probe",function(){return a});var q=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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Y=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],V=[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 O=o.samplesPerFrame*9e4/o.sampleRate,S=t+u*O,R={unit:s.subarray(i,i+o.frameLength),pts:S,dts:S};return c.config=[],c.channelCount=o.channelCount,c.samplerate=o.sampleRate,c.samples.push(R),{sample:R,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 O=c[s+2]>>1&1,S=c[s+3]>>6,R=i===3?3-t:t===3?3:4,A=K[R*14+u-1]*1e3,P=i===3?0:i===2?1:2,w=M[P*3+o],E=S===3?1:2,h=Y[i][t],f=V[t],T=h*8*f,x=Math.floor(h*A/w+O)*f;if(q===null){var _=navigator.userAgent||"",j=_.match(/Chrome\/(\d+)/i);q=j?parseInt(j[1]):0}var W=!!q&&q<=87;return W&&t===2&&A>=224e3&&S===0&&(c[s+3]=c[s+3]|128),{sampleRate:w,channelCount:E,frameLength:x,samplesPerFrame:T}}}function m(c,s){return c[s]===255&&(c[s+1]&224)===224&&(c[s+1]&6)!==0}function p(c,s){return s+1<c.length&&m(c,s)}function g(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||p(c,o)}return!1}},"./src/demux/sample-aes.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/crypt/decrypter.ts"),K=B("./src/demux/tsdemuxer.ts"),M=function(){function Y(r,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new q.default(r,D,{removePKCS7Padding:!1})}var V=Y.prototype;return V.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},V.decryptAacSample=function(D,m,p,g){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),g||i.decryptAacSamples(D,m+1,p)})},V.decryptAacSamples=function(D,m,p){for(;;m++){if(m>=D.length){p();return}if(D[m].unit.length<32)continue;var g=this.decrypter.isSync();if(this.decryptAacSample(D,m,p,g),!g)return}},V.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(m),g=0,a=32;a<=D.length-16;a+=160,g+=16)p.set(D.subarray(a,a+16),g);return p},V.getAvcDecryptedUnit=function(D,m){for(var p=new Uint8Array(m),g=0,a=32;a<=D.length-16;a+=160,g+=16)D.set(p.subarray(g,g+16),a);return D},V.decryptAvcSample=function(D,m,p,g,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,p+1,g)})},V.decryptAvcSamples=function(D,m,p,g){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,p=0){if(m>=D.length){g();return}for(var a=D[m].units;!(p>=a.length);p++){var c=a[p];if(c.data.length<=48||c.type!==1&&c.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(D,m,p,g,c,s),!s)return}}},Y}();Q.default=M},"./src/demux/transmuxer-interface.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var q=B("./node_modules/webworkify-webpack/index.js"),K=B.n(q),M=B("./src/events.ts"),Y=B("./src/demux/transmuxer.ts"),V=B("./src/utils/logger.ts"),r=B("./src/errors.ts"),D=B("./src/utils/mediasource-helper.ts"),m=B("./node_modules/eventemitter3/index.js"),p=B.n(m),g=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function c(i,t,u,o){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=t,this.onTransmuxComplete=u,this.onFlush=o;var S=i.config,R=function(h,f){f=f||{},f.frag=O.frag,f.id=O.id,i.trigger(h,f)};this.observer=new m.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,R),this.observer.on(M.Events.ERROR,R);var A={mp4:g.isTypeSupported("video/mp4"),mpeg:g.isTypeSupported("audio/mpeg"),mp3:g.isTypeSupported('audio/mp4; codecs="mp3"')},P=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){V.logger.log("demuxing in webworker");var w;try{w=this.worker=q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(E){i.trigger(M.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},w.postMessage({cmd:"init",typeSupported:A,vendor:P,id:t,config:JSON.stringify(S)})}catch(E){V.logger.warn("Error in worker:",E),V.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new Y.default(this.observer,A,S,P,t),this.worker=null}}else this.transmuxer=new Y.default(this.observer,A,S,P,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,O,S,R,A,P,w,E){var h=this;w.transmuxing.start=self.performance.now();var f=this.transmuxer,T=this.worker,x=R?R.start:S.start,_=S.decryptdata,j=this.frag,W=!(j&&S.cc===j.cc),C=!(j&&w.level===j.level),F=j?w.sn-j.sn:-1,k=this.part?w.part-this.part.index:1,y=!C&&(F===1||F===0&&k===1),H=self.performance.now();(C||F||S.stats.parsing.start===0)&&(S.stats.parsing.start=H),R&&(k||!y)&&(R.stats.parsing.start=H);var J=new Y.TransmuxState(W,y,P,C,x);if(!y||W){V.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
|
|
discontinuity: `+W+`
|
|
trackSwitch: `+C+`
|
|
contiguous: `+y+`
|
|
accurateTimeOffset: `+P+`
|
|
timeOffset: `+x);var ae=new Y.TransmuxConfig(o,O,u,A,E);this.configureTransmuxer(ae)}if(this.frag=S,this.part=R,T)T.postMessage({cmd:"demux",data:t,decryptdata:_,chunkMeta:w,state:J},t instanceof ArrayBuffer?[t]:[]);else if(f){var fe=f.push(t,_,w,J);Object(Y.isPromise)(fe)?fe.then(function(ge){h.handleTransmuxComplete(ge)}):this.handleTransmuxComplete(fe)}},s.flush=function(t){var u=this;t.transmuxing.start=self.performance.now();var o=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:t});else if(o){var S=o.flush(t);Object(Y.isPromise)(S)?S.then(function(R){u.handleFlushResult(R,t)}):this.handleFlushResult(S,t)}},s.handleFlushResult=function(t,u){var o=this;t.forEach(function(O){o.handleTransmuxComplete(O)}),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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var q=B("./src/demux/transmuxer.ts"),K=B("./src/events.ts"),M=B("./src/utils/logger.ts"),Y=B("./node_modules/eventemitter3/index.js"),V=B.n(Y);function r(a){var c=new Y.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 q.default(c,t.typeSupported,u,t.vendor,t.id),Object(M.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(q.isPromise)(o)?o.then(function(R){D(a,R)}):D(a,o);break}case"flush":{var O=t.chunkMeta,S=a.transmuxer.flush(O);Object(q.isPromise)(S)?S.then(function(R){p(a,R,O)}):p(a,S,O);break}default:break}})}function D(a,c){if(g(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 p(a,c,s){c.forEach(function(i){D(a,i)}),a.postMessage({event:"flush",data:s})}function g(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"isPromise",function(){return S}),B.d(Q,"TransmuxConfig",function(){return R}),B.d(Q,"TransmuxState",function(){return A});var q=B("./src/events.ts"),K=B("./src/errors.ts"),M=B("./src/crypt/decrypter.ts"),Y=B("./src/demux/aacdemuxer.ts"),V=B("./src/demux/mp4demuxer.ts"),r=B("./src/demux/tsdemuxer.ts"),D=B("./src/demux/mp3demuxer.ts"),m=B("./src/remux/mp4-remuxer.ts"),p=B("./src/remux/passthrough-remuxer.ts"),g=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(P){c.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var i=[{demux:r.default,remux:m.default},{demux:V.default,remux:p.default},{demux:Y.default,remux:m.default},{demux:D.default,remux:m.default}],t=1024;i.forEach(function(P){var w=P.demux;t=Math.max(t,w.minProbeByteLength)});var u=function(){function P(E,h,f,T,x){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 g.default,this.observer=E,this.typeSupported=h,this.config=f,this.vendor=T,this.id=x}var w=P.prototype;return w.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},w.push=function(h,f,T,x){var _=this,j=T.transmuxing;j.executeStart=s();var W=new Uint8Array(h),C=this.cache,F=this.config,k=this.currentTransmuxState,y=this.transmuxConfig;x&&(this.currentTransmuxState=x);var H=o(W,f);if(H&&H.method==="AES-128"){var J=this.getDecrypter();if(F.enableSoftwareAES){var ae=J.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!ae)return j.executeEnd=s(),O(T);W=new Uint8Array(ae)}else return this.decryptionPromise=J.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(Fe){var qe=_.push(Fe,null,T);return _.decryptionPromise=null,qe}),this.decryptionPromise}var fe=x||k,ge=fe.contiguous,Te=fe.discontinuity,Ue=fe.trackSwitch,Se=fe.accurateTimeOffset,Le=fe.timeOffset,ye=y.audioCodec,Z=y.videoCodec,v=y.defaultInitPts,L=y.duration,z=y.initSegmentData;if((Te||Ue)&&this.resetInitSegment(z,ye,Z,L),Te&&this.resetInitialTimestamp(v),ge||this.resetContiguity(),this.needsProbing(W,Te,Ue)){if(C.dataLength){var ee=C.flush();W=Object(a.appendUint8Array)(ee,W)}this.configureTransmuxer(W,y)}var $=this.transmux(W,H,Le,Se,T),Ee=this.currentTransmuxState;return Ee.contiguous=!0,Ee.discontinuity=!1,Ee.trackSwitch=!1,j.executeEnd=s(),$},w.flush=function(h){var f=this,T=h.transmuxing;T.executeStart=s();var x=this.decrypter,_=this.cache,j=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return f.flush(h)});var C=[],F=j.timeOffset;if(x){var k=x.flush();k&&C.push(this.push(k,null,h))}var y=_.dataLength;_.reset();var H=this.demuxer,J=this.remuxer;if(!H||!J)return y>=t&&this.observer.emit(q.Events.ERROR,q.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=s(),[O(h)];var ae=H.flush(F);return S(ae)?ae.then(function(fe){return f.flushRemux(C,fe,h),C}):(this.flushRemux(C,ae,h),C)},w.flushRemux=function(h,f,T){var x=f.audioTrack,_=f.avcTrack,j=f.id3Track,W=f.textTrack,C=this.currentTransmuxState,F=C.accurateTimeOffset,k=C.timeOffset;c.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var y=this.remuxer.remux(x,_,j,W,k,F,!0,this.id);h.push({remuxResult:y,chunkMeta:T}),T.transmuxing.executeEnd=s()},w.resetInitialTimestamp=function(h){var f=this.demuxer,T=this.remuxer;if(!f||!T)return;f.resetTimeStamp(h),T.resetTimeStamp(h)},w.resetContiguity=function(){var h=this.demuxer,f=this.remuxer;if(!h||!f)return;h.resetContiguity(),f.resetNextTimestamp()},w.resetInitSegment=function(h,f,T,x){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetInitSegment(f,T,x),j.resetInitSegment(h,f,T)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(h,f,T,x,_){var j;return f&&f.method==="SAMPLE-AES"?j=this.transmuxSampleAes(h,f,T,x,_):j=this.transmuxUnencrypted(h,T,x,_),j},w.transmuxUnencrypted=function(h,f,T,x){var _=this.demuxer.demux(h,f,!1,!this.config.progressive),j=_.audioTrack,W=_.avcTrack,C=_.id3Track,F=_.textTrack,k=this.remuxer.remux(j,W,C,F,f,T,!1,this.id);return{remuxResult:k,chunkMeta:x}},w.transmuxSampleAes=function(h,f,T,x,_){var j=this;return this.demuxer.demuxSampleAes(h,f,T).then(function(W){var C=j.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,T,x,!1,j.id);return{remuxResult:C,chunkMeta:_}})},w.configureTransmuxer=function(h,f){for(var T=this.config,x=this.observer,_=this.typeSupported,j=this.vendor,W=f.audioCodec,C=f.defaultInitPts,F=f.duration,k=f.initSegmentData,y=f.videoCodec,H,J=0,ae=i.length;J<ae;J++)if(i[J].demux.probe(h)){H=i[J];break}H||(c.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:V.default,remux:p.default});var fe=this.demuxer,ge=this.remuxer,Te=H.remux,Ue=H.demux;(!ge||!(ge instanceof Te))&&(this.remuxer=new Te(x,T,_,j)),(!fe||!(fe instanceof Ue))&&(this.demuxer=new Ue(x,T,_),this.probe=Ue.probe),this.resetInitSegment(k,W,y,F),this.resetInitialTimestamp(C)},w.needsProbing=function(h,f,T){return!this.demuxer||!this.remuxer||f||T},w.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new M.default(this.observer,this.config)),h},P}();function o(P,w){var E=null;return P.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(E=w),E}var O=function(w){return{remuxResult:{},chunkMeta:w}};function S(P){return"then"in P&&P.then instanceof Function}var R=function(w,E,h,f,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=E,this.initSegmentData=h,this.duration=f,this.defaultInitPts=T},A=function(w,E,h,f,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=E,this.accurateTimeOffset=h,this.trackSwitch=f,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"discardEPB",function(){return O});var q=B("./src/demux/adts.ts"),K=B("./src/demux/mpegaudio.ts"),M=B("./src/demux/exp-golomb.ts"),Y=B("./src/demux/id3.ts"),V=B("./src/demux/sample-aes.ts"),r=B("./src/events.ts"),D=B("./src/utils/mp4-tools.ts"),m=B("./src/utils/logger.ts"),p=B("./src/errors.ts"),g={video:1,audio:2,id3:3,text:4},a=function(){function S(A,P,w){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=P,this.typeSupported=w}S.probe=function(P){var w=S.syncOffset(P);return w<0?!1:(w&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},S.syncOffset=function(P){for(var w=Math.min(1e3,P.length-3*188),E=0;E<w;){if(P[E]===71&&P[E+188]===71&&P[E+2*188]===71)return E;E++}return-1},S.createTrack=function(P,w){return{container:P==="video"||P==="audio"?"video/mp2t":void 0,type:P,id:g[P],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:P==="audio"?w:void 0}};var R=S.prototype;return R.resetInitSegment=function(P,w,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",E),this._audioTrack=S.createTrack("audio",E),this._id3Track=S.createTrack("id3",E),this._txtTrack=S.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=P,this.videoCodec=w,this._duration=E},R.resetTimeStamp=function(){},R.resetContiguity=function(){var P=this._audioTrack,w=this._avcTrack,E=this._id3Track;P&&(P.pesData=null),w&&(w.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},R.demux=function(P,w,E,h){E===void 0&&(E=!1),h===void 0&&(h=!1),E||(this.sampleAes=null);var f,T=this._avcTrack,x=this._audioTrack,_=this._id3Track,j=T.pid,W=T.pesData,C=x.pid,F=_.pid,k=x.pesData,y=_.pesData,H=!1,J=this.pmtParsed,ae=this._pmtId,fe=P.length;if(this.remainderData&&(P=Object(D.appendUint8Array)(this.remainderData,P),fe=P.length,this.remainderData=null),fe<188&&!h)return this.remainderData=P,{audioTrack:x,avcTrack:T,id3Track:_,textTrack:this._txtTrack};var ge=Math.max(0,S.syncOffset(P));fe-=(fe+ge)%188,fe<P.byteLength&&!h&&(this.remainderData=new Uint8Array(P.buffer,fe,P.buffer.byteLength-fe));for(var Te=ge;Te<fe;Te+=188)if(P[Te]===71){var Ue=!!(P[Te+1]&64),Se=((P[Te+1]&31)<<8)+P[Te+2],Le=(P[Te+3]&48)>>4,ye=void 0;if(Le>1){if(ye=Te+5+P[Te+4],ye===Te+188)continue}else ye=Te+4;switch(Se){case j:Ue&&(W&&(f=t(W))&&this.parseAVCPES(f,!1),W={data:[],size:0}),W&&(W.data.push(P.subarray(ye,Te+188)),W.size+=Te+188-ye);break;case C:Ue&&(k&&(f=t(k))&&(x.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),k={data:[],size:0}),k&&(k.data.push(P.subarray(ye,Te+188)),k.size+=Te+188-ye);break;case F:Ue&&(y&&(f=t(y))&&this.parseID3PES(f),y={data:[],size:0}),y&&(y.data.push(P.subarray(ye,Te+188)),y.size+=Te+188-ye);break;case 0:Ue&&(ye+=P[ye]+1),ae=this._pmtId=s(P,ye);break;case ae:{Ue&&(ye+=P[ye]+1);var Z=i(P,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);j=Z.avc,j>0&&(T.pid=j),C=Z.audio,C>0&&(x.pid=C,x.isAAC=Z.isAAC),F=Z.id3,F>0&&(_.pid=F),H&&!J&&(m.logger.log("reparse from beginning"),H=!1,Te=ge-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=W,x.pesData=k,_.pesData=y;var v={audioTrack:x,avcTrack:T,id3Track:_,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(v),v},R.flush=function(){var P=this.remainderData;this.remainderData=null;var w;return P?w=this.demux(P,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},R.extractRemainingSamples=function(P){var w=P.audioTrack,E=P.avcTrack,h=P.id3Track,f=E.pesData,T=w.pesData,x=h.pesData,_;f&&(_=t(f))?(this.parseAVCPES(_,!0),E.pesData=null):E.pesData=f,T&&(_=t(T))?(w.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),w.pesData=null):(T!=null&&T.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=T),x&&(_=t(x))?(this.parseID3PES(_),h.pesData=null):h.pesData=x},R.demuxSampleAes=function(P,w,E){var h=this.demux(P,E,!0,!this.config.progressive),f=this.sampleAes=new V.default(this.observer,this.config,w);return this.decrypt(h,f)},R.decrypt=function(P,w){return new Promise(function(E){var h=P.audioTrack,f=P.avcTrack;h.samples&&h.isAAC?w.decryptAacSamples(h.samples,0,function(){f.samples?w.decryptAvcSamples(f.samples,0,0,function(){E(P)}):E(P)}):f.samples&&w.decryptAvcSamples(f.samples,0,0,function(){E(P)})})},R.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},R.parseAVCPES=function(P,w){var E=this,h=this._avcTrack,f=this.parseAVCNALu(P.data),T=!1,x=this.avcSample,_,j=!1;P.data=null,x&&f.length&&!h.audFound&&(u(x,h),x=this.avcSample=c(!1,P.pts,P.dts,"")),f.forEach(function(W){switch(W.type){case 1:{_=!0,x||(x=E.avcSample=c(!0,P.pts,P.dts,"")),T&&(x.debug+="NDR "),x.frame=!0;var C=W.data;if(j&&C.length>4){var F=new M.default(C).readSliceType();(F===2||F===4||F===7||F===9)&&(x.key=!0)}break}case 5:_=!0,x||(x=E.avcSample=c(!0,P.pts,P.dts,"")),T&&(x.debug+="IDR "),x.key=!0,x.frame=!0;break;case 6:{_=!0,T&&x&&(x.debug+="SEI ");var k=new M.default(O(W.data));k.readUByte();for(var y=0,H=0,J=!1,ae=0;!J&&k.bytesAvailable>1;){y=0;do ae=k.readUByte(),y+=ae;while(ae===255);H=0;do ae=k.readUByte(),H+=ae;while(ae===255);if(y===4&&k.bytesAvailable!==0){J=!0;var fe=k.readUByte();if(fe===181){var ge=k.readUShort();if(ge===49){var Te=k.readUInt();if(Te===1195456820){var Ue=k.readUByte();if(Ue===3){for(var Se=k.readUByte(),Le=k.readUByte(),ye=31&Se,Z=[Se,Le],v=0;v<ye;v++)Z.push(k.readUByte()),Z.push(k.readUByte()),Z.push(k.readUByte());o(E._txtTrack.samples,{type:3,pts:P.pts,bytes:Z})}}}}}else if(y===5&&k.bytesAvailable!==0){if(J=!0,H>16){for(var L=[],z=0;z<16;z++)L.push(k.readUByte().toString(16)),(z===3||z===5||z===7||z===9)&&L.push("-");for(var ee=H-16,$=new Uint8Array(ee),Ee=0;Ee<ee;Ee++)$[Ee]=k.readUByte();o(E._txtTrack.samples,{pts:P.pts,payloadType:y,uuid:L.join(""),userData:Object(Y.utf8ArrayToStr)($),userDataBytes:$})}}else if(H<k.bytesAvailable)for(var Fe=0;Fe<H;Fe++)k.readUByte()}break}case 7:if(_=!0,j=!0,T&&x&&(x.debug+="SPS "),!h.sps){var qe=new M.default(W.data),Ce=qe.readSPS();h.width=Ce.width,h.height=Ce.height,h.pixelRatio=Ce.pixelRatio,h.sps=[W.data],h.duration=E._duration;for(var Me=W.data.subarray(1,4),He="avc1.",Ke=0;Ke<3;Ke++){var ut=Me[Ke].toString(16);ut.length<2&&(ut="0"+ut),He+=ut}h.codec=He}break;case 8:_=!0,T&&x&&(x.debug+="PPS "),h.pps||(h.pps=[W.data]);break;case 9:_=!1,h.audFound=!0,x&&u(x,h),x=E.avcSample=c(!1,P.pts,P.dts,T?"AUD ":"");break;case 12:_=!1;break;default:_=!1,x&&(x.debug+="unknown NAL "+W.type+" ");break}if(x&&_){var bt=x.units;bt.push(W)}}),w&&x&&(u(x,h),this.avcSample=null)},R.getLastNalUnit=function(){var P,w=this.avcSample,E;if(!w||w.units.length===0){var h=this._avcTrack.samples;w=h[h.length-1]}if((P=w)!==null&&P!==void 0&&P.units){var f=w.units;E=f[f.length-1]}return E},R.parseAVCNALu=function(P){var w=P.byteLength,E=this._avcTrack,h=E.naluState||0,f=h,T=[],x=0,_,j,W,C=-1,F=0;for(h===-1&&(C=0,F=P[0]&31,h=0,x=1);x<w;){if(_=P[x++],!h){h=_?0:1;continue}if(h===1){h=_?0:2;continue}if(!_)h=3;else if(_===1){if(C>=0){var k={data:P.subarray(C,x-h-1),type:F};T.push(k)}else{var y=this.getLastNalUnit();if(y&&(f&&x<=4-f&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-f))),j=x-h-1,j>0)){var H=new Uint8Array(y.data.byteLength+j);H.set(y.data,0),H.set(P.subarray(0,j),y.data.byteLength),y.data=H,y.state=0}}x<w?(W=P[x]&31,C=x,F=W,h=0):h=-1}else h=0}if(C>=0&&h>=0){var J={data:P.subarray(C,w),type:F,state:h};T.push(J)}if(T.length===0){var ae=this.getLastNalUnit();if(ae){var fe=new Uint8Array(ae.data.byteLength+P.byteLength);fe.set(ae.data,0),fe.set(P,ae.data.byteLength),ae.data=fe}}return E.naluState=h,T},R.parseAACPES=function(P){var w=0,E=this._audioTrack,h=this.aacOverFlow,f=P.data;if(h){this.aacOverFlow=null;var T=h.sample.unit.byteLength,x=Math.min(h.missing,T),_=T-x;h.sample.unit.set(f.subarray(0,x),_),E.samples.push(h.sample),w=h.missing}var j,W;for(j=w,W=f.length;j<W-1&&!q.isHeader(f,j);j++);if(j!==w){var C,F;if(j<W-1?(C="AAC PES did not start with ADTS header,offset:"+j,F=!1):(C="no ADTS header found in AAC PES",F=!0),m.logger.warn("parsing error:"+C),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:C}),F)return}q.initTrackConfig(E,this.observer,f,j,this.audioCodec);var k;if(P.pts!==void 0)k=P.pts;else if(h){var y=q.getFrameDuration(E.samplerate);k=h.sample.pts+y}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;j<W;)if(q.isHeader(f,j)){if(j+5<W){var J=q.appendFrame(E,f,j,k,H);if(J)if(J.missing)this.aacOverFlow=J;else{j+=J.length,H++;continue}}break}else j++},R.parseMPEGPES=function(P){var w=P.data,E=w.length,h=0,f=0,T=P.pts;if(T===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<E;)if(K.isHeader(w,f)){var x=K.appendFrame(this._audioTrack,w,f,T,h);if(x)f+=x.length,h++;else break}else f++},R.parseID3PES=function(P){if(P.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(P)},S}();a.minProbeByteLength=188;function c(S,R,A,P){return{key:S,frame:!1,pts:R,dts:A,units:[],debug:P,length:0}}function s(S,R){return(S[R+10]&31)<<8|S[R+11]}function i(S,R,A,P){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(S[R+1]&15)<<8|S[R+2],h=R+3+E-4,f=(S[R+10]&15)<<8|S[R+11];for(R+=12+f;R<h;){var T=(S[R+1]&31)<<8|S[R+2];switch(S[R]){case 207:if(!P){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=T);break;case 21:w.id3===-1&&(w.id3=T);break;case 219:if(!P){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=T);break;case 3:case 4:A?w.audio===-1&&(w.audio=T,w.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}R+=((S[R+3]&15)<<8|S[R+4])+5}return w}function t(S){var R=0,A,P,w,E,h,f=S.data;if(!S||S.size===0)return null;for(;f[0].length<19&&f.length>1;){var T=new Uint8Array(f[0].length+f[1].length);T.set(f[0]),T.set(f[1],f[0].length),f[0]=T,f.splice(1,1)}A=f[0];var x=(A[0]<<16)+(A[1]<<8)+A[2];if(x===1){if(P=(A[4]<<8)+A[5],P&&P>S.size-6)return null;var _=A[7];_&192&&(E=(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,E-h>60*9e4&&(m.logger.warn(Math.round((E-h)/9e4)+"s delta between PTS and DTS, align them"),E=h)):h=E),w=A[8];var j=w+9;if(S.size<=j)return null;S.size-=j;for(var W=new Uint8Array(S.size),C=0,F=f.length;C<F;C++){A=f[C];var k=A.byteLength;if(j)if(j>k){j-=k;continue}else A=A.subarray(j),k-=j,j=0;W.set(A,R),R+=k}return P&&(P-=w+3),{data:W,pts:E,dts:h,len:P}}return null}function u(S,R){if(S.units.length&&S.frame){if(S.pts===void 0){var A=R.samples,P=A.length;if(P){var w=A[P-1];S.pts=w.pts,S.dts=w.dts}else{R.dropped++;return}}R.samples.push(S)}S.debug.length&&m.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function o(S,R){var A=S.length;if(A>0){if(R.pts>=S[A-1].pts)S.push(R);else for(var P=A-1;P>=0;P--)if(R.pts<S[P].pts){S.splice(P,0,R);break}}else S.push(R)}function O(S){for(var R=S.byteLength,A=[],P=1;P<R-2;)S[P]===0&&S[P+1]===0&&S[P+2]===3?(A.push(P+2),P+=2):P++;if(A.length===0)return S;var w=R-A.length,E=new Uint8Array(w),h=0;for(P=0;P<w;h++,P++)h===A[0]&&(h++,A.shift()),E[P]=S[h];return E}Q.default=a},"./src/errors.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"ErrorTypes",function(){return q}),B.d(Q,"ErrorDetails",function(){return K});var q;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(q||(q={}));var K;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(K||(K={}))},"./src/events.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"Events",function(){return q});var q;(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"})(q||(q={}))},"./src/hls.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return S});var q=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(q),M=B("./src/loader/playlist-loader.ts"),Y=B("./src/loader/key-loader.ts"),V=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"),p=B("./src/controller/stream-controller.ts"),g=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(R,A){for(var P=0;P<A.length;P++){var w=A[P];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(R,w.key,w)}}function O(R,A,P){return A&&o(R.prototype,A),P&&o(R,P),R}var S=function(){R.isSupported=function(){return Object(g.isSupported)()};function R(P){P===void 0&&(P={}),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 w=this.config=Object(c.mergeConfig)(R.DefaultConfig,P);this.userConfig=P,Object(a.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(c.enableStreamingMode)(w);var E=w.abrController,h=w.bufferController,f=w.capLevelController,T=w.fpsController,x=this.abrController=new E(this),_=this.bufferController=new h(this),j=this.capLevelController=new f(this),W=new T(this),C=new M.default(this),F=new Y.default(this),k=new V.default(this),y=this.levelController=new D.default(this),H=new m.FragmentTracker(this),J=this.streamController=new p.default(this,H);j.setStreamController(J),W.setStreamController(J);var ae=[y,J];this.networkControllers=ae;var fe=[C,F,x,_,j,W,k,H];this.audioTrackController=this.createController(w.audioTrackController,null,ae),this.createController(w.audioStreamController,H,ae),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,ae),this.createController(w.subtitleStreamController,H,ae),this.createController(w.timelineController,null,fe),this.emeController=this.createController(w.emeController,null,fe),this.cmcdController=this.createController(w.cmcdController,null,fe),this.latencyController=this.createController(r.default,null,fe),this.coreComponents=fe}var A=R.prototype;return A.createController=function(w,E,h){if(w){var f=E?new w(this,E):new w(this);return h&&h.push(f),f}return null},A.on=function(w,E,h){h===void 0&&(h=this),this._emitter.on(w,E,h)},A.once=function(w,E,h){h===void 0&&(h=this),this._emitter.once(w,E,h)},A.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},A.off=function(w,E,h,f){h===void 0&&(h=this),this._emitter.off(w,E,h,f)},A.listeners=function(w){return this._emitter.listeners(w)},A.emit=function(w,E,h){return this._emitter.emit(w,E,h)},A.trigger=function(w,E){if(this.config.debug)return this.emit(w,w,E);try{return this.emit(w,w,E)}catch(h){a.logger.error("An internal error happened while handling event "+w+'. 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:w,error:h})}return!1},A.listenerCount=function(w){return this._emitter.listenerCount(w)},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(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},A.attachMedia=function(w){a.logger.log("attachMedia"),this._media=w,this.trigger(t.Events.MEDIA_ATTACHING,{media:w})},A.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(w){this.stopLoad();var E=this.media,h=this.url,f=this.url=q.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});a.logger.log("loadSource:"+f),E&&h&&h!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(t.Events.MANIFEST_LOADING,{url:w})},A.startLoad=function(w){w===void 0&&(w=-1),a.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(E){E.startLoad(w)})},A.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},A.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){a.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},A.removeLevel=function(w,E){E===void 0&&(E=0),this.levelController.removeLevel(w,E)},O(R,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){a.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){a.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){a.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){a.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){a.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var E=!!w;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(a.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,E=this.config.minAutoBitrate;if(!w)return 0;for(var h=w.length,f=0;f<h;f++)if(w[f].maxBitrate>E)return f;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,E=this.autoLevelCapping,h;return E===-1&&w&&w.length?h=w.length-1:h=E,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var E=this.audioTrackController;E&&(E.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{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 R.defaultConfig?R.defaultConfig:c.hlsDefaultConfig},set:function(w){R.defaultConfig=w}}]),R}();S.defaultConfig=void 0},"./src/is-supported.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"isSupported",function(){return M}),B.d(Q,"changeTypeSupported",function(){return Y});var q=B("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var V=Object(q.getMediaSource)();if(!V)return!1;var r=K(),D=V&&typeof V.isTypeSupported=="function"&&V.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 Y(){var V,r=K();return typeof(r==null||((V=r.prototype)===null||V===void 0)?void 0:V.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a}),B.d(Q,"LoadError",function(){return s});var q=B("./src/polyfills/number.ts"),K=B("./src/errors.ts");function M(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,m(i,t)}function Y(i){var t=typeof Map=="function"?new Map:void 0;return Y=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,O)}function O(){return V(o,arguments,p(this).constructor)}return O.prototype=Object.create(o.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,o)},Y(i)}function V(i,t,u){return r()?V=Reflect.construct:V=function(O,S,R){var A=[null];A.push.apply(A,S);var P=Function.bind.apply(O,A),w=new P;return R&&m(w,R.prototype),w},V.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,O){return o.__proto__=O,o},m(i,t)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},p(i)}var g=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,O){var S=this,R=o.url;if(!R)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 "+(R?"part list":"url")));this.abort();var A=this.config,P=A.fLoader,w=A.loader;return new Promise(function(E,h){S.loader&&S.loader.destroy();var f=S.loader=o.loader=P?new P(A):new w(A),T=c(o),x={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:g};o.stats=f.stats,f.load(T,x,{onSuccess:function(j,W,C,F){S.resetLoader(o,f),E({frag:o,part:null,payload:j.data,networkDetails:F})},onError:function(j,W,C){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:j,networkDetails:C}))},onAbort:function(j,W,C){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:C}))},onTimeout:function(j,W,C){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:C}))},onProgress:function(j,W,C,F){O&&O({frag:o,part:null,payload:C,networkDetails:F})}})})},t.loadPart=function(o,O,S){var R=this;this.abort();var A=this.config,P=A.fLoader,w=A.loader;return new Promise(function(E,h){R.loader&&R.loader.destroy();var f=R.loader=o.loader=P?new P(A):new w(A),T=c(o,O),x={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:g};O.stats=f.stats,f.load(T,x,{onSuccess:function(j,W,C,F){R.resetLoader(o,f),R.updateStatsFromPart(o,O);var k={frag:o,part:O,payload:j.data,networkDetails:F};S(k),E(k)},onError:function(j,W,C){R.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:O,response:j,networkDetails:C}))},onAbort:function(j,W,C){o.stats.aborted=O.stats.aborted,R.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:O,networkDetails:C}))},onTimeout:function(j,W,C){R.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:O,networkDetails:C}))}})})},t.updateStatsFromPart=function(o,O){var S=o.stats,R=O.stats,A=R.total;if(S.loaded+=R.loaded,A){var P=Math.round(o.duration/O.duration),w=Math.min(Math.round(S.loaded/A),P),E=P-w,h=E*Math.round(S.loaded/w);S.total=S.loaded+h}else S.total=Math.max(S.loaded,S.total);var f=S.loading,T=R.loading;f.start?f.first+=T.first-T.start:(f.start=T.start,f.first=T.first),f.end=T.end},t.resetLoader=function(o,O){o.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.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},O=u.byteRangeStartOffset,S=u.byteRangeEndOffset;return Object(q.isFiniteNumber)(O)&&Object(q.isFiniteNumber)(S)&&(o.rangeStart=O,o.rangeEnd=S),o}var s=function(i){M(t,i);function t(u){for(var o,O=arguments.length,S=new Array(O>1?O-1:0),R=1;R<O;R++)S[R-1]=arguments[R];return o=i.call.apply(i,[this].concat(S))||this,o.data=void 0,o.data=u,o}return t}(Y(Error))},"./src/loader/fragment.ts":function(ne,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 q=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),M=B.n(K),Y=B("./src/utils/logger.ts"),V=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(O,S){return O.__proto__=S,O},m(t,u)}function p(t,u){for(var o=0;o<u.length;o++){var O=u[o];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(t,O.key,O)}}function g(t,u,o){return u&&p(t.prototype,u),o&&p(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 O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[a.AUDIO]=null,O[a.VIDEO]=null,O[a.AUDIOVIDEO]=null,O),this.baseurl=o}var u=t.prototype;return u.setByteRange=function(O,S){var R=O.split("@",2),A=[];R.length===1?A[0]=S?S.byteRangeEndOffset:0:A[0]=parseInt(R[1]),A[1]=parseInt(R[0])+A[0],this._byteRange=A},g(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(O){this._url=O}}]),t}(),s=function(t){D(u,t);function u(O,S){var R;return R=t.call(this,S)||this,R._decryptdata=null,R.rawProgramDateTime=null,R.programDateTime=null,R.tagList=[],R.duration=0,R.sn=0,R.levelkey=void 0,R.type=void 0,R.loader=null,R.level=-1,R.cc=0,R.startPTS=void 0,R.endPTS=void 0,R.appendedPTS=void 0,R.startDTS=void 0,R.endDTS=void 0,R.start=0,R.deltaPTS=void 0,R.maxStartPTS=void 0,R.minEndPTS=void 0,R.stats=new r.LoadStats,R.urlId=0,R.data=void 0,R.bitrateTest=!1,R.title=null,R.initSegment=null,R.type=O,R}var o=u.prototype;return o.createInitializationVector=function(S){for(var R=new Uint8Array(16),A=12;A<16;A++)R[A]=S>>8*(15-A)&255;return R},o.setDecryptDataFromLevelKey=function(S,R){var A=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(A=V.LevelKey.fromURI(S.uri),A.method=S.method,A.iv=this.createInitializationVector(R),A.keyFormat="identity"),A},o.setElementaryStreamInfo=function(S,R,A,P,w,E){E===void 0&&(E=!1);var h=this.elementaryStreams,f=h[S];if(!f){h[S]={startPTS:R,endPTS:A,startDTS:P,endDTS:w,partial:E};return}f.startPTS=Math.min(f.startPTS,R),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,P),f.endDTS=Math.max(f.endDTS,w)},o.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[a.AUDIO]=null,S[a.VIDEO]=null,S[a.AUDIOVIDEO]=null},g(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&Y.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(q.isFiniteNumber)(this.programDateTime))return null;var S=Object(q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),u}(c),i=function(t){D(u,t);function u(o,O,S,R,A){var P;P=t.call(this,S)||this,P.fragOffset=0,P.duration=0,P.gap=!1,P.independent=!1,P.relurl=void 0,P.fragment=void 0,P.index=void 0,P.stats=new r.LoadStats,P.duration=o.decimalFloatingPoint("DURATION"),P.gap=o.bool("GAP"),P.independent=o.bool("INDEPENDENT"),P.relurl=o.enumeratedString("URI"),P.fragment=O,P.index=R;var w=o.enumeratedString("BYTERANGE");return w&&P.setByteRange(w,A),A&&(P.fragOffset=A.fragOffset+A.duration),P}return g(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 O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),u}(c)},"./src/loader/key-loader.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return Y});var q=B("./src/events.ts"),K=B("./src/errors.ts"),M=B("./src/utils/logger.ts"),Y=function(){function V(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var r=V.prototype;return r._registerListeners=function(){this.hls.on(q.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(q.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var p=this.loaders[m];p&&p.destroy()}this.loaders={}},r.onKeyLoading=function(m,p){var g=p.frag,a=g.type,c=this.loaders[a];if(!g.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=g.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(c&&(M.logger.warn("abort previous key loader for type:"+a),c.abort()),!s){M.logger.warn("key uri is falsy");return}var t=i.loader,u=g.loader=this.loaders[a]=new t(i);this.decrypturl=s,this.decryptkey=null;var o={url:s,frag:g,responseType:"arraybuffer"},O={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(o,O,S)}else this.decryptkey&&(g.decryptdata.key=this.decryptkey,this.hls.trigger(q.Events.KEY_LOADED,{frag:g}))},r.loadsuccess=function(m,p,g){var a=g.frag;if(!a.decryptdata){M.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(q.Events.KEY_LOADED,{frag:a})},r.loaderror=function(m,p){var g=p.frag,a=g.loader;a&&a.abort(),delete this.loaders[g.type],this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:g,response:m})},r.loadtimeout=function(m,p){var g=p.frag,a=g.loader;a&&a.abort(),delete this.loaders[g.type],this.hls.trigger(q.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:g})},V}()},"./src/loader/level-details.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"LevelDetails",function(){return V});var q=B("./src/polyfills/number.ts");function K(r,D){for(var m=0;m<D.length;m++){var p=D[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function M(r,D,m){return D&&K(r.prototype,D),m&&K(r,m),r}var Y=10,V=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(p){if(!p){this.advanced=!0,this.updated=!0;return}var g=this.lastPartSn-p.lastPartSn,a=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!a||!!g,this.advanced=this.endSN>p.endSN||g>0||g===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},M(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||Y}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var g=this.driftEnd-this.driftStart;return g*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"LevelKey",function(){return V});var q=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(q);function M(r,D){for(var m=0;m<D.length;m++){var p=D[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function Y(r,D,m){return D&&M(r.prototype,D),m&&M(r,m),r}var V=function(){r.fromURL=function(m,p){return new r(m,p)},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(q.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return Y(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"LoadStats",function(){return q});var q=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u});var q=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),M=B.n(K),Y=B("./src/loader/fragment.ts"),V=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"),p=B("./src/utils/codecs.ts"),g=/#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 P,w;return i.test((P=(w=K.parseURL(A))===null||w===void 0?void 0:w.path)!=null?P:"")}var u=function(){function A(){}return A.findGroup=function(w,E){for(var h=0;h<w.length;h++){var f=w[h];if(f.id===E)return f}},A.convertAVC1ToAVCOTI=function(w){var E=w.split(".");if(E.length>2){var h=E.shift()+".";return h+=parseInt(E.shift()).toString(16),h+=("000"+parseInt(E.shift()).toString(16)).substr(-4),h}return w},A.resolve=function(w,E){return K.buildAbsoluteURL(E,w,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(w,E){var h=[],f={},T=!1;g.lastIndex=0;for(var x;(x=g.exec(w))!=null;)if(x[1]){var _=new D.AttrList(x[1]),j={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(x[2],E)},W=_.decimalResolution("RESOLUTION");W&&(j.width=W.width,j.height=W.height),o((_.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=A.convertAVC1ToAVCOTI(j.videoCodec)),h.push(j)}else if(x[3]){var C=new D.AttrList(x[3]);C["DATA-ID"]&&(T=!0,f[C["DATA-ID"]]=C)}return{levels:h,sessionData:T?f:null}},A.parseMasterPlaylistMedia=function(w,E,h,f){f===void 0&&(f=[]);var T,x=[],_=0;for(a.lastIndex=0;(T=a.exec(w))!==null;){var j=new D.AttrList(T[1]);if(j.TYPE===h){var W={attrs:j,bitrate:0,id:_++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:h,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?A.resolve(j.URI,E):""};if(f.length){var C=A.findGroup(f,W.groupId)||f[0];O(W,C,"audioCodec"),O(W,C,"textCodec")}x.push(W)}}return x},A.parseLevelPlaylist=function(w,E,h,f,T){var x=new V.LevelDetails(E),_=x.fragments,j=null,W=0,C=0,F=0,k=0,y=null,H=new Y.Fragment(f,E),J,ae,fe,ge=-1,Te=!1;for(c.lastIndex=0,x.m3u8=w;(J=c.exec(w))!==null;){Te&&(Te=!1,H=new Y.Fragment(f,E),H.start=F,H.sn=W,H.cc=k,H.level=h,j&&(H.initSegment=j,H.rawProgramDateTime=j.rawProgramDateTime));var Ue=J[1];if(Ue){H.duration=parseFloat(Ue);var Se=(" "+J[2]).slice(1);H.title=Se||null,H.tagList.push(Se?["INF",Ue,Se]:["INF",Ue])}else if(J[3])Object(q.isFiniteNumber)(H.duration)&&(H.start=F,fe&&(H.levelkey=fe),H.sn=W,H.level=h,H.cc=k,H.urlId=T,_.push(H),H.relurl=(" "+J[3]).slice(1),R(H,y),y=H,F+=H.duration,W++,C=0,Te=!0);else if(J[4]){var Le=(" "+J[4]).slice(1);y?H.setByteRange(Le,y):H.setByteRange(Le)}else if(J[5])H.rawProgramDateTime=(" "+J[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),ge===-1&&(ge=_.length);else{if(J=J[0].match(s),!J){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<J.length&&!(typeof J[ae]!="undefined");ae++);var ye=(" "+J[ae]).slice(1),Z=(" "+J[ae+1]).slice(1),v=J[ae+2]?(" "+J[ae+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":x.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":W=x.startSN=parseInt(Z);break;case"SKIP":{var L=new D.AttrList(Z),z=L.decimalInteger("SKIPPED-SEGMENTS");if(Object(q.isFiniteNumber)(z)){x.skippedSegments=z;for(var ee=z;ee--;)_.unshift(null);W+=z}var $=L.enumeratedString("RECENTLY-REMOVED-DATERANGES");$&&(x.recentlyRemovedDateranges=$.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(Z);break;case"VERSION":x.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(Z||v)&&H.tagList.push(v?[Z,v]:[Z]);break;case"DIS":k++;case"GAP":H.tagList.push([ye]);break;case"BITRATE":H.tagList.push([ye,Z]);break;case"DISCONTINUITY-SEQ":k=parseInt(Z);break;case"KEY":{var Ee,Fe=new D.AttrList(Z),qe=Fe.enumeratedString("METHOD"),Ce=Fe.URI,Me=Fe.hexadecimalInteger("IV"),He=Fe.enumeratedString("KEYFORMATVERSIONS"),Ke=Fe.enumeratedString("KEYID"),ut=(Ee=Fe.enumeratedString("KEYFORMAT"))!=null?Ee:"identity",bt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(bt.indexOf(ut)>-1){m.logger.warn("Keyformat "+ut+" is not supported from the manifest");continue}else if(ut!=="identity")continue;qe&&(fe=r.LevelKey.fromURL(E,Ce),Ce&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(qe)>=0&&(fe.method=qe,fe.keyFormat=ut,Ke&&(fe.keyID=Ke),He&&(fe.keyFormatVersions=He),fe.iv=Me));break}case"START":{var Lt=new D.AttrList(Z),Ft=Lt.decimalFloatingPoint("TIME-OFFSET");Object(q.isFiniteNumber)(Ft)&&(x.startTimeOffset=Ft);break}case"MAP":{var Yt=new D.AttrList(Z);H.relurl=Yt.URI,Yt.BYTERANGE&&H.setByteRange(Yt.BYTERANGE),H.level=h,H.sn="initSegment",fe&&(H.levelkey=fe),H.initSegment=null,j=H,Te=!0;break}case"SERVER-CONTROL":{var Xt=new D.AttrList(Z);x.canBlockReload=Xt.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=Xt.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&Xt.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=Xt.optionalFloat("PART-HOLD-BACK",0),x.holdBack=Xt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Je=new D.AttrList(Z);x.partTarget=Je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Qe=x.partList;Qe||(Qe=x.partList=[]);var _t=C>0?Qe[Qe.length-1]:void 0,xt=C++,_e=new Y.Part(new D.AttrList(Z),H,E,xt,_t);Qe.push(_e),H.duration+=_e.duration;break}case"PRELOAD-HINT":{var ie=new D.AttrList(Z);x.preloadHint=ie;break}case"RENDITION-REPORT":{var oe=new D.AttrList(Z);x.renditionReports=x.renditionReports||[],x.renditionReports.push(oe);break}default:m.logger.warn("line parsed but not handled: "+J);break}}}y&&!y.relurl?(_.pop(),F-=y.duration,x.partList&&(x.fragmentHint=y)):x.partList&&(R(H,y),H.cc=k,x.fragmentHint=H);var ce=_.length,we=_[0],de=_[ce-1];if(F+=x.skippedSegments*x.targetduration,F>0&&ce&&de){x.averagetargetduration=F/ce;var he=de.sn;x.endSN=he!=="initSegment"?he:0,we&&(x.startCC=we.cc,we.initSegment||x.fragments.every(function(Oe){return Oe.relurl&&t(Oe.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new Y.Fragment(f,E),H.relurl=de.relurl,H.level=h,H.sn="initSegment",we.initSegment=H,x.needSidxRanges=!0))}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(F+=x.fragmentHint.duration),x.totalduration=F,x.endCC=k,ge>0&&S(_,ge),x},A}();function o(A,P){["video","audio","text"].forEach(function(w){var E=A.filter(function(f){return Object(p.isCodecType)(f,w)});if(E.length){var h=E.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});P[w+"Codec"]=h.length>0?h[0]:E[0],A=A.filter(function(f){return E.indexOf(f)===-1})}}),P.unknownCodecs=A}function O(A,P,w){var E=P[w];E&&(A[w]=E)}function S(A,P){for(var w=A[P],E=P;E--;){var h=A[E];if(!h)return;h.programDateTime=w.programDateTime-h.duration*1e3,w=h}}function R(A,P){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):P!=null&&P.programDateTime&&(A.programDateTime=P.endProgramDateTime),Object(q.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),M=B("./src/errors.ts"),Y=B("./src/utils/logger.ts"),V=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 p(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 g(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,O=u.loader,S=o||O,R=new S(u);return t.loader=R,this.loaders[t.type]=R,R},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,O=u.level,S=u.url,R=u.deliveryDirectives;this.load({id:o,groupId:null,level:O,responseType:"text",type:D.PlaylistContextType.LEVEL,url:S,deliveryDirectives:R})},s.onAudioTrackLoading=function(t,u){var o=u.id,O=u.groupId,S=u.url,R=u.deliveryDirectives;this.load({id:o,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:R})},s.onSubtitleTrackLoading=function(t,u){var o=u.id,O=u.groupId,S=u.url,R=u.deliveryDirectives;this.load({id:o,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:R})},s.load=function(t){var u,o=this.hls.config,O=this.getInternalLoader(t);if(O){var S=O.context;if(S&&S.url===t.url){Y.logger.trace("[playlist-loader]: playlist request ongoing");return}Y.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),O.abort()}var R,A,P,w;switch(t.type){case D.PlaylistContextType.MANIFEST:R=o.manifestLoadingMaxRetry,A=o.manifestLoadingTimeOut,P=o.manifestLoadingRetryDelay,w=o.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:R=0,A=o.levelLoadingTimeOut;break;default:R=o.levelLoadingMaxRetry,A=o.levelLoadingTimeOut,P=o.levelLoadingRetryDelay,w=o.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(t),(u=t.deliveryDirectives)!==null&&u!==void 0&&u.part){var E;if(t.type===D.PlaylistContextType.LEVEL&&t.level!==null?E=this.hls.levels[t.level].details:t.type===D.PlaylistContextType.AUDIO_TRACK&&t.id!==null?E=this.hls.audioTracks[t.id].details:t.type===D.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(E=this.hls.subtitleTracks[t.id].details),E){var h=E.partTarget,f=E.targetduration;h&&f&&(A=Math.min(Math.max(h*3,f*.8)*1e3,A))}}var T={timeout:A,maxRetry:R,retryDelay:P,maxRetryDelay:w,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(t,T,x)},s.loadsuccess=function(t,u,o,O){if(O===void 0&&(O=null),o.isSidxRequest){this.handleSidxRequest(t,o),this.handlePlaylistLoaded(t,u,o,O);return}this.resetInternalLoader(o.type);var S=t.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,o,"no EXTM3U delimiter",O);return}u.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,u,o,O):this.handleMasterPlaylist(t,u,o,O)},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,O){var S=this.hls,R=t.data,A=g(t,o),P=r.default.parseMasterPlaylist(R,A),w=P.levels,E=P.sessionData;if(!w.length){this.handleManifestParsingError(t,o,"no level found in manifest",O);return}var h=w.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),f=w.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),T=r.default.parseMasterPlaylistMedia(R,A,"AUDIO",h),x=r.default.parseMasterPlaylistMedia(R,A,"SUBTITLES",f),_=r.default.parseMasterPlaylistMedia(R,A,"CLOSED-CAPTIONS");if(T.length){var j=T.some(function(W){return!W.url});!j&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(Y.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}S.trigger(K.Events.MANIFEST_LOADED,{levels:w,audioTracks:T,subtitles:x,captions:_,url:A,stats:u,networkDetails:O,sessionData:E})},s.handleTrackOrLevelPlaylist=function(t,u,o,O){var S=this.hls,R=o.id,A=o.level,P=o.type,w=g(t,o),E=Object(q.isFiniteNumber)(R)?R:0,h=Object(q.isFiniteNumber)(A)?A:E,f=p(o),T=r.default.parseLevelPlaylist(t.data,w,h,f,E);if(!T.fragments.length){S.trigger(K.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(P===D.PlaylistContextType.MANIFEST){var x={attrs:new m.AttrList({}),bitrate:0,details:T,name:"",url:w};S.trigger(K.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:w,stats:u,networkDetails:O,sessionData:null})}if(u.parsing.end=performance.now(),T.needSidxRanges){var _,j=(_=T.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:j,isSidxRequest:!0,type:P,level:A,levelDetails:T,id:R,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=T,this.handlePlaylistLoaded(t,u,o,O)},s.handleSidxRequest=function(t,u){var o=Object(V.parseSegmentIndex)(new Uint8Array(t.data));if(!o)return;var O=o.references,S=u.levelDetails;O.forEach(function(R,A){var P=R.info,w=S.fragments[A];w.byteRange.length===0&&w.setByteRange(String(1+P.end-P.start)+"@"+String(P.start)),w.initSegment&&w.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(t,u,o,O){this.hls.trigger(K.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===D.PlaylistContextType.MANIFEST,url:t.url,reason:o,response:t,context:u,networkDetails:O})},s.handleNetworkError=function(t,u,o,O){o===void 0&&(o=!1),Y.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 S=M.ErrorDetails.UNKNOWN,R=!1,A=this.getInternalLoader(t);switch(t.type){case D.PlaylistContextType.MANIFEST:S=o?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,R=!0;break;case D.PlaylistContextType.LEVEL:S=o?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,R=!1;break;case D.PlaylistContextType.AUDIO_TRACK:S=o?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,R=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:S=o?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,R=!1;break}A&&this.resetInternalLoader(t.type);var P={type:M.ErrorTypes.NETWORK_ERROR,details:S,fatal:R,url:t.url,loader:A,context:t,networkDetails:u};O&&(P.response=O),this.hls.trigger(K.Events.ERROR,P)},s.handlePlaylistLoaded=function(t,u,o,O){var S=o.type,R=o.level,A=o.id,P=o.groupId,w=o.loader,E=o.levelDetails,h=o.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(t,o,"invalid target duration",O);return}if(!w)return;E.live&&(w.getCacheAge&&(E.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(S){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:E,level:R||0,id:A||0,stats:u,networkDetails:O,deliveryDirectives:h});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:E,id:A||0,groupId:P||"",stats:u,networkDetails:O,deliveryDirectives:h});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:E,id:A||0,groupId:P||"",stats:u,networkDetails:O,deliveryDirectives:h});break}},c}();Q.default=a},"./src/polyfills/number.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"isFiniteNumber",function(){return q}),B.d(Q,"MAX_SAFE_INTEGER",function(){return K});var q=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,Q,B){"use strict";B.r(Q);var q=function(){function K(){}return K.getSilentFrame=function(Y,V){switch(Y){case"mp4a.40.2":if(V===1)return new Uint8Array([0,200,0,128,35,128]);if(V===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(V===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(V===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(V===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(V===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(V===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(V===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(V===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=q},"./src/remux/mp4-generator.ts":function(ne,Q,B){"use strict";B.r(Q);var q=Math.pow(2,32)-1,K=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var V;for(V in M.types)M.types.hasOwnProperty(V)&&(M.types[V]=[V.charCodeAt(0),V.charCodeAt(1),V.charCodeAt(2),V.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]);M.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]),p=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=p,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var g=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,g,c,g,a),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,m))},M.box=function(V){for(var r=8,D=arguments.length,m=new Array(D>1?D-1:0),p=1;p<D;p++)m[p-1]=arguments[p];for(var g=m.length,a=g;g--;)r+=m[g].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(V,4),g=0,r=8;g<a;g++)c.set(m[g],r),r+=m[g].byteLength;return c},M.hdlr=function(V){return M.box(M.types.hdlr,M.HDLR_TYPES[V])},M.mdat=function(V){return M.box(M.types.mdat,V)},M.mdhd=function(V,r){r*=V;var D=Math.floor(r/(q+1)),m=Math.floor(r%(q+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,V>>24&255,V>>16&255,V>>8&255,V&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},M.mdia=function(V){return M.box(M.types.mdia,M.mdhd(V.timescale,V.duration),M.hdlr(V.type),M.minf(V))},M.mfhd=function(V){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,V>>24,V>>16&255,V>>8&255,V&255]))},M.minf=function(V){return V.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(V)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(V))},M.moof=function(V,r,D){return M.box(M.types.moof,M.mfhd(V),M.traf(D,r))},M.moov=function(V){for(var r=V.length,D=[];r--;)D[r]=M.trak(V[r]);return M.box.apply(null,[M.types.moov,M.mvhd(V[0].timescale,V[0].duration)].concat(D).concat(M.mvex(V)))},M.mvex=function(V){for(var r=V.length,D=[];r--;)D[r]=M.trex(V[r]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(V,r){r*=V;var D=Math.floor(r/(q+1)),m=Math.floor(r%(q+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,V>>24&255,V>>16&255,V>>8&255,V&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,p)},M.sdtp=function(V){var r=V.samples||[],D=new Uint8Array(4+r.length),m,p;for(m=0;m<r.length;m++)p=r[m].flags,D[m+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(V){return M.box(M.types.stbl,M.stsd(V),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(V){var r=[],D=[],m,p,g;for(m=0;m<V.sps.length;m++)p=V.sps[m],g=p.byteLength,r.push(g>>>8&255),r.push(g&255),r=r.concat(Array.prototype.slice.call(p));for(m=0;m<V.pps.length;m++)p=V.pps[m],g=p.byteLength,D.push(g>>>8&255),D.push(g&255),D=D.concat(Array.prototype.slice.call(p));var a=M.box(M.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|V.sps.length].concat(r).concat([V.pps.length]).concat(D))),c=V.width,s=V.height,i=V.pixelRatio[0],t=V.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},M.esds=function(V){var r=V.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(V.config).concat([6,1,2]))},M.mp4a=function(V){var r=V.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,V.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),M.box(M.types.esds,M.esds(V)))},M.mp3=function(V){var r=V.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,V.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},M.stsd=function(V){return V.type==="audio"?!V.isAAC&&V.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(V)):M.box(M.types.stsd,M.STSD,M.mp4a(V)):M.box(M.types.stsd,M.STSD,M.avc1(V))},M.tkhd=function(V){var r=V.id,D=V.duration*V.timescale,m=V.width,p=V.height,g=Math.floor(D/(q+1)),a=Math.floor(D%(q+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,g>>24,g>>16&255,g>>8&255,g&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,p>>8&255,p&255,0,0]))},M.traf=function(V,r){var D=M.sdtp(V),m=V.id,p=Math.floor(r/(q+1)),g=Math.floor(r%(q+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,g>>24,g>>16&255,g>>8&255,g&255])),M.trun(V,D.length+16+20+8+16+8+8),D)},M.trak=function(V){return V.duration=V.duration||4294967295,M.box(M.types.trak,M.tkhd(V),M.mdia(V))},M.trex=function(V){var r=V.id;return M.box(M.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]))},M.trun=function(V,r){var D=V.samples||[],m=D.length,p=12+16*m,g=new Uint8Array(p),a,c,s,i,t,u;for(r+=8+p,g.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,g.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 M.box(M.types.trun,g)},M.initSegment=function(V){M.types||M.init();var r=M.moov(V),D=new Uint8Array(M.FTYP.byteLength+r.byteLength);return D.set(M.FTYP),D.set(r,M.FTYP.byteLength),D},M}();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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"normalizePts",function(){return o});var q=B("./src/polyfills/number.ts"),K=B("./src/remux/aac-helper.ts"),M=B("./src/remux/mp4-generator.ts"),Y=B("./src/events.ts"),V=B("./src/errors.ts"),r=B("./src/utils/logger.ts"),D=B("./src/types/loader.ts"),m=B("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(A){for(var P=1;P<arguments.length;P++){var w=arguments[P];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(A[E]=w[E])}return A},p.apply(this,arguments)}var g=10*1e3,a=1024,c=1152,s=null,i=null,t=!1,u=function(){function A(w,E,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=w,this.config=E,this.typeSupported=h,this.ISGenerated=!1,s===null){var T=navigator.userAgent||"",x=T.match(/Chrome\/(\d+)/i);s=x?parseInt(x[1]):0}if(i===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);i=_?parseInt(_[1]):0}t=!!s&&s<75||!!i&&i<600}var P=A.prototype;return P.destroy=function(){},P.resetTimeStamp=function(E){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},P.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},P.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},P.getVideoStartPts=function(E){var h=!1,f=E.reduce(function(T,x){var _=x.pts-T;return _<-4294967296?(h=!0,o(T,x.pts)):_>0?T:x.pts},E[0].pts);return h&&r.logger.debug("PTS rollover detected"),f},P.remux=function(E,h,f,T,x,_,j,W){var C,F,k,y,H,J,ae=x,fe=x,ge=E.pid>-1,Te=h.pid>-1,Ue=h.samples.length,Se=E.samples.length>0,Le=Ue>1,ye=(!ge||Se)&&(!Te||Le)||this.ISGenerated||j;if(ye){this.ISGenerated||(k=this.generateIS(E,h,x));var Z=this.isVideoContiguous,v=-1;if(Le&&(v=O(h.samples),!Z&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,v>0){r.logger.warn("[mp4-remuxer]: Dropped "+v+" out of "+Ue+" video samples due to a missing keyframe");var L=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(v),h.dropped+=v,fe+=(h.samples[0].pts-L)/(h.timescale||9e4)}else v===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ue+" video samples"),J=!1);if(this.ISGenerated){if(Se&&Le){var z=this.getVideoStartPts(h.samples),ee=o(E.samples[0].pts,z)-z,$=ee/h.inputTimeScale;ae+=Math.max(0,$),fe+=Math.max(0,-$)}if(Se){if(E.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(E,h,x)),F=this.remuxAudio(E,ae,this.isAudioContiguous,_,Te||Le||W===D.PlaylistLevelType.AUDIO?fe:void 0),Le){var Ee=F?F.endPTS-F.startPTS:0;h.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(E,h,x)),C=this.remuxVideo(h,fe,Z,Ee)}}else Le&&(C=this.remuxVideo(h,fe,Z,0));C&&(C.firstKeyFrame=v,C.independent=v!==-1)}}return this.ISGenerated&&(f.samples.length&&(H=this.remuxID3(f,x)),T.samples.length&&(y=this.remuxText(T,x))),{audio:F,video:C,initSegment:k,independent:J,text:y,id3:H}},P.generateIS=function(E,h,f){var T=E.samples,x=h.samples,_=this.typeSupported,j={},W=!Object(q.isFiniteNumber)(this._initPTS),C="audio/mp4",F,k,y;if(W&&(F=k=Infinity),E.config&&T.length&&(E.timescale=E.samplerate,E.isAAC||(_.mpeg?(C="audio/mpeg",E.codec=""):_.mp3&&(E.codec="mp3")),j.audio={id:"audio",container:C,codec:E.codec,initSegment:!E.isAAC&&_.mpeg?new Uint8Array(0):M.default.initSegment([E]),metadata:{channelCount:E.channelCount}},W&&(y=E.inputTimeScale,F=k=T[0].pts-Math.round(y*f))),h.sps&&h.pps&&x.length&&(h.timescale=h.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:M.default.initSegment([h]),metadata:{width:h.width,height:h.height}},W)){y=h.inputTimeScale;var H=this.getVideoStartPts(x),J=Math.round(y*f);k=Math.min(k,o(x[0].dts,H)-J),F=Math.min(F,H-J)}if(Object.keys(j).length)return this.ISGenerated=!0,W&&(this._initPTS=F,this._initDTS=k),{tracks:j,initPTS:F,timescale:y}},P.remuxVideo=function(E,h,f,T){var x=E.inputTimeScale,_=E.samples,j=[],W=_.length,C=this._initPTS,F=this.nextAvcDts,k=8,y,H,J,ae=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,ge=0,Te=!1;if(!f||F===null){var Ue=h*x,Se=_[0].pts-o(_[0].dts,_[0].pts);F=Ue-Se}for(var Le=0;Le<W;Le++){var ye=_[Le];if(ye.pts=o(ye.pts-C,F),ye.dts=o(ye.dts-C,F),ye.dts>ye.pts){var Z=9e4*.2;ge=Math.max(Math.min(ge,ye.pts-ye.dts),-1*Z)}ye.dts<_[Le>0?Le-1:Le].dts&&(Te=!0)}Te&&_.sort(function(qn,Vt){var qt=qn.dts-Vt.dts,nn=qn.pts-Vt.pts;return qt||nn}),H=_[0].dts,J=_[_.length-1].dts;var v=Math.round((J-H)/(W-1));if(ge<0){if(ge<v*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-v,!0)+" ms");for(var L=ge,z=0;z<W;z++)_[z].dts=L=Math.max(L,_[z].pts-v),_[z].pts=Math.max(L,_[z].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(ge,!0)+" ms to overcome this issue");for(var ee=0;ee<W;ee++)_[ee].dts=_[ee].dts+ge}H=_[0].dts}if(f){var $=H-F,Ee=$>v,Fe=$<-1;if(Ee||Fe){Ee?r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)($,!0)+" ms ("+$+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-$,!0)+" ms ("+$+"dts) overlapping between fragments detected"),H=F;var qe=_[0].pts-$;_[0].dts=H,_[0].pts=qe,r.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(qe,!0)+"/"+Object(m.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(m.toMsFromMpegTsClock)($,!0)+" ms")}}t&&(H=Math.max(0,H));for(var Ce=0,Me=0,He=0;He<W;He++){for(var Ke=_[He],ut=Ke.units,bt=ut.length,Lt=0,Ft=0;Ft<bt;Ft++)Lt+=ut[Ft].data.length;Me+=Lt,Ce+=bt,Ke.length=Lt,Ke.dts=Math.max(Ke.dts,H),Ke.pts=Math.max(Ke.pts,Ke.dts,0),ae=Math.min(Ke.pts,ae),fe=Math.max(Ke.pts,fe)}J=_[W-1].dts;var Yt=Me+4*Ce+8,Xt;try{Xt=new Uint8Array(Yt)}catch(qn){this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:V.ErrorTypes.MUX_ERROR,details:V.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Yt,reason:"fail allocating video mdat "+Yt});return}var Je=new DataView(Xt.buffer);Je.setUint32(0,Yt),Xt.set(M.default.types.mdat,4);for(var Qe=0;Qe<W;Qe++){for(var _t=_[Qe],xt=_t.units,_e=0,ie=0,oe=xt.length;ie<oe;ie++){var ce=xt[ie],we=ce.data,de=ce.data.byteLength;Je.setUint32(k,de),k+=4,Xt.set(we,k),k+=de,_e+=4+de}if(Qe<W-1)y=_[Qe+1].dts-_t.dts;else{var he=this.config,Oe=_t.dts-_[Qe>0?Qe-1:Qe].dts;if(he.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(he.maxBufferHole*x),Ne=(T?ae+T*x:this.nextAudioPts)-_t.pts;Ne>le?(y=Ne-Oe,y<0&&(y=Oe),r.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=Oe}else y=Oe}var We=Math.round(_t.pts-_t.dts);j.push(new S(_t.key,y,_e,We))}if(j.length&&s&&s<70){var lt=j[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=J+y,this.isVideoContiguous=!0;var Ct=M.default.moof(E.sequenceNumber++,H,p({},E,{samples:j})),Rt="video",It={data1:Ct,data2:Xt,startPTS:ae/x,endPTS:(fe+y)/x,startDTS:H/x,endDTS:F/x,type:Rt,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(Xt.length,"MDAT length must not be zero"),It},P.remuxAudio=function(E,h,f,T,x){var _=E.inputTimeScale,j=E.samplerate?E.samplerate:_,W=_/j,C=E.isAAC?a:c,F=C*W,k=this._initPTS,y=!E.isAAC&&this.typeSupported.mpeg,H=[],J=E.samples,ae=y?0:8,fe=this.nextAudioPts||-1,ge=h*_;if(this.isAudioContiguous=f=f||J.length&&fe>0&&(T&&Math.abs(ge-fe)<9e3||Math.abs(o(J[0].pts-k,ge)-fe)<20*F),J.forEach(function(we){we.pts=o(we.pts-k,ge)}),!f||fe<0){if(J=J.filter(function(we){return we.pts>=0}),!J.length)return;x===0?fe=0:T?fe=Math.max(0,ge):fe=J[0].pts}if(E.isAAC)for(var Te=x!==void 0,Ue=this.config.maxAudioFramesDrift,Se=0,Le=fe;Se<J.length;Se++){var ye=J[Se],Z=ye.pts,v=Z-Le,L=Math.abs(1e3*v/_);if(v<=-Ue*F&&Te)Se===0&&(r.logger.warn("Audio frame @ "+(Z/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*v/_)+" ms."),this.nextAudioPts=fe=Le=Z);else if(v>=Ue*F&&L<g&&Te){var z=Math.round(v/F);Le=Z-z*F,Le<0&&(z--,Le+=F),Se===0&&(this.nextAudioPts=fe=Le),r.logger.warn("[mp4-remuxer]: Injecting "+z+" audio frame @ "+(Le/_).toFixed(3)+"s due to "+Math.round(1e3*v/_)+" ms gap.");for(var ee=0;ee<z;ee++){var $=Math.max(Le,0),Ee=K.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);Ee||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ee=ye.unit.subarray()),J.splice(Se,0,{unit:Ee,pts:$}),Le+=F,Se++}}ye.pts=Le,Le+=F}for(var Fe=null,qe=null,Ce,Me=0,He=J.length;He--;)Me+=J[He].unit.byteLength;for(var Ke=0,ut=J.length;Ke<ut;Ke++){var bt=J[Ke],Lt=bt.unit,Ft=bt.pts;if(qe!==null){var Yt=H[Ke-1];Yt.duration=Math.round((Ft-qe)/W)}else if(f&&E.isAAC&&(Ft=fe),Fe=Ft,Me>0){Me+=ae;try{Ce=new Uint8Array(Me)}catch(we){this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:V.ErrorTypes.MUX_ERROR,details:V.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Me,reason:"fail allocating audio mdat "+Me});return}if(!y){var Xt=new DataView(Ce.buffer);Xt.setUint32(0,Me),Ce.set(M.default.types.mdat,4)}}else return;Ce.set(Lt,ae);var Je=Lt.byteLength;ae+=Je,H.push(new S(!0,C,Je,0)),qe=Ft}var Qe=H.length;if(!Qe)return;var _t=H[H.length-1];this.nextAudioPts=fe=qe+W*_t.duration;var xt=y?new Uint8Array(0):M.default.moof(E.sequenceNumber++,Fe/W,p({},E,{samples:H}));E.samples=[];var _e=Fe/_,ie=fe/_,oe="audio",ce={data1:xt,data2:Ce,startPTS:_e,endPTS:ie,startDTS:_e,endDTS:ie,type:oe,hasAudio:!0,hasVideo:!1,nb:Qe};return this.isAudioContiguous=!0,console.assert(Ce.length,"MDAT length must not be zero"),ce},P.remuxEmptyAudio=function(E,h,f,T){var x=E.inputTimeScale,_=E.samplerate?E.samplerate:x,j=x/_,W=this.nextAudioPts,C=(W!==null?W:T.startDTS*x)+this._initDTS,F=T.endDTS*x+this._initDTS,k=j*a,y=Math.ceil((F-C)/k),H=K.default.getSilentFrame(E.manifestCodec||E.codec,E.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 J=[],ae=0;ae<y;ae++){var fe=C+ae*k;J.push({unit:H,pts:fe,dts:fe})}return E.samples=J,this.remuxAudio(E,h,f,!1)},P.remuxID3=function(E,h){var f=E.samples.length;if(!f)return;for(var T=E.inputTimeScale,x=this._initPTS,_=this._initDTS,j=0;j<f;j++){var W=E.samples[j];W.pts=o(W.pts-x,h*T)/T,W.dts=o(W.dts-_,h*T)/T}var C=E.samples;return E.samples=[],{samples:C}},P.remuxText=function(E,h){var f=E.samples.length;if(!f)return;for(var T=E.inputTimeScale,x=this._initPTS,_=0;_<f;_++){var j=E.samples[_];j.pts=o(j.pts-x,h*T)/T}E.samples.sort(function(C,F){return C.pts-F.pts});var W=E.samples;return E.samples=[],{samples:W}},A}();function o(A,P){var w;if(P===null)return A;for(P<A?w=-8589934592:w=8589934592;Math.abs(A-P)>4294967296;)A+=w;return A}function O(A){for(var P=0;P<A.length;P++)if(A[P].key)return P;return-1}var S=function(P,w,E,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=E,this.cts=h,this.flags=new R(P)},R=function(P){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=P?2:1,this.isNonSync=P?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/polyfills/number.ts"),K=B("./src/utils/mp4-tools.ts"),M=B("./src/loader/fragment.ts"),Y=B("./src/utils/logger.ts"),V=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 p=m.prototype;return p.destroy=function(){},p.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(a,c,s){this.audioCodec=c,this.videoCodec=s,this.generateInitSegment(a),this.emitInitSegment=!0},p.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,M.ElementaryStreamTypes.AUDIO)),s||(s=D(i.video,M.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"}:Y.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},p.remux=function(a,c,s,i,t){var u=this.initPTS,o=this.lastEndDTS,O={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};Object(q.isFiniteNumber)(o)||(o=this.lastEndDTS=t||0);var S=c.samples;if(!S||!S.length)return O;var R={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(S),A=this.initData),!A||!A.length)return Y.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(R.tracks=this.initTracks,this.emitInitSegment=!1),Object(q.isFiniteNumber)(u)||(this.initPTS=R.initPTS=u=r(A,S,o));var P=Object(K.getDuration)(S,A),w=o,E=P+w;Object(K.offsetStartDTS)(A,S,u),P>0?this.lastEndDTS=E:(Y.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!A.audio,f=!!A.video,T="";h&&(T+="audio"),f&&(T+="video");var x={data1:S,startPTS:w,startDTS:w,endPTS:E,endDTS:E,type:T,hasAudio:h,hasVideo:f,nb:1,dropped:0};return O.audio=x.type==="audio"?x:void 0,O.video=x.type!=="audio"?x:void 0,O.text=i,O.id3=s,O.initSegment=R,O},m}(),r=function(p,g,a){return Object(K.getStartDTS)(p,g)-a};function D(m,p){var g=m==null?void 0:m.codec;return g&&g.length>4?g:g==="hvc1"?"hvc1.1.c.L120.90":g==="av01"?"av01.0.04M.08":g==="avc1"||p===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=V},"./src/task-loop.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return q});var q=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=K.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(V){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,V),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},K}()},"./src/types/cmcd.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"CMCDVersion",function(){return q}),B.d(Q,"CMCDObjectType",function(){return K}),B.d(Q,"CMCDStreamingFormat",function(){return M}),B.d(Q,"CMCDStreamType",function(){return Y});var q=1,K;(function(V){V.MANIFEST="m",V.AUDIO="a",V.VIDEO="v",V.MUXED="av",V.INIT="i",V.CAPTION="c",V.TIMED_TEXT="tt",V.KEY="k",V.OTHER="o"})(K||(K={}));var M;(function(V){V.DASH="d",V.HLS="h",V.SMOOTH="s",V.OTHER="o"})(M||(M={}));var Y;(function(V){V.VOD="v",V.LIVE="l"})(Y||(Y={}))},"./src/types/level.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"HlsSkip",function(){return M}),B.d(Q,"getSkipValue",function(){return Y}),B.d(Q,"HlsUrlParameters",function(){return V}),B.d(Q,"Level",function(){return r});function q(D,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(D,g.key,g)}}function K(D,m,p){return m&&q(D.prototype,m),p&&q(D,p),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function Y(D,m){var p=D.canSkipUntil,g=D.canSkipDateRanges,a=D.endSN,c=m!==void 0?m-a:0;return p&&c<p?g?M.v2:M.Yes:M.No}var V=function(){function D(p,g,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=g,this.skip=a}var m=D.prototype;return m.addDirectives=function(g){var a=new self.URL(g);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(p){return p}).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(p){var g=p%this.url.length;this._urlId!==g&&(this.details=void 0,this._urlId=g)}}]),D}()},"./src/types/loader.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"PlaylistContextType",function(){return q}),B.d(Q,"PlaylistLevelType",function(){return K});var q;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(q||(q={}));var K;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(K||(K={}))},"./src/types/transmuxer.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"ChunkMetadata",function(){return q});var q=function(Y,V,r,D,m,p){D===void 0&&(D=0),m===void 0&&(m=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=K(),this.buffering={audio:K(),video:K(),audiovideo:K()},this.level=Y,this.sn=V,this.id=r,this.size=D,this.part=m,this.partial=p};function K(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"AttrList",function(){return M});var q=/^(\d+)x(\d+)$/,K=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function Y(r){typeof r=="string"&&(r=Y.parseAttrList(r));for(var D in r)r.hasOwnProperty(D)&&(this[D]=r[D])}var V=Y.prototype;return V.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},V.hexadecimalInteger=function(D){if(this[D]){var m=(this[D]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var p=new Uint8Array(m.length/2),g=0;g<m.length/2;g++)p[g]=parseInt(m.slice(g*2,g*2+2),16);return p}else return null},V.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},V.decimalFloatingPoint=function(D){return parseFloat(this[D])},V.optionalFloat=function(D,m){var p=this[D];return p?parseFloat(p):m},V.enumeratedString=function(D){return this[D]},V.bool=function(D){return this[D]==="YES"},V.decimalResolution=function(D){var m=q.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},Y.parseAttrList=function(D){var m,p={},g='"';for(K.lastIndex=0;(m=K.exec(D))!==null;){var a=m[2];a.indexOf(g)===0&&a.lastIndexOf(g)===a.length-1&&(a=a.slice(1,-1)),p[m[1]]=a}return p},Y}()},"./src/utils/binary-search.ts":function(ne,Q,B){"use strict";B.r(Q);var q={search:function(M,Y){for(var V=0,r=M.length-1,D=null,m=null;V<=r;){D=(V+r)/2|0,m=M[D];var p=Y(m);if(p>0)V=D+1;else if(p<0)r=D-1;else return m}return null}};Q.default=q},"./src/utils/buffer-helper.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"BufferHelper",function(){return M});var q=B("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function Y(){}return Y.isBuffered=function(r,D){try{if(r){for(var m=Y.getBuffered(r),p=0;p<m.length;p++)if(D>=m.start(p)&&D<=m.end(p))return!0}}catch(g){}return!1},Y.bufferInfo=function(r,D,m){try{if(r){var p=Y.getBuffered(r),g=[],a;for(a=0;a<p.length;a++)g.push({start:p.start(a),end:p.end(a)});return this.bufferedInfo(g,D,m)}}catch(c){}return{len:0,start:D,end:D,nextStart:void 0}},Y.bufferedInfo=function(r,D,m){D=Math.max(0,D),r.sort(function(R,A){var P=R.start-A.start;return P||A.end-R.end});var p=[];if(m)for(var g=0;g<r.length;g++){var a=p.length;if(a){var c=p[a-1].end;r[g].start-c<m?r[g].end>c&&(p[a-1].end=r[g].end):p.push(r[g])}else p.push(r[g])}else p=r;for(var s=0,i,t=D,u=D,o=0;o<p.length;o++){var O=p[o].start,S=p[o].end;if(D+m>=O&&D<S)t=O,u=S,s=u-D;else if(D+m<O){i=O;break}}return{len:s,start:t||0,end:u||0,nextStart:i}},Y.getBuffered=function(r){try{return r.buffered}catch(D){return q.logger.log("failed to get media.buffered",D),K}},Y}()},"./src/utils/cea-608-parser.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"Row",function(){return u}),B.d(Q,"CaptionScreen",function(){return o});var q=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},M=function(E){var h=E;return K.hasOwnProperty(E)&&(h=K[E]),String.fromCharCode(h)},Y=15,V=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},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},g=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(a||(a={}));var c=function(){function w(){this.time=null,this.verboseLevel=a.ERROR}var E=w.prototype;return E.log=function(f,T){this.verboseLevel>=f&&q.logger.log(this.time+" ["+f+"] "+T)},w}(),s=function(E){for(var h=[],f=0;f<E.length;f++)h.push(E[f].toString(16));return h},i=function(){function w(h,f,T,x,_){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=T||!1,this.background=x||"black",this.flash=_||!1}var E=w.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(f){for(var T=["foreground","underline","italics","background","flash"],x=0;x<T.length;x++){var _=T[x];f.hasOwnProperty(_)&&(this[_]=f[_])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},E.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),t=function(){function w(h,f,T,x,_,j){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new i(f,T,x,_,j)}var E=w.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(f,T){this.uchar=f,this.penState.copy(T)},E.setPenState=function(f){this.penState.copy(f)},E.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},E.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),u=function(){function w(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<V;f++)this.chars.push(new t);this.logger=h,this.pos=0,this.currPenState=new i}var E=w.prototype;return E.equals=function(f){for(var T=!0,x=0;x<V;x++)if(!this.chars[x].equals(f.chars[x])){T=!1;break}return T},E.copy=function(f){for(var T=0;T<V;T++)this.chars[T].copy(f.chars[T])},E.isEmpty=function(){for(var f=!0,T=0;T<V;T++)if(!this.chars[T].isEmpty()){f=!1;break}return f},E.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>V&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=V)},E.moveCursor=function(f){var T=this.pos+f;if(f>1)for(var x=this.pos+1;x<T+1;x++)this.chars[x].setPenState(this.currPenState);this.setCursor(T)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(f){f>=144&&this.backSpace();var T=M(f);if(this.pos>=V){this.logger.log(a.ERROR,"Cannot insert "+f.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(f){var T;for(T=f;T<V;T++)this.chars[T].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var f=[],T=!0,x=0;x<V;x++){var _=this.chars[x].uchar;_!==" "&&(T=!1),f.push(_)}return T?"":f.join("")},E.setPenStyles=function(f){this.currPenState.setStyles(f);var T=this.chars[this.pos];T.setPenState(this.currPenState)},w}(),o=function(){function w(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<Y;f++)this.rows.push(new u(h));this.logger=h,this.currRow=Y-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=w.prototype;return E.reset=function(){for(var f=0;f<Y;f++)this.rows[f].clear();this.currRow=Y-1},E.equals=function(f){for(var T=!0,x=0;x<Y;x++)if(!this.rows[x].equals(f.rows[x])){T=!1;break}return T},E.copy=function(f){for(var T=0;T<Y;T++)this.rows[T].copy(f.rows[T])},E.isEmpty=function(){for(var f=!0,T=0;T<Y;T++)if(!this.rows[T].isEmpty()){f=!1;break}return f},E.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},E.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},E.insertChar=function(f){var T=this.rows[this.currRow];T.insertChar(f)},E.setPen=function(f){var T=this.rows[this.currRow];T.setPenStyles(f)},E.moveCursor=function(f){var T=this.rows[this.currRow];T.moveCursor(f)},E.setCursor=function(f){this.logger.log(a.INFO,"setCursor: "+f);var T=this.rows[this.currRow];T.setCursor(f)},E.setPAC=function(f){this.logger.log(a.INFO,"pacData = "+JSON.stringify(f));var T=f.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var x=0;x<Y;x++)this.rows[x].clear();var _=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var W=j.rows[_].cueStartTime,C=this.logger.time;if(W&&C!==null&&W<C)for(var F=0;F<this.nrRollUpRows;F++)this.rows[T-this.nrRollUpRows+F+1].copy(j.rows[_+F])}}this.currRow=T;var k=this.rows[this.currRow];if(f.indent!==null){var y=f.indent,H=Math.max(y-1,0);k.setCursor(f.indent),f.color=k.chars[H].penState.foreground}var J={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(J)},E.setBkgData=function(f){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},E.setRollUpRows=function(f){this.nrRollUpRows=f},E.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,T=this.rows.splice(f,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(a.INFO,"Rolling up")},E.getDisplayText=function(f){f=f||!1;for(var T=[],x="",_=-1,j=0;j<Y;j++){var W=this.rows[j].getTextString();W&&(_=j+1,f?T.push("Row "+_+": '"+W+"'"):T.push(W.trim()))}return T.length>0&&(f?x="["+T.join(" | ")+"]":x=T.join(`
|
|
`)),x},E.getTextAndFormat=function(){return this.rows},w}(),O=function(){function w(h,f,T){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(T),this.nonDisplayedMemory=new o(T),this.lastOutputScreen=new o(T),this.currRollUpRow=this.displayedMemory.rows[Y-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var E=w.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Y-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(f){this.outputFilter=f},E.setPAC=function(f){this.writeScreen.setPAC(f)},E.setBkgData=function(f){this.writeScreen.setBkgData(f)},E.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},E.insertChars=function(f){for(var T=0;T<f.length;T++)this.writeScreen.insertChar(f[T]);var x=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,x+": "+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())},E.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.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)},E.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.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)},E.ccTO=function(f){this.logger.log(a.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},E.ccMIDROW=function(f){var T={flash:!1};if(T.underline=f%2===1,T.italics=f>=46,T.italics)T.foreground="white";else{var x=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=_[x]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},E.outputDataUpdate=function(f){f===void 0&&(f=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},w}(),S=function(){function w(h,f,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new c;this.channels=[null,new O(h,f,x),new O(h+1,T,x)],this.cmdHistory=P(),this.logger=x}var E=w.prototype;return E.getHandler=function(f){return this.channels[f].getHandler()},E.setHandler=function(f,T){this.channels[f].setHandler(T)},E.addData=function(f,T){var x,_,j,W=!1;this.logger.time=f;for(var C=0;C<T.length;C+=2){if(_=T[C]&127,j=T[C+1]&127,_===0&&j===0)continue;if(this.logger.log(a.DATA,"["+s([T[C],T[C+1]])+"] -> ("+s([_,j])+")"),x=this.parseCmd(_,j),x||(x=this.parseMidrow(_,j)),x||(x=this.parsePAC(_,j)),x||(x=this.parseBackgroundAttributes(_,j)),!x&&(W=this.parseChars(_,j),W)){var F=this.currentChannel;if(F&&F>0){var k=this.channels[F];k.insertChars(W)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!x&&!W&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+s([_,j])+" orig: "+s([T[C],T[C+1]]))}},E.parseCmd=function(f,T){var x=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&T>=32&&T<=47,j=(f===23||f===31)&&T>=33&&T<=35;if(!(_||j))return!1;if(A(f,T,x))return R(null,null,x),this.logger.log(a.DEBUG,"Repeated command ("+s([f,T])+") is dropped"),!0;var W=f===20||f===21||f===23?1:2,C=this.channels[W];return f===20||f===21||f===28||f===29?T===32?C.ccRCL():T===33?C.ccBS():T===34?C.ccAOF():T===35?C.ccAON():T===36?C.ccDER():T===37?C.ccRU(2):T===38?C.ccRU(3):T===39?C.ccRU(4):T===40?C.ccFON():T===41?C.ccRDC():T===42?C.ccTR():T===43?C.ccRTD():T===44?C.ccEDM():T===45?C.ccCR():T===46?C.ccENM():T===47&&C.ccEOC():C.ccTO(T-32),R(f,T,x),this.currentChannel=W,!0},E.parseMidrow=function(f,T){var x=0;if((f===17||f===25)&&T>=32&&T<=47){if(f===17?x=1:x=2,x!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[x];return _?(_.ccMIDROW(T),this.logger.log(a.DEBUG,"MIDROW ("+s([f,T])+")"),!0):!1}return!1},E.parsePAC=function(f,T){var x,_=this.cmdHistory,j=(f>=17&&f<=23||f>=25&&f<=31)&&T>=64&&T<=127,W=(f===16||f===24)&&T>=64&&T<=95;if(!(j||W))return!1;if(A(f,T,_))return R(null,null,_),!0;var C=f<=23?1:2;T>=64&&T<=95?x=C===1?r[f]:m[f]:x=C===1?D[f]:p[f];var F=this.channels[C];return F?(F.setPAC(this.interpretPAC(x,T)),R(f,T,_),this.currentChannel=C,!0):!1},E.interpretPAC=function(f,T){var x,_={color:null,italics:!1,indent:null,underline:!1,row:f};return T>95?x=T-96:x=T-64,_.underline=(x&1)===1,x<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(x/2)]:x<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((x-16)/2)*4,_},E.parseChars=function(f,T){var x,_=null,j=null;if(f>=25?(x=2,j=f-8):(x=1,j=f),j>=17&&j<=19){var W;j===17?W=T+80:j===18?W=T+112:W=T+144,this.logger.log(a.INFO,"Special char '"+M(W)+"' in channel "+x),_=[W]}else f>=32&&f<=127&&(_=T===0?[f]:[f,T]);if(_){var C=s(_);this.logger.log(a.DEBUG,"Char codes = "+C.join(",")),R(f,T,this.cmdHistory)}return _},E.parseBackgroundAttributes=function(f,T){var x=(f===16||f===24)&&T>=32&&T<=47,_=(f===23||f===31)&&T>=45&&T<=47;if(!(x||_))return!1;var j,W={};f===16||f===24?(j=Math.floor((T-32)/2),W.background=g[j],T%2===1&&(W.background=W.background+"_semi")):T===45?W.background="transparent":(W.foreground="black",T===47&&(W.underline=!0));var C=f<=23?1:2,F=this.channels[C];return F.setBkgData(W),R(f,T,this.cmdHistory),!0},E.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var T=this.channels[f];T&&T.reset()}this.cmdHistory=P()},E.cueSplitAtTime=function(f){for(var T=0;T<this.channels.length;T++){var x=this.channels[T];x&&x.cueSplitAtTime(f)}},w}();function R(w,E,h){h.a=w,h.b=E}function A(w,E,h){return h.a===w&&h.b===E}function P(){return{a:null,b:null}}Q.default=S},"./src/utils/codecs.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"isCodecType",function(){return K}),B.d(Q,"isCodecSupportedInMp4",function(){return M});var q={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function K(Y,V){var r=q[V];return!!r&&r[Y.slice(0,4)]===!0}function M(Y,V){return MediaSource.isTypeSupported((V||"video")+'/mp4;codecs="'+Y+'"')}},"./src/utils/cues.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/utils/vttparser.ts"),K=B("./src/utils/webvtt-parser.ts"),M=B("./src/utils/texttrack-utils.ts"),Y=/\s/,V={newCue:function(D,m,p,g){for(var a=[],c,s,i,t,u,o=self.VTTCue||self.TextTrackCue,O=0;O<g.rows.length;O++)if(c=g.rows[O],i=!0,t=0,u="",!c.isEmpty()){for(var S=0;S<c.chars.length;S++)Y.test(c.chars[S].uchar)&&i?t++:(u+=c.chars[S].uchar,i=!1);c.cueStartTime=m,m===p&&(p+=1e-4),t>=16?t--:t++;var R=Object(q.fixLineBreaks)(u.trim()),A=Object(K.generateCueId)(m,p,R);(!D||!D.cues||!D.cues.getCueById(A))&&(s=new o(m,p,R),s.id=A,s.line=O+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(P,w){return P.line==="auto"||w.line==="auto"?0:P.line>8&&w.line>8?w.line-P.line:P.line-w.line}),a.forEach(function(P){return Object(M.addCueToTrack)(D,P)})),a}};Q.default=V},"./src/utils/discontinuities.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"findFirstFragWithCC",function(){return Y}),B.d(Q,"shouldAlignOnDiscontinuities",function(){return V}),B.d(Q,"findDiscontinuousReferenceFrag",function(){return r}),B.d(Q,"adjustSlidingStart",function(){return m}),B.d(Q,"alignStream",function(){return p}),B.d(Q,"alignPDT",function(){return a}),B.d(Q,"alignFragmentByPDTDelta",function(){return c}),B.d(Q,"alignMediaPlaylistByPDT",function(){return s});var q=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts"),M=B("./src/controller/level-helper.ts");function Y(i,t){for(var u=null,o=0,O=i.length;o<O;o++){var S=i[o];if(S&&S.cc===t){u=S;break}}return u}function V(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 O=Y(u,o[0].cc);if(!O||O&&!O.startPTS){K.logger.log("No frag in previous level to align on");return}return O}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,O=u.length;o<O;o++)D(u[o],i);t.fragmentHint&&D(t.fragmentHint,i),t.alignedSliding=!0}function p(i,t,u){if(!t)return;g(i,u,t),!u.alignedSliding&&t.details&&a(u,t.details),!u.alignedSliding&&t.details&&!u.skippedSegments&&Object(M.adjustSliding)(t.details,u)}function g(i,t,u){if(V(i,u,t)){var o=r(u.details,t);o&&Object(q.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,O=(o-u)/1e3+t.fragments[0].start;O&&Object(q.isFiniteNumber)(O)&&(K.logger.log("Adjusting PTS using programDateTime delta "+(o-u)+"ms, sliding:"+O.toFixed(3)+" "+i.url+" "),m(O,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,O=u-o*1e3;i.fragments.forEach(function(S){c(S,O)}),i.fragmentHint&&c(i.fragmentHint,O),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/utils/ewma.ts"),K=function(){function M(V,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 q.default(V),this.fast_=new q.default(r)}var Y=M.prototype;return Y.update=function(r,D){var m=this.slow_,p=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new q.default(r,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new q.default(D,p.getEstimate(),p.getTotalWeight()))},Y.sample=function(r,D){r=Math.max(r,this.minDelayMs_);var m=8*D,p=r/1e3,g=m/p;this.fast_.sample(p,g),this.slow_.sample(p,g)},Y.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},Y.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},Y.destroy=function(){},M}();Q.default=K},"./src/utils/ewma.ts":function(ne,Q,B){"use strict";B.r(Q);var q=function(){function K(Y,V,r){V===void 0&&(V=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=Y,this.alpha_=Y?Math.exp(Math.log(.5)/Y):0,this.estimate_=V,this.totalWeight_=r}var M=K.prototype;return M.sample=function(V,r){var D=Math.pow(this.alpha_,V);this.estimate_=r*(1-D)+D*this.estimate_,this.totalWeight_+=V},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var V=1-Math.pow(this.alpha_,this.totalWeight_);if(V)return this.estimate_/V}return this.estimate_},K}();Q.default=q},"./src/utils/fetch-loader.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"fetchSupported",function(){return c});var q=B("./src/polyfills/number.ts"),K=B("./src/loader/load-stats.ts"),M=B("./src/demux/chunk-cache.ts");function Y(o,O){o.prototype=Object.create(O.prototype),o.prototype.constructor=o,p(o,O)}function V(o){var O=typeof Map=="function"?new Map:void 0;return V=function(R){if(R===null||!m(R))return R;if(typeof R!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(R))return O.get(R);O.set(R,A)}function A(){return r(R,arguments,g(this).constructor)}return A.prototype=Object.create(R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p(A,R)},V(o)}function r(o,O,S){return D()?r=Reflect.construct:r=function(A,P,w){var E=[null];E.push.apply(E,P);var h=Function.bind.apply(A,E),f=new h;return w&&p(f,w.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 p(o,O){return p=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},p(o,O)}function g(o){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},g(o)}function a(){return a=Object.assign||function(o){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(o[R]=S[R])}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(S){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=S.fetchSetup||t,this.controller=new self.AbortController,this.stats=new K.LoadStats}var O=o.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var R=this.response;(!R||!R.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var R;this.abortInternal(),(R=this.callbacks)!==null&&R!==void 0&&R.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(R,A,P){var w=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var h=i(R,this.controller.signal),f=P.onProgress,T=R.responseType==="arraybuffer",x=T?"byteLength":"length";this.context=R,this.config=A,this.callbacks=P,this.request=this.fetchSetup(R,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),P.onTimeout(E,R,w.response)},A.timeout),self.fetch(this.request).then(function(_){if(w.response=w.loader=_,!_.ok){var j=_.status,W=_.statusText;throw new u(W||"fetch, bad network response",j,_)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object(q.isFiniteNumber)(A.highWaterMark)?w.loadProgressively(_,E,R,A.highWaterMark,f):T?_.arrayBuffer():_.text()}).then(function(_){var j=w.response;self.clearTimeout(w.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=_[x];var W={url:j.url,data:_};f&&!Object(q.isFiniteNumber)(A.highWaterMark)&&f(E,R,_,j),P.onSuccess(W,E,R,j)}).catch(function(_){if(self.clearTimeout(w.requestTimeout),E.aborted)return;var j=_.code||0;P.onError({code:j,text:_.message},R,_.details)})},O.getCacheAge=function(){var R=null;if(this.response){var A=this.response.headers.get("age");R=A?parseFloat(A):null}return R},O.loadProgressively=function(R,A,P,w,E){w===void 0&&(w=0);var h=new M.default,f=R.body.getReader(),T=function x(){return f.read().then(function(_){if(_.done)return h.dataLength&&E(A,P,h.flush(),R),Promise.resolve(new ArrayBuffer(0));var j=_.value,W=j.length;return A.loaded+=W,W<w||h.dataLength?(h.push(j),h.dataLength>=w&&E(A,P,h.flush(),R)):E(A,P,j,R),x()}).catch(function(){return Promise.reject()})};return T()},o}();function i(o,O){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(a({},o.headers))};return o.rangeEnd&&S.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),S}function t(o,O){return new self.Request(o.url,O)}var u=function(o){Y(O,o);function O(S,R,A){var P;return P=o.call(this,S)||this,P.code=void 0,P.details=void 0,P.code=R,P.details=A,P}return O}(V(Error));Q.default=s},"./src/utils/imsc1-ttml-parser.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"IMSC1_CODEC",function(){return m}),B.d(Q,"parseIMSC1",function(){return c});var q=B("./src/utils/mp4-tools.ts"),K=B("./src/utils/vttparser.ts"),M=B("./src/utils/vttcue.ts"),Y=B("./src/demux/id3.ts"),V=B("./src/utils/timescale-conversion.ts"),r=B("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var h=arguments[E];for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(w[f]=h[f])}return w},D.apply(this,arguments)}var m="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,g=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function c(w,E,h,f,T){var x=Object(q.findBox)(new Uint8Array(w),["mdat"]);if(x.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var _=x[0],j=Object(Y.utf8ArrayToStr)(new Uint8Array(w,_.start,_.end-_.start)),W=Object(V.toTimescaleFromScale)(E,1,h);try{f(s(j,W))}catch(C){T(C)}}function s(w,E){var h=new DOMParser,f=h.parseFromString(w,"text/xml"),T=f.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var x={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(x).reduce(function(k,y){return k[y]=T.getAttribute("ttp:"+y)||x[y],k},{}),j=T.getAttribute("xml:space")!=="preserve",W=t(i(T,"styling","style")),C=t(i(T,"layout","region")),F=i(T,"body","[begin]");return[].map.call(F,function(k){var y=u(k,j);if(!y||!k.hasAttribute("begin"))return null;var H=R(k.getAttribute("begin"),_),J=R(k.getAttribute("dur"),_),ae=R(k.getAttribute("end"),_);if(H===null)throw S(k);if(ae===null){if(J===null)throw S(k);ae=H+J}var fe=new M.default(H-E,ae-E,y);fe.id=Object(r.generateCueId)(fe.startTime,fe.endTime,fe.text);var ge=C[k.getAttribute("region")],Te=W[k.getAttribute("style")];fe.position=10,fe.size=80;var Ue=o(ge,Te),Se=Ue.textAlign;if(Se){var Le=a[Se];Le&&(fe.lineAlign=Le),fe.align=Se}return D(fe,Ue),fe}).filter(function(k){return k!==null})}function i(w,E,h){var f=w.getElementsByTagName(E)[0];return f?[].slice.call(f.querySelectorAll(h)):[]}function t(w){return w.reduce(function(E,h){var f=h.getAttribute("xml:id");return f&&(E[f]=h),E},{})}function u(w,E){return[].slice.call(w.childNodes).reduce(function(h,f,T){var x;return f.nodeName==="br"&&T?h+`
|
|
`:(x=f.childNodes)!==null&&x!==void 0&&x.length?u(f,E):E?h+f.textContent.trim().replace(/\s+/g," "):h+f.textContent},"")}function o(w,E){var h="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(T,x){var _=O(E,h,x)||O(w,h,x);return _&&(T[x]=_),T},{})}function O(w,E,h){return w.hasAttributeNS(E,h)?w.getAttributeNS(E,h):null}function S(w){return new Error("Could not parse ttml timestamp "+w)}function R(w,E){if(!w)return null;var h=Object(K.parseTimeStamp)(w);return h===null&&(p.test(w)?h=A(w,E):g.test(w)&&(h=P(w,E))),h}function A(w,E){var h=p.exec(w),f=(h[4]|0)+(h[5]|0)/E.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+f/E.frameRate}function P(w,E){var h=g.exec(w),f=Number(h[1]),T=h[2];switch(T){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/E.frameRate;case"t":return f/E.tickRate}return f}},"./src/utils/logger.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"enableLogs",function(){return r}),B.d(Q,"logger",function(){return D});var q=function(){},K={trace:q,debug:q,log:q,warn:q,info:q,error:q},M=K;function Y(m){var p=self.console[m];return p?p.bind(self.console,"["+m+"] >"):q}function V(m){for(var p=arguments.length,g=new Array(p>1?p-1:0),a=1;a<p;a++)g[a-1]=arguments[a];g.forEach(function(c){M[c]=m[c]?m[c].bind(m):Y(c)})}function r(m){if(self.console&&m===!0||typeof m=="object"){V(m,"debug","log","info","warn","error");try{M.log()}catch(p){M=K}}else M=K}var D=M},"./src/utils/mediakeys-helper.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"KeySystems",function(){return q}),B.d(Q,"requestMediaKeySystemAccess",function(){return K});var q;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(q||(q={}));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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"getMediaSource",function(){return q});function q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"bin2str",function(){return V}),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 p}),B.d(Q,"parseSegmentIndex",function(){return g}),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 q=B("./src/utils/typed-array.ts"),K=B("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,Y=[].push;function V(O){return String.fromCharCode.apply(null,O)}function r(O,S){"data"in O&&(S+=O.start,O=O.data);var R=O[S]<<8|O[S+1];return R<0?65536+R:R}function D(O,S){"data"in O&&(S+=O.start,O=O.data);var R=O[S]<<24|O[S+1]<<16|O[S+2]<<8|O[S+3];return R<0?4294967296+R:R}function m(O,S,R){"data"in O&&(S+=O.start,O=O.data),O[S]=R>>24,O[S+1]=R>>16&255,O[S+2]=R>>8&255,O[S+3]=R&255}function p(O,S){var R=[];if(!S.length)return R;var A,P,w;"data"in O?(A=O.data,P=O.start,w=O.end):(A=O,P=0,w=A.byteLength);for(var E=P;E<w;){var h=D(A,E),f=V(A.subarray(E+4,E+8)),T=h>1?E+h:w;if(f===S[0])if(S.length===1)R.push({data:A,start:E+8,end:T});else{var x=p({data:A,start:E+8,end:T},S.slice(1));x.length&&Y.apply(R,x)}E=T}return R}function g(O){var S=p(O,["moov"]),R=S[0],A=R?R.end:null,P=p(O,["sidx"]);if(!P||!P[0])return null;var w=[],E=P[0],h=E.data[0],f=h===0?8:16,T=D(E,f);f+=4;var x=0,_=0;h===0?f+=8:f+=16,f+=2;var j=E.end+_,W=r(E,f);f+=2;for(var C=0;C<W;C++){var F=f,k=D(E,F);F+=4;var y=k&2147483647,H=(k&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=D(E,F);F+=4,w.push({referenceSize:y,subsegmentDuration:J,info:{duration:J/T,start:j,end:j+y-1}}),j+=y,F+=4,f=F}return{earliestPresentationTime:x,timescale:T,version:h,referencesCount:W,references:w,moovEndOffset:A}}function a(O){for(var S=[],R=p(O,["moov","trak"]),A=0;A<R.length;A++){var P=R[A],w=p(P,["tkhd"])[0];if(w){var E=w.data[w.start],h=E===0?12:20,f=D(w,h),T=p(P,["mdia","mdhd"])[0];if(T){E=T.data[T.start],h=E===0?12:20;var x=D(T,h),_=p(P,["mdia","hdlr"])[0];if(_){var j=V(_.data.subarray(_.start+8,_.start+12)),W={soun:K.ElementaryStreamTypes.AUDIO,vide:K.ElementaryStreamTypes.VIDEO}[j];if(W){var C=p(P,["mdia","minf","stbl","stsd"])[0],F=void 0;C&&(F=V(C.data.subarray(C.start+12,C.start+16))),S[f]={timescale:x,type:W},S[W]={timescale:x,id:f,codec:F}}}}}}var k=p(O,["moov","mvex","trex"]);return k.forEach(function(y){var H=D(y,4),J=S[H];J&&(J.default={duration:D(y,12),flags:D(y,20)})}),S}function c(O,S){return p(S,["moof","traf"]).reduce(function(R,A){var P=p(A,["tfdt"])[0],w=P.data[P.start],E=p(A,["tfhd"]).reduce(function(h,f){var T=D(f,4),x=O[T];if(x){var _=D(P,4);w===1&&(_*=Math.pow(2,32),_+=D(P,8));var j=x.timescale||9e4,W=_/j;if(isFinite(W)&&(h===null||W<h))return W}return h},null);return E!==null&&isFinite(E)&&(R===null||E<R)?E:R},null)||0}function s(O,S){for(var R=0,A=0,P=0,w=p(O,["moof","traf"]),E=0;E<w.length;E++){var h=w[E],f=p(h,["tfhd"])[0],T=D(f,4),x=S[T];if(!x)continue;var _=x.default,j=D(f,0)|(_==null?void 0:_.flags),W=_==null?void 0:_.duration;j&8&&(j&2?W=D(f,12):W=D(f,8));for(var C=x.timescale||9e4,F=p(h,["trun"]),k=0;k<F.length;k++){if(W){var y=D(F[k],4);R=W*y}else R=i(F[k]);x.type===K.ElementaryStreamTypes.VIDEO?A+=R/C:x.type===K.ElementaryStreamTypes.AUDIO&&(P+=R/C)}}if(A===0&&P===0){var H=g(O);if(H!=null&&H.references)return H.references.reduce(function(J,ae){return J+ae.info.duration||0},0)}return A||P}function i(O){var S=D(O,0),R=8;S&1&&(R+=4),S&4&&(R+=4);for(var A=0,P=D(O,4),w=0;w<P;w++){if(S&256){var E=D(O,R);A+=E,R+=4}S&512&&(R+=4),S&1024&&(R+=4),S&2048&&(R+=4)}return A}function t(O,S,R){p(S,["moof","traf"]).forEach(function(A){p(A,["tfhd"]).forEach(function(P){var w=D(P,4),E=O[w];if(!E)return;var h=E.timescale||9e4;p(A,["tfdt"]).forEach(function(f){var T=f.data[f.start],x=D(f,4);if(T===0)m(f,4,x-R*h);else{x*=Math.pow(2,32),x+=D(f,8),x-=R*h,x=Math.max(x,0);var _=Math.floor(x/(M+1)),j=Math.floor(x%(M+1));m(f,4,_),m(f,8,j)}})})})}function u(O){var S={valid:null,remainder:null},R=p(O,["moof"]);if(R){if(R.length<2)return S.remainder=O,S}else return S;var A=R[R.length-1];return S.valid=Object(q.sliceUint8)(O,0,A.start-8),S.remainder=Object(q.sliceUint8)(O,A.start-8),S}function o(O,S){var R=new Uint8Array(O.length+S.length);return R.set(O),R.set(S,O.length),R}},"./src/utils/output-filter.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return q});var q=function(){function K(Y,V){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=Y,this.trackName=V}var M=K.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(V,r,D){(this.startTime===null||this.startTime>V)&&(this.startTime=V),this.endTime=r,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"sendAddTrackEvent",function(){return K}),B.d(Q,"addCueToTrack",function(){return M}),B.d(Q,"clearCurrentCues",function(){return Y}),B.d(Q,"removeCuesInRange",function(){return V}),B.d(Q,"getCuesInRange",function(){return D});var q=B("./src/utils/logger.ts");function K(m,p){var g;try{g=new Event("addtrack")}catch(a){g=document.createEvent("Event"),g.initEvent("addtrack",!1,!1)}g.track=m,p.dispatchEvent(g)}function M(m,p){var g=m.mode;if(g==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(p.id))try{if(m.addCue(p),!m.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(c){q.logger.debug("[texttrack-utils]: "+c);var a=new self.TextTrackCue(p.startTime,p.endTime,p.text);a.id=p.id,m.addCue(a)}g==="disabled"&&(m.mode=g)}function Y(m){var p=m.mode;if(p==="disabled"&&(m.mode="hidden"),m.cues)for(var g=m.cues.length;g--;)m.removeCue(m.cues[g]);p==="disabled"&&(m.mode=p)}function V(m,p,g){var a=m.mode;if(a==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var c=D(m.cues,p,g),s=0;s<c.length;s++)m.removeCue(c[s]);a==="disabled"&&(m.mode=a)}function r(m,p){if(p<m[0].startTime)return 0;var g=m.length-1;if(p>m[g].endTime)return-1;for(var a=0,c=g;a<=c;){var s=Math.floor((c+a)/2);if(p<m[s].startTime)c=s-1;else if(p>m[s].startTime&&a<g)a=s+1;else return s}return m[a].startTime-p<p-m[c].startTime?a:c}function D(m,p,g){var a=[],c=r(m,p);if(c>-1)for(var s=c,i=m.length;s<i;s++){var t=m[s];if(t.startTime>=p&&t.endTime<=g)a.push(t);else if(t.startTime>g)return a}return a}},"./src/utils/time-ranges.ts":function(ne,Q,B){"use strict";B.r(Q);var q={toString:function(M){for(var Y="",V=M.length,r=0;r<V;r++)Y+="["+M.start(r).toFixed(3)+","+M.end(r).toFixed(3)+"]";return Y}};Q.default=q},"./src/utils/timescale-conversion.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"toTimescaleFromBase",function(){return K}),B.d(Q,"toTimescaleFromScale",function(){return M}),B.d(Q,"toMsFromMpegTsClock",function(){return Y}),B.d(Q,"toMpegTsClockFromTimescale",function(){return V});var q=9e4;function K(r,D,m,p){m===void 0&&(m=1),p===void 0&&(p=!1);var g=r*D*m;return p?Math.round(g):g}function M(r,D,m,p){return m===void 0&&(m=1),p===void 0&&(p=!1),K(r,D,1/m,p)}function Y(r,D){return D===void 0&&(D=!1),K(r,1e3,1/q,D)}function V(r,D){return D===void 0&&(D=1),K(r,q,1/D)}},"./src/utils/typed-array.ts":function(ne,Q,B){"use strict";B.r(Q),B.d(Q,"sliceUint8",function(){return q});function q(K,M,Y){return Uint8Array.prototype.slice?K.slice(M,Y):new Uint8Array(Array.prototype.slice.call(K,M,Y))}},"./src/utils/vttcue.ts":function(ne,Q,B){"use strict";B.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var q=["","lr","rl"],K=["start","middle","end","left","right"];function M(m,p){if(typeof p!="string")return!1;if(!Array.isArray(m))return!1;var g=p.toLowerCase();return~m.indexOf(g)?g:!1}function Y(m){return M(q,m)}function V(m){return M(K,m)}function r(m){for(var p=arguments.length,g=new Array(p>1?p-1:0),a=1;a<p;a++)g[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,p,g){var a=this,c={enumerable:!0};a.hasBeenReset=!1;var s="",i=!1,t=m,u=p,o=g,O=null,S="",R=!0,A="auto",P="start",w=50,E="middle",h=50,f="middle";Object.defineProperty(a,"id",r({},c,{get:function(){return s},set:function(x){s=""+x}})),Object.defineProperty(a,"pauseOnExit",r({},c,{get:function(){return i},set:function(x){i=!!x}})),Object.defineProperty(a,"startTime",r({},c,{get:function(){return t},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");t=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",r({},c,{get:function(){return u},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");u=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",r({},c,{get:function(){return o},set:function(x){o=""+x,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",r({},c,{get:function(){return O},set:function(x){O=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",r({},c,{get:function(){return S},set:function(x){var _=Y(x);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",r({},c,{get:function(){return R},set:function(x){R=!!x,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",r({},c,{get:function(){return A},set:function(x){if(typeof x!="number"&&x!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",r({},c,{get:function(){return P},set:function(x){var _=V(x);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");P=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",r({},c,{get:function(){return w},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");w=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",r({},c,{get:function(){return E},set:function(x){var _=V(x);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");E=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",r({},c,{get:function(){return h},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");h=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",r({},c,{get:function(){return f},set:function(x){var _=V(x);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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"parseTimeStamp",function(){return M}),B.d(Q,"fixLineBreaks",function(){return p}),B.d(Q,"VTTParser",function(){return g});var q=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 M(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 Y=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 V(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 O=o[0],S=o[1];c(O,S)}}var r=new q.default(0,0,""),D=r.align==="middle"?"middle":"center";function m(a,c,s){var i=a;function t(){var O=M(a);if(O===null)throw new Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),O}function u(O,S){var R=new Y;V(O,function(w,E){var h;switch(w){case"region":for(var f=s.length-1;f>=0;f--)if(s[f].id===E){R.set(w,s[f].region);break}break;case"vertical":R.alt(w,E,["rl","lr"]);break;case"line":h=E.split(","),R.integer(w,h[0]),R.percent(w,h[0])&&R.set("snapToLines",!1),R.alt(w,h[0],["auto"]),h.length===2&&R.alt("lineAlign",h[1],["start",D,"end"]);break;case"position":h=E.split(","),R.percent(w,h[0]),h.length===2&&R.alt("positionAlign",h[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":R.percent(w,E);break;case"align":R.alt(w,E,["start",D,"end","left","right"]);break}},/:/,/\s/),S.region=R.get("region",null),S.vertical=R.get("vertical","");var A=R.get("line","auto");A==="auto"&&r.line===-1&&(A=-1),S.line=A,S.lineAlign=R.get("lineAlign","start"),S.snapToLines=R.get("snapToLines",!0),S.size=R.get("size",100),S.align=R.get("align",D);var P=R.get("position","auto");P==="auto"&&r.position===50&&(P=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=P}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 p(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var g=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 P=t.buffer,w=0;for(P=p(P);w<P.length&&P[w]!=="\r"&&P[w]!==`
|
|
`;)++w;var E=P.substr(0,w);return P[w]==="\r"&&++w,P[w]===`
|
|
`&&++w,t.buffer=P.substr(w),E}function o(P){V(P,function(w,E){},/:/)}try{var O="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;O=u();var S=O.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var R=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;R?R=!1:O=u();switch(t.state){case"HEADER":/:/.test(O)?o(O):O||(t.state="ID");continue;case"NOTE":O||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){t.state="NOTE";break}if(!O)continue;if(t.cue=new q.default(0,0,""),t.state="CUE",O.indexOf("-->")===-1){t.cue.id=O;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{m(O,t.cue,t.regionList)}catch(P){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var A=O.indexOf("-->")!==-1;if(!O||A&&(R=!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+=O}continue;case"BADCUE":O||(t.state="ID")}}}catch(P){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(ne,Q,B){"use strict";B.r(Q),B.d(Q,"generateCueId",function(){return g}),B.d(Q,"parseWebVTT",function(){return c});var q=B("./src/polyfills/number.ts"),K=B("./src/utils/vttparser.ts"),M=B("./src/demux/id3.ts"),Y=B("./src/utils/timescale-conversion.ts"),V=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)),O=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(q.isFiniteNumber)(t)||!Object(q.isFiniteNumber)(u)||!Object(q.isFiniteNumber)(o)||!Object(q.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*u,t+=60*1e3*o,t+=60*60*1e3*O,t},p=function(i){for(var t=5381,u=i.length;u;)t=t*33^i.charCodeAt(--u);return(t>>>0).toString()};function g(s,i,t){return p(s.toString())+p(i.toString())+p(t)}var a=function(i,t,u){var o=i[t],O=i[o.prevCC];if(!O||!O.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(S=O)!==null&&S!==void 0&&S.new;){var S;i.ccOffset+=o.start-O.start,o.new=!1,o=O,O=i[o.prevCC]}i.presentationOffset=u};function c(s,i,t,u,o,O,S,R){var A=new K.VTTParser,P=Object(M.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
|
|
`).split(`
|
|
`),w=[],E=Object(Y.toMpegTsClockFromTimescale)(i,t),h="00:00.000",f=0,T=0,x,_=!0,j=!1;A.oncue=function(W){var C=u[o],F=u.ccOffset,k=(f-E)/9e4;if(C!=null&&C.new&&(T!==void 0?F=u.ccOffset=C.start:a(u,o,k)),k&&(F=k-u.presentationOffset),j){var y=W.endTime-W.startTime,H=Object(V.normalizePts)((W.startTime+F-T)*9e4,O*9e4)/9e4;W.startTime=H,W.endTime=H+y}var J=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(J)),W.id||(W.id=g(W.startTime,W.endTime,J)),W.endTime>0&&w.push(W)},A.onparsingerror=function(W){x=W},A.onflush=function(){if(x){R(x);return}S(w)},P.forEach(function(W){if(_)if(D(W,"X-TIMESTAMP-MAP=")){_=!1,j=!0,W.substr(16).split(",").forEach(function(C){D(C,"LOCAL:")?h=C.substr(6):D(C,"MPEGTS:")&&(f=parseInt(C.substr(7)))});try{T=m(h)/1e3}catch(C){j=!1,x=C}return}else W===""&&(_=!1);A.parse(W+`
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(ne,Q,B){"use strict";B.r(Q);var q=B("./src/utils/logger.ts"),K=B("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,Y=function(){function V(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=V.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,p,g){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=p,this.callbacks=g,this.retryDelay=p.retryDelay,this.loadInternal()},r.loadInternal=function(){var m=this.config,p=this.context;if(!m)return;var g=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(g,p.url)}catch(t){g.open("GET",p.url,!0),c(g,p.url)}g.readyState||g.open("GET",p.url,!0);var s=this.context.headers;if(s)for(var i in s)g.setRequestHeader(i,s[i])}catch(t){this.callbacks.onError({code:g.status,text:t.message},p,g);return}p.rangeEnd&&g.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),g.onreadystatechange=this.readystatechange.bind(this),g.onprogress=this.loadprogress.bind(this),g.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),g.send()},r.readystatechange=function(){var m=this.context,p=this.loader,g=this.stats;if(!m||!p)return;var a=p.readyState,c=this.config;if(g.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),g.loading.first===0&&(g.loading.first=Math.max(self.performance.now(),g.loading.start)),a===4){p.onreadystatechange=null,p.onprogress=null;var s=p.status;if(s>=200&&s<300){g.loading.end=Math.max(self.performance.now(),g.loading.first);var i,t;if(m.responseType==="arraybuffer"?(i=p.response,t=i.byteLength):(i=p.responseText,t=i.length),g.loaded=g.total=t,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(g,m,i,p),!this.callbacks)return;var o={url:p.responseURL,data:i};this.callbacks.onSuccess(o,g,m,p)}else g.retry>=c.maxRetry||s>=400&&s<499?(q.logger.error(s+" while loading "+m.url),this.callbacks.onError({code:s,text:p.statusText},m,p)):(q.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),g.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout)},r.loadtimeout=function(){q.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(m){var p=this.stats;p.loaded=m.loaded,m.lengthComputable&&(p.total=m.total)},r.getCacheAge=function(){var m=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");m=p?parseFloat(p):null}return m},V}();Q.default=Y}}).default})},vHTk:function(wt,Pe,U){wt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return Lt});var ne=U("rePB"),Q=U("VTBJ"),B=U("KQm4"),q=U("U8pU"),K=U("ODXe"),M=U("q1tI"),Y=U("TSYQ"),V=U.n(Y),r=U("Gytx"),D=U.n(r),m=U("Kwbf"),p=U("t23M"),g=U("qx4F"),a=U("6eGT"),c=U("IBYe"),s=U("Ff2n"),i=U("c+Xe"),t=U("fyJ8"),u=U("biw7");function o(Je,Qe,_t,xt,_e){var ie=_t[Je]||{},oe=_t[Qe]||{},ce,we;ie.fixed==="left"?ce=xt.left[Je]:oe.fixed==="right"&&(we=xt.right[Qe]);var de=!1,he=!1,Oe=!1,le=!1,Ne=_t[Qe+1],We=_t[Je-1];if(_e==="rtl"){if(ce!==void 0){var lt=We&&We.fixed==="left";le=!lt}else if(we!==void 0){var Ct=Ne&&Ne.fixed==="right";Oe=!Ct}}else if(ce!==void 0){var Rt=Ne&&Ne.fixed==="left";de=!Rt}else if(we!==void 0){var It=We&&We.fixed==="right";he=!It}return{fixLeft:ce,fixRight:we,lastFixLeft:de,firstFixRight:he,lastFixRight:Oe,firstFixLeft:le,isSticky:xt.isSticky}}var O=U("sR1s");function S(Je){var Qe=Je.cells,_t=Je.stickyOffsets,xt=Je.flattenColumns,_e=Je.rowComponent,ie=Je.cellComponent,oe=Je.onHeaderRow,ce=Je.index,we=M.useContext(u.a),de=we.prefixCls,he=we.direction,Oe;oe&&(Oe=oe(Qe.map(function(Ne){return Ne.column}),ce));var le=Object(O.a)(Qe.map(function(Ne){return Ne.column}));return M.createElement(_e,Object.assign({},Oe),Qe.map(function(Ne,We){var lt=Ne.column,Ct=o(Ne.colStart,Ne.colEnd,xt,_t,he),Rt;return lt&<.onHeaderCell&&(Rt=Ne.column.onHeaderCell(lt)),M.createElement(t.a,Object.assign({},Ne,{ellipsis:lt.ellipsis,align:lt.align,component:ie,prefixCls:de,key:le[We]},Ct,{additionalProps:Rt,rowType:"header"}))}))}S.displayName="HeaderRow";var R=S;function A(Je){var Qe=[];function _t(oe,ce){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Qe[we]=Qe[we]||[];var de=ce,he=oe.filter(Boolean).map(function(Oe){var le={key:Oe.key,className:Oe.className||"",children:Oe.title,column:Oe,colStart:de},Ne=1,We=Oe.children;return We&&We.length>0&&(Ne=_t(We,de,we+1).reduce(function(lt,Ct){return lt+Ct},0),le.hasSubColumns=!0),"colSpan"in Oe&&(Ne=Oe.colSpan),"rowSpan"in Oe&&(le.rowSpan=Oe.rowSpan),le.colSpan=Ne,le.colEnd=le.colStart+Ne-1,Qe[we].push(le),de+=Ne,Ne});return he}_t(Je,0);for(var xt=Qe.length,_e=function(ce){Qe[ce].forEach(function(we){!("rowSpan"in we)&&!we.hasSubColumns&&(we.rowSpan=xt-ce)})},ie=0;ie<xt;ie+=1)_e(ie);return Qe}function P(Je){var Qe=Je.stickyOffsets,_t=Je.columns,xt=Je.flattenColumns,_e=Je.onHeaderRow,ie=M.useContext(u.a),oe=ie.prefixCls,ce=ie.getComponent,we=M.useMemo(function(){return A(_t)},[_t]),de=ce(["header","wrapper"],"thead"),he=ce(["header","row"],"tr"),Oe=ce(["header","cell"],"th");return M.createElement(de,{className:"".concat(oe,"-thead")},we.map(function(le,Ne){var We=M.createElement(R,{key:Ne,flattenColumns:xt,cells:le,stickyOffsets:Qe,rowComponent:he,cellComponent:Oe,onHeaderRow:_e,index:Ne});return We}))}var w=P,E=U("hW8S");function h(Je){for(var Qe=Je.colWidths,_t=Je.columns,xt=Je.columCount,_e=[],ie=xt||_t.length,oe=!1,ce=ie-1;ce>=0;ce-=1){var we=Qe[ce],de=_t&&_t[ce],he=de&&de[E.a];(we||he||oe)&&(_e.unshift(M.createElement("col",Object.assign({key:ce,style:{width:we,minWidth:we}},he))),oe=!0)}return M.createElement("colgroup",null,_e)}var f=h;function T(Je,Qe){return Object(M.useMemo)(function(){for(var _t=[],xt=0;xt<Qe;xt+=1){var _e=Je[xt];if(_e!==void 0)_t[xt]=_e;else return null}return _t},[Je.join("_"),Qe])}var x=M.forwardRef(function(Je,Qe){var _t=Je.noData,xt=Je.columns,_e=Je.flattenColumns,ie=Je.colWidths,oe=Je.columCount,ce=Je.stickyOffsets,we=Je.direction,de=Je.fixHeader,he=Je.offsetHeader,Oe=Je.stickyClassName,le=Je.onScroll,Ne=Object(s.a)(Je,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),We=M.useContext(u.a),lt=We.prefixCls,Ct=We.scrollbarSize,Rt=We.isSticky,It=Rt&&!de?0:Ct,qn=M.useRef(null),Vt=M.useCallback(function(yr){Object(i.b)(Qe,yr),Object(i.b)(qn,yr)},[]);M.useEffect(function(){var yr;function Sr(Nn){var Ar=Nn.currentTarget,Dn=Nn.deltaX;Dn&&(le({currentTarget:Ar,scrollLeft:Ar.scrollLeft+Dn}),Nn.preventDefault())}return(yr=qn.current)===null||yr===void 0||yr.addEventListener("wheel",Sr),function(){var Nn;(Nn=qn.current)===null||Nn===void 0||Nn.removeEventListener("wheel",Sr)}},[]);var qt=_e[_e.length-1],nn={fixed:qt?qt.fixed:null,onHeaderCell:function(){return{className:"".concat(lt,"-cell-scrollbar")}}},On=Object(M.useMemo)(function(){return It?[].concat(Object(B.a)(xt),[nn]):xt},[It,xt]),ar=Object(M.useMemo)(function(){return It?[].concat(Object(B.a)(_e),[nn]):_e},[It,_e]),cr=Object(M.useMemo)(function(){var yr=ce.right,Sr=ce.left;return Object(Q.a)(Object(Q.a)({},ce),{},{left:we==="rtl"?[].concat(Object(B.a)(Sr.map(function(Nn){return Nn+It})),[0]):Sr,right:we==="rtl"?yr:[].concat(Object(B.a)(yr.map(function(Nn){return Nn+It})),[0]),isSticky:Rt})},[It,ce,Rt]),Qn=T(ie,oe);return M.createElement("div",{style:Object(Q.a)({overflow:"hidden"},Rt?{top:he}:{}),ref:Vt,className:V()("".concat(lt,"-header"),Object(ne.a)({},Oe,!!Oe))},M.createElement("table",{style:{tableLayout:"fixed",visibility:_t||Qn?null:"hidden"}},M.createElement(f,{colWidths:Qn?[].concat(Object(B.a)(Qn),[It]):[],columCount:oe+1,columns:ar}),M.createElement(w,Object.assign({},Ne,{stickyOffsets:cr,columns:On,flattenColumns:ar}))))});x.displayName="FixedHeader";var _=x,j=M.createContext(null),W=j;function C(Je){var Qe=Je.prefixCls,_t=Je.children,xt=Je.component,_e=Je.cellComponent,ie=Je.fixHeader,oe=Je.fixColumn,ce=Je.horizonScroll,we=Je.className,de=Je.expanded,he=Je.componentWidth,Oe=Je.colSpan,le=M.useContext(u.a),Ne=le.scrollbarSize;return M.useMemo(function(){var We=_t;return oe&&(We=M.createElement("div",{style:{width:he-(ie?Ne:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Qe,"-expanded-row-fixed")},We)),M.createElement(xt,{className:we,style:{display:de?null:"none"}},M.createElement(t.a,{component:_e,prefixCls:Qe,colSpan:Oe},We))},[_t,xt,ie,ce,we,de,he,Oe,Ne])}var F=C;function k(Je){var Qe=Je.className,_t=Je.style,xt=Je.record,_e=Je.index,ie=Je.rowKey,oe=Je.getRowKey,ce=Je.rowExpandable,we=Je.expandedKeys,de=Je.onRow,he=Je.indent,Oe=he===void 0?0:he,le=Je.rowComponent,Ne=Je.cellComponent,We=Je.childrenColumnName,lt=M.useContext(u.a),Ct=lt.prefixCls,Rt=lt.fixedInfoList,It=M.useContext(W),qn=It.fixHeader,Vt=It.fixColumn,qt=It.horizonScroll,nn=It.componentWidth,On=It.flattenColumns,ar=It.expandableType,cr=It.expandRowByClick,Qn=It.onTriggerExpand,yr=It.rowClassName,Sr=It.expandedRowClassName,Nn=It.indentSize,Ar=It.expandIcon,Dn=It.expandedRowRender,Pn=It.expandIconColumnIndex,Zn=M.useState(!1),pr=Object(K.a)(Zn,2),Lr=pr[0],Or=pr[1],at=we&&we.has(Je.recordKey);M.useEffect(function(){at&&Or(!0)},[at]);var Be=ar==="row"&&(!ce||ce(xt)),pt=ar==="nest",Ie=We&&xt&&xt[We],xe=Be||pt,ve;de&&(ve=de(xt,_e));var Hn=function(Wt){if(cr&&xe&&Qn(xt,Wt),ve&&ve.onClick){for(var dr,ht=arguments.length,Un=new Array(ht>1?ht-1:0),yn=1;yn<ht;yn++)Un[yn-1]=arguments[yn];(dr=ve).onClick.apply(dr,[Wt].concat(Un))}},kt;typeof yr=="string"?kt=yr:typeof yr=="function"&&(kt=yr(xt,_e,Oe));var ke=Object(O.a)(On),dt=M.createElement(le,Object.assign({},ve,{"data-row-key":ie,className:V()(Qe,"".concat(Ct,"-row"),"".concat(Ct,"-row-level-").concat(Oe),kt,ve&&ve.className),style:Object(Q.a)(Object(Q.a)({},_t),ve?ve.style:null),onClick:Hn}),On.map(function(Kn,Wt){var dr=Kn.render,ht=Kn.dataIndex,Un=Kn.className,yn=ke[Wt],un=Rt[Wt],Qt;Wt===(Pn||0)&&pt&&(Qt=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Nn*Oe,"px")},className:"".concat(Ct,"-row-indent indent-level-").concat(Oe)}),Ar({prefixCls:Ct,expanded:at,expandable:Ie,record:xt,onExpand:Qn})));var Ln;return Kn.onCell&&(Ln=Kn.onCell(xt,_e)),M.createElement(t.a,Object.assign({className:Un,ellipsis:Kn.ellipsis,align:Kn.align,component:Ne,prefixCls:Ct,key:yn,record:xt,index:_e,dataIndex:ht,render:dr,shouldCellUpdate:Kn.shouldCellUpdate},un,{appendNode:Qt,additionalProps:Ln}))})),Re;if(Be&&(Lr||at)){var an=Dn(xt,_e,Oe+1,at),hr=Sr&&Sr(xt,_e,Oe);Re=M.createElement(F,{expanded:at,className:V()("".concat(Ct,"-expanded-row"),"".concat(Ct,"-expanded-row-level-").concat(Oe+1),hr),prefixCls:Ct,fixHeader:qn,fixColumn:Vt,horizonScroll:qt,component:le,componentWidth:nn,cellComponent:Ne,colSpan:On.length},an)}var mr;return Ie&&at&&(mr=(xt[We]||[]).map(function(Kn,Wt){var dr=oe(Kn,Wt);return M.createElement(k,Object.assign({},Je,{key:dr,rowKey:dr,record:Kn,recordKey:dr,index:Wt,indent:Oe+1}))})),M.createElement(M.Fragment,null,dt,Re,mr)}k.displayName="BodyRow";var y=k,H=M.createContext(null),J=H;function ae(Je){var Qe=Je.columnKey,_t=Je.onColumnResize,xt=M.useRef();return M.useEffect(function(){xt.current&&_t(Qe,xt.current.offsetWidth)},[]),M.createElement(p.a,{onResize:function(ie){var oe=ie.offsetWidth;_t(Qe,oe)}},M.createElement("td",{ref:xt,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Je){var Qe=Je.data,_t=Je.getRowKey,xt=Je.measureColumnWidth,_e=Je.expandedKeys,ie=Je.onRow,oe=Je.rowExpandable,ce=Je.emptyNode,we=Je.childrenColumnName,de=M.useContext(J),he=de.onColumnResize,Oe=M.useContext(u.a),le=Oe.prefixCls,Ne=Oe.getComponent,We=M.useContext(W),lt=We.fixHeader,Ct=We.horizonScroll,Rt=We.flattenColumns,It=We.componentWidth;return M.useMemo(function(){var qn=Ne(["body","wrapper"],"tbody"),Vt=Ne(["body","row"],"tr"),qt=Ne(["body","cell"],"td"),nn;Qe.length?nn=Qe.map(function(ar,cr){var Qn=_t(ar,cr);return M.createElement(y,{key:Qn,rowKey:Qn,record:ar,recordKey:Qn,index:cr,rowComponent:Vt,cellComponent:qt,expandedKeys:_e,onRow:ie,getRowKey:_t,rowExpandable:oe,childrenColumnName:we})}):nn=M.createElement(F,{expanded:!0,className:"".concat(le,"-placeholder"),prefixCls:le,fixHeader:lt,fixColumn:Ct,horizonScroll:Ct,component:Vt,componentWidth:It,cellComponent:qt,colSpan:Rt.length},ce);var On=Object(O.a)(Rt);return M.createElement(qn,{className:"".concat(le,"-tbody")},xt&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(le,"-measure-row"),style:{height:0}},On.map(function(ar){return M.createElement(ae,{key:ar,columnKey:ar,onColumnResize:he})})),nn)},[Qe,le,ie,xt,_e,_t,Ne,It,ce,Rt])}var ge=M.memo(fe);ge.displayName="Body";var Te=ge,Ue=U("wRmb"),Se=U("xEkU"),Le=U.n(Se);function ye(Je){var Qe=Object(M.useRef)(Je),_t=Object(M.useState)({}),xt=Object(K.a)(_t,2),_e=xt[1],ie=Object(M.useRef)(null),oe=Object(M.useRef)([]);function ce(we){ie.current===null&&(oe.current=[],ie.current=Le()(function(){oe.current.forEach(function(de){Qe.current=de(Qe.current)}),ie.current=null,_e({})})),oe.current.push(we)}return Object(M.useEffect)(function(){return function(){Le.a.cancel(ie.current)}},[]),[Qe.current,ce]}function Z(Je){var Qe=Object(M.useRef)(Je),_t=Object(M.useRef)(null);function xt(){window.clearTimeout(_t.current)}function _e(oe){Qe.current=oe,xt(),_t.current=window.setTimeout(function(){Qe.current=null,_t.current=null},100)}function ie(){return Qe.current}return Object(M.useEffect)(function(){return xt},[]),[_e,ie]}function v(Je,Qe,_t){var xt=Object(M.useMemo)(function(){for(var _e=[],ie=[],oe=0,ce=0,we=0;we<Qe;we+=1)if(_t==="rtl"){ie[we]=ce,ce+=Je[we]||0;var de=Qe-we-1;_e[de]=oe,oe+=Je[de]||0}else{_e[we]=oe,oe+=Je[we]||0;var he=Qe-we-1;ie[he]=ce,ce+=Je[he]||0}return{left:_e,right:ie}},[Je,Qe,_t]);return xt}var L=v;function z(Je){var Qe=Je.className,_t=Je.children;return M.createElement("div",{className:Qe},_t)}var ee=z,$=U("n6Qo");function Ee(Je){var Qe,_t=Je.prefixCls,xt=Je.record,_e=Je.onExpand,ie=Je.expanded,oe=Je.expandable,ce="".concat(_t,"-row-expand-icon");if(!oe)return M.createElement("span",{className:V()(ce,"".concat(_t,"-row-spaced"))});var we=function(he){_e(xt,he),he.stopPropagation()};return M.createElement("span",{className:V()(ce,(Qe={},Object(ne.a)(Qe,"".concat(_t,"-row-expanded"),ie),Object(ne.a)(Qe,"".concat(_t,"-row-collapsed"),!ie),Qe)),onClick:we})}function Fe(Je,Qe,_t){var xt=[];function _e(ie){(ie||[]).forEach(function(oe,ce){xt.push(Qe(oe,ce)),_e(oe[_t])})}return _e(Je),xt}var qe=U("zT1h"),Ce=U("y0+3"),Me=function(Qe,_t){var xt,_e,ie=Qe.scrollBodyRef,oe=Qe.onScroll,ce=Qe.offsetScroll,we=M.useContext(u.a),de=we.prefixCls,he=((xt=ie.current)===null||xt===void 0?void 0:xt.scrollWidth)||0,Oe=((_e=ie.current)===null||_e===void 0?void 0:_e.clientWidth)||0,le=he&&Oe*(Oe/he),Ne=M.useRef(),We=ye({scrollLeft:0,isHiddenScrollBar:!1}),lt=Object(K.a)(We,2),Ct=lt[0],Rt=lt[1],It=M.useRef({delta:0,x:0}),qn=M.useState(!1),Vt=Object(K.a)(qn,2),qt=Vt[0],nn=Vt[1],On=function(){nn(!1)},ar=function(Nn){Nn.persist(),It.current.delta=Nn.pageX-Ct.scrollLeft,It.current.x=0,nn(!0),Nn.preventDefault()},cr=function(Nn){var Ar,Dn=Nn||((Ar=window)===null||Ar===void 0?void 0:Ar.event),Pn=Dn.buttons;if(!qt||Pn===0){qt&&nn(!1);return}var Zn=It.current.x+Nn.pageX-It.current.x-It.current.delta;Zn<=0&&(Zn=0),Zn+le>=Oe&&(Zn=Oe-le),oe({scrollLeft:Zn/Oe*(he+2)}),It.current.x=Nn.pageX},Qn=function(){var Nn=Object(Ce.b)(ie.current).top,Ar=Nn+ie.current.offsetHeight,Dn=document.documentElement.scrollTop+window.innerHeight;Ar-Object(g.a)()<=Dn||Nn>=Dn-ce?Rt(function(Pn){return Object(Q.a)(Object(Q.a)({},Pn),{},{isHiddenScrollBar:!0})}):Rt(function(Pn){return Object(Q.a)(Object(Q.a)({},Pn),{},{isHiddenScrollBar:!1})})},yr=function(Nn){Rt(function(Ar){return Object(Q.a)(Object(Q.a)({},Ar),{},{scrollLeft:Nn/he*Oe||0})})};return M.useImperativeHandle(_t,function(){return{setScrollLeft:yr}}),M.useEffect(function(){var Sr=Object(qe.a)(document.body,"mouseup",On,!1),Nn=Object(qe.a)(document.body,"mousemove",cr,!1);return Qn(),function(){Sr.remove(),Nn.remove()}},[le,qt]),M.useEffect(function(){var Sr=Object(qe.a)(window,"scroll",Qn,!1),Nn=Object(qe.a)(window,"resize",Qn,!1);return function(){Sr.remove(),Nn.remove()}},[]),M.useEffect(function(){Ct.isHiddenScrollBar||Rt(function(Sr){var Nn,Ar;return Object(Q.a)(Object(Q.a)({},Sr),{},{scrollLeft:ie.current.scrollLeft/((Nn=ie.current)===null||Nn===void 0?void 0:Nn.scrollWidth)*((Ar=ie.current)===null||Ar===void 0?void 0:Ar.clientWidth)})})},[Ct.isHiddenScrollBar]),he<=Oe||!le||Ct.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(g.a)(),width:Oe,bottom:ce},className:"".concat(de,"-sticky-scroll")},M.createElement("div",{onMouseDown:ar,ref:Ne,className:V()("".concat(de,"-sticky-scroll-bar"),Object(ne.a)({},"".concat(de,"-sticky-scroll-bar-active"),qt)),style:{width:"".concat(le,"px"),transform:"translate3d(".concat(Ct.scrollLeft,"px, 0, 0)")}}))},He=M.forwardRef(Me);function Ke(Je,Qe){return M.useMemo(function(){var _t=!!Je;return{isSticky:_t,stickyClassName:_t?"".concat(Qe,"-sticky-header"):"",offsetHeader:Object(q.a)(Je)==="object"&&Je.offsetHeader||0,offsetScroll:Object(q.a)(Je)==="object"&&Je.offsetScroll||0}},[Je,Qe])}var ut=[],bt={},Lt="rc-table-internal-hook",Ft=M.memo(function(Je){var Qe=Je.children;return Qe},function(Je,Qe){return D()(Je.props,Qe.props)?Je.pingLeft!==Qe.pingLeft||Je.pingRight!==Qe.pingRight:!1});function Yt(Je){var Qe,_t=Je.prefixCls,xt=Je.className,_e=Je.rowClassName,ie=Je.style,oe=Je.data,ce=Je.rowKey,we=Je.scroll,de=Je.tableLayout,he=Je.direction,Oe=Je.title,le=Je.footer,Ne=Je.summary,We=Je.id,lt=Je.showHeader,Ct=Je.components,Rt=Je.emptyText,It=Je.onRow,qn=Je.onHeaderRow,Vt=Je.internalHooks,qt=Je.transformColumns,nn=Je.internalRefs,On=Je.sticky,ar=oe||ut,cr=!!ar.length,Qn=M.useState(0),yr=Object(K.a)(Qn,2),Sr=yr[0],Nn=yr[1];M.useEffect(function(){Nn(Object(g.a)())});var Ar=M.useMemo(function(){return Object(O.c)(Ct,{})},[Ct]),Dn=M.useCallback(function(jn,Wn){return Object(O.b)(Ar,jn)||Wn},[Ar]),Pn=M.useMemo(function(){return typeof ce=="function"?ce:function(jn){var Wn=jn&&jn[ce];return Wn}},[ce]),Zn=Object(E.c)(Je),pr=Zn.expandIcon,Lr=Zn.expandedRowKeys,Or=Zn.defaultExpandedRowKeys,at=Zn.defaultExpandAllRows,Be=Zn.expandedRowRender,pt=Zn.onExpand,Ie=Zn.onExpandedRowsChange,xe=Zn.expandRowByClick,ve=Zn.rowExpandable,Hn=Zn.expandIconColumnIndex,kt=Zn.expandedRowClassName,ke=Zn.childrenColumnName,dt=Zn.indentSize,Re=pr||Ee,an=ke||"children",hr=M.useMemo(function(){return Be?"row":Je.expandable&&Vt===Lt&&Je.expandable.__PARENT_RENDER_ICON__||ar.some(function(jn){return jn&&Object(q.a)(jn)==="object"&&jn[an]})?"nest":!1},[!!Be,ar]),mr=M.useState(function(){return Or||(at?Fe(ar,Pn,an):[])}),Kn=Object(K.a)(mr,2),Wt=Kn[0],dr=Kn[1],ht=M.useMemo(function(){return new Set(Lr||Wt||[])},[Lr,Wt]),Un=M.useCallback(function(jn){var Wn=Pn(jn,ar.indexOf(jn)),jt,pn=ht.has(Wn);pn?(ht.delete(Wn),jt=Object(B.a)(ht)):jt=[].concat(Object(B.a)(ht),[Wn]),dr(jt),pt&&pt(!pn,jn),Ie&&Ie(jt)},[Pn,ht,ar,pt,Ie]),yn=M.useState(0),un=Object(K.a)(yn,2),Qt=un[0],Ln=un[1],hn=Object(Ue.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},Je),Zn),{},{expandable:!!Be,expandedKeys:ht,getRowKey:Pn,onTriggerExpand:Un,expandIcon:Re,expandIconColumnIndex:Hn,direction:he}),Vt===Lt?qt:null),en=Object(K.a)(hn,2),Ut=en[0],Kt=en[1],sr=M.useMemo(function(){return{columns:Ut,flattenColumns:Kt}},[Ut,Kt]),or=M.useRef(),Fn=M.useRef(),bn=M.useRef(),Bt=M.useState(!1),$t=Object(K.a)(Bt,2),Gt=$t[0],Dt=$t[1],er=M.useState(!1),An=Object(K.a)(er,2),fn=An[0],Vn=An[1],dn=ye(new Map),_n=Object(K.a)(dn,2),tn=_n[0],kn=_n[1],tr=Object(O.a)(Kt),nr=tr.map(function(jn){return tn.get(jn)}),wn=M.useMemo(function(){return nr},[nr.join("_")]),Mn=L(wn,Kt.length,he),cn=we&&Object(O.d)(we.y),lr=we&&Object(O.d)(we.x),Xn=lr&&Kt.some(function(jn){var Wn=jn.fixed;return Wn}),vr=M.useRef(),gr=Ke(On,_t),Gn=gr.isSticky,Bn=gr.offsetHeader,_r=gr.offsetScroll,Rn=gr.stickyClassName,En,Cn,vn;cn&&(Cn={overflowY:"scroll",maxHeight:we.y}),lr&&(En={overflowX:"auto"},cn||(Cn={overflowY:"hidden"}),vn={width:we.x===!0?"auto":we.x,minWidth:"100%"});var Zt=M.useCallback(function(jn,Wn){kn(function(jt){var pn=new Map(jt);return pn.set(jn,Wn),pn})},[]),St=Z(null),Mt=Object(K.a)(St,2),Nt=Mt[0],At=Mt[1];function zt(jn,Wn){if(!Wn)return;typeof Wn=="function"?Wn(jn):Wn.scrollLeft!==jn&&(Wn.scrollLeft=jn)}var on=function(Wn){var jt=Wn.currentTarget,pn=Wn.scrollLeft,In=typeof pn=="number"?pn:jt.scrollLeft,zn=jt||bt;if(!At()||At()===zn){var mn;Nt(zn),zt(In,Fn.current),zt(In,bn.current),zt(In,(mn=vr.current)===null||mn===void 0?void 0:mn.setScrollLeft)}if(jt){var Ir=jt.scrollWidth,jr=jt.clientWidth;Dt(In>0),Vn(In<Ir-jr)}},sn=function(){bn.current&&on({currentTarget:bn.current})},ft=function(Wn){var jt=Wn.width;sn(),Ln(or.current?or.current.offsetWidth:jt)};M.useEffect(function(){return sn},[]),M.useEffect(function(){lr&&sn()},[lr]),M.useEffect(function(){Vt===Lt&&nn&&(nn.body.current=bn.current)});var rt=Dn(["table"],"table"),Ye=M.useMemo(function(){return de||(Xn?we.x==="max-content"?"auto":"fixed":cn||Kt.some(function(jn){var Wn=jn.ellipsis;return Wn})?"fixed":"auto")},[cn,Xn,Kt,de]),et,Ge={colWidths:wn,columCount:Kt.length,stickyOffsets:Mn,onHeaderRow:qn,fixHeader:cn},ot=M.useMemo(function(){return cr?null:typeof Rt=="function"?Rt():Rt},[cr,Rt]),tt=M.createElement(Te,{data:ar,measureColumnWidth:cn||lr||Gn,expandedKeys:ht,rowExpandable:ve,getRowKey:Pn,onRow:It,emptyNode:ot,childrenColumnName:an}),mt=M.createElement(f,{colWidths:Kt.map(function(jn){var Wn=jn.width;return Wn}),columns:Kt}),Tt=Ne&&M.createElement($.b,null,Ne(ar)),gt=Dn(["body"]);if(cn||Gn){var Pt;typeof gt=="function"?(Pt=gt(ar,{scrollbarSize:Sr,ref:bn,onScroll:on}),Ge.colWidths=Kt.map(function(jn,Wn){var jt=jn.width,pn=Wn===Ut.length-1?jt-Sr:jt;return typeof pn=="number"&&!Number.isNaN(pn)?pn:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Pt=M.createElement("div",{style:Object(Q.a)(Object(Q.a)({},En),Cn),onScroll:on,ref:bn,className:V()("".concat(_t,"-body"))},M.createElement(rt,{style:Object(Q.a)(Object(Q.a)({},vn),{},{tableLayout:Ye})},mt,tt,Tt),Gn&&M.createElement(He,{ref:vr,offsetScroll:_r,scrollBodyRef:bn,onScroll:on})),et=M.createElement(M.Fragment,null,lt!==!1&&M.createElement(_,Object.assign({noData:!ar.length},Ge,sr,{direction:he,offsetHeader:Bn,stickyClassName:Rn,ref:Fn,onScroll:on})),Pt)}else et=M.createElement("div",{style:Object(Q.a)(Object(Q.a)({},En),Cn),className:V()("".concat(_t,"-content")),onScroll:on,ref:bn},M.createElement(rt,{style:Object(Q.a)(Object(Q.a)({},vn),{},{tableLayout:Ye})},mt,lt!==!1&&M.createElement(w,Object.assign({},Ge,sr)),tt,Tt));var vt=Object(E.b)(Je),Et=M.createElement("div",Object.assign({className:V()(_t,xt,(Qe={},Object(ne.a)(Qe,"".concat(_t,"-rtl"),he==="rtl"),Object(ne.a)(Qe,"".concat(_t,"-ping-left"),Gt),Object(ne.a)(Qe,"".concat(_t,"-ping-right"),fn),Object(ne.a)(Qe,"".concat(_t,"-layout-fixed"),de==="fixed"),Object(ne.a)(Qe,"".concat(_t,"-fixed-header"),cn),Object(ne.a)(Qe,"".concat(_t,"-fixed-column"),Xn),Object(ne.a)(Qe,"".concat(_t,"-scroll-horizontal"),lr),Object(ne.a)(Qe,"".concat(_t,"-has-fix-left"),Kt[0]&&Kt[0].fixed),Object(ne.a)(Qe,"".concat(_t,"-has-fix-right"),Kt[Kt.length-1]&&Kt[Kt.length-1].fixed==="right"),Qe)),style:ie,id:We,ref:or},vt),M.createElement(Ft,{pingLeft:Gt,pingRight:fn,props:Object(Q.a)(Object(Q.a)({},Je),{},{stickyOffsets:Mn,mergedExpandedKeys:ht})},Oe&&M.createElement(ee,{className:"".concat(_t,"-title")},Oe(ar)),M.createElement("div",{className:"".concat(_t,"-container")},et),le&&M.createElement(ee,{className:"".concat(_t,"-footer")},le(ar))));lr&&(Et=M.createElement(p.a,{onResize:ft},Et));var ln=M.useMemo(function(){return{prefixCls:_t,getComponent:Dn,scrollbarSize:Sr,direction:he,fixedInfoList:Kt.map(function(jn,Wn){return o(Wn,Wn,Kt,Mn,he)}),isSticky:Gn}},[_t,Dn,Sr,he,Kt,Mn,he,Gn]),Jt=M.useMemo(function(){return Object(Q.a)(Object(Q.a)({},sr),{},{tableLayout:Ye,rowClassName:_e,expandedRowClassName:kt,componentWidth:Qt,fixHeader:cn,fixColumn:Xn,horizonScroll:lr,expandIcon:Re,expandableType:hr,expandRowByClick:xe,expandedRowRender:Be,onTriggerExpand:Un,expandIconColumnIndex:Hn,indentSize:dt})},[sr,Ye,_e,kt,Qt,cn,Xn,lr,Re,hr,xe,Be,Un,Hn,dt]),fr=M.useMemo(function(){return{onColumnResize:Zt}},[Zt]);return M.createElement(u.a.Provider,{value:ln},M.createElement(W.Provider,{value:Jt},M.createElement(J.Provider,{value:fr},Et)))}Yt.Column=c.a,Yt.ColumnGroup=a.a,Yt.Summary=$.a,Yt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Xt=Pe.b=Yt},wRmb:function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return D});var ne=U("rePB"),Q=U("KQm4"),B=U("VTBJ"),q=U("Ff2n"),K=U("q1tI"),M=U.n(K),Y=U("Kwbf"),V=U("Zm9Q"),r=U("hW8S");function D(c){return Object(V.a)(c).filter(function(s){return K.isValidElement(s)}).map(function(s){var i=s.key,t=s.props,u=t.children,o=Object(q.a)(t,["children"]),O=Object(B.a)({key:i},o);return u&&(O.children=D(u)),O})}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(O){return Object(B.a)({fixed:u},O)}))):[].concat(Object(Q.a)(s),[Object(B.a)(Object(B.a)({},i),{},{fixed:u})])},[])}function p(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(Y.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 O=c[o];if(u&&O.fixed!=="right")u=!1;else if(!u&&O.fixed==="right"){Object(Y.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function g(c){return c.map(function(s){var i=s.fixed,t=Object(q.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,O=c.expandedKeys,S=c.getRowKey,R=c.onTriggerExpand,A=c.expandIcon,P=c.rowExpandable,w=c.expandIconColumnIndex,E=c.direction,h=c.expandRowByClick,f=K.useMemo(function(){return t||D(u)},[t,u]),T=K.useMemo(function(){if(o){var j,W=w||0,C=f[W],F=(j={},Object(ne.a)(j,r.a,{className:"".concat(i,"-expand-icon-col")}),Object(ne.a)(j,"title",""),Object(ne.a)(j,"fixed",C?C.fixed:null),Object(ne.a)(j,"className","".concat(i,"-row-expand-icon-cell")),Object(ne.a)(j,"render",function(H,J,ae){var fe=S(J,ae),ge=O.has(fe),Te=P?P(J):!0,Ue=A({prefixCls:i,expanded:ge,expandable:Te,record:J,onExpand:R});return h?K.createElement("span",{onClick:function(Le){return Le.stopPropagation()}},Ue):Ue}),j),k=f.slice();return W>=0&&k.splice(W,0,F),k}return f},[o,f,S,O,A,E]),x=K.useMemo(function(){var j=T;return s&&(j=s(j)),j.length||(j=[{render:function(){return null}}]),j},[s,T,E]),_=K.useMemo(function(){return E==="rtl"?g(m(x)):m(x)},[x,E]);return[x,_]}Pe.b=a},"y0+3":function(wt,Pe,U){"use strict";U.d(Pe,"a",function(){return m}),U.d(Pe,"b",function(){return g});var ne=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},B={cssFloat:1,styleFloat:1,float:1};function q(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]=ne.test(c)),Q[c]?parseFloat(s)||0:s}function M(a,c){var s=arguments.length,i=q(a);return c=B[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,s===1?i:K(a,c,i[c]||a.style[c])}function Y(a,c,s){var i=arguments.length;if(c=B[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,i===3)return typeof s=="number"&&ne.test(c)&&(s="".concat(s,"px")),a.style[c]=s,s;for(var t in c)c.hasOwnProperty(t)&&Y(a,t,c[t]);return q(a)}function V(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 p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function g(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(wt,Pe,U){wt.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"},zWo0:function(wt,Pe,U){wt.exports={flex_box_center:"flex_box_center___3zJMe",flex_space_between:"flex_space_between___13piC",flex_box_vertical_center:"flex_box_vertical_center___1Z05H",flex_box_center_end:"flex_box_center_end___3Vv0l",flex_box_column:"flex_box_column___3GJ6D",bg:"bg___1hpKT",containerTitle:"containerTitle___3ViW8",containerDesc:"containerDesc___X72Fr",d1:"d1___4bBm6",name:"name___2KzoA",diff:"diff___1fPyD",time:"time___3N9-e",d2:"d2___1kqjn",listItem:"listItem___1lLy6",info:"info___2vCxA",title:"title___bqOOF",titleLeft:"titleLeft___1gE5Z",titleRight:"titleRight___3_pXb",acitons:"acitons___3AN6t",formWrap:"formWrap___2GMGM",button:"button___KOTNG"}}}]);
|