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([[194,5,6,7,8,21],{"+BqJ":function(kt,Ae,U){kt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Q,B){"use strict";function J(a,d){a.cmdState.push(d)}function K(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function N(a){var d=a.cmdState.pop();d&&d.closeBracket()}function $(a){for(var d=a.cmdState,s=d.length-1;s>=0;s--){var i=d[s];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function z(a,d,s){return function(){this.name=a,this.bracketNo=0,this.style=d,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=z("importmodule","tag",["string","builtin"]),r.documentclass=z("documentclass","tag",["","atom"]),r.usepackage=z("usepackage","tag",["atom"]),r.begin=z("begin","tag",["atom"]),r.end=z("end","tag",["atom"]),r.label=z("label","tag",["atom"]),r.ref=z("ref","tag",["atom"]),r.eqref=z("eqref","tag",["atom"]),r.cite=z("cite","tag",["atom"]),r.bibitem=z("bibitem","tag",["atom"]),r.Bibitem=z("Bibitem","tag",["atom"]),r.RBibitem=z("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(a,d){a.f=d}function p(a,d){var s;if(a.match(/^\\[a-zA-Z@]+/)){var i=a.current().slice(1);return s=r.hasOwnProperty(i)?r[i]:r.DEFAULT,s=new s,J(d,s),D(d,m),s.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return D(d,function(u,o){return g(u,o,"\\]")}),"keyword";if(a.match("\\("))return D(d,function(u,o){return g(u,o,"\\)")}),"keyword";if(a.match("$$"))return D(d,function(u,o){return g(u,o,"$$")}),"keyword";if(a.match("$"))return D(d,function(u,o){return g(u,o,"$")}),"keyword";var t=a.next();if(t=="%")return a.skipToEnd(),"comment";if(t=="}"||t=="]"){if(s=K(d),s)s.closeBracket(t),D(d,m);else return"error";return"bracket"}else return t=="{"||t=="["?(s=r.DEFAULT,s=new s,J(d,s),"bracket"):/\d/.test(t)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),s=$(d),s.name=="begin"&&(s.argument=a.current()),s.styleIdentifier())}function g(a,d,s){if(a.eatSpace())return null;if(s&&a.match(s))return D(d,p),"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 m(a,d){var s=a.peek(),i;return s=="{"||s=="["?(i=K(d),i.openBracket(s),a.eat(s),D(d,p),"bracket"):/[ \t\r]/.test(s)?(a.eat(s),null):(D(d,p),N(d),p(a,d))}return{startState:function(){var a=B.inMathMode?function(d,s){return g(d,s)}:p;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,d){return d.f(a,d)},blankLine:function(a){a.f=p,a.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(kt,Ae,U){},"/cxE":function(kt,Ae,U){"use strict";U.d(Ae,"f",function(){return B}),U.d(Ae,"g",function(){return J}),U.d(Ae,"h",function(){return K}),U.d(Ae,"e",function(){return $}),U.d(Ae,"b",function(){return z}),U.d(Ae,"c",function(){return r}),U.d(Ae,"d",function(){return D}),U.d(Ae,"a",function(){return p});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
|
|
|
|
`+g.stack):g},0)}}emit(g){this.listeners.forEach(m=>{m(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const Q=new te;function B(g){$(g)||Q.onUnexpectedError(g);return}function J(g){$(g)||Q.onUnexpectedExternalError(g);return}function K(g){if(g instanceof Error){let{name:m,message:a}=g;const d=g.stacktrace||g.stack;return{$isError:!0,name:m,message:a,stack:d}}return g}const N="Canceled";function $(g){return g instanceof Error&&g.name===N&&g.message===N}function z(){const g=new Error(N);return g.name=g.message,g}function r(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function D(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class p extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"19Vz":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){te.defineOption("placeholder","",function(z,r,D){var p=D&&D!=te.Init;if(r&&!p)z.on("blur",K),z.on("change",N),z.on("swapDoc",N),te.on(z.getInputField(),"compositionupdate",z.state.placeholderCompose=function(){J(z)}),N(z);else if(!r&&p){z.off("blur",K),z.off("change",N),z.off("swapDoc",N),te.off(z.getInputField(),"compositionupdate",z.state.placeholderCompose),Q(z);var g=z.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}r&&!z.hasFocus()&&K(z)});function Q(z){z.state.placeholder&&(z.state.placeholder.parentNode.removeChild(z.state.placeholder),z.state.placeholder=null)}function B(z){Q(z);var r=z.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=z.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var D=z.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),r.appendChild(D),z.display.lineSpace.insertBefore(r,z.display.lineSpace.firstChild)}function J(z){setTimeout(function(){var r=!1,D=z.getInputField();D.nodeName=="TEXTAREA"?r=!D.value:z.lineCount()==1&&(r=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),r?B(z):Q(z)},20)}function K(z){$(z)&&B(z)}function N(z){var r=z.getWrapperElement(),D=$(z);r.className=r.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?B(z):Q(z)}function $(z){return z.lineCount()===1&&z.getLine(0)===""}})},"1eCo":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Q={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},B={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(J,K){var N=J.indentUnit,$={},z=K.htmlMode?Q:B;for(var r in z)$[r]=z[r];for(var r in K)$[r]=K[r];var D,p;function g(f,C){function x(W){return C.tokenize=W,W(f,C)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?x(d("atom","]]>")):null:f.match("--")?x(d("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),x(s(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=d("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",C.tokenize=m,"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}g.isInText=!0;function m(f,C){var x=f.next();if(x==">"||x=="/"&&f.eat(">"))return C.tokenize=g,D=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return D="equals",null;if(x=="<"){C.tokenize=g,C.state=o,C.tagName=C.tagStart=null;var _=C.tokenize(f,C);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(x)?(C.tokenize=a(x),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(f){var C=function(x,_){for(;!x.eol();)if(x.next()==f){_.tokenize=m;break}return"string"};return C.isInAttribute=!0,C}function d(f,C){return function(x,_){for(;!x.eol();){if(x.match(C)){_.tokenize=g;break}x.next()}return f}}function s(f){return function(C,x){for(var _;(_=C.next())!=null;){if(_=="<")return x.tokenize=s(f+1),x.tokenize(C,x);if(_==">")if(f==1){x.tokenize=g;break}else return x.tokenize=s(f-1),x.tokenize(C,x)}return"meta"}}function i(f,C,x){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=x,($.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function t(f){f.context&&(f.context=f.context.prev)}function u(f,C){for(var x;;){if(!f.context)return;if(x=f.context.tagName,!$.contextGrabbers.hasOwnProperty(x)||!$.contextGrabbers[x].hasOwnProperty(C))return;t(f)}}function o(f,C,x){return f=="openTag"?(x.tagStart=C.column(),R):f=="closeTag"?T:o}function R(f,C,x){return f=="word"?(x.tagName=C.current(),p="tag",P):$.allowMissingTagName&&f=="endTag"?(p="tag bracket",P(f,C,x)):(p="error",R)}function T(f,C,x){if(f=="word"){var _=C.current();return x.context&&x.context.tagName!=_&&$.implicitlyClosed.hasOwnProperty(x.context.tagName)&&t(x),x.context&&x.context.tagName==_||$.matchClosing===!1?(p="tag",S):(p="tag error",A)}else return $.allowMissingTagName&&f=="endTag"?(p="tag bracket",S(f,C,x)):(p="error",A)}function S(f,C,x){return f!="endTag"?(p="error",S):(t(x),o)}function A(f,C,x){return p="error",S(f,C,x)}function P(f,C,x){if(f=="word")return p="attribute",E;if(f=="endTag"||f=="selfcloseTag"){var _=x.tagName,j=x.tagStart;return x.tagName=x.tagStart=null,f=="selfcloseTag"||$.autoSelfClosers.hasOwnProperty(_)?u(x,_):(u(x,_),x.context=new i(x,_,j==x.indented)),o}return p="error",P}function E(f,C,x){return f=="equals"?b:($.allowMissing||(p="error"),P(f,C,x))}function b(f,C,x){return f=="string"?h:f=="word"&&$.allowUnquoted?(p="string",P):(p="error",P(f,C,x))}function h(f,C,x){return f=="string"?h:P(f,C,x)}return{startState:function(f){var C={tokenize:g,state:o,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;D=null;var x=C.tokenize(f,C);return(x||D)&&x!="comment"&&(p=null,C.state=C.state(D||x,f,C),p&&(x=p=="error"?x+" error":p)),x},indent:function(f,C,x){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+N;if(_&&_.noIndent)return te.Pass;if(f.tokenize!=m&&f.tokenize!=g)return x?x.match(/^(\s*)/)[0].length:0;if(f.tagName)return $.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+N*($.multilineTagIndentFactor||1);if($.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var j=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(j&&j[1])for(;_;)if(_.tagName==j[2]){_=_.prev;break}else if($.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(j)for(;_;){var W=$.contextGrabbers[_.tagName];if(W&&W.hasOwnProperty(j[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+N:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:$.htmlMode?"html":"xml",helperType:$.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=P)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],x=f.context;x;x=x.prev)x.tagName&&C.push(x.tagName);return C.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});class te{constructor(B){this.element=B,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class Q{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let B=this._first;for(;B!==te.Undefined;){const J=B.next;B.prev=te.Undefined,B.next=te.Undefined,B=J}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(B){return this._insert(B,!1)}push(B){return this._insert(B,!0)}_insert(B,J){const K=new te(B);if(this._first===te.Undefined)this._first=K,this._last=K;else if(J){const $=this._last;this._last=K,K.prev=$,$.next=K}else{const $=this._first;this._first=K,K.next=$,$.prev=K}this._size+=1;let N=!1;return()=>{N||(N=!0,this._remove(K))}}shift(){if(this._first===te.Undefined)return;{const B=this._first.element;return this._remove(this._first),B}}pop(){if(this._last===te.Undefined)return;{const B=this._last.element;return this._remove(this._last),B}}_remove(B){if(B.prev!==te.Undefined&&B.next!==te.Undefined){const J=B.prev;J.next=B.next,B.next.prev=J}else B.prev===te.Undefined&&B.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):B.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):B.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let B=this._first;for(;B!==te.Undefined;)yield B.element,B=B.next}}},"2aBv":function(kt,Ae,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("0Owb"),J=U("14J3"),K=U("BMrR"),N=U("jCWc"),$=U("kPKH"),z=U("+L6B"),r=U("2/Rp"),D=U("oBTY"),p=U("tJVT"),g=U("q1tI"),m=U.n(g),a=U("ngQI"),d=U("Ty5D"),s=U("YIbm"),i=U.n(s),t=function(o){var R=o.visible,T=o.onOk,S=o.onCancel,A=o.data,P=Object(g.useState)([]),E=Object(p.a)(P,2),b=E[0],h=E[1],f=Object(g.useState)(!1),C=Object(p.a)(f,2),x=C[0],_=C[1],j=Object(d.i)();Object(g.useEffect)(function(){if(!R){h([]),_(!1);return}h(Object(D.a)(A)||[])},[R]);var W=function(){_(!0),T(b,function(){_(!1)})},w=function(){S()},F=function(H,Y,ie){var le=Array.from(H),he=le.splice(Y,1),we=Object(p.a)(he,1),Pe=we[0];return le.splice(ie,0,Pe),le},I=function(H,Y){if(!H.destination)return;var ie=F(Y,H.source.index,H.destination.index);h(ie)};return m.a.createElement(Q.a,{title:"\u9898\u578B\u6392\u5E8F",visible:R,centered:!0,onCancel:w,footer:m.a.createElement("div",null,m.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),m.a.createElement(r.a,{onClick:w},"\u53D6\u6D88"),m.a.createElement(r.a,{type:"primary",loading:x,onClick:W},"\u786E\u8BA4")),width:"680px"},m.a.createElement("div",{className:i.a.content},m.a.createElement(K.a,null,m.a.createElement($.a,{span:12},"\u5E8F\u53F7"),m.a.createElement($.a,{span:12},"\u9898\u578B\u540D\u79F0")),m.a.createElement(a.a,{onDragEnd:function(H){return I(H,b)}},m.a.createElement(a.c,{droppableId:"droppable"},function(v,H){return m.a.createElement("div",Object(B.a)({ref:v.innerRef},v.droppableProps,{style:{width:"100%"}}),b.map(function(Y,ie){return m.a.createElement(a.b,{key:ie,draggableId:ie.toString(),index:ie},function(le,he){return m.a.createElement("aside",Object(B.a)({ref:le.innerRef},le.draggableProps,le.dragHandleProps),m.a.createElement("div",null,m.a.createElement(K.a,{style:{backgroundColor:ie%2===0?"#f5f5f5":"#fff"}},m.a.createElement($.a,{span:12},ie+1),m.a.createElement($.a,{span:12},Y))))})}))}))))};Ae.a=t},"3/fG":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});function te(B,J){let K;return J.length===0?K=B:K=B.replace(/\{(\d+)\}/g,function(N,$){const z=$[0];return typeof J[z]!="undefined"?J[z]:N}),K}function Q(B,J,...K){return te(J,K)}},"55Ip":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return u});var te=U("Ty5D"),Q=U("dI71"),B=U("q1tI"),J=U.n(B),K=U("YS25"),N=U("17x9"),$=U.n(N),z=U("wx14"),r=U("zLVn"),D=U("9R94"),p=function(b){Object(Q.a)(h,b);function h(){for(var C,x=arguments.length,_=new Array(x),j=0;j<x;j++)_[j]=arguments[j];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(K.a)(C.props),C}var f=h.prototype;return f.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),g=function(b){Object(Q.a)(h,b);function h(){for(var C,x=arguments.length,_=new Array(x),j=0;j<x;j++)_[j]=arguments[j];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(K.b)(C.props),C}var f=h.prototype;return f.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),m=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},d=function(h){return h},s=J.a.forwardRef;typeof s=="undefined"&&(s=d);function i(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var t=s(function(b,h){var f=b.innerRef,C=b.navigate,x=b.onClick,_=Object(r.a)(b,["innerRef","navigate","onClick"]),j=_.target,W=Object(z.a)({},_,{onClick:function(F){try{x&&x(F)}catch(I){throw F.preventDefault(),I}!F.defaultPrevented&&F.button===0&&(!j||j==="_self")&&!i(F)&&(F.preventDefault(),C())}});return d!==s?W.ref=h||f:W.ref=f,J.a.createElement("a",W)}),u=s(function(b,h){var f=b.component,C=f===void 0?t:f,x=b.replace,_=b.to,j=b.innerRef,W=Object(r.a)(b,["component","replace","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(w){w||Object(D.a)(!1);var F=w.history,I=a(m(_,w.location),w.location),v=I?F.createHref(I):"",H=Object(z.a)({},W,{href:v,navigate:function(){var ie=m(_,w.location),le=x?F.replace:F.push;le(ie)}});return d!==s?H.ref=h||j:H.innerRef=j,J.a.createElement(C,H)})});if(!1)var o,R;var T=function(h){return h},S=J.a.forwardRef;typeof S=="undefined"&&(S=T);function A(){for(var b=arguments.length,h=new Array(b),f=0;f<b;f++)h[f]=arguments[f];return h.filter(function(C){return C}).join(" ")}var P=S(function(b,h){var f=b["aria-current"],C=f===void 0?"page":f,x=b.activeClassName,_=x===void 0?"active":x,j=b.activeStyle,W=b.className,w=b.exact,F=b.isActive,I=b.location,v=b.sensitive,H=b.strict,Y=b.style,ie=b.to,le=b.innerRef,he=Object(r.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(we){we||Object(D.a)(!1);var Pe=I||we.location,xe=a(m(ie,Pe),Pe),Oe=xe.pathname,pe=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),be=pe?Object(te.f)(Pe.pathname,{path:pe,exact:w,sensitive:v,strict:H}):null,ne=!!(F?F(be,Pe):be),fe=ne?A(W,_):W,_e=ne?Object(z.a)({},Y,{},j):Y,ke=Object(z.a)({"aria-current":ne&&C||null,className:fe,style:_e,to:xe},he);return T!==S?ke.ref=h||le:ke.innerRef=le,J.a.createElement(u,ke)})});if(!1)var E},"5VLF":function(kt,Ae,U){"use strict";var te,Q;function B(J,K,N){var $=function(z,r){return J.js_beautify(z,r)};return $.js=J.js_beautify,$.css=K.css_beautify,$.html=N.html_beautify,$.js_beautify=J.js_beautify,$.css_beautify=K.css_beautify,$.html_beautify=N.html_beautify,$}!(te=[U("6UM0"),U("TXwP"),U("psGv")],Q=function(J,K,N){return B(J,K,N)}.apply(Ae,te),Q!==void 0&&(kt.exports=Q))},"5Y4S":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return B});var te=U("MNsG");const Q=te.b.performance&&typeof te.b.performance.now=="function";class B{constructor(J){this._highResolution=Q&&J,this._startTime=this._now(),this._stopTime=-1}static create(J=!0){return new B(J)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6+eU":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return S});var te=U("wx14"),Q=U("rePB"),B=U("VTBJ"),J=U("1OyB"),K=U("vuIU"),N=U("Ji7U"),$=U("LK+K"),z=U("q1tI"),r=U.n(z),D=U("TSYQ"),p=U.n(D),g=function(P){var E,b="".concat(P.rootPrefixCls,"-item"),h=p()(b,"".concat(b,"-").concat(P.page),(E={},Object(Q.a)(E,"".concat(b,"-active"),P.active),Object(Q.a)(E,P.className,!!P.className),Object(Q.a)(E,"".concat(b,"-disabled"),!P.page),E)),f=function(){P.onClick(P.page)},C=function(_){P.onKeyPress(_,P.onClick,P.page)};return r.a.createElement("li",{title:P.showTitle?P.page:null,className:h,onClick:f,onKeyPress:C,tabIndex:"0"},P.itemRender(P.page,"page",r.a.createElement("a",{rel:"nofollow"},P.page)))},m=g,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},d=function(A){Object(N.a)(E,A);var P=Object($.a)(E);function E(){var b;Object(J.a)(this,E);for(var h=arguments.length,f=new Array(h),C=0;C<h;C++)f[C]=arguments[C];return b=P.call.apply(P,[this].concat(f)),b.state={goInputText:""},b.buildOptionText=function(x){return"".concat(x," ").concat(b.props.locale.items_per_page)},b.changeSize=function(x){b.props.changeSize(Number(x))},b.handleChange=function(x){b.setState({goInputText:x.target.value})},b.handleBlur=function(x){var _=b.props,j=_.goButton,W=_.quickGo,w=_.rootPrefixCls,F=b.state.goInputText;if(j||F==="")return;if(x.relatedTarget&&(x.relatedTarget.className.indexOf("".concat(w,"-prev"))>=0||x.relatedTarget.className.indexOf("".concat(w,"-next"))>=0))return;b.setState({goInputText:""}),W(b.getValidValue())},b.go=function(x){var _=b.state.goInputText;if(_==="")return;(x.keyCode===a.ENTER||x.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(K.a)(E,[{key:"getValidValue",value:function(){var h=this.state,f=h.goInputText,C=h.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var h=this.props,f=h.pageSize,C=h.pageSizeOptions;return C.some(function(x){return x.toString()===f.toString()})?C:C.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,C=f.pageSize,x=f.locale,_=f.rootPrefixCls,j=f.changeSize,W=f.quickGo,w=f.goButton,F=f.selectComponentClass,I=f.buildOptionText,v=f.selectPrefixCls,H=f.disabled,Y=this.state.goInputText,ie="".concat(_,"-options"),le=F,he=null,we=null,Pe=null;if(!j&&!W)return null;var xe=this.getPageSizeOptions();if(j&&le){var Oe=xe.map(function(pe,be){return r.a.createElement(le.Option,{key:be,value:pe.toString()},(I||h.buildOptionText)(pe))});he=r.a.createElement(le,{disabled:H,prefixCls:v,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||xe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(be){return be.parentNode}},Oe)}return W&&(w&&(Pe=typeof w=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ie,"-quick-jumper-button")},x.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},w)),we=r.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},x.jump_to,r.a.createElement("input",{disabled:H,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,Pe)),r.a.createElement("li",{className:"".concat(ie)},he,we)}}]),E}(r.a.Component);d.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=d,i=U("N2Kk");function t(){}function u(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function o(A,P,E){return E}function R(A,P,E){var b=typeof A=="undefined"?P.pageSize:A;return Math.floor((E.total-1)/b)+1}var T=function(A){Object(N.a)(E,A);var P=Object($.a)(E);function E(b){var h;Object(J.a)(this,E),h=P.call(this,b),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,W){var w=h.props.prefixCls,F=j||r.a.createElement("button",{type:"button","aria-label":W,className:"".concat(w,"-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,w=j.pageSize,F=j.total;return F<=w?!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),w=h.state.currentInputValue;W!==w&&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,w=R(j,h.state,h.props);W=W>w?w:W,w===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,w=j;if(h.isValid(w)&&!W){var F=R(void 0,h.state,h.props);w>F?w=F:w<1&&(w=1),"current"in h.props||h.setState({current:w,currentInputValue:w});var I=h.state.pageSize;return h.props.onChange(w,I),w}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<R(void 0,h.state,h.props)},h.runIfEnter=function(j,W){if(j.key==="Enter"||j.charCode===13){for(var w=arguments.length,F=new Array(w>2?w-2:0),I=2;I<w;I++)F[I-2]=arguments[I];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=b.onChange!==t,C="current"in b;C&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var x=b.defaultCurrent;"current"in b&&(x=b.current);var _=b.defaultPageSize;return"pageSize"in b&&(_=b.pageSize),x=Math.min(x,R(_,void 0,b)),h.state={current:x,currentInputValue:x,pageSize:_},h}return Object(K.a)(E,[{key:"componentDidUpdate",value:function(h,f){var C=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var x=this.paginationNode.querySelector(".".concat(C,"-item-").concat(f.current));x&&document.activeElement===x&&x.blur()}}},{key:"getValidValue",value:function(h){var f=h.target.value,C=R(void 0,this.state,this.props),x=this.state.currentInputValue,_;return f===""?_=f:isNaN(Number(f))?_=x:f>=C?_=C:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var h=this.props,f=h.showSizeChanger,C=h.total,x=h.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>x}},{key:"renderPrev",value:function(h){var f=this.props,C=f.prevIcon,x=f.itemRender,_=x(h,"prev",this.getItemIcon(C,"prev page")),j=!this.hasPrev();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:j}):_}},{key:"renderNext",value:function(h){var f=this.props,C=f.nextIcon,x=f.itemRender,_=x(h,"next",this.getItemIcon(C,"next page")),j=!this.hasNext();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:j}):_}},{key:"render",value:function(){var h=this,f=this.props,C=f.prefixCls,x=f.className,_=f.style,j=f.disabled,W=f.hideOnSinglePage,w=f.total,F=f.locale,I=f.showQuickJumper,v=f.showLessItems,H=f.showTitle,Y=f.showTotal,ie=f.simple,le=f.itemRender,he=f.showPrevNextJumpers,we=f.jumpPrevIcon,Pe=f.jumpNextIcon,xe=f.selectComponentClass,Oe=f.selectPrefixCls,pe=f.pageSizeOptions,be=this.state,ne=be.current,fe=be.pageSize,_e=be.currentInputValue;if(W===!0&&w<=fe)return null;var ke=R(void 0,this.state,this.props),qe=[],je=null,st=null,vt=null,Re=null,Be=null,Ye=I&&I.goButton,Ke=v?1:2,yt=ne-1>0?ne-1:0,Pt=ne+1<ke?ne+1:ke,Ht=Object.keys(this.props).reduce(function(ge,Ee){return(Ee.substr(0,5)==="data-"||Ee.substr(0,5)==="aria-"||Ee==="role")&&(ge[Ee]=h.props[Ee]),ge},{});if(ie)return Ye&&(typeof Ye=="boolean"?Be=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F.jump_to_confirm):Be=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ye),Be=r.a.createElement("li",{title:H?"".concat(F.jump_to).concat(ne,"/").concat(ke):null,className:"".concat(C,"-simple-pager")},Be)),r.a.createElement("ul",Object(te.a)({className:p()(C,"".concat(C,"-simple"),Object(Q.a)({},"".concat(C,"-disabled"),j),x),style:_,ref:this.savePaginationNode},Ht),r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(Q.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(yt)),r.a.createElement("li",{title:H?"".concat(ne,"/").concat(ke):null,className:"".concat(C,"-simple-pager")},r.a.createElement("input",{type:"text",value:_e,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(C,"-slash")},"/"),ke),r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(Q.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Pt)),Be);if(ke<=3+Ke*2){var Xt={locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:le};ke||qe.push(r.a.createElement(m,Object(te.a)({},Xt,{key:"noPager",page:ke,className:"".concat(C,"-disabled")})));for(var an=1;an<=ke;an+=1){var tn=ne===an;qe.push(r.a.createElement(m,Object(te.a)({},Xt,{key:an,page:an,active:tn})))}}else{var et=v?F.prev_3:F.prev_5,Ze=v?F.next_3:F.next_5;he&&(je=r.a.createElement("li",{title:H?et:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(C,"-jump-prev"),Object(Q.a)({},"".concat(C,"-jump-prev-custom-icon"),!!we))},le(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(we,"prev page"))),st=r.a.createElement("li",{title:H?Ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(C,"-jump-next"),Object(Q.a)({},"".concat(C,"-jump-next-custom-icon"),!!Pe))},le(this.getJumpNextPage(),"jump-next",this.getItemIcon(Pe,"next page")))),Re=r.a.createElement(m,{locale:F,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:!1,showTitle:H,itemRender:le}),vt=r.a.createElement(m,{locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:le});var Ct=Math.max(1,ne-Ke),At=Math.min(ne+Ke,ke);ne-1<=Ke&&(At=1+Ke*2),ke-ne<=Ke&&(Ct=ke-Ke*2);for(var dt=Ct;dt<=At;dt+=1){var ft=ne===dt;qe.push(r.a.createElement(m,{locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:dt,page:dt,active:ft,showTitle:H,itemRender:le}))}ne-1>=Ke*2&&ne!==1+2&&(qe[0]=Object(z.cloneElement)(qe[0],{className:"".concat(C,"-item-after-jump-prev")}),qe.unshift(je)),ke-ne>=Ke*2&&ne!==ke-2&&(qe[qe.length-1]=Object(z.cloneElement)(qe[qe.length-1],{className:"".concat(C,"-item-before-jump-next")}),qe.push(st)),Ct!==1&&qe.unshift(vt),At!==ke&&qe.push(Re)}var He=null;Y&&(He=r.a.createElement("li",{className:"".concat(C,"-total-text")},Y(w,[w===0?0:(ne-1)*fe+1,ne*fe>w?w:ne*fe])));var Ne=!this.hasPrev()||!ke,Ue=!this.hasNext()||!ke;return r.a.createElement("ul",Object(te.a)({className:p()(C,x,Object(Q.a)({},"".concat(C,"-disabled"),j)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Ht),He,r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:Ne?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(Q.a)({},"".concat(C,"-disabled"),Ne)),"aria-disabled":Ne},this.renderPrev(yt)),qe,r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(Q.a)({},"".concat(C,"-disabled"),Ue)),"aria-disabled":Ue},this.renderNext(Pt)),r.a.createElement(s,{disabled:j,locale:F,rootPrefixCls:C,selectComponentClass:xe,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:fe,pageSizeOptions:pe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(h,f){var C={};if("current"in h&&(C.current=h.current,h.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in h&&h.pageSize!==f.pageSize){var x=f.current,_=R(h.pageSize,f,h);x=x>_?_:x,"current"in h||(C.current=x,C.currentInputValue=x),C.pageSize=h.pageSize}return C}}]),E}(r.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var S=T},"69hG":function(kt,Ae,U){kt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(kt,Ae,U){"use strict";var te=U("wCXF"),Q=U("n6Qo");U.d(Ae,"b",function(){return Q.a});var B=U("IBYe"),J=U("6eGT"),K=U("hW8S");U.d(Ae,"a",function(){return K.a}),Ae.c=te.b},"6UM0":function(kt,Ae,U){var te,Q;(function(){var B;(function(){"use strict";var K=[function(r,D,p){var g=p(1).Beautifier,m=p(5).Options;function a(d,s){var i=new g(d,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new m}},function(r,D,p){var g=p(2).Output,m=p(3).Token,a=p(4),d=p(5).Options,s=p(7).Tokenizer,i=p(7).line_starters,t=p(7).positionable_operators,u=p(7).TOKEN;function o(v,H){return H.indexOf(v)!==-1}function R(v){return v.replace(/^\s+/g,"")}function T(v){for(var H={},Y=0;Y<v.length;Y++)H[v[Y].replace(/-/g,"_")]=v[Y];return H}function S(v,H){return v&&v.type===u.RESERVED&&v.text===H}function A(v,H){return v&&v.type===u.RESERVED&&o(v.text,H)}var P=["case","return","do","if","throw","else","await","break","continue","async"],E=["before-newline","after-newline","preserve-newline"],b=T(E),h=[b.before_newline,b.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(v,H){if(H.multiline_frame||H.mode===f.ForInitializer||H.mode===f.Conditional)return;v.remove_indent(H.start_line_index)}function x(v){v=v.replace(a.allLineBreaks,`
|
|
`);for(var H=[],Y=v.indexOf(`
|
|
`);Y!==-1;)H.push(v.substring(0,Y)),v=v.substring(Y+1),Y=v.indexOf(`
|
|
`);return v.length&&H.push(v),H}function _(v){return v===f.ArrayLiteral}function j(v){return o(v,[f.Expression,f.ForInitializer,f.Conditional])}function W(v,H){for(var Y=0;Y<v.length;Y++){var ie=v[Y].trim();if(ie.charAt(0)!==H)return!1}return!0}function w(v,H){for(var Y=0,ie=v.length,le;Y<ie;Y++)if(le=v[Y],le&&le.indexOf(H)!==0)return!1;return!0}function F(v,H){H=H||{},this._source_text=v||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new d(H)}F.prototype.create_flags=function(v,H){var Y=0;v&&(Y=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>Y&&(Y=v.line_indent_level));var ie={mode:H,parent:v,last_token:v?v.last_token:new m(u.START_BLOCK,""),last_word:v?v.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:v?v.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},F.prototype._reset=function(v){var H=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var Y=new s(v,this._options);return this._tokens=Y.tokenize(),v},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,H=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
|
|
`,H&&a.lineBreak.test(H||"")&&(Y=H.match(a.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return v=this._output.get_code(Y),v},F.prototype.handle_token=function(v,H){v.type===u.START_EXPR?this.handle_start_expr(v):v.type===u.END_EXPR?this.handle_end_expr(v):v.type===u.START_BLOCK?this.handle_start_block(v):v.type===u.END_BLOCK?this.handle_end_block(v):v.type===u.WORD?this.handle_word(v):v.type===u.RESERVED?this.handle_word(v):v.type===u.SEMICOLON?this.handle_semicolon(v):v.type===u.STRING?this.handle_string(v):v.type===u.EQUALS?this.handle_equals(v):v.type===u.OPERATOR?this.handle_operator(v):v.type===u.COMMA?this.handle_comma(v):v.type===u.BLOCK_COMMENT?this.handle_block_comment(v,H):v.type===u.COMMENT?this.handle_comment(v,H):v.type===u.DOT?this.handle_dot(v):v.type===u.EOF?this.handle_eof(v):v.type===u.UNKNOWN?this.handle_unknown(v,H):this.handle_unknown(v,H)},F.prototype.handle_whitespace_and_comments=function(v,H){var Y=v.newlines,ie=this._options.keep_array_indentation&&_(this._flags.mode);if(v.comments_before)for(var le=v.comments_before.next();le;)this.handle_whitespace_and_comments(le,H),this.handle_token(le,H),le=v.comments_before.next();if(ie)for(var he=0;he<Y;he+=1)this.print_newline(he>0,H);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,H);for(var we=1;we<Y;we+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(v,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&v.newlines||H,ie=o(this._flags.last_token.text,t)||o(v.text,t);if(ie){var le=o(this._flags.last_token.text,t)&&o(this._options.operator_position,h)||o(v.text,t);Y=Y&&le}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,I))return;this._output.set_wrap_point()}},F.prototype.print_newline=function(v,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Y=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},F.prototype.print_token=function(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},F.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(v){var H=!1;return H=H||A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,I)&&!v.newlines,H=H||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==u.WORD&&v.type!==u.RESERVED,H=H||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),H?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,A(v,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var H=f.Expression;if(v.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=f.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),o(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=f.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=f.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ie=this._tokens.peek(-4);A(Y,["async","function"])||Y.text==="*"&&A(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(v);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(v){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(v),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var H=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):Y&&(o(Y.text,[":",","])&&o(H.type,[u.STRING,u.WORD,u.RESERVED])||o(H.text,["get","set","..."])&&o(Y.type,[u.WORD,u.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Y.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):o(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!H.comments_before&&H.text==="}",le=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var he=0,we=null;this._flags.inline_frame=!0;do if(he+=1,we=this._tokens.peek(he-1),we.newlines){this._flags.inline_frame=!1;break}while(we.type!==u.EOF&&!(we.type===u.END_BLOCK&&we.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(le||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,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(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===f.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(_(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(v)},F.prototype.handle_word=function(v){if(v.type===u.RESERVED){if(o(v.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)v.type=u.WORD;else if(v.text==="import"&&o(this._tokens.peek().text,["(","."]))v.type=u.WORD;else if(o(v.text,["as","from"])&&!this._flags.import_block)v.type=u.WORD;else if(this._flags.mode===f.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(v.type=u.WORD)}}if(this.start_of_statement(v)?A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!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(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(S(v,"while")){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(v,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v)),S(v,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,I)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var Y="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":A(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===f.BlockStatement?Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&j(this._flags.mode)?Y="SPACE":this._flags.last_token.type===u.STRING?Y="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),A(v,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),A(v,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?A(this._flags.last_token,P)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!A(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(v,"if")&&S(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(v,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===u.WORD||v.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===u.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(v,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var H=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},F.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},F.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},F.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(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(v)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},F.prototype.handle_operator=function(v){var H=v.text==="*"&&(A(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),Y=o(v.text,["-","+"])&&(o(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var ie=!H;this.handle_whitespace_and_comments(v,ie)}if(v.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===u.OPERATOR&&o(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var le=!0,he=!0,we=!1;if(v.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,we=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!H&&this._options.preserve_newlines&&o(v.text,t)){var Pe=v.text===":",xe=Pe&&we,Oe=Pe&&!we;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Oe,this.print_token(v),(!Pe||xe)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Pe||xe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case b.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(v),le=!(this._output.just_added_newline()||Oe),this._output.space_before_token=le,this.print_token(v),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(v),le=!1;var pe=this._tokens.peek();he=pe&&o(pe.type,[u.WORD,u.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),le=this._flags.last_token.type===u.START_BLOCK,he=!1;else if(o(v.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),le=!1,he=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var be=A(this._flags.last_token,P)&&v.newlines;be&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(be,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(le=!0),this._flags.last_token.type===u.RESERVED?le=!0:this._flags.last_token.type===u.END_EXPR?le=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===u.OPERATOR&&(le=o(v.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(v.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(v),this._output.space_before_token=he},F.prototype.handle_block_comment=function(v,H){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,H),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,H)},F.prototype.print_block_commment=function(v,H){var Y=x(v.text),ie,le=!1,he=!1,we=v.whitespace_before,Pe=we.length;if(this.print_newline(!1,H),this.print_token_line_indentation(v),this._output.add_token(Y[0]),this.print_newline(!1,H),Y.length>1){for(Y=Y.slice(1),le=W(Y,"*"),he=w(Y,we),le&&(this._flags.alignment=1),ie=0;ie<Y.length;ie++)le?(this.print_token_line_indentation(v),this._output.add_token(R(Y[ie]))):he&&Y[ie]?(this.print_token_line_indentation(v),this._output.add_token(Y[ie].substring(Pe))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[ie])),this.print_newline(!1,H);this._flags.alignment=0}},F.prototype.handle_comment=function(v,H){v.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,H)},F.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,P)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(v)},F.prototype.handle_unknown=function(v,H){this.print_token(v),v.text[v.text.length-1]===`
|
|
`&&this.print_newline(!1,H)},F.prototype.handle_eof=function(v){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},r.exports.Beautifier=F},function(r){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(m))return!0;return!1},D.prototype.set_indent=function(m,a){this.is_empty()&&(this.__indent_count=m||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var a=m.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=m.length-a:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function p(m,a){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),a=a||"",m.indent_level>0&&(a=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}p.prototype.get_indent_size=function(m,a){var d=this.__base_string_length;return a=a||0,m<0&&(d=0),d+=m*this.__indent_size,d+=a,d},p.prototype.get_indent_string=function(m,a){var d=this.__base_string;return a=a||0,m<0&&(m=0,d=""),a+=m*this.__indent_size,this.__ensure_cache(a),d+=this.__cache[a],d},p.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var m=this.__cache.length,a=0,d="";this.__indent_size&&m>=this.__indent_size&&(a=Math.floor(m/this.__indent_size),m-=a*this.__indent_size,d=new Array(a+1).join(this.__indent_string)),m&&(d+=new Array(m+1).join(" ")),this.__cache.push(d)};function g(m,a){this.__indent_cache=new p(m,a),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,a){return this.__indent_cache.get_indent_string(m,a)},g.prototype.get_indent_size=function(m,a){return this.__indent_cache.get_indent_size(m,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){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 d=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(d=d.replace(/[\n]/g,m)),d},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,a){return m=m||0,a=a||0,this.next_line.set_indent(m,a),this.__lines.length>1?(this.current_line.set_indent(m,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var a=0;a<m.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},g.prototype.remove_indent=function(m){for(var a=this.__lines.length;m<a;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,a){for(var d=this.__lines.length-2;d>=0;){var s=this.__lines[d];if(s.is_empty())break;if(s.item(0).indexOf(m)!==0&&s.item(-1)!==a){this.__lines.splice(d+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},r.exports.Output=g},function(r){function D(p,g,m,a){this.type=p,this.text=g,this.comments_before=null,this.newlines=m||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 p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",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",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+a+"])*";D.identifier=new RegExp(d+s,"g"),D.identifierStart=new RegExp(d),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+m+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,p){var g=p(6).Options,m=["before-newline","after-newline","preserve-newline"];function a(d){g.call(this,d,"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",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new g,r.exports.Options=a},function(r){function D(m,a){this.raw_options=p(m,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(m,a){var d=this.raw_options[m],s=a||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(s=d.concat()):typeof d=="string"&&(s=d.split(/[^a-zA-Z0-9_\/\-]+/)),s},D.prototype._get_boolean=function(m,a){var d=this.raw_options[m],s=d===void 0?!!a:!!d;return s},D.prototype._get_characters=function(m,a){var d=this.raw_options[m],s=a||"";return typeof d=="string"&&(s=d.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},D.prototype._get_number=function(m,a){var d=this.raw_options[m];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(d,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(m,a,d){var s=this._get_selection_list(m,a,d);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s[0]},D.prototype._get_selection_list=function(m,a,d){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[a[0]],!this._is_valid_selection(d,a))throw new Error("Invalid Default Value!");var s=this._get_array(m,d);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s},D.prototype._is_valid_selection=function(m,a){return m.length&&a.length&&!m.some(function(d){return a.indexOf(d)===-1})};function p(m,a){var d={};m=g(m);var s;for(s in m)s!==a&&(d[s]=m[s]);if(a&&m[a])for(s in m[a])d[s]=m[a][s];return d}function g(m){var a={},d;for(d in m){var s=d.replace(/-/g,"_");a[s]=m[d]}return a}r.exports.Options=D,r.exports.normalizeOpts=g,r.exports.mergeOpts=p},function(r,D,p){var g=p(8).InputScanner,m=p(9).Tokenizer,a=p(9).TOKEN,d=p(13).Directives,s=p(4),i=p(12).Pattern,t=p(14).TemplatablePattern;function u(W,w){return w.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},R=new d(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,A=/[^\d\.]/,P=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),E=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";E=E.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),E="\\?\\.(?!\\d) "+E,E=E.replace(/ /g,"|");var b=new RegExp(E),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),x,_=function(W,w){m.call(this,W,w),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new i(this._input),I=new t(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(s.identifier).matching(s.identifierMatch),number:F.matching(T),punct:F.matching(b),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(/<!--/),html_comment_end:F.matching(/-->/),include:F.starting_with(/#include/).until_after(s.lineBreak),shebang:F.starting_with(/#!/).until_after(s.lineBreak),xml:F.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};_.prototype=new m,_.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,w){return(W.type===o.END_BLOCK||W.type===o.END_EXPR)&&w&&(W.text==="]"&&w.text==="["||W.text===")"&&w.text==="("||W.text==="}"&&w.text==="{")},_.prototype._reset=function(){x=!1},_.prototype._get_next_token=function(W,w){var F=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(o.EOF,""):(F=F||this._read_non_javascript(I),F=F||this._read_string(I),F=F||this._read_word(W),F=F||this._read_singles(I),F=F||this._read_comment(I),F=F||this._read_regexp(I,W),F=F||this._read_xml(I,W),F=F||this._read_punctuation(),F=F||this._create_token(o.UNKNOWN,this._input.next()),F)},_.prototype._read_word=function(W){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(s.allLineBreaks,`
|
|
`),!(W.type===o.DOT||W.type===o.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(w)?(w==="in"||w==="of")&&(W.type===o.WORD||W.type===o.STRING)?this._create_token(o.OPERATOR,w):this._create_token(o.RESERVED,w):this._create_token(o.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(o.WORD,w)},_.prototype._read_singles=function(W){var w=null;return W==="("||W==="["?w=this._create_token(o.START_EXPR,W):W===")"||W==="]"?w=this._create_token(o.END_EXPR,W):W==="{"?w=this._create_token(o.START_BLOCK,W):W==="}"?w=this._create_token(o.END_BLOCK,W):W===";"?w=this._create_token(o.SEMICOLON,W):W==="."&&A.test(this._input.peek(1))?w=this._create_token(o.DOT,W):W===","&&(w=this._create_token(o.COMMA,W)),w&&this._input.next(),w},_.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 w="";if(W==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(o.UNKNOWN,w.trim()+`
|
|
`);if(w=this.__patterns.include.read(),w)return this._create_token(o.UNKNOWN,w.trim()+`
|
|
`);W=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(S)){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(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)w+=this._input.next();return x=!0,this._create_token(o.COMMENT,w)}}else if(x&&W==="-"&&(w=this.__patterns.html_comment_end.read(),w))return x=!1,this._create_token(o.COMMENT,w);return null},_.prototype._read_comment=function(W){var w=null;if(W==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var I=R.get_directives(F);I&&I.ignore==="start"&&(F+=R.readIgnored(this._input)),F=F.replace(s.allLineBreaks,`
|
|
`),w=this._create_token(o.BLOCK_COMMENT,F),w.directives=I}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),w=this._create_token(o.COMMENT,F))}return w},_.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var w=this._input.next();return this.has_char_escapes=!1,W==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(w=j(w)),this._input.peek()===W&&(w+=this._input.next()),w=w.replace(s.allLineBreaks,`
|
|
`),this._create_token(o.STRING,w)}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,w){if(W==="/"&&this._allow_regexp_or_xml(w)){for(var F=this._input.next(),I=!1,v=!1;this._input.hasNext()&&(I||v||this._input.peek()!==W)&&!this._input.testChar(s.newline);)F+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!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,w){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(w)){var F="",I=this.__patterns.xml.read_match();if(I){for(var v=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=v.indexOf("{")===0,Y=0;I;){var ie=!!I[1],le=I[2],he=!!I[I.length-1]||le.slice(0,8)==="![CDATA[";if(!he&&(le===v||H&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--Y:++Y),F+=I[0],Y<=0)break;I=this.__patterns.xml.read_match()}return I||(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 w="",F=0,I=new g(W),v=null;I.hasNext();)if(v=I.match(/([\s]|[^\\]|\\\\)+/g),v&&(w+=v[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")v=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")v=I.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",I.hasNext()&&(w+=I.next());continue}if(!v)return W;if(F=parseInt(v[1],16),F>126&&F<=255&&v[0].indexOf("x")===0)return W;if(F>=0&&F<32){w+="\\"+v[0];continue}else F===34||F===39||F===92?w+="\\"+String.fromCharCode(F):w+=String.fromCharCode(F)}return w}_.prototype._read_string_recursive=function(W,w,F){var I,v;W==="'"?v=this.__patterns.single_quote:W==='"'?v=this.__patterns.double_quote:W==="`"?v=this.__patterns.template_text:W==="}"&&(v=this.__patterns.template_expression);for(var H=v.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===W||!w&&s.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Y+=this._input.next()):F&&(F==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),F===Y&&(W==="`"?Y+=this._read_string_recursive("}",w,"`"):Y+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=v.read(),H+=Y}return H},r.exports.Tokenizer=_,r.exports.TOKEN=o,r.exports.positionable_operators=P.slice(),r.exports.line_starters=h.slice()},function(r){var D=RegExp.prototype.hasOwnProperty("sticky");function p(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},p.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(m=this.__input.charAt(g)),m},p.prototype.__match=function(g,m){g.lastIndex=m;var a=g.exec(this.__input);return a&&!(D&&g.sticky)&&(a.index!==m&&(a=null)),a},p.prototype.test=function(g,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(g,m):!1},p.prototype.testChar=function(g,m){var a=this.peek(m);return g.lastIndex=0,a!==null&&g.test(a)},p.prototype.match=function(g){var m=this.__match(g,this.__position);return m?this.__position+=m[0].length:m=null,m},p.prototype.read=function(g,m,a){var d="",s;return g&&(s=this.match(g),s&&(d+=s[0])),m&&(s||!g)&&(d+=this.readUntil(m,a)),d},p.prototype.readUntil=function(g,m){var a="",d=this.__position;g.lastIndex=this.__position;var s=g.exec(this.__input);return s?(d=s.index,m&&(d+=s[0].length)):d=this.__input_length,a=this.__input.substring(this.__position,d),this.__position=d,a},p.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},p.prototype.get_regexp=function(g,m){var a=null,d="g";return m&&D&&(d="y"),typeof g=="string"&&g!==""?a=new RegExp(g,d):g&&(a=new RegExp(g.source,d)),a},p.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(g){var m=this.__position,a=this.readUntilAfter(g);return this.__position=m,a},p.prototype.lookBack=function(g){var m=this.__position-1;return m>=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},r.exports.InputScanner=p},function(r,D,p){var g=p(8).InputScanner,m=p(3).Token,a=p(10).TokenStream,d=p(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,u){this._input=new g(t),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new d(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var t,u=new m(s.START,""),o=null,R=[],T=new a;u.type!==s.EOF;){for(t=this._get_next_token(u,o);this._is_comment(t);)T.add(t),t=this._get_next_token(u,o);T.isEmpty()||(t.comments_before=T,T=new a),t.parent=o,this._is_opening(t)?(R.push(o),o=t):o&&this._is_closing(t,o)&&(t.opened=o,o.closed=t,o=R.pop(),t.parent=o),t.previous=u,u.next=t,this.__tokens.add(t),u=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,u){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(s.RAW,o):this._create_token(s.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,u){return!1},i.prototype._create_token=function(t,u){var o=new m(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(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}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 p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},D.prototype.peek=function(p){var g=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(g=this.__tokens[p]),g},D.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},r.exports.TokenStream=D},function(r,D,p){var g=p(12).Pattern;function m(a,d){g.call(this,a,d),d?this._line_regexp=this._input.get_regexp(d._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new g,m.prototype.__set_whitespace_patterns=function(a,d){a+="\\t ",d+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+d+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+d+"]")},m.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 d=this.__split(this._newline_regexp,a);this.newline_count=d.length-1,this.whitespace_before_token=d[this.newline_count]}return a},m.prototype.matching=function(a,d){var s=this._create();return s.__set_whitespace_patterns(a,d),s._update(),s},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(a,d){a.lastIndex=0;for(var s=0,i=[],t=a.exec(d);t;)i.push(d.substring(s,t.index)),s=t.index+t[0].length,t=a.exec(d);return s<d.length?i.push(d.substring(s,d.length)):i.push(""),i},r.exports.WhitespacePattern=m},function(r){function D(p,g){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}D.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(p){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(p),g._update(),g},D.prototype.until=function(p){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(p),g._update(),g},D.prototype.starting_with=function(p){var g=this._create();return g._starting_pattern=this._input.get_regexp(p,!0),g._update(),g},D.prototype.matching=function(p){var g=this._create();return g._match_pattern=this._input.get_regexp(p,!0),g._update(),g},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},r.exports.Pattern=D},function(r){function D(p,g){p=typeof p=="string"?p:p.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(p);m;)g[m[1]]=m[2],m=this.__directive_pattern.exec(p);return g},D.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},function(r,D,p){var g=p(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(d,s){g.call(this,d,s),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new g(d);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new g,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(d){var s=this._create();return s._disabled[d]=!0,s._update(),s},a.prototype.read_options=function(d){var s=this._create();for(var i in m)s._disabled[i]=d.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(d){var s=this._create();return s._excluded[d]=!0,s._update(),s},a.prototype.read=function(){var d="";this._match_pattern?d=this._input.read(this._starting_pattern):d=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),d+=s,s=this._read_template();return this._until_after&&(d+=this._input.readUntilAfter(this._until_pattern)),d},a.prototype.__set_templated_pattern=function(){var d=[];this._disabled.php||d.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||d.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||d.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(d.push(this.__patterns.django._starting_pattern.source),d.push(this.__patterns.django_value._starting_pattern.source),d.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||d.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&d.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+d.join("|")+")")},a.prototype._read_template=function(){var d="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(d=d||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(d=d||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(d=d||this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars_unescaped.read(),d=d||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(d=d||this.__patterns.django_value.read()),this._excluded.django||(d=d||this.__patterns.django_comment.read(),d=d||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(d=d||this.__patterns.smarty_comment.read(),d=d||this.__patterns.smarty_literal.read(),d=d||this.__patterns.smarty.read()));return d},r.exports.TemplatablePattern=a}],N={};function $(r){var D=N[r];if(D!==void 0)return D.exports;var p=N[r]={exports:{}};return K[r](p,p.exports,$),p.exports}var z=$(0);B=z})();var J=B;!(te=[],Q=function(){return{js_beautify:J}}.apply(Ae,te),Q!==void 0&&(kt.exports=Q))})()},"6eGT":function(kt,Ae,U){"use strict";function te(Q){return null}Ae.a=te},"746U":function(kt,Ae,U){"use strict";U.d(Ae,"f",function(){return te}),U.d(Ae,"l",function(){return Q}),U.d(Ae,"k",function(){return B}),U.d(Ae,"j",function(){return J}),U.d(Ae,"g",function(){return K}),U.d(Ae,"m",function(){return N}),U.d(Ae,"h",function(){return $}),U.d(Ae,"n",function(){return z}),U.d(Ae,"c",function(){return r}),U.d(Ae,"a",function(){return D}),U.d(Ae,"i",function(){return p}),U.d(Ae,"o",function(){return g}),U.d(Ae,"e",function(){return d}),U.d(Ae,"d",function(){return s}),U.d(Ae,"p",function(){return i}),U.d(Ae,"b",function(){return t});function te(u){return Array.isArray(u)}function Q(u){return typeof u=="string"}function B(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function J(u){return typeof u=="number"&&!isNaN(u)}function K(u){return u===!0||u===!1}function N(u){return typeof u=="undefined"}function $(u){return!z(u)}function z(u){return N(u)||u===null}function r(u,o){if(!u)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function D(u){if(z(u))throw new Error("Assertion Failed: argument is undefined or null");return u}function p(u){return typeof u=="function"}function g(u,o){const R=Math.min(u.length,o.length);for(let T=0;T<R;T++)m(u[T],o[T])}function m(u,o){if(Q(o)){if(typeof u!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(p(o)){try{if(u instanceof o)return}catch(R){}if(!z(u)&&u.constructor===o)return;if(o.length===1&&o.call(void 0,u)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(u){let o=[],R=Object.getPrototypeOf(u);for(;Object.prototype!==R;)o=o.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return o}function d(u){const o=[];for(const R of a(u))typeof u[R]=="function"&&o.push(R);return o}function s(u,o){const R=S=>function(){const A=Array.prototype.slice.call(arguments,0);return o(S,A)};let T={};for(const S of u)T[S]=R(S);return T}function i(u){return u===null?void 0:u}function t(u,o="Unreachable"){throw new Error(o)}},"7Cbv":function(kt,Ae,U){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function B(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Q)}var J=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function K(m){return typeof m=="string"&&J.test(m)}for(var N=K,$=[],z=0;z<256;++z)$.push((z+256).toString(16).substr(1));function r(m){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=($[m[a+0]]+$[m[a+1]]+$[m[a+2]]+$[m[a+3]]+"-"+$[m[a+4]]+$[m[a+5]]+"-"+$[m[a+6]]+$[m[a+7]]+"-"+$[m[a+8]]+$[m[a+9]]+"-"+$[m[a+10]]+$[m[a+11]]+$[m[a+12]]+$[m[a+13]]+$[m[a+14]]+$[m[a+15]]).toLowerCase();if(!N(d))throw TypeError("Stringified UUID is invalid");return d}var D=r;function p(m,a,d){m=m||{};var s=m.random||(m.rng||B)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,a){d=d||0;for(var i=0;i<16;++i)a[d+i]=s[i];return a}return D(s)}var g=Ae.a=p},"7ahc":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return R});var te=U("k1fw"),Q=U("0Owb"),B=U("+L6B"),J=U("2/Rp"),K=U("y8nQ"),N=U("Vl3Y"),$=U("tJVT"),z=U("OaEy"),r=U("2fM7"),D=U("q1tI"),p=U.n(D),g=U("VrN/"),m=U.n(g),a=U("p77/"),d=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"]};Ae.b=function(T){var S=T.callback,A=T.onCancel,P=Object(D.useState)("python"),E=Object($.a)(P,2),b=E[0],h=E[1];function f(x){h(o[x][1])}function C(x){S(x)}return p.a.createElement(N.a,Object(Q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),p.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(r.a,{onChange:f},Object.keys(o).map(function(x){return p.a.createElement(t,{key:x,value:x},o[x][0])}))),p.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(R,{mode:b})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(J.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function R(T){var S=T.value,A=T.onChange,P=T.mode,E=T.options,b=E===void 0?{}:E,h=Object(D.useRef)(),f=Object(D.useState)(),C=Object($.a)(f,2),x=C[0],_=C[1];return Object(D.useEffect)(function(){if(x){function j(W){var w=W.getValue();A&&A(w)}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&&((S!==x.getValue()||S==="")&&setTimeout(function(){x.setValue(S||" ")},300))},[x,S]),Object(D.useEffect)(function(){if(h.current&&!x){var j=m.a.fromTextArea(h.current,Object(te.a)({mode:P,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));_(j)}},[h.current,x]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:h}))}},"7qnI":function(kt,Ae,U){"use strict";var te=U("5Dmo"),Q=U("3S7+"),B=U("fWQN"),J=U("mtLc"),K=U("yKVA"),N=U("879j"),$=U("5NDa"),z=U("5rEg"),r=U("q1tI"),D=U.n(r),p=U("O2Wb"),g=U.n(p),m=z.a.TextArea,a=function(d){Object(K.a)(i,d);var s=Object(N.a)(i);function i(){return Object(B.a)(this,i),s.apply(this,arguments)}return Object(J.a)(i,[{key:"render",value:function(){var u=this,o=this.props,R=o.index,T=o.onAnswerChange,S=o.addChildAnswer,A=o.exerciseIsPublish,P=o.answers,E=o.activeOptionErrorIndex,b=o.flex,h=b===void 0?"0 0 1000px":b;return D.a.createElement("div",{className:g.a.flex},D.a.createElement("div",{className:"".concat(g.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",R+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},P.map(function(f,C){var x="".concat(R,"-").concat(C);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:C},D.a.createElement("div",{className:g.a.flex1,style:{flex:h}},D.a.createElement("div",null,D.a.createElement(m,{className:x===E?g.a.error:"",spellCheck:!1,rows:4,value:f||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(C==0?"":"(\u53EF\u9009)"),onChange:function(j){return T(R,C,j.target.value)},style:{minHeight:95}}))),!A&&D.a.createElement(D.a.Fragment,null,C!=0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswer(R,C)},style:{float:"right"}})),C===0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswermain(R,C)},style:{float:"right"}})),D.a.createElement(Q.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return S(R)},style:{float:"right",visibility:C==P.length-1?"":"hidden"}}))))})))}}]),i}(r.Component);Ae.a=a},"815F":function(kt,Ae,U){"use strict";U.d(Ae,"e",function(){return $}),U.d(Ae,"c",function(){return r}),U.d(Ae,"d",function(){return D}),U.d(Ae,"a",function(){return g}),U.d(Ae,"f",function(){return m}),U.d(Ae,"b",function(){return a});var te=U("KQm4"),Q=U("VTBJ"),B=U("Ff2n"),J=U("Zm9Q"),K=U("Kwbf"),N=U("OZM5");function $(d,s){return d!=null?d:s}function z(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function i(t){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(o){var R=o.key,T=o.children;Object(K.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var S=String(R);Object(K.a)(!s.has(S)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(S)),s.set(S,!0),i(T,"".concat(u).concat(S," > "))})}i(d)}function r(d){function s(i){var t=Object(J.a)(i);return t.map(function(u){if(!Object(N.i)(u))return Object(K.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var o=u.key,R=u.props,T=R.children,S=Object(B.a)(R,["children"]),A=Object(Q.a)({key:o},S),P=s(T);return P.length&&(A.children=P),A}).filter(function(u){return u})}return s(d)}function D(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(s===!0?[]:s),t=[];function u(o){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(T,S){var A=Object(N.h)(R?R.pos:"0",S),P=$(T.key,A),E=Object(Q.a)(Object(Q.a)({},T),{},{parent:R,pos:A,children:null,data:T,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[S===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[S===o.length-1])});return t.push(E),s===!0||i.has(P)?E.children=u(T.children||[],E):E.children=[],E})}return u(d),t}function p(d,s,i){var t;i?typeof i=="string"?t=function(R){return R[i]}:typeof i=="function"&&(t=function(R){return i(R)}):t=function(R,T){return $(R.key,T)};function u(o,R,T){var S=o?o.children:d,A=o?Object(N.h)(T.pos,R):"0";if(o){var P=t(o,A),E={node:o,index:R,pos:A,key:P,parentPos:T.node?T.pos:null,level:T.level+1};s(E)}S&&S.forEach(function(b,h){u(b,h,{node:o,pos:A,level:T?T.level+1:-1})})}u(null)}function g(d){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.initWrapper,t=s.processEntity,u=s.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,R={},T={},S={posEntities:R,keyEntities:T};return i&&(S=i(S)||S),p(d,function(A){var P=A.node,E=A.index,b=A.pos,h=A.key,f=A.parentPos,C=A.level,x={node:P,index:E,key:h,pos:b,level:C},_=$(h,b);R[b]=x,T[_]=x,x.parent=R[f],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),t&&t(x,S)},o),u&&u(S),S}function m(d,s){var i=s.expandedKeys,t=s.selectedKeys,u=s.loadedKeys,o=s.loadingKeys,R=s.checkedKeys,T=s.halfCheckedKeys,S=s.dragOverNodeKey,A=s.dropPosition,P=s.keyEntities,E=P[d],b={eventKey:d,expanded:i.indexOf(d)!==-1,selected:t.indexOf(d)!==-1,loaded:u.indexOf(d)!==-1,loading:o.indexOf(d)!==-1,checked:R.indexOf(d)!==-1,halfChecked:T.indexOf(d)!==-1,pos:String(E?E.pos:""),dragOver:S===d&&A===0,dragOverGapTop:S===d&&A===-1,dragOverGapBottom:S===d&&A===1};return b}function a(d){var s=d.data,i=d.expanded,t=d.selected,u=d.checked,o=d.loaded,R=d.loading,T=d.halfChecked,S=d.dragOver,A=d.dragOverGapTop,P=d.dragOverGapBottom,E=d.pos,b=d.active,h=Object(Q.a)(Object(Q.a)({},s),{},{expanded:i,selected:t,checked:u,loaded:o,loading:R,halfChecked:T,dragOver:S,dragOverGapTop:A,dragOverGapBottom:P,pos:E,active:b});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(K.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),d}}),h}},"8EBN":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Q=0;Q<te.modeInfo.length;Q++){var B=te.modeInfo[Q];B.mimes&&(B.mime=B.mimes[0])}te.findModeByMIME=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.mime==J)return N;if(N.mimes){for(var $=0;$<N.mimes.length;$++)if(N.mimes[$]==J)return N}}if(/\+xml$/.test(J))return te.findModeByMIME("application/xml");if(/\+json$/.test(J))return te.findModeByMIME("application/json")},te.findModeByExtension=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.ext){for(var $=0;$<N.ext.length;$++)if(N.ext[$]==J)return N}}},te.findModeByFileName=function(J){for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.file&&N.file.test(J))return N}var $=J.lastIndexOf("."),z=$>-1&&J.substring($+1,J.length);if(z)return te.findModeByExtension(z)},te.findModeByName=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.name.toLowerCase()==J)return N;if(N.alias){for(var $=0;$<N.alias.length;$++)if(N.alias[$].toLowerCase()==J)return N}}}})},"8HAY":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return K}),U.d(Ae,"b",function(){return N}),U.d(Ae,"d",function(){return $}),U.d(Ae,"e",function(){return z}),U.d(Ae,"c",function(){return r});var te=U("MI8n"),Q=U("pmY6"),B=U("3/fG"),J=function(D,p,g,m){function a(d){return d instanceof g?d:new g(function(s){s(d)})}return new(g||(g=Promise))(function(d,s){function i(o){try{u(m.next(o))}catch(R){s(R)}}function t(o){try{u(m.throw(o))}catch(R){s(R)}}function u(o){o.done?d(o.value):a(o.value).then(i,t)}u((m=m.apply(D,p||[])).next())})};class K extends Q.a{constructor(D,p="",g="",m=!0,a){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=p,this._cssClass=g,this._enabled=m,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,p){return J(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class N extends Q.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(D,p){return J(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let g;try{yield this.runAction(D,p)}catch(m){g=m}this._onDidRun.fire({action:D,error:g})})}runAction(D,p){return J(this,void 0,void 0,function*(){yield D.run(p)})}}class $ extends K{constructor(D){super($.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}$.ID="vs.actions.separator";class z{constructor(D,p,g,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=p,this.class=m,this._actions=g}get actions(){return this._actions}dispose(){}run(){return J(this,void 0,void 0,function*(){})}}class r extends K{constructor(){super(r.ID,B.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(kt,Ae,U){kt.exports={button:"button___1wy9m"}},"9Bee":function(kt,Ae,U){"use strict";var te=U("DYRE"),Q=U("zeV3"),B=U("+L6B"),J=U("2/Rp"),K=U("k1fw"),N=U("9og8"),$=U("tJVT"),z=U("WmNS"),r=U.n(z),D=U("q1tI"),p=U.n(D),g=U("vg9a"),m=U("DlQD"),a=U.n(m),d=U("rUJ1");function s(q,O){var M=q.match(/^(\s+)(?:```)/);if(M===null)return O;var X=M[1];return O.split(`
|
|
`).map(function(se){var Z=se.match(/^\s+/);if(Z===null)return se;var Le=Object($.a)(Z,1),ot=Le[0];return ot.length>=X.length?se.slice(X.length):se}).join(`
|
|
`)}var i=[],t=["<ul>"],u=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){i.length=0,t=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(q,O,M,X){if(O>=q.length||q[O].level<=M)return O;var se=q[O];X.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),O++;var Z=[];return O=S(q,O,se.level,Z),Z.length>0&&(X.push("<ul>"),Z.forEach(function(Le){X.push(Le)}),X.push("</ul>")),X.push("</li>"),O=S(q,O,M,X),O}function A(){return S(i,0,0,t),t.push("</ul>"),t.join("")}var P={heading:function(O){var M=o.exec(O);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},fences:function(O){var M=this.rules.block.fences.exec(O);if(M){var X=M[0],se=s(X,M[3]||""),Z=M[2]?M[2].trim():M[2];if(["latex","katex","math"].indexOf(Z)>=0){var Le=h(),ot=se;se=Le,f[Le]={type:"block",expression:ot}}return{type:"code",raw:X,lang:Z,text:se}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,h=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function x(){b=0,f={}}function _(q){return q=q.replace(E,function(O,M){var X=h();return f[X]={type:"inline",expression:M},X}),q}var j=u.listitem;u.listitem=function(q){return j(_(q))};var W=u.paragraph;u.paragraph=function(q){return W(_(q))};var w=u.tablecell;u.tablecell=function(q,O){return w(_(q),O)},u.code=function(q,O,M){var X=(O||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(O,'">').concat(M?q:Object(d.escape)(q,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(M?q:Object(d.escape)(q,!0))+"</code></pre>"},u.heading=function(q,O,M){var X=this.options.headerPrefix+M.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:X,level:O,text:q}),"<h"+O+' id="'+X+'">'+q+"</h"+O+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:P,renderer:u});var F=a.a,I=U("SJMd"),v=U("ulZh"),H=U.n(v),Y=U("m3rI"),ie=U("Oy/b"),le=U("p5ED"),he=U("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var we=function(q,O){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function Pe(q,O){function M(){this.constructor=q}we(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function xe(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Le(Lt){try{wt(X.next(Lt))}catch(ct){Z(ct)}}function ot(Lt){try{wt(X.throw(Lt))}catch(ct){Z(ct)}}function wt(Lt){var ct;Lt.done?se(Lt.value):(ct=Lt.value,ct instanceof M?ct:new M(function(Et){Et(ct)})).then(Le,ot)}wt((X=X.apply(q,O||[])).next())})}function Oe(q,O){var M,X,se,Z,Le={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ot(wt){return function(Lt){return function(ct){if(M)throw new TypeError("Generator is already executing.");for(;Le;)try{if(M=1,X&&(se=2&ct[0]?X.return:ct[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,ct[1])).done)return se;switch(X=0,se&&(ct=[2&ct[0],se.value]),ct[0]){case 0:case 1:se=ct;break;case 4:return Le.label++,{value:ct[1],done:!1};case 5:Le.label++,X=ct[1],ct=[0];continue;case 7:ct=Le.ops.pop(),Le.trys.pop();continue;default:if(!(se=Le.trys,(se=se.length>0&&se[se.length-1])||ct[0]!==6&&ct[0]!==2)){Le=0;continue}if(ct[0]===3&&(!se||ct[1]>se[0]&&ct[1]<se[3])){Le.label=ct[1];break}if(ct[0]===6&&Le.label<se[1]){Le.label=se[1],se=ct;break}if(se&&Le.label<se[2]){Le.label=se[2],Le.ops.push(ct);break}se[2]&&Le.ops.pop(),Le.trys.pop();continue}ct=O.call(q,Le)}catch(Et){ct=[6,Et],X=0}finally{M=se=0}if(5&ct[0])throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}([wt,Lt])}}}function pe(){for(var q=0,O=0,M=arguments.length;O<M;O++)q+=arguments[O].length;var X=Array(q),se=0;for(O=0;O<M;O++)for(var Z=arguments[O],Le=0,ot=Z.length;Le<ot;Le++,se++)X[se]=Z[Le];return X}var be=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(O,M){for(var X=0,se=M;X<se.length;X++){var Z=se[X],Le=Z[0],ot=Z[1];O.setAttribute(Le,ot)}},q.createRect=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",O.toString()),se.setAttribute("height",M.toString()),X&&q.setAttributes(se,X),se},q.createLine=function(O,M,X,se,Z){var Le=document.createElementNS("http://www.w3.org/2000/svg","line");return Le.setAttribute("x1",O.toString()),Le.setAttribute("y1",M.toString()),Le.setAttribute("x2",X.toString()),Le.setAttribute("y2",se.toString()),Z&&q.setAttributes(Le,Z),Le},q.createPolygon=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",O),M&&q.setAttributes(X,M),X},q.createCircle=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(O/2).toString()),X.setAttribute("cy",(O/2).toString()),X.setAttribute("r",O.toString()),M&&q.setAttributes(X,M),X},q.createEllipse=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(O/2).toString()),se.setAttribute("cy",(M/2).toString()),se.setAttribute("rx",(O/2).toString()),se.setAttribute("ry",(M/2).toString()),X&&q.setAttributes(se,X),se},q.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&q.setAttributes(M,O),M},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(O,M,X,se,Z,Le,ot){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(wt,[["id",O],["orient",M],["markerWidth",X.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Le.toString()]]),wt.appendChild(ot),wt},q.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&q.setAttributes(M,O),M},q.createTSpan=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=O,M&&q.setAttributes(X,M),X},q.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&q.setAttributes(M,O),M},q.createPoint=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=O,X.y=M,X},q.createPath=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",O),M&&q.setAttributes(X,M),X},q}(),ne=function(){function q(){}return q.addKey=function(O){q.key=O},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),fe=function(){function q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return q.prototype.rasterize=function(O,M,X){var se=this;return new Promise(function(Z){var Le=X!==void 0?X:document.createElement("canvas");O===null&&(se.markersOnly=!0,se.naturalSize=!1);var ot=document.createElementNS("http://www.w3.org/2000/svg","svg");ot.setAttribute("xmlns","http://www.w3.org/2000/svg"),ot.setAttribute("width",M.width.baseVal.valueAsString),ot.setAttribute("height",M.height.baseVal.valueAsString),ot.setAttribute("viewBox","0 0 "+M.viewBox.baseVal.width.toString()+" "+M.viewBox.baseVal.height.toString()),ot.innerHTML=M.innerHTML,se.naturalSize===!0?(ot.width.baseVal.value=O.naturalWidth,ot.height.baseVal.value=O.naturalHeight):se.width!==void 0&&se.height!==void 0&&(ot.width.baseVal.value=se.width,ot.height.baseVal.value=se.height),Le.width=ot.width.baseVal.value,Le.height=ot.height.baseVal.value;var wt=ot.outerHTML,Lt=Le.getContext("2d");se.markersOnly!==!0&&Lt.drawImage(O,0,0,Le.width,Le.height);var ct=window.URL,Et=new Image(Le.width,Le.height);Et.setAttribute("crossOrigin","anonymous");var Mt=new Blob([wt],{type:"image/svg+xml"}),Cn=ct.createObjectURL(Mt);Et.onload=function(){Lt.drawImage(Et,0,0),ct.revokeObjectURL(Cn);var Yn=Le.toDataURL(se.imageType,se.imageQuality);Z(Yn)},Et.src=Cn})},q}(),_e=function(){},ke=function(){function q(O){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},q.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new qe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new qe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new qe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new je("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new je("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},q.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),qe=function(q,O){this.selector=q,this.style=O},je=function(q,O){this.localName=q,this.style=O},st=function(){function q(O,M,X,se,Z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=O,this.displayMode=M,this.markerItems=X,this.uiStyleSettings=se,this.styles=Z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return q.prototype.show=function(O){var M=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",this.uiContainer.appendChild(X),this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Z){var Le=document.createElement("div");Le.className=""+M.toolbarButtonStyleClass.name,Le.setAttribute("data-type-name",Z.typeName),Le.innerHTML=Z.icon,Le.addEventListener("click",function(){M.markerToolbarButtonClicked(Le,Z)}),M.buttons.push(Le),M.markerButtons.push(Le)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var se=document.createElement("div");se.className=this.toolbarBlockStyleClass.name,se.style.whiteSpace="nowrap",se.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(se),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},q.prototype.addButtonClickListener=function(O){this.buttonClickListeners.push(O)},q.prototype.removeButtonClickListener=function(O){this.buttonClickListeners.indexOf(O)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(O),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var O=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M<this.markerButtons.length;M++)M<O||M===O&&this.markerButtons.length-1===O?this.markerButtonBlock.appendChild(this.markerButtons[M]):(M===O&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[M]))}},q.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},q.prototype.resetButtonStyles=function(){var O=this;this.buttons.forEach(function(M){M.className=M.className.replace(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name,"").trim(),M.className=M.className.replace(O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:O.toolbarActiveButtonStyleColorsClass.name,"").trim(),M.className+=" "+(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name)})},q.prototype.addActionButton=function(O,M,X){var se=this,Z=document.createElement("div");switch(Z.className=""+this.toolbarButtonStyleClass.name,Z.innerHTML=M,Z.setAttribute("data-action",X),Z.addEventListener("click",function(){se.actionToolbarButtonClicked(Z,X)}),X){case"select":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Z.style.fill=this.uiStyleSettings.closeButtonColor}O.appendChild(Z),this.buttons.push(Z)},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new je("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new je("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new je("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new je("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new je("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var O=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new je("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new je("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new je("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new qe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new qe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},q.prototype.markerToolbarButtonClicked=function(O,M){this.setActiveButton(O),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(O,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(O){this.resetButtonStyles(),O.className=O.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),O.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(O){var M=this.markerButtons.find(function(X){return X.getAttribute("data-type-name")===O});M&&this.setActiveButton(M)},q.prototype.setCurrentMarker=function(O){var M=this;this.currentMarker=O,this.buttons.filter(function(X){return/delete|notes/.test(X.getAttribute("data-action"))}).forEach(function(X){M.currentMarker===void 0?(X.style.fillOpacity="0.4",X.style.pointerEvents="none"):(X.style.fillOpacity="1",X.style.pointerEvents="all")})},q}(),vt=function(){function q(O,M,X,se){this.panels=[],this.panelButtons=[],this.markerjsContainer=O,this.displayMode=M,this.uiStyleSettings=X,this.styles=se,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var O;this.toolboxStyleClass=this.styles.addClass(new je("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new je("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new je("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new je("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new je("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new je("toolbox-panel-row_colors",`
|
|
background-color: `+((O=this.uiStyleSettings.toolboxBackgroundColor)!==null&&O!==void 0?O:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new je("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
|
|
padding: `+M+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new je("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new je("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new qe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new qe("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},q.prototype.show=function(O){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(O){var M,X,se=this;this.panels=O,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var Le;Z.uiStyleSettings=se.uiStyleSettings;var ot=document.createElement("div");ot.className=se.toolboxButtonStyleClass.name+" "+((Le=se.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Le!==void 0?Le:se.toolboxButtonStyleColorsClass.name),ot.innerHTML=Z.icon,ot.title=Z.title,ot.addEventListener("click",function(){se.panelButtonClick(Z)}),se.panelButtons.push(ot),se.buttonRow.appendChild(ot)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(O){var M=this,X=-1;if(O!==this.activePanel){X=this.panels.indexOf(O),this.panelRow.innerHTML="";var se=O.getUi();se.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(se),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=O}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Z,Le){var ot,wt;Z.className=M.toolboxButtonStyleClass.name+" "+(Le===X?""+((ot=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ot!==void 0?ot:M.toolboxActiveButtonStyleColorsClass.name):""+((wt=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&wt!==void 0?wt:M.toolboxButtonStyleColorsClass.name))})},q}(),Re=function(q,O){this.title=q,this.icon=O},Be=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Le.colors=[],Le.addTransparent=!1,Le.colorBoxes=[],Le.colors=X,Le.currentColor=se,Le.setCurrentColor=Le.setCurrentColor.bind(Le),Le.getColorBox=Le.getColorBox.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.whiteSpace="nowrap",this.colors.forEach(function(se){var Z=M.getColorBox(se);X.appendChild(Z),M.colorBoxes.push(Z)}),X},O.prototype.getColorBox=function(M){var X=this,se=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-se,Le=document.createElement("div");Le.style.display="inline-block",Le.style.boxSizing="content-box",Le.style.width=Z-2+"px",Le.style.height=Z-2+"px",Le.style.padding="1px",Le.style.marginRight="2px",Le.style.marginBottom="2px",Le.style.borderWidth="2px",Le.style.borderStyle="solid",Le.style.borderRadius=(Z+2)/2+"px",Le.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Le.addEventListener("click",function(){X.setCurrentColor(M,Le)});var ot=document.createElement("div");return ot.style.display="inline-block",ot.style.width=Z-2+"px",ot.style.height=Z-2+"px",ot.style.backgroundColor=M,ot.style.borderRadius=Z/2+"px",M==="transparent"&&(ot.style.fill=this.uiStyleSettings.toolboxAccentColor,ot.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>`),Le.appendChild(ot),Le},O.prototype.setCurrentColor=function(M,X){var se=this;this.currentColor=M,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},O}(Re),Ye=function(){function q(O,M,X){this._state="new",this._isSelected=!1,this._container=O,this._overlayContainer=M,this.globalSettings=X,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(O){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(O,M){},q.prototype.dblClick=function(O,M){},q.prototype.manipulate=function(O){},q.prototype.pointerUp=function(O){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(O){this.container.childNodes.length>0?this.container.insertBefore(O,this.container.childNodes[0]):this.container.appendChild(O)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(O){this._state=O.state,this.notes=O.notes},q.prototype.scale=function(O,M){},q.prototype.colorChanged=function(O){this.onColorChanged&&this.onColorChanged(O),this.stateChanged()},q.prototype.fillColorChanged=function(O){this.onFillColorChanged&&this.onFillColorChanged(O),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var O=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),O.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(O)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),Ke=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(O){return this.topLeft.ownsTarget(O)?this.topLeft:this.topCenter.ownsTarget(O)?this.topCenter:this.topRight.ownsTarget(O)?this.topRight:this.centerLeft.ownsTarget(O)?this.centerLeft:this.centerRight.ownsTarget(O)?this.centerRight:this.bottomLeft.ownsTarget(O)?this.bottomLeft:this.bottomCenter.ownsTarget(O)?this.bottomCenter:this.bottomRight.ownsTarget(O)?this.bottomRight:void 0},q}(),yt=function(){function q(){this.GRIP_SIZE=10,this.visual=be.createGroup(),this.visual.appendChild(be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(be.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q}(),Pt=function(){function q(){}return q.toITransformMatrix=function(O){return{a:O.a,b:O.b,c:O.c,d:O.d,e:O.e,f:O.f}},q.toSVGMatrix=function(O,M){return O.a=M.a,O.b=M.b,O.c=M.c,O.d=M.d,O.e=M.e,O.f=M.f,O},q}(),Ht=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(be.createTransform()),Z.setupControlBox(),Z}return Pe(O,q),Object.defineProperty(O.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var X=be.createTransform();this._visual.transform.baseVal.appendItem(X)},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var se=this.unrotatePoint(M);if(this.manipulationStartX=se.x,this.manipulationStartY=se.y,this.offsetX=se.x-this.left,this.offsetY=se.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(X),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Le=this.container.transform.baseVal.getItem(0);Le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Le,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},O.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},O.prototype.manipulate=function(M){var X=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(X.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(X.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(X):this.state==="rotate"&&this.rotate(M)},O.prototype.resize=function(M){var X=this.manipulationStartLeft,se=this.manipulationStartWidth,Z=this.manipulationStartTop,Le=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:X=this.manipulationStartLeft+M.x-this.manipulationStartX,se=this.manipulationStartWidth+this.manipulationStartLeft-X;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:se=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+M.y-this.manipulationStartY,Le=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Le=this.manipulationStartHeight+M.y-this.manipulationStartY}se>=0?(this.left=X,this.width=se):(this.left=X+se,this.width=-se),Le>=0?(this.top=Z,this.height=Le):(this.top=Z+Le,this.height=-Le),this.setSize()},O.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},O.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var X=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*X,this.applyRotation()}},O.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},O.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM(),se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM();X=X.inverse();var se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup();var M=be.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=be.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=be.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ke,this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},O.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},O.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,X=-M/2,se=X,Z=(this.width+this.CB_DISTANCE)/2-M/2,Le=(this.height+this.CB_DISTANCE)/2-M/2,ot=this.height+this.CB_DISTANCE-M/2,wt=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,X,se),this.positionGrip(this.controlGrips.topCenter.visual,Z,se),this.positionGrip(this.controlGrips.topRight.visual,wt,se),this.positionGrip(this.controlGrips.centerLeft.visual,X,Le),this.positionGrip(this.controlGrips.centerRight.visual,wt,Le),this.positionGrip(this.controlGrips.bottomLeft.visual,X,ot),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,ot),this.positionGrip(this.controlGrips.bottomRight.visual,wt,ot),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,se-3*this.CB_DISTANCE)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.hideControlBox=function(){this.controlBox.style.display="none"},O.prototype.showControlBox=function(){this.controlBox.style.display=""},O.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.left=X.left,this.top=X.top,this.width=X.width,this.height=X.height,this.rotationAngle=X.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,X.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,X.containerTransformMatrix))},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X);var se=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:se.x*M,y:se.y*X});this.left=Z.x,this.top=Z.y,this.width=this.width*M,this.height=this.height*X,this.adjustControlBox()},O}(Ye),Xt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.title="Rectangle marker",O}(Ht),an=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Le.widths=[],Le.widthBoxes=[],Le.widths=X,Le.currentWidth=se,Le.setCurrentWidth=Le.setCurrentWidth.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.widths.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentWidth(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.innerText=se.toString(),Le.style.marginRight="5px",Z.appendChild(Le);var ot=document.createElement("div");ot.style.minHeight="20px",ot.style.flexGrow="2",ot.style.display="flex",ot.style.alignItems="center";var wt=document.createElement("hr");wt.style.minWidth="20px",wt.style.border="0px",wt.style.borderTop=se+"px solid "+M.uiStyleSettings.toolboxColor,wt.style.flexGrow="2",ot.appendChild(wt),Z.appendChild(ot),M.widthBoxes.push(Z)}),X},O.prototype.setCurrentWidth=function(M,X){var se=this;this.currentWidth=M,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},O}(Re),tn=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Le.styles=[],Le.styleBoxes=[],Le.styles=X,Le.currentStyle=se,Le.setCurrentStyle=Le.setCurrentStyle.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.styles.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.styles.length-5+"%",Z.style.borderColor=se===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentStyle(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.overflow="hidden";var ot=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+M.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(se!==""?'stroke-dasharray="'+se+'"':"")+` />
|
|
</svg>`;Le.innerHTML=ot,Z.appendChild(Le),M.styleBoxes.push(Z)}),X},O.prototype.setCurrentStyle=function(M,X){var se=this;this.currentStyle=M,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},O}(Re),et=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="FrameMarker",O.title="Frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',O}(Xt),Ze=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ct=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(X)?this.activeGrip=this.grip1:this.grip2.ownsTarget(X)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},O.prototype.adjustVisual=function(){},O.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},O.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){this.positionGrips()},O.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},O.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.x1=X.x1,this.y1=X.y1,this.x2=X.x2,this.y2=X.y2},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.x1=this.x1*M,this.y1=this.y1*X,this.x2=this.x2*M,this.y2=this.y2*X,this.adjustVisual(),this.adjustControlBox()},O}(Ye),At=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},O.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),be.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.createVisual(),this.adjustVisual()},O.typeName="LineMarker",O.title="Line marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',O}(Ct),dt=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Le.fonts=[],Le.fontBoxes=[],Le.fonts=X,Le.currentFont=se,Le.setCurrentFont=Le.setCurrentFont.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.flexGrow="2",this.fonts.forEach(function(se){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.fonts.length-5+"%",Z.style.borderColor=se===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentFont(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.style.display="flex",Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.fontFamily=se,Le.style.overflow="hidden";var ot=document.createElement("div");ot.style.whiteSpace="nowrap",ot.style.overflow="hidden",ot.style.textOverflow="ellipsis",ot.innerHTML="The quick brown fox jumps over the lazy dog",Le.appendChild(ot),Z.appendChild(Le),M.fontBoxes.push(Z)}),X},O.prototype.setCurrentFont=function(M,X){var se=this;this.currentFont=M,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},O}(Re),ft=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=se.defaultColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new dt("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){if(q.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var X=!1;return this.textElement.childNodes.forEach(function(se){se===M&&(X=!0)}),X},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.bgRectangle=be.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=be.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.renderText=function(){var M=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(X){M.textElement.appendChild(be.createTSpan(X.trim()===""?" ":X.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},O.prototype.getTextScale=function(){var M=this.textElement.getBBox(),X=1;if(M.width>0&&M.height>0){var se=(1*this.width-this.width*this.padding*2/100)/M.width,Z=(1*this.height-this.height*this.padding*2/100)/M.height;X=Math.min(se,Z)}return X},O.prototype.getTextPosition=function(M){var X=this.textElement.getBBox(),se=0,Z=0;return X.width>0&&X.height>0&&(se=(this.width-X.width*M)/2,Z=this.height/2-X.height*M/2),{x:se,y:Z}},O.prototype.sizeText=function(){var M=this.textElement.getBBox(),X=this.getTextScale(),se=this.getTextPosition(X);se.y-=M.y*X,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+se.x+"px, "+se.y+"px) scale("+X+", "+X+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(se.x,se.y),this.textElement.transform.baseVal.getItem(1).setScale(X,X))},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},O.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},O.prototype.pointerUp=function(M){var X=this.state;X==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,M),this.setSize(),(X==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},O.prototype.showTextEditor=function(){var M=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(X){X.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var X=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&X>.9;)X-=.1,M.textEditor.style.fontSize=Math.max(X,.9)+"em"}),this.textEditor.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(X){if(X.clipboardData){var se=X.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(se)),X.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},O.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),X=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),se=this.textElement.getBBox(),Z={x:se.width*M,y:se.height*M};X.x-=Z.x/2,X.y-=Z.y/2,this.textEditor.style.top=X.y+"px",this.textEditor.style.left=X.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-X.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},O.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},O.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},O.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},O.prototype.dblClick=function(M,X){q.prototype.dblClick.call(this,M,X),this.showTextEditor()},O.prototype.setColor=function(M){this.textElement&&be.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},O.prototype.setFont=function(M){this.textElement&&be.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},O.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},O.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.color=X.color,this.fontFamily=X.fontFamily,this.padding=X.padding,this.text=X.text,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize(),this.sizeText(),this.positionTextEditor()},O.typeName="TextMarker",O.title="Text marker",O.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',O}(Ht),He=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=se.defaultColor,Z.lineWidth=se.defaultStrokeWidth,Z.pixelRatio=se.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.drawingImage=be.createImage(),this.visual.appendChild(this.drawingImage);var M=be.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(M.x,M.y),this.drawing=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,M)},O.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},O.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},O.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},O.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),X=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],se=X[0],Z=X[1],Le=X[2],ot=X[3],wt=!1,Lt=0;Lt<this.canvasElement.height;Lt++)for(var ct=0;ct<this.canvasElement.width;ct++)M.data[Lt*this.canvasElement.width*4+4*ct+3]>0&&(wt=!0,Lt<Z&&(Z=Lt),ct<se&&(se=ct),Lt>ot&&(ot=Lt),ct>Le&&(Le=ct));if(wt){this.left=se/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(Le-se)/this.pixelRatio,this.height=(ot-Z)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=Le-se,Et.height=ot-Z,Et.getContext("2d").putImageData(this.canvasContext.getImageData(se,Z,Le-se,ot-Z),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},O.prototype.setDrawingImage=function(){be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},O.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},O.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){this.createVisual(),q.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setDrawingImage()},O.typeName="FreehandMarker",O.title="Freehand marker",O.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',O}(Ht),Ne=function(q){function O(M,X,se){var Z=q.call(this,M,se||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Z.typeBoxes=[],Z.currentType=X,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2";for(var se=function(ot){var wt="both";switch(ot){case 0:wt="both";break;case 1:wt="start";break;case 2:wt="end";break;case 3:wt="none"}var Lt=document.createElement("div");if(Lt.style.display="flex",Lt.style.flexGrow="2",Lt.style.alignItems="center",Lt.style.justifyContent="space-between",Lt.style.padding="5px",Lt.style.borderWidth="2px",Lt.style.borderStyle="solid",Lt.style.borderColor=wt===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",Lt.addEventListener("click",function(){M.setCurrentType(wt,Lt)}),X.appendChild(Lt),wt==="both"||wt==="start"){var ct=document.createElement("div");ct.style.display="flex",ct.style.alignItems="center",ct.style.minHeight="20px",ct.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ct.style.marginLeft="5px",Lt.appendChild(ct)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var Mt=document.createElement("hr");if(Mt.style.minWidth="20px",Mt.style.border="0px",Mt.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),Mt.style.flexGrow="2",Et.appendChild(Mt),Lt.appendChild(Et),wt==="both"||wt==="end"){var Cn=document.createElement("div");Cn.style.display="flex",Cn.style.alignItems="center",Cn.style.minHeight="20px",Cn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Cn.style.marginRight="5px",Lt.appendChild(Cn)}Z.typeBoxes.push(Lt)},Z=this,Le=0;Le<4;Le++)se(Le);return X},O.prototype.setCurrentType=function(M,X){var se=this;this.currentType=M,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},O}(Re),Ue=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new Ne("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},O.prototype.getArrowPoints=function(M,X){var se=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return M-se/2+","+(X+Z/2)+" "+M+","+(X-Z/2)+" "+(M+se/2)+","+(X+Z/2)},O.prototype.createTips=function(){this.arrow1=be.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=be.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",be.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),be.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.arrow1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(X,0);var se=this.arrow2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(se,0)}},O.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.arrowType=X.arrowType,this.createTips(),this.adjustVisual()},O.typeName="ArrowMarker",O.title="Arrow marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',O}(At),ge=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor=se.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new Be("Color",se.defaultColorSet,se.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="CoverMarker",O.title="Cover marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',O}(Xt),Ee=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Le.opacities=[],Le.opacityBoxes=[],Le.opacities=X,Le.currentOpacity=se,Le.setCurrentOpacity=Le.setCurrentOpacity.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",X.style.justifyContent="space-between",this.opacities.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentOpacity(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.innerText=100*se+"%",Z.appendChild(Le),M.opacityBoxes.push(Z)}),X},O.prototype.setCurrentOpacity=function(M,X){var se=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},O}(Re),De=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=se.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=se.defaultHighlightOpacity,Z.fillPanel=new Be("Color",se.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Pe(O,q),O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="HighlightMarker",O.title="Highlight marker",O.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',O}(ge),ue='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Fe=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=se.defaultStrokeColor,Z.bgColor=se.defaultFillColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new Be("Text color",se.defaultColorSet,Z.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new Be("Fill color",se.defaultColorSet,Z.bgColor,ue),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new dt("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new yt,Z.tipGrip.visual.transform.baseVal.appendItem(be.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return q.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},O.prototype.createTip=function(){be.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=be.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},O.prototype.pointerDown=function(M,X){this.state==="new"&&q.prototype.pointerDown.call(this,M,X),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(X)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,M);else{var X=this.state==="creating";q.prototype.pointerUp.call(this,M),this.setTipPoints(X),this.positionTip()}},O.prototype.manipulate=function(M){if(this.tipMoving){var X=this.unrotatePoint(M);this.tipPosition={x:X.x-this.manipulationStartLeft,y:X.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,M)},O.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(be.setAttributes(this.bgRectangle,[["fill",M]]),be.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},O.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},O.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var X=Math.min(this.height/2,15),se=this.height/5;M&&(this.tipPosition={x:X+se/2,y:this.height+20});var Z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:0},this.tipBase2Position={x:X+se,y:0}):(this.tipBase1Position={x:0,y:X},this.tipBase2Position={x:0,y:X+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-se,y:0},this.tipBase2Position={x:this.width-X,y:0}):(this.tipBase1Position={x:this.width,y:X},this.tipBase2Position={x:this.width,y:X+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-se,y:this.height},this.tipBase2Position={x:this.width-X,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-X-se},this.tipBase2Position={x:this.width,y:this.height-X}):Z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:this.height},this.tipBase2Position={x:X+se,y:this.height}):(this.tipBase1Position={x:0,y:this.height-X},this.tipBase2Position={x:0,y:this.height-X-se})},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.positionTip()},O.prototype.positionTip=function(){be.setAttributes(this.tip,[["points",this.getTipPoints()]]);var M=this.tipGrip.visual.transform.baseVal.getItem(0);M.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(M,0)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.select=function(){this.positionTip(),q.prototype.select.call(this)},O.prototype.getState=function(){var M=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.bgColor=X.bgColor,this.tipPosition=X.tipPosition,q.prototype.restoreState.call(this,M),this.createTip(),this.setTipPoints()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.tipPosition={x:this.tipPosition.x*M,y:this.tipPosition.y*X},this.positionTip()},O.typeName="CalloutMarker",O.title="Callout marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',O}(ft),at=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.fillColor=se.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new Be("Line color",pe(se.defaultColorSet,["transparent"]),se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new Be("Fill color",pe(se.defaultColorSet,["transparent"]),Z.fillColor,ue),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.typeName="EllipseMarker",O.title="Ellipse marker",O.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',O}(Ht),xt=function(q){function O(M,X,se){return q.call(this,M,X,se)||this}return Pe(O,q),Object.defineProperty(O.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},O.prototype.createTips=function(){this.tip1=be.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.tip1),this.tip2=be.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.tip2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(be.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.tip1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(X,0);var se=this.tip2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(se,0)}},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},O.typeName="MeasurementMarker",O.title="Measurement marker",O.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',O}(At),Gt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokePanel.colors=se.defaultColorSet,Z.fillColor="transparent",Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="EllipseFrameMarker",O.title="Ellipse frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',O}(at),$t=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(O){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(O)||(this.undoStack.push(O),JSON.stringify(this.lastRedoStep)!==JSON.stringify(O)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(O){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=O)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var O=this.undoStack.pop();return O!==void 0&&this.redoStack.push(O),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),Yt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},O.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorCurve=be.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=be.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(X)&&(this.activeGrip=this.curveGrip,this._state="resize")},O.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),be.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=be.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=be.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},O.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},O.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},O.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),q.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},O.prototype.scale=function(M,X){this.curveX=this.curveX*M,this.curveY=this.curveY*X,q.prototype.scale.call(this,M,X)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.curveX=X.curveX,this.curveY=X.curveY,this.createVisual(),this.adjustVisual()},O.typeName="CurveMarker",O.title="Curve marker",O.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',O}(Ct),$n=function(){function q(O,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=O,this.cancelable=M}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),vn=function(q){function O(M,X,se){var Z=q.call(this,M,!1)||this;return Z.dataUrl=X,Z.state=se,Z}return Pe(O,q),O}($n),ln=function(q){function O(M,X,se){se===void 0&&(se=!1);var Z=q.call(this,M,se)||this;return Z.marker=X,Z}return Pe(O,q),O}($n),hn=function(){function q(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return q.prototype.addEventListener=function(O,M){this[O].push(M)},q.prototype.removeEventListener=function(O,M){var X=this[O].indexOf(M);X>-1&&this[O].splice(X,1)},q}(),Gn=function(){function q(O){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ze,this._isOpen=!1,this.undoRedoManager=new $t,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new hn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=O,this.targetRoot=document.body,this.width=O.clientWidth,this.height=O.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,Gt,at,De,Fe,xt,ge,At,Yt]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,at,De,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,De]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(O){var M=this;this._availableMarkerTypes.splice(0),O.forEach(function(X){if(typeof X=="string"){var se=M.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===X});se!==void 0&&M._availableMarkerTypes.push(se)}else M._availableMarkerTypes.push(X)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(O){this._zoomLevel=O,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var O=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new $n(O))})},q.prototype.render=function(){return xe(this,void 0,void 0,function(){var O;return Oe(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(O=new fe).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.markersOnly=this.renderMarkersOnly,O.width=this.renderWidth,O.height=this.renderHeight,[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},q.prototype.close=function(O){var M=this;if(O===void 0&&(O=!1),this.isOpen){var X=!1;O||this.eventListeners.beforeclose.forEach(function(se){var Z=new $n(M,!0);se(Z),Z.defaultPrevented&&(X=!0)}),X||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(se){return se(new $n(M))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var O,M=[],X=0;X<arguments.length;X++)M[X]=arguments[X];(O=this._availableMarkerTypes).push.apply(O,M)},q.prototype.addRenderEventListener=function(O){this.addEventListener("render",function(M){O(M.dataUrl,M.state)})},q.prototype.removeRenderEventListener=function(O){},q.prototype.addCloseEventListener=function(O){this.addEventListener("close",function(){O()})},q.prototype.removeCloseEventListener=function(O){},q.prototype.setupResizeObserver=function(){var O=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return O.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupTargetResize=function(){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.editorCanvas.clientWidth/O>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*O:this.editorCanvas.clientWidth,X=M<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/O;this.resize(M,X)},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.resize=function(O,M){this._isResizing=!0;var X=O/this.imageWidth,se=M/this.imageHeight;this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(X,se),this._isResizing=!1},q.prototype.scaleMarkers=function(O,M){var X,se=this;this._currentMarker&&this._currentMarker instanceof ft?this._currentMarker.scale(O,M):(X=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Z){Z!==se._currentMarker&&Z.scale(O,M)}),X!==void 0&&this.setCurrentMarker(X)},q.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},q.prototype.setTopLeft=function(){var O=this.editingTarget.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left,this.top=O.top-M.top},q.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},q.prototype.addDefs=function(){for(var O,M=[],X=0;X<arguments.length;X++)M[X]=arguments[X];this.defs=be.createDefs(),this.addDefsToImage(),(O=this.defs).append.apply(O,M)},q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},q.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},q.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},q.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},q.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var O=document.createElement("a");O.href="https://markerjs.com/",O.target="_blank",O.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',O.title="Powered by marker.js",O.style.display="grid",O.style.alignItems="center",O.style.justifyItems="center",O.style.padding="3px",O.style.width="20px",O.style.height="20px",this.logoUI.appendChild(O),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new st(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 vt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.removeMarker=function(O){this.markerImage.removeChild(O.container),this.markers.indexOf(O)>-1&&this.markers.splice(this.markers.indexOf(O),1),O.dispose()},q.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},q.prototype.toolbarButtonClicked=function(O,M){if(O==="marker"&&M!==void 0)this.createNewMarker(M);else if(O==="action")switch(M){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},q.prototype.deleteSelectedMarker=function(){var O=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function(se){var Z=new ln(O,O._currentMarker,!0);se(Z),Z.defaultPrevented&&(M=!0)}),!M){var X=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(se){return se(new ln(O,X))})}}},q.prototype.clear=function(){var O=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Le){var ot=new ln(O,void 0,!0);Le(ot),ot.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var X=function(Le){var ot=se.markers[Le];se.setCurrentMarker(se.markers[Le]),se._currentMarker.dispose(),se.markerImage.removeChild(se._currentMarker.container),se.markers.splice(se.markers.indexOf(se._currentMarker),1),se.eventListeners.markerdelete.forEach(function(wt){return wt(new ln(O,ot))})},se=this,Z=this.markers.length-1;Z>=0;Z--)X(Z);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var O;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(O=this._currentMarker.notes)!==null&&O!==void 0?O:"",this.overlayContainer.appendChild(this.notesArea))},q.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var O=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),X=this.undoRedoManager.getLastUndoStep();if(!X||X.width===M.width&&X.height===M.height){var se=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),se<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Z){return Z(new $n(O))})}else this.undoRedoManager.replaceLastUndoStep(M),this.eventListeners.statechange.forEach(function(Z){return Z(new $n(O))})}},q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},q.prototype.undoStep=function(){var O=this,M=this.undoRedoManager.undo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new $n(O))}))},q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},q.prototype.redoStep=function(){var O=this,M=this.undoRedoManager.redo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new $n(O))}))},q.prototype.stepZoom=function(){var O=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=O<this.zoomSteps.length-1?this.zoomSteps[O+1]:this.zoomSteps[0]},q.prototype.panTo=function(O){this.contentDiv.scrollBy({left:this.prevPanPoint.x-O.x,top:this.prevPanPoint.y-O.y}),this.prevPanPoint=O},q.prototype.startRenderAndClose=function(){return xe(this,void 0,void 0,function(){var O,M,X=this;return Oe(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return O=se.sent(),M=this.getState(),this.eventListeners.render.forEach(function(Z){return Z(new vn(X,O,M))}),this.close(!0),[2]}})})},q.prototype.getState=function(O){O===!0&&this.setCurrentMarker();var M={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(X){return M.markers.push(X.getState())}),M},q.prototype.restoreState=function(O){var M=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);O.markers.forEach(function(X){var se=M._availableMarkerTypes.find(function(Le){return Le.typeName===X.typeName});if(se!==void 0){var Z=M.addNewMarker(se);Z.restoreState(X),M.markers.push(Z)}}),O.width&&O.height&&(O.width!==this.imageWidth||O.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/O.width,this.imageHeight/O.height),this.eventListeners.restorestate.forEach(function(X){return X(new $n(M))})},q.prototype.addNewMarker=function(O){var M=be.createGroup();return this.markerImage.appendChild(M),new O(M,this.overlayContainer,this.settings)},q.prototype.createNewMarker=function(O){var M,X=this;(M=typeof O=="string"?this._availableMarkerTypes.find(function(se){return se.typeName===O}):O)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(M),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(M.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(se){return se(new ln(X,X._currentMarker))}))},q.prototype.markerCreated=function(O){var M=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(O),this.setCurrentMarker(O),O instanceof He&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(He):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(X){return X(new ln(M,M._currentMarker))})},q.prototype.colorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=O,this.settings.defaultStrokeColor=O)},q.prototype.fillColorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=O)},q.prototype.markerStateChanged=function(O){var M=this;this.eventListeners.markerchange.forEach(function(X){return X(new ln(M,O))})},q.prototype.setCurrentMarker=function(O){var M=this;this._currentMarker!==O&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(X){return X(new ln(M,M._currentMarker))})),this._currentMarker=O,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(X){return X(new ln(M,M._currentMarker))}))},q.prototype.onPointerDown=function(O){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||O.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var M=this.markers.find(function(X){return X.ownsTarget(O.target)});M!==void 0?(this.setCurrentMarker(M),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:O.clientX,y:O.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY))},q.prototype.onDblClick=function(O){if(this._isFocused||this.focus(),this.mode==="select"){var M=this.markers.find(function(X){return X.ownsTarget(O.target)});M!==void 0&&M!==this._currentMarker&&this.setCurrentMarker(M),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target):this.setCurrentMarker()}},q.prototype.onPointerMove=function(O){this.touchPoints!==1&&O.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||O.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(O.clientX,O.clientY)):this.zoomLevel>1&&this.panTo({x:O.clientX,y:O.clientY}))},q.prototype.onPointerUp=function(O){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(O.clientX,O.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(O){this._currentMarker===void 0||this.notesArea!==void 0||O.key!=="Delete"&&O.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.markerImage.getBoundingClientRect();return{x:(O-X.left)/this.zoomLevel,y:(M-X.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},q.prototype.addLicenseKey=function(O){ne.addKey(O)},q.prototype.addEventListener=function(O,M){this.eventListeners.addEventListener(O,M)},q.prototype.removeEventListener=function(O,M){this.eventListeners.removeEventListener(O,M)},q.prototype.renderState=function(O){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(O),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var O=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new $n(O))}))},q.prototype.blur=function(){var O=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new $n(O))}))},q.instanceCounter=0,q}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var fr=function(q,O){return(fr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function vr(q,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function M(){this.constructor=q}fr(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function ir(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Le(Lt){try{wt(X.next(Lt))}catch(ct){Z(ct)}}function ot(Lt){try{wt(X.throw(Lt))}catch(ct){Z(ct)}}function wt(Lt){var ct;Lt.done?se(Lt.value):(ct=Lt.value,ct instanceof M?ct:new M(function(Et){Et(ct)})).then(Le,ot)}wt((X=X.apply(q,O||[])).next())})}function br(q,O){var M,X,se,Z,Le={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ot(wt){return function(Lt){return function(ct){if(M)throw new TypeError("Generator is already executing.");for(;Le;)try{if(M=1,X&&(se=2&ct[0]?X.return:ct[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,ct[1])).done)return se;switch(X=0,se&&(ct=[2&ct[0],se.value]),ct[0]){case 0:case 1:se=ct;break;case 4:return Le.label++,{value:ct[1],done:!1};case 5:Le.label++,X=ct[1],ct=[0];continue;case 7:ct=Le.ops.pop(),Le.trys.pop();continue;default:if(!(se=Le.trys,(se=se.length>0&&se[se.length-1])||ct[0]!==6&&ct[0]!==2)){Le=0;continue}if(ct[0]===3&&(!se||ct[1]>se[0]&&ct[1]<se[3])){Le.label=ct[1];break}if(ct[0]===6&&Le.label<se[1]){Le.label=se[1],se=ct;break}if(se&&Le.label<se[2]){Le.label=se[2],Le.ops.push(ct);break}se[2]&&Le.ops.pop(),Le.trys.pop();continue}ct=O.call(q,Le)}catch(Et){ct=[6,Et],X=0}finally{M=se=0}if(5&ct[0])throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}([wt,Lt])}}}var Rr=function(){function q(){}return q.addKey=function(O){q.key=O},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),Jt=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(O,M){for(var X=0,se=M;X<se.length;X++){var Z=se[X],Le=Z[0],ot=Z[1];O.setAttribute(Le,ot)}},q.createRect=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",O.toString()),se.setAttribute("height",M.toString()),X&&q.setAttributes(se,X),se},q.createLine=function(O,M,X,se,Z){var Le=document.createElementNS("http://www.w3.org/2000/svg","line");return Le.setAttribute("x1",O.toString()),Le.setAttribute("y1",M.toString()),Le.setAttribute("x2",X.toString()),Le.setAttribute("y2",se.toString()),Z&&q.setAttributes(Le,Z),Le},q.createPolygon=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",O),M&&q.setAttributes(X,M),X},q.createCircle=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(O/2).toString()),X.setAttribute("cy",(O/2).toString()),X.setAttribute("r",O.toString()),M&&q.setAttributes(X,M),X},q.createEllipse=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(O/2).toString()),se.setAttribute("cy",(M/2).toString()),se.setAttribute("rx",(O/2).toString()),se.setAttribute("ry",(M/2).toString()),X&&q.setAttributes(se,X),se},q.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&q.setAttributes(M,O),M},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(O,M,X,se,Z,Le,ot){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(wt,[["id",O],["orient",M],["markerWidth",X.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Le.toString()]]),wt.appendChild(ot),wt},q.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&q.setAttributes(M,O),M},q.createTSpan=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=O,M&&q.setAttributes(X,M),X},q.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&q.setAttributes(M,O),M},q.createPoint=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=O,X.y=M,X},q.createPath=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",O),M&&q.setAttributes(X,M),X},q.createElement=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg",O);return M&&q.setAttributes(X,M),X},q.getHollowRectanglePath=function(O,M,X,se,Z,Le,ot,wt){return"M"+O+","+M+"V"+(M+se)+"H"+(O+X)+"V"+M+"H"+Z+"V"+Le+"H"+(Z+ot)+"V"+(Le+wt)+"H"+Z+"V"+M+"Z"},q}(),Ar=function(){function q(O){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},q.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new Nn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Nn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Nn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Tn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Tn("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},q.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),Nn=function(q,O){this.selector=q,this.style=O},Tn=function(q,O){this.localName=q,this.style=O},pr=function(){function q(){this.blocks=[],this.display=""}return q.prototype.addButtonBlock=function(O){O.className=this.blockClassName,O.buttonClassName=this.buttonClassName,O.buttonColorsClassName=this.buttonColorsClassName,O.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(O)},q.prototype.addElementBlock=function(O){O.className===void 0&&(O.className=this.blockClassName),this.blocks.push(O)},q.prototype.getUI=function(){var O=document.createElement("div");return O.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,O.style.display=this.display,this.blocks.forEach(function(M){return O.appendChild(M.getUI())}),O},q}(),_r=function(){function q(){}return q.prototype.getUI=function(){var O=document.createElement("div");if(O.className=this.className,this.minWidth!==void 0&&(O.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":O.style.justifyContent="flex-start";break;case"center":O.style.justifyContent="center";break;case"end":O.style.justifyContent="flex-end"}return O.style.whiteSpace="nowrap",O},q}(),Pr=function(q){function O(){var M=q!==null&&q.apply(this,arguments)||this;return M.buttons=[],M}return vr(O,q),O.prototype.addButton=function(M){M.className=this.buttonClassName,M.colorsClassName=this.buttonColorsClassName,M.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(M)},O.prototype.getUI=function(){var M=q.prototype.getUI.call(this);return this.buttons.forEach(function(X){return M.appendChild(X.getUI())}),M},O}(_r),yr=function(){function q(O,M){this._isActive=!1,this._isHidden=!1,this._icon=O,this.title=M,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(q.prototype,"icon",{get:function(){return this._icon},set:function(O){this._icon=O,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isActive",{get:function(){return this._isActive},set:function(O){this._isActive=O,this.adjustClassName()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){var O=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return O.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},q.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},q.prototype.hide=function(){this._isHidden=!0},q}(),mt=function(q){function O(){var M=q!==null&&q.apply(this,arguments)||this;return M.elements=[],M}return vr(O,q),O.prototype.addElement=function(M){this.elements.push(M)},O.prototype.getUI=function(){var M=q.prototype.getUI.call(this);return this.elements.forEach(function(X){return M.appendChild(X)}),M},O}(_r),Ge=function(){function q(O,M){this.horizontal=O,this.vertical=M}return Object.defineProperty(q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),q.prototype.getVerticalLength=function(O){return O/this.ratio},q.prototype.getHorizontalLength=function(O){return O*this.ratio},q}(),Ot=function(){function q(){}return q.getIcon=function(O,M){if(O>0&&M>0){var X=new Ge(O,M),se=X.ratio>=1?20:X.getHorizontalLength(20),Z=X.ratio<1?20:X.getVerticalLength(20),Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("xmlns","http://www.w3.org/2000/svg"),Le.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Le);var ot=Jt.createDefs();Le.appendChild(ot);var wt=Jt.createElement("clipPath",[["id","text-bg-clip"]]);ot.appendChild(wt);var Lt=Jt.createPath(Jt.getHollowRectanglePath((24-se)/2,(24-Z)/2,se,Z,(24-se)/2+2,(24-Z)/2+2,se-4,Z-4));Le.appendChild(Lt);var ct=Jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ct.appendChild(Jt.createTSpan(O+":"+M)),Le.appendChild(ct);var Et=ct.getBBox();Jt.setAttributes(ct,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var Mt=Jt.createPath(Jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return wt.appendChild(Mt),Jt.setAttributes(Lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Le),Le.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},q}(),Me=function(q){function O(M,X,se){var Z=q.call(this,M,X)||this;return Z.isDropdownOpen=!1,Z.onClick=Z.dropdownButtonClicked,Z.dropdownButtons=se,Z}return vr(O,q),O.prototype.setupDropdown=function(){var M=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=M.className,X.colorsClassName=M.colorsClassName,M.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},O.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},O.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},O.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},O.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},O.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},O}(yr),ye=function(){function q(O,M){this.GRIP_SIZE=10,this.color=O,this.fillColor=M,this.visual=Jt.createGroup(),this.visual.appendChild(Jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q.prototype.setCenter=function(O,M){this.visual.childNodes.forEach(function(X){return Jt.setAttributes(X,[["cx",O.toString()],["cy",M.toString()]])})},q}(),ve=function(){function q(O,M,X,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=O,this.canvasHeight=M,this.margin=X,this.container=se,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(O){this._aspectRatio=O,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.gridContainer&&Jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(O){this._zoomFactor=O,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var O=this;this.cropShadeElement=Jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var M=0;M<this.numberOfGridLines;M++)this.horizontalGridLines.push(Jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return O.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return O.gridContainer.appendChild(X)}),this.cropRectElement=Jt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},q.prototype.setCropRectangle=function(O){this.cropRect=O;var M=Object.assign({},this.cropRect);this.zoomFactor!==1&&(M.width=this.cropRect.width*this.zoomFactor,M.height=this.cropRect.height*this.zoomFactor,M.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-M.width/2,M.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-M.height/2),Jt.setAttributes(this.cropRectElement,[["x",M.x.toString()],["y",M.y.toString()],["width",M.width.toString()],["height",M.height.toString()]]);var X=M.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Z,Le){var ot=M.y+X*(Le+1);Jt.setAttributes(Z,[["x1",""+M.x],["y1",""+ot],["x2",""+(M.x+M.width)],["y2",""+ot]])});var se=M.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Z,Le){var ot=M.x+se*(Le+1);Jt.setAttributes(Z,[["x1",""+ot],["y1",""+M.y],["x2",""+ot],["y2",""+(M.y+M.height)]])}),Jt.setAttributes(this.cropShadeElement,[["d",Jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,M.x,M.y,M.width,M.height)]]),this.topLeftGrip.setCenter(M.x,M.y),this.topRightGrip.setCenter(M.x+M.width,M.y),this.bottomLeftGrip.setCenter(M.x,M.y+M.height),this.bottomRightGrip.setCenter(M.x+M.width,M.y+M.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},q.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.container.getBoundingClientRect();return{x:O-X.left+this.margin,y:M-X.top+this.margin}},q.prototype.onPointerDown=function(O){this.container.setPointerCapture(O.pointerId),this.previousPoint=this.clientToLocalCoordinates(O.clientX,O.clientY),this.cropRectElement===O.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(O.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(O.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(O.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(O.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(O){if(this.isMoving)this.move(this.clientToLocalCoordinates(O.clientX,O.clientY));else if(this.activeGrip){var M=this.clientToLocalCoordinates(O.clientX,O.clientY);this.resize(M)}O.preventDefault()},q.prototype.onPointerUp=function(O){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(O.pointerId)},q.prototype.move=function(O){var M=O.x-this.previousPoint.x,X=O.y-this.previousPoint.y;this.zoomFactor!==1&&(M=-M/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+M),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=O},q.prototype.resize=function(O){var M=Object.assign({},this.cropRect),X=O.x-this.previousPoint.x,se=O.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:M.x+X<this.margin&&(X=this.margin-M.x),M.x+=X,M.width=this.cropRect.x+this.cropRect.width-M.x;break;case this.bottomRightGrip:case this.topRightGrip:M.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-M.width),M.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(M.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),M.height=this.aspectRatio.getVerticalLength(M.width)):(M.y+=se,M.height=this.cropRect.y+this.cropRect.height-M.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?M.height=this.aspectRatio.getVerticalLength(M.width):M.height+=se}M.width<10&&(M.x=this.cropRect.x,M.width=10),M.height<10&&(M.y=this.cropRect.y,M.height=10),this.previousPoint=O,M.x>=this.margin&&M.y>=this.margin&&M.x-this.margin+M.width<=this.canvasWidth&&M.y-this.margin+M.height<=this.canvasHeight&&(this.cropRect=M,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var O=this.cropRect.x+this.cropRect.width/2,M=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=se,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=O-this.cropRect.width/2,this.cropRect.y=M-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},q.prototype.getRescaledRect=function(O,M,X,se,Z,Le){var ot=X/O,wt=se/M;return{x:(Z.x-Le)*ot+Le,y:(Z.y-Le)*wt+Le,width:Z.width*ot,height:Z.height*wt}},q.prototype.scaleCanvas=function(O,M){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,O,M,this.cropRect,this.margin);this.canvasWidth=O,this.canvasHeight=M,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},q}(),or=function(){function q(O){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=O,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(q.prototype,"angle",{get:function(){return this._angle},set:function(O){this._angle=O,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},q.prototype.onPointerDown=function(O){this.controlContainer.setPointerCapture(O.pointerId),this.isDragging=!0,this.previousPoint={x:O.clientX,y:O.clientY}},q.prototype.onPointerMove=function(O){this.isDragging&&(this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.previousPoint.x=O.clientX)},q.prototype.onPointerUp=function(O){this.isDragging&&this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(O.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var O=this.angleLabelText.getBBox();Jt.setAttributes(this.angleLabelElement,[["x",((this.width-O.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var O=this.scaleShape.transform.baseVal.getItem(0);O.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(O,0)}},q.prototype.getVisual=function(){var O=document.createElementNS("http://www.w3.org/2000/svg","svg");O.setAttribute("xmlns","http://www.w3.org/2000/svg"),O.setAttribute("width",this.width+"px"),O.setAttribute("height",this.height+"px"),O.setAttribute("viewBox","0 0 "+this.width+" "+this.height),O.style.flexShrink="0",document.body.appendChild(O);for(var M="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var se=X%5==0?this.height/3:this.height/6;M+="h4v"+-se+"h1v"+se}M+="v1H0Z",this.scaleShape=Jt.createPath(M);var Z=Jt.createTransform();this.scaleShape.transform.baseVal.appendItem(Z),O.appendChild(this.scaleShape),this.angleLabelElement=Jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Le=Jt.createTSpan("");return Le.innerHTML="°",this.angleLabelElement.appendChild(Le),O.appendChild(this.angleLabelElement),document.body.removeChild(O),O},q}(),en=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(O,M,X,se,Z,Le,ot){var wt=this;return new Promise(function(Lt){var ct=document.createElement("canvas");ct.width=O.width.baseVal.value-2*se,ct.height=O.height.baseVal.value-2*se;var Et=1,Mt=1;wt.naturalSize===!0?(Et=M.naturalWidth/(O.width.baseVal.value-2*se)/Le,Mt=M.naturalHeight/(O.height.baseVal.value-2*se)/ot,ct.width=M.naturalWidth/Le,ct.height=M.naturalHeight/ot):wt.width!==void 0&&wt.height!==void 0&&(Et=wt.width/X.width,Mt=wt.height/X.height,ct.width*=Et,ct.height*=Mt);var Cn=ct.getContext("2d");Cn.translate(ct.width/2,ct.height/2),Cn.rotate(Z*Math.PI/180),Cn.scale(Le,ot),Cn.translate(-ct.width/2,-ct.height/2),Cn.drawImage(M,0,0,ct.width,ct.height);var Yn=document.createElement("canvas");Yn.width=X.width*Et,Yn.height=X.height*Mt,Yn.getContext("2d").putImageData(Cn.getImageData((X.x-se)*Et,(X.y-se)*Mt,X.width*Et,X.height*Mt),0,0),Lt(Yn.toDataURL(wt.imageType,wt.imageQuality))})},q}(),Ie=function(){function q(O){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=q.instanceCounter++,this.styles=new Ar(this.instanceNo),this.target=O,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(O){this._zoomToCropEnabled=O,O?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(O){this._gridLines=O,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(O){this._rotationAngle=O,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var O;return(O=this._aspectRatio)!==null&&O!==void 0?O:this.aspectRatios[0]},set:function(O){this._aspectRatio=O},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(O){O===void 0&&(O=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),O||this.closeEventListeners.forEach(function(M){return M()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(O){this.renderEventListeners.push(O)},q.prototype.removeRenderEventListener=function(O){this.renderEventListeners.indexOf(O)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(O),1)},q.prototype.addCloseEventListener=function(O){this.closeEventListeners.push(O)},q.prototype.removeCloseEventListener=function(O){this.closeEventListeners.indexOf(O)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(O),1)},q.prototype.setupResizeObserver=function(){var O=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.contentDiv.clientWidth/O>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*O:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=M+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/O;this.resize(M,X)}},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Jt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},q.prototype.resize=function(O,M){this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},q.prototype.setEditingTarget=function(){var O=document.createElement("canvas");O.width=this.target.naturalWidth,O.height=this.target.naturalHeight,O.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var M=O.toDataURL();Jt.setAttributes(this.editingTarget,[["href",M]]),this.setEditingTargetSize()},q.prototype.setTopLeft=function(){var O=this.target.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left-this.CANVAS_MARGIN,this.top=O.top-M.top-this.CANVAS_MARGIN},q.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Jt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Jt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Jt.createGroup(),this.editingTargetRotationScaleContainer=Jt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var O=Jt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(O);var M=Jt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(M),this.editingTargetContainer=Jt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Jt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ve(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},q.prototype.zoomToCrop=function(){if(this.cropRect){var O=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,M=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=O+"px "+M+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-O+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-M+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},q.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},q.prototype.cropRectChanged=function(O){this.cropRect=O,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,M=this.target.offsetTop>O+this.CANVAS_MARGIN?this.target.offsetTop-(O+this.CANVAS_MARGIN):0;this.coverDiv.style.top=M+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var O=this;this.topToolbar=new pr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var M=new Pr;M.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(M);var X=[];this.aspectRatios.forEach(function(Mt){var Cn=new yr(Ot.getIcon(Mt.horizontal,Mt.vertical),Mt.horizontal===0&&Mt.vertical===0?"FREE":Mt.horizontal+":"+Mt.vertical);Cn.onClick=function(){return O.ratioButtonClicked(Mt)},X.push(Cn)}),this.aspectRatioButton=new Me(Ot.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,M.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new yr('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");se.isActive=this.isGridVisible,se.onClick=function(){O.isGridVisible=!O.isGridVisible,se.isActive=O.isGridVisible},M.addButton(se);var Z=new yr('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Z.isActive=this.zoomToCropEnabled,Z.onClick=function(){O.zoomToCropEnabled=!O.zoomToCropEnabled,Z.isActive=O.zoomToCropEnabled},M.addButton(Z),!Rr.isLicensed){var Le=new mt;this.topToolbar.addElementBlock(Le);var ot=document.createElement("div");ot.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var wt=document.createElement("a");wt.style.color="currentColor",wt.href="https://markerjs.com/products/cropro",wt.target="_blank",wt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ot.appendChild(wt),Le.addElement(ot)}var Lt=new Pr;Lt.minWidth=3*this.toolbarHeight+"px",Lt.contentAlign="end",this.topToolbar.addButtonBlock(Lt);var ct=new yr('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ct.onClick=this.startRenderAndClose,Lt.addButton(ct),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ct.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new yr('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Et.onClick=this.close,Lt.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var O=this;this.bottomToolbar=new pr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var M=new Pr;M.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(M);var X=new yr('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");X.onClick=this.rotateLeftButtonClicked,M.addButton(X);var se=new yr('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");se.onClick=this.rotateRightButtonClicked,M.addButton(se);var Z=new mt;Z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Z),this.straightener=new or("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Lt){O.rotateBy(Lt),O.straightener.angle=O.rotationAngle},Z.addElement(this.straightener.getUI());var Le=new Pr;Le.minWidth=2*this.toolbarHeight+"px",Le.contentAlign="end",this.bottomToolbar.addButtonBlock(Le);var ot=new yr('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ot.onClick=this.flipHorizontallyButtonClicked,Le.addButton(ot);var wt=new yr('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");wt.onClick=this.flipVerticallyButtonClicked,Le.addButton(wt)},q.prototype.ratioButtonClicked=function(O){this.aspectRatio=O,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ge(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(O){if(O){var M=this.cropLayer.getRescaledRect(O.width,O.height,this.imageWidth,this.imageHeight,O.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(M),this.cropRectChanged(M),this.flippedHorizontally=O.flippedHorizontally,this.flippedVertically=O.flippedVertically,this.applyFlip(),this.rotationAngle=O.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.cropImage.getBoundingClientRect();return{x:O-X.left,y:M-X.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var O=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},q.prototype.rotateLeftButtonClicked=function(){var O=this.rotationAngle-90;this.rotationAngle%90!=0&&(O+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateRightButtonClicked=function(){var O=this.rotationAngle+90;this.rotationAngle%90!=0&&(O-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateTo=function(O){O=(O=O>180?O-360:O)<=-180?O+360:O,this.rotationAngle=O,this.applyRotation()},q.prototype.rotateBy=function(O){this.rotateTo((this.rotationAngle+O)%360)},q.prototype.applyRotation=function(){var O=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var M=this.editingTargetRotationContainer.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(M,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=O},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return ir(this,void 0,void 0,function(){var O,M;return br(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return O=X.sent(),M=this.getState(),this.renderEventListeners.forEach(function(se){return se(O,M)}),this.close(!0),[2]}})})},q.prototype.render=function(){return ir(this,void 0,void 0,function(){var O;return br(this,function(M){switch(M.label){case 0:return(O=new en).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.width=this.renderWidth,O.height=this.renderHeight,this.unzoomFromCrop(),Jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return M.sent(),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,M.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tn("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Tn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var O=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tn("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*O)+`px;
|
|
height: `+(this.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tn("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Tn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tn("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Tn("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},q.instanceCounter=0,q}(),gt=U("8hTe"),Ce=U.n(gt),cn=/<pre[^>]*>/g;function hr(q){var O=document.createElement("div");return O.innerHTML=q,O.childNodes.length===0?"":O.childNodes[0].nodeValue}var mr=Ae.a=function(q){var O=q.value,M=O===void 0?"":O,X=q.edit,se=X===void 0?!1:X,Z=q.className,Le=q.showTextOnly,ot=q.showLines,wt=q.replaces,Lt=q.zoomImg,ct=q.hasMask,Et=q.style,Mt=Et===void 0?{}:Et,Cn=q.stylesPrev,Yn=Cn===void 0?{}:Cn,Hn=String(M),fn=Object(D.useRef)(),Wt=Object(D.useRef)(),sn=Object(D.useState)(""),qt=Object($.a)(sn,2),Ft=qt[0],Qn=qt[1],Bn=Object(D.useState)("office"),xn=Object($.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=function(){var _n=new Ie(Wt.current);_n.displayMode="popup",_n.addRenderEventListener(function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return fn.current.style.display="none",qn.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn}});case 3:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 5:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show()},un=function(){var _n=new Gn(Wt.current);_n.settings.displayMode="popup",_n.addEventListener("render",function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(fn.current.style.display="none",!Wt.current){qn.next=6;break}return qn.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn.dataUrl}});case 4:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 6:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show(),window.markerArea=_n},Un=Object(D.useMemo)(function(){fn.current&&(fn.current.style.zIndex=-1);try{var rn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,_n=/\"\/api\/attachments\/|\"\/attachments\/download\//g,In=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(rn,"("+Y.a.API_SERVER+"/api/attachments/").replace(_n,'"'+Y.a.API_SERVER+"/api/attachments/").replace(In,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Vn){}var wn=F(Hn),Zn=C();if(Hn.match(/\[TOC\]/)&&(wn=wn.replace("<p>[TOC]</p>",A()),R()),wn=wn.replace(/(__special_katext_id_\d+__)/g,function(Vn,qn){var kn=Zn[qn],Pn=kn.type,Mn=kn.expression;return Object(ie.renderToString)(hr(Mn)||"",{displayMode:Pn==="block",throwOnError:!1,output:"html"})}),wn=wn.replace(/▁/g,"\u2581\u2581\u2581"),x(),Le){var yn=document.createElement("div");return yn.innerHTML=wn,yn.innerText}return setTimeout(function(){return Ln()},500),wn},[Hn]),Xn=Object(D.useRef)();T.WebkitLineClamp=ot,ot&&(Mt=Object(K.a)(Object(K.a)({},Mt),T));function nr(rn){var _n=rn.target;if(_n.tagName.toUpperCase()==="IMG"){if(Lt){var In=_n.getAttribute("src");Qn(In),pn("image")}}else if(_n.tagName.toUpperCase()==="A"){var wn=_n.getAttribute("href");if(wn.indexOf("office")>-1)rn.preventDefault(),Qn(wn),pn("office");else if(wn.indexOf("application/pdf")>-1)rn.preventDefault(),Qn(wn),pn("pdf");else if(wn.indexOf("text/html")>-1)rn.preventDefault(),Qn(wn),pn("html");else if(wn.startsWith("#")){rn.preventDefault();var Zn=document.getElementById(wn.replace("#",""));Zn&&Zn.scrollIntoView(!0)}}}var Ln=function(){var _n,In=(_n=Xn.current)===null||_n===void 0?void 0:_n.querySelectorAll("video");In==null||In.forEach(function(wn){if(wn.oncontextmenu=function(){return!1},wn.src.indexOf(".m3u8")>-1&&!wn.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var Zn=new H.a;Zn.loadSource(wn.src),Zn.attachMedia(wn)}}})};Object(D.useEffect)(function(){if(Xn.current&&Un&&(Un.match(cn)&&window.PR.prettyPrint()),Xn.current)return Xn.current.addEventListener("click",nr),function(){Xn.current.removeEventListener("click",nr),x(),R()}},[Un,Xn.current,nr]);var Kn=function(_n){if(!se)return;_n.target.nodeName==="IMG"?(fn.current.style.zIndex=1,fn.current.style.display="flex",fn.current.style.width=_n.target.clientWidth+"px",fn.current.style.height=_n.target.clientHeight+"px",fn.current.style.top=_n.target.offsetTop+"px",fn.current.style.left=_n.target.offsetLeft+"px",Wt.current.src=_n.target.getAttribute("src")):fn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Xn,style:Object(K.a)({},Mt),className:"".concat(Z||""," markdown-body ").concat(Ce.a.mdBody),onMouseOver:Kn,dangerouslySetInnerHTML:{__html:Un}}),p.a.createElement("div",{ref:fn,className:Ce.a.button},p.a.createElement(Q.a,null,p.a.createElement(J.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),p.a.createElement(J.a,{onClick:function(){return un()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:Wt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(le.a,{close:!0,data:Ft,type:Ft!=null&&Ft.length?Jn:"",style:Object(K.a)({},Yn),onClose:function(){return Qn("")}}))}},"9VGf":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return B});var te=U("q1tI"),Q=U.n(te);function B(J,K){var N=Object(te.useRef)();Object(te.useEffect)(function(){N.current=J}),Object(te.useEffect)(function(){function $(){N.current()}if(K!==null){var z=setInterval($,K);return function(){return clearInterval(z)}}},[K])}},"9z17":function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return S});var te=U("g9YV"),Q=U("wCAj"),B=U("5NDa"),J=U("5rEg"),K=U("y8nQ"),N=U("Vl3Y"),$=U("2qtc"),z=U("kLXV"),r=U("7Kak"),D=U("9yH6"),p=U("9og8"),g=U("tJVT"),m=U("WmNS"),a=U.n(m),d=U("q1tI"),s=U.n(d),i=U("ie49"),t=U.n(i),u=U("HBuW"),o=function(b){var h=b.total,f=b.used,C=b.copy,x=b.canNotCopy,_=b.inPaper,j="";return C>0&&x>0?j="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(x,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):C>0&&x===0?j="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):C===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":"")},R=function(b){return b?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},T=function(b){var h=b.onCancel,f=b.onOk,C=b.visible,x=b.inPaper,_=b.renderData,j=b.type,W=Object(d.useState)(1),w=Object(g.a)(W,2),F=w[0],I=w[1],v=Object(d.useState)(!1),H=Object(g.a)(v,2),Y=H[0],ie=H[1],le=Object(d.useMemo)(function(){return(_==null?void 0:_.total_num)===1&&(_==null?void 0:_.can_copy_num)===1},[_]);return s.a.createElement(s.a.Fragment,null,le?s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,confirmLoading:Y,onCancel:h,onOk:Object(p.a)(a.a.mark(function he(){return a.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ie(!0),Pe.next=3,f(F);case 3:ie(!1);case 4:case"end":return Pe.stop()}},he)}))},s.a.createElement("div",{className:t.a.content,style:{marginBottom:20}},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D\uFF1F"),s.a.createElement(D.a.Group,{value:F,onChange:function(we){return I(we.target.value)},className:t.a.content,style:{marginBottom:30}},s.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),s.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),s.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),s.a.createElement("div",{className:t.a.content},"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",{className:t.a.content},"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")):s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,onCancel:h,onOk:Object(p.a)(a.a.mark(function he(){return a.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ie(!0),Pe.next=3,f(0);case 3:ie(!1);case 4:case"end":return Pe.stop()}},he)}))},s.a.createElement("div",{className:t.a.content},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F")))},S=function(){var b=Object(d.useState)(!1),h=Object(g.a)(b,2),f=h[0],C=h[1],x=Object(d.useState)(),_=Object(g.a)(x,2),j=_[0],W=_[1],w=function(){return C(!1)},F=function(){var I=Object(p.a)(a.a.mark(function v(H){var Y;return a.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,Object(u.p)(H);case 2:if(Y=le.sent,!("status"in Y)){le.next=5;break}return le.abrupt("return",!1);case 5:if(!(Y.repeat_shixun_num===0)){le.next=7;break}return le.abrupt("return",!1);case 7:return W(Y),C(!0),le.abrupt("return",!0);case 10:case"end":return le.stop()}},v)}));return function(H){return I.apply(this,arguments)}}();return[f,w,j,F]},A=function(b){var h=N.a.useForm(),f=Object(g.a)(h,1),C=f[0],x=Object(d.useState)(!1),_=Object(g.a)(x,2),j=_[0],W=_[1],w=b.onCancel,F=b.onOk,I=b.visible,v=b.inPaper,H=v===void 0?!1:v,Y=b.renderData,ie=b.type,le=Object(d.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(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_use"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}}]},[H]),he=Object(d.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement("span",null,Oe),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],initialValue:0},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})))}}]},[H]),we=Object(d.useMemo)(function(){return o({total:Y==null?void 0:Y.total_num,used:Y==null?void 0:Y.repeat_shixun_num,copy:Y==null?void 0:Y.can_copy_num,canNotCopy:Y==null?void 0:Y.no_copy_num,inPaper:H})},[Y,H]),Pe=Object(d.useMemo)(function(){return R(H)},[H]);return s.a.createElement(z.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:I,confirmLoading:j,onOk:Object(p.a)(a.a.mark(function xe(){var Oe,pe;return a.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return W(!0),Oe=C.getFieldsValue(),pe=Object.keys(Oe).map(function(fe){return{id:parseInt(fe),is_use:Oe[fe].is_use,is_copy:Oe[fe].is_copy}}),ne.next=5,F(pe);case 5:W(!1);case 6:case"end":return ne.stop()}},xe)})),onCancel:w,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},s.a.createElement(N.a,{form:C,preserve:!1},s.a.createElement("div",{className:t.a.brief},we),(Y==null?void 0:Y.can_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Pe.reproducible),s.a.createElement("div",{className:t.a.tips},s.a.createElement("div",null,"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",null,"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")),s.a.createElement(Q.a,{columns:le,className:t.a.antdTable,dataSource:Y==null?void 0:Y.can_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(Y==null?void 0:Y.no_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Pe.irreproducible),s.a.createElement(Q.a,{columns:he,className:t.a.antdTable,dataSource:Y==null?void 0:Y.no_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(Y==null?void 0:Y.no_use_list.length)>0&&(Y==null?void 0:Y.no_use_list.map(function(xe){return s.a.createElement("div",{key:ie==="subject"?xe.stage_shixun_id:xe.id},s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?xe==null?void 0:xe.stage_shixun_id:xe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?xe==null?void 0:xe.stage_shixun_id:xe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}))))},P=function(b){var h=b.modalType;return h==="multiple"?s.a.createElement(A,b):s.a.createElement(T,b)};Ae.a=P},BU3w:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return N});var te=U("MNnm"),Q="rc-util-key";function B($){if($.attachTo)return $.attachTo;var z=document.querySelector("head");return z||document.body}function J($){var z,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var D=document.createElement("style");if((z=r.csp)===null||z===void 0?void 0:z.nonce){var p;D.nonce=(p=r.csp)===null||p===void 0?void 0:p.nonce}D.innerHTML=$;var g=B(r),m=g.firstChild;return r.prepend&&g.prepend?g.prepend(D):r.prepend&&m?g.insertBefore(D,m):g.appendChild(D),D}var K=new Map;function N($,z){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=B(r);if(!K.has(D)){var p=J("",r),g=p.parentNode;K.set(D,g),g.removeChild(p)}var m=Array.from(K.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===z});if(m){var a,d;if(((a=r.csp)===null||a===void 0?void 0:a.nonce)&&m.nonce!==((d=r.csp)===null||d===void 0?void 0:d.nonce)){var s;m.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return m.innerHTML!==$&&(m.innerHTML=$),m}var i=J($,r);return i[Q]=z,i}},Bd2K:function(kt,Ae,U){(function(te){te(U("VrN/"),U("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(r,D,p){if(p!=te.Init&&p&&r.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(m){return N(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(m){return J(m)}),r.addKeyMap(g)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],B=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function J(r){if(r.getOption("disableInput"))return te.Pass;for(var D=r.listSelections(),p=[],g=r.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return te.Pass;var a=D[m].head,d=r.getTokenAt(a),s=te.innerMode(r.getMode(),d.state),i=s.state,t=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(i),u=t&&t.name;if(!u)return te.Pass;var o=s.mode.configuration=="html",R=typeof g=="object"&&g.dontCloseTags||o&&Q,T=typeof g=="object"&&g.indentTags||o&&B;d.end>a.ch&&(u=u.slice(0,u.length-d.end+a.ch));var S=u.toLowerCase();if(!u||d.type=="string"&&(d.end!=a.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||d.string.length==1)||d.type=="tag"&&t.close||d.string.indexOf("/")==a.ch-d.start-1||R&&$(R,S)>-1||z(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i)||[],u,a,!0))return te.Pass;var A=typeof g=="object"&&g.emptyTags;if(A&&$(A,u)>-1){p[m]={text:"/>",newPos:te.Pos(a.line,a.ch+2)};continue}var P=T&&$(T,S)>-1;p[m]={indent:P,text:">"+(P?`
|
|
|
|
`:"")+"</"+u+">",newPos:P?te.Pos(a.line+1,0):te.Pos(a.line,a.ch+1)}}for(var E=typeof g=="object"&&g.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var b=p[m];r.replaceRange(b.text,D[m].head,D[m].anchor,"+insert");var h=r.listSelections().slice(0);h[m]={head:b.newPos,anchor:b.newPos},r.setSelections(h),!E&&b.indent&&(r.indentLine(b.newPos.line,null,!0),r.indentLine(b.newPos.line+1,null,!0))}}function K(r,D){for(var p=r.listSelections(),g=[],m=D?"/":"</",a=r.getOption("autoCloseTags"),d=typeof a=="object"&&a.dontIndentOnSlash,s=0;s<p.length;s++){if(!p[s].empty())return te.Pass;var i=p[s].head,t=r.getTokenAt(i),u=te.innerMode(r.getMode(),t.state),o=u.state;if(D&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return te.Pass;var R,T=u.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&u.mode.name=="javascript")R=m+"script";else if(T&&u.mode.name=="css")R=m+"style";else{var S=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(o);if(!S||S.length&&z(r,S,S[S.length-1],i))return te.Pass;R=m+S[S.length-1]}r.getLine(i.line).charAt(t.end)!=">"&&(R+=">"),g[s]=R}if(r.replaceSelections(g),p=r.listSelections(),!d)for(var s=0;s<p.length;s++)(s==p.length-1||p[s].head.line<p[s+1].head.line)&&r.indentLine(p[s].head.line)}function N(r){return r.getOption("disableInput")?te.Pass:K(r,!0)}te.commands.closeTag=function(r){return K(r)};function $(r,D){if(r.indexOf)return r.indexOf(D);for(var p=0,g=r.length;p<g;++p)if(r[p]==D)return p;return-1}function z(r,D,p,g,m){if(!te.scanForClosingTag)return!1;var a=Math.min(r.lastLine()+1,g.line+500),d=te.scanForClosingTag(r,g,null,a);if(!d||d.tag!=p)return!1;for(var s=m?1:0,i=D.length-1;i>=0&&D[i]==p;i--)++s;g=d.to;for(var i=1;i<s;i++){var t=te.scanForClosingTag(r,g,null,a);if(!t||t.tag!=p)return!1;g=t.to}return!0}})},BjJ7:function(kt,Ae,U){"use strict";U.d(Ae,"d",function(){return Q}),U.d(Ae,"c",function(){return B}),U.d(Ae,"e",function(){return J}),U.d(Ae,"b",function(){return K}),U.d(Ae,"a",function(){return $});var te=U("m3rI");function Q(z){var r=!0;if(z.length>0){for(var D=0;D<z.length;D++)if(z[D].compile_success==0||!z[D].compile_success){r=!1;break}}else r=!1;return r}function B(z){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],p=0;p<z.length;p++){var g=z[p],m=r?"".concat(r,"/").concat(g.name):"".concat(g.name);D.push({title:g.name,isLeaf:!(g.type==="tree"),key:m})}return D}function J(z,r,D){for(var p=0;p<z.length;p++){var g=z[p];if(g.key===r){g.children=D;break}g.children&&J(g.children,r,D)}return z}function K(z,r,D){var p;return function(){var g=this,m=arguments,a=function(){p=null,D||z.apply(g,m)},d=D&&!p;clearTimeout(p),p=setTimeout(a,r),d&&z.apply(g,m)}}var N=!0,$=te.a.API_SERVER},"C+DQ":function(kt,Ae,U){},"C/vA":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return te});function te(Q){const B=this;let J=!1,K;return function(){return J||(J=!0,K=Q.apply(B,arguments)),K}}},"Cg/j":function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return te}),U.d(Ae,"a",function(){return Q}),U.d(Ae,"c",function(){return J}),U.d(Ae,"d",function(){return K});var te;(function(N){N.serviceIds=new Map,N.DI_TARGET="$di$target",N.DI_DEPENDENCIES="$di$dependencies";function $(z){return z[N.DI_DEPENDENCIES]||[]}N.getServiceDependencies=$})(te||(te={}));const Q=J("instantiationService");function B(N,$,z,r){$[te.DI_TARGET]===$?$[te.DI_DEPENDENCIES].push({id:N,index:z,optional:r}):($[te.DI_DEPENDENCIES]=[{id:N,index:z,optional:r}],$[te.DI_TARGET]=$)}function J(N){if(te.serviceIds.has(N))return te.serviceIds.get(N);const $=function(z,r,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B($,z,D,!1)};return $.toString=()=>N,te.serviceIds.set(N,$),$}function K(N){return function($,z,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");B(N,$,r,!0)}}},DlQD:function(kt,Ae,U){(function(te,Q){kt.exports=Q()})(this,function(){"use strict";function te(He,Ne){for(var Ue=0;Ue<Ne.length;Ue++){var ge=Ne[Ue];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty(He,ge.key,ge)}}function Q(He,Ne,Ue){return Ne&&te(He.prototype,Ne),Ue&&te(He,Ue),He}function B(He,Ne){if(!He)return;if(typeof He=="string")return J(He,Ne);var Ue=Object.prototype.toString.call(He).slice(8,-1);if(Ue==="Object"&&He.constructor&&(Ue=He.constructor.name),Ue==="Map"||Ue==="Set")return Array.from(He);if(Ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ue))return J(He,Ne)}function J(He,Ne){(Ne==null||Ne>He.length)&&(Ne=He.length);for(var Ue=0,ge=new Array(Ne);Ue<Ne;Ue++)ge[Ue]=He[Ue];return ge}function K(He,Ne){var Ue;if(typeof Symbol=="undefined"||He[Symbol.iterator]==null){if(Array.isArray(He)||(Ue=B(He))||Ne&&He&&typeof He.length=="number"){Ue&&(He=Ue);var ge=0;return function(){return ge>=He.length?{done:!0}:{done:!1,value:He[ge++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ue=He[Symbol.iterator](),Ue.next.bind(Ue)}function N(He,Ne){return Ne={exports:{}},He(Ne,Ne.exports),Ne.exports}var $=N(function(He){function Ne(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ue(ge){He.exports.defaults=ge}He.exports={defaults:Ne(),getDefaults:Ne,changeDefaults:Ue}}),z=$.defaults,r=$.getDefaults,D=$.changeDefaults,p=/[&<>"']/,g=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,d={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(Ne){return d[Ne]};function i(He,Ne){if(Ne){if(p.test(He))return He.replace(g,s)}else if(m.test(He))return He.replace(a,s);return He}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(He){return He.replace(t,function(Ne,Ue){return Ue=Ue.toLowerCase(),Ue==="colon"?":":Ue.charAt(0)==="#"?Ue.charAt(1)==="x"?String.fromCharCode(parseInt(Ue.substring(2),16)):String.fromCharCode(+Ue.substring(1)):""})}var o=/(^|[^\[])\^/g;function R(He,Ne){He=He.source||He,Ne=Ne||"";var Ue={replace:function(Ee,De){return De=De.source||De,De=De.replace(o,"$1"),He=He.replace(Ee,De),Ue},getRegex:function(){return new RegExp(He,Ne)}};return Ue}var T=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(He,Ne,Ue){if(He){var ge;try{ge=decodeURIComponent(u(Ue)).replace(T,"").toLowerCase()}catch(Ee){return null}if(ge.indexOf("javascript:")===0||ge.indexOf("vbscript:")===0||ge.indexOf("data:")===0)return null}Ne&&!S.test(Ue)&&(Ue=f(Ne,Ue));try{Ue=encodeURI(Ue).replace(/%25/g,"%")}catch(Ee){return null}return Ue}var P={},E=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(He,Ne){P[" "+He]||(E.test(He)?P[" "+He]=He+"/":P[" "+He]=j(He,"/",!0)),He=P[" "+He];var Ue=He.indexOf(":")===-1;return Ne.substring(0,2)==="//"?Ue?Ne:He.replace(b,"$1")+Ne:Ne.charAt(0)==="/"?Ue?Ne:He.replace(h,"$1")+Ne:He+Ne}var C={exec:function(){}};function x(He){for(var Ne=1,Ue,ge;Ne<arguments.length;Ne++){Ue=arguments[Ne];for(ge in Ue)Object.prototype.hasOwnProperty.call(Ue,ge)&&(He[ge]=Ue[ge])}return He}function _(He,Ne){var Ue=He.replace(/\|/g,function(De,ue,Fe){for(var at=!1,xt=ue;--xt>=0&&Fe[xt]==="\\";)at=!at;return at?"|":" |"}),ge=Ue.split(/ \|/),Ee=0;if(ge.length>Ne)ge.splice(Ne);else for(;ge.length<Ne;)ge.push("");for(;Ee<ge.length;Ee++)ge[Ee]=ge[Ee].trim().replace(/\\\|/g,"|");return ge}function j(He,Ne,Ue){var ge=He.length;if(ge===0)return"";for(var Ee=0;Ee<ge;){var De=He.charAt(ge-Ee-1);if(De===Ne&&!Ue)Ee++;else if(De!==Ne&&Ue)Ee++;else break}return He.substr(0,ge-Ee)}function W(He,Ne){if(He.indexOf(Ne[1])===-1)return-1;for(var Ue=He.length,ge=0,Ee=0;Ee<Ue;Ee++)if(He[Ee]==="\\")Ee++;else if(He[Ee]===Ne[0])ge++;else if(He[Ee]===Ne[1]&&(ge--,ge<0))return Ee;return-1}function w(He){He&&He.sanitize&&!He.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var F={escape:i,unescape:u,edit:R,cleanUrl:A,resolveUrl:f,noopTest:C,merge:x,splitCells:_,rtrim:j,findClosingBracket:W,checkSanitizeDeprecation:w},I=$.defaults,v=F.rtrim,H=F.splitCells,Y=F.escape,ie=F.findClosingBracket;function le(He,Ne,Ue){var ge=Ne.href,Ee=Ne.title?Y(Ne.title):null,De=He[1].replace(/\\([\[\]])/g,"$1");return He[0].charAt(0)!=="!"?{type:"link",raw:Ue,href:ge,title:Ee,text:De}:{type:"image",raw:Ue,href:ge,title:Ee,text:Y(De)}}function he(He,Ne){var Ue=He.match(/^(\s+)(?:```)/);if(Ue===null)return Ne;var ge=Ue[1];return Ne.split(`
|
|
`).map(function(Ee){var De=Ee.match(/^\s+/);if(De===null)return Ee;var ue=De[0];return ue.length>=ge.length?Ee.slice(ge.length):Ee}).join(`
|
|
`)}var we=function(){function He(Ue){this.options=Ue||I}var Ne=He.prototype;return Ne.space=function(ge){var Ee=this.rules.block.newline.exec(ge);if(Ee)return Ee[0].length>1?{type:"space",raw:Ee[0]}:{raw:`
|
|
`}},Ne.code=function(ge,Ee){var De=this.rules.block.code.exec(ge);if(De){var ue=Ee[Ee.length-1];if(ue&&ue.type==="paragraph")return{raw:De[0],text:De[0].trimRight()};var Fe=De[0].replace(/^ {4}/gm,"");return{type:"code",raw:De[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:v(Fe,`
|
|
`)}}},Ne.fences=function(ge){var Ee=this.rules.block.fences.exec(ge);if(Ee){var De=Ee[0],ue=he(De,Ee[3]||"");return{type:"code",raw:De,lang:Ee[2]?Ee[2].trim():Ee[2],text:ue}}},Ne.heading=function(ge){var Ee=this.rules.block.heading.exec(ge);if(Ee)return{type:"heading",raw:Ee[0],depth:Ee[1].length,text:Ee[2]}},Ne.nptable=function(ge){var Ee=this.rules.block.nptable.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Ee[0]};if(De.header.length===De.align.length){var ue=De.align.length,Fe;for(Fe=0;Fe<ue;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(ue=De.cells.length,Fe=0;Fe<ue;Fe++)De.cells[Fe]=H(De.cells[Fe],De.header.length);return De}}},Ne.hr=function(ge){var Ee=this.rules.block.hr.exec(ge);if(Ee)return{type:"hr",raw:Ee[0]}},Ne.blockquote=function(ge){var Ee=this.rules.block.blockquote.exec(ge);if(Ee){var De=Ee[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ee[0],text:De}}},Ne.list=function(ge){var Ee=this.rules.block.list.exec(ge);if(Ee){for(var De=Ee[0],ue=Ee[2],Fe=ue.length>1,at=ue[ue.length-1]===")",xt={type:"list",raw:De,ordered:Fe,start:Fe?+ue.slice(0,-1):"",loose:!1,items:[]},Gt=Ee[0].match(this.rules.block.item),$t=!1,Yt,$n,vn,ln,hn,Gn,fr,vr=Gt.length,ir=0;ir<vr;ir++)Yt=Gt[ir],De=Yt,$n=Yt.length,Yt=Yt.replace(/^ *([*+-]|\d+[.)]) */,""),~Yt.indexOf(`
|
|
`)&&($n-=Yt.length,Yt=this.options.pedantic?Yt.replace(/^ {1,4}/gm,""):Yt.replace(new RegExp("^ {1,"+$n+"}","gm"),"")),ir!==vr-1&&(vn=this.rules.block.bullet.exec(Gt[ir+1])[0],(Fe?vn.length===1||!at&&vn[vn.length-1]===")":vn.length>1||this.options.smartLists&&vn!==ue)&&(ln=Gt.slice(ir+1).join(`
|
|
`),xt.raw=xt.raw.substring(0,xt.raw.length-ln.length),ir=vr-1)),hn=$t||/\n\n(?!\s*$)/.test(Yt),ir!==vr-1&&($t=Yt.charAt(Yt.length-1)===`
|
|
`,hn||(hn=$t)),hn&&(xt.loose=!0),Gn=/^\[[ xX]\] /.test(Yt),fr=void 0,Gn&&(fr=Yt[1]!==" ",Yt=Yt.replace(/^\[[ xX]\] +/,"")),xt.items.push({type:"list_item",raw:De,task:Gn,checked:fr,loose:hn,text:Yt});return xt}},Ne.html=function(ge){var Ee=this.rules.block.html.exec(ge);if(Ee)return{type:this.options.sanitize?"paragraph":"html",raw:Ee[0],pre:!this.options.sanitizer&&(Ee[1]==="pre"||Ee[1]==="script"||Ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):Y(Ee[0]):Ee[0]}},Ne.def=function(ge){var Ee=this.rules.block.def.exec(ge);if(Ee){Ee[3]&&(Ee[3]=Ee[3].substring(1,Ee[3].length-1));var De=Ee[1].toLowerCase().replace(/\s+/g," ");return{tag:De,raw:Ee[0],href:Ee[2],title:Ee[3]}}},Ne.table=function(ge){var Ee=this.rules.block.table.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
|
|
`):[]};if(De.header.length===De.align.length){De.raw=Ee[0];var ue=De.align.length,Fe;for(Fe=0;Fe<ue;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(ue=De.cells.length,Fe=0;Fe<ue;Fe++)De.cells[Fe]=H(De.cells[Fe].replace(/^ *\| *| *\| *$/g,""),De.header.length);return De}}},Ne.lheading=function(ge){var Ee=this.rules.block.lheading.exec(ge);if(Ee)return{type:"heading",raw:Ee[0],depth:Ee[2].charAt(0)==="="?1:2,text:Ee[1]}},Ne.paragraph=function(ge){var Ee=this.rules.block.paragraph.exec(ge);if(Ee)return{type:"paragraph",raw:Ee[0],text:Ee[1].charAt(Ee[1].length-1)===`
|
|
`?Ee[1].slice(0,-1):Ee[1]}},Ne.text=function(ge,Ee){var De=this.rules.block.text.exec(ge);if(De){var ue=Ee[Ee.length-1];return ue&&ue.type==="text"?{raw:De[0],text:De[0]}:{type:"text",raw:De[0],text:De[0]}}},Ne.escape=function(ge){var Ee=this.rules.inline.escape.exec(ge);if(Ee)return{type:"escape",raw:Ee[0],text:Y(Ee[1])}},Ne.tag=function(ge,Ee,De){var ue=this.rules.inline.tag.exec(ge);if(ue)return!Ee&&/^<a /i.test(ue[0])?Ee=!0:Ee&&/^<\/a>/i.test(ue[0])&&(Ee=!1),!De&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?De=!0:De&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(De=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:Ee,inRawBlock:De,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]}},Ne.link=function(ge){var Ee=this.rules.inline.link.exec(ge);if(Ee){var De=ie(Ee[2],"()");if(De>-1){var ue=Ee[0].indexOf("!")===0?5:4,Fe=ue+Ee[1].length+De;Ee[2]=Ee[2].substring(0,De),Ee[0]=Ee[0].substring(0,Fe).trim(),Ee[3]=""}var at=Ee[2],xt="";if(this.options.pedantic){var Gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);Gt?(at=Gt[1],xt=Gt[3]):xt=""}else xt=Ee[3]?Ee[3].slice(1,-1):"";at=at.trim().replace(/^<([\s\S]*)>$/,"$1");var $t=le(Ee,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:xt&&xt.replace(this.rules.inline._escapes,"$1")},Ee[0]);return $t}},Ne.reflink=function(ge,Ee){var De;if((De=this.rules.inline.reflink.exec(ge))||(De=this.rules.inline.nolink.exec(ge))){var ue=(De[2]||De[1]).replace(/\s+/g," ");if(ue=Ee[ue.toLowerCase()],!ue||!ue.href){var Fe=De[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var at=le(De,ue,De[0]);return at}},Ne.strong=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.strong.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.strong.middle.exec(Ee.slice(0,ue.index+3)),at)return{type:"strong",raw:ge.slice(0,at[0].length),text:ge.slice(2,at[0].length-2)}}},Ne.em=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.em.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.em.middle.exec(Ee.slice(0,ue.index+2)),at)return{type:"em",raw:ge.slice(0,at[0].length),text:ge.slice(1,at[0].length-1)}}},Ne.codespan=function(ge){var Ee=this.rules.inline.code.exec(ge);if(Ee){var De=Ee[2].replace(/\n/g," "),ue=/[^ ]/.test(De),Fe=De.startsWith(" ")&&De.endsWith(" ");return ue&&Fe&&(De=De.substring(1,De.length-1)),De=Y(De,!0),{type:"codespan",raw:Ee[0],text:De}}},Ne.br=function(ge){var Ee=this.rules.inline.br.exec(ge);if(Ee)return{type:"br",raw:Ee[0]}},Ne.del=function(ge){var Ee=this.rules.inline.del.exec(ge);if(Ee)return{type:"del",raw:Ee[0],text:Ee[1]}},Ne.autolink=function(ge,Ee){var De=this.rules.inline.autolink.exec(ge);if(De){var ue,Fe;return De[2]==="@"?(ue=Y(this.options.mangle?Ee(De[1]):De[1]),Fe="mailto:"+ue):(ue=Y(De[1]),Fe=ue),{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.url=function(ge,Ee){var De;if(De=this.rules.inline.url.exec(ge)){var ue,Fe;if(De[2]==="@")ue=Y(this.options.mangle?Ee(De[0]):De[0]),Fe="mailto:"+ue;else{var at;do at=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(at!==De[0]);ue=Y(De[0]),De[1]==="www."?Fe="http://"+ue:Fe=ue}return{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.inlineText=function(ge,Ee,De){var ue=this.rules.inline.text.exec(ge);if(ue){var Fe;return Ee?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]:Fe=Y(this.options.smartypants?De(ue[0]):ue[0]),{type:"text",raw:ue[0],text:Fe}}},He}(),Pe=F.noopTest,xe=F.edit,Oe=F.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=xe(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=xe(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=xe(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=xe(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=xe(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=xe(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Oe({},pe),pe.gfm=Oe({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=xe(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=xe(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=Oe({},pe.normal,{html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Pe,paragraph:xe(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",be.punctuation=xe(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",be._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",be.em.start=xe(be.em.start).replace(/punctuation/g,be._punctuation).getRegex(),be.em.middle=xe(be.em.middle).replace(/punctuation/g,be._punctuation).replace(/overlapSkip/g,be._overlapSkip).getRegex(),be.em.endAst=xe(be.em.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.em.endUnd=xe(be.em.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.start=xe(be.strong.start).replace(/punctuation/g,be._punctuation).getRegex(),be.strong.middle=xe(be.strong.middle).replace(/punctuation/g,be._punctuation).replace(/blockSkip/g,be._blockSkip).getRegex(),be.strong.endAst=xe(be.strong.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.endUnd=xe(be.strong.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=xe(be._blockSkip,"g").getRegex(),be.overlapSkip=xe(be._overlapSkip,"g").getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,be.autolink=xe(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=xe(be.tag).replace("comment",pe._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=xe(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=xe(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=xe(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=Oe({},be),be.pedantic=Oe({},be.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=Oe({},be.normal,{escape:xe(be.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),be.gfm.url=xe(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex(),be.breaks=Oe({},be.gfm,{br:xe(be.br).replace("{2,}","*").getRegex(),text:xe(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:pe,inline:be},fe=$.defaults,_e=ne.block,ke=ne.inline;function qe(He){return He.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function je(He){var Ne="",Ue,ge,Ee=He.length;for(Ue=0;Ue<Ee;Ue++)ge=He.charCodeAt(Ue),Math.random()>.5&&(ge="x"+ge.toString(16)),Ne+="&#"+ge+";";return Ne}var st=function(){function He(Ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ue||fe,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:_e.normal,inline:ke.normal};this.options.pedantic?(ge.block=_e.pedantic,ge.inline=ke.pedantic):this.options.gfm&&(ge.block=_e.gfm,this.options.breaks?ge.inline=ke.breaks:ge.inline=ke.gfm),this.tokenizer.rules=ge}He.lex=function(ge,Ee){var De=new He(Ee);return De.lex(ge)};var Ne=He.prototype;return Ne.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},Ne.blockTokens=function(ge,Ee,De){Ee===void 0&&(Ee=[]),De===void 0&&(De=!0),ge=ge.replace(/^ +$/gm,"");for(var ue,Fe,at,xt;ge;){if(ue=this.tokenizer.space(ge)){ge=ge.substring(ue.raw.length),ue.type&&Ee.push(ue);continue}if(ue=this.tokenizer.code(ge,Ee)){ge=ge.substring(ue.raw.length),ue.type?Ee.push(ue):(xt=Ee[Ee.length-1],xt.raw+=`
|
|
`+ue.raw,xt.text+=`
|
|
`+ue.text);continue}if(ue=this.tokenizer.fences(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.heading(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.nptable(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.hr(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.blockquote(ge)){ge=ge.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],De),Ee.push(ue);continue}if(ue=this.tokenizer.list(ge)){for(ge=ge.substring(ue.raw.length),at=ue.items.length,Fe=0;Fe<at;Fe++)ue.items[Fe].tokens=this.blockTokens(ue.items[Fe].text,[],!1);Ee.push(ue);continue}if(ue=this.tokenizer.html(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(De&&(ue=this.tokenizer.def(ge))){ge=ge.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.lheading(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(De&&(ue=this.tokenizer.paragraph(ge))){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.text(ge,Ee)){ge=ge.substring(ue.raw.length),ue.type?Ee.push(ue):(xt=Ee[Ee.length-1],xt.raw+=`
|
|
`+ue.raw,xt.text+=`
|
|
`+ue.text);continue}if(ge){var Gt="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Gt);break}else throw new Error(Gt)}}return Ee},Ne.inline=function(ge){var Ee,De,ue,Fe,at,xt,Gt=ge.length;for(Ee=0;Ee<Gt;Ee++){xt=ge[Ee];switch(xt.type){case"paragraph":case"text":case"heading":{xt.tokens=[],this.inlineTokens(xt.text,xt.tokens);break}case"table":{for(xt.tokens={header:[],cells:[]},Fe=xt.header.length,De=0;De<Fe;De++)xt.tokens.header[De]=[],this.inlineTokens(xt.header[De],xt.tokens.header[De]);for(Fe=xt.cells.length,De=0;De<Fe;De++)for(at=xt.cells[De],xt.tokens.cells[De]=[],ue=0;ue<at.length;ue++)xt.tokens.cells[De][ue]=[],this.inlineTokens(at[ue],xt.tokens.cells[De][ue]);break}case"blockquote":{this.inline(xt.tokens);break}case"list":{for(Fe=xt.items.length,De=0;De<Fe;De++)this.inline(xt.items[De].tokens);break}}}return ge},Ne.inlineTokens=function(ge,Ee,De,ue,Fe){Ee===void 0&&(Ee=[]),De===void 0&&(De=!1),ue===void 0&&(ue=!1),Fe===void 0&&(Fe="");var at,xt=ge,Gt;if(this.tokens.links){var $t=Object.keys(this.tokens.links);if($t.length>0)for(;(Gt=this.tokenizer.rules.inline.reflinkSearch.exec(xt))!=null;)$t.includes(Gt[0].slice(Gt[0].lastIndexOf("[")+1,-1))&&(xt=xt.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Gt=this.tokenizer.rules.inline.blockSkip.exec(xt))!=null;)xt=xt.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ge;){if(at=this.tokenizer.escape(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.tag(ge,De,ue)){ge=ge.substring(at.raw.length),De=at.inLink,ue=at.inRawBlock,Ee.push(at);continue}if(at=this.tokenizer.link(ge)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.strong(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.em(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.codespan(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.br(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.del(ge)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.autolink(ge,je)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(!De&&(at=this.tokenizer.url(ge,je))){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.inlineText(ge,ue,qe)){ge=ge.substring(at.raw.length),Fe=at.raw.slice(-1),Ee.push(at);continue}if(ge){var Yt="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Yt);break}else throw new Error(Yt)}}return Ee},Q(He,null,[{key:"rules",get:function(){return{block:_e,inline:ke}}}]),He}(),vt=$.defaults,Re=F.cleanUrl,Be=F.escape,Ye=function(){function He(Ue){this.options=Ue||vt}var Ne=He.prototype;return Ne.code=function(ge,Ee,De){var ue=(Ee||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(ge,ue);Fe!=null&&Fe!==ge&&(De=!0,ge=Fe)}return ue?'<pre><code class="'+this.options.langPrefix+Be(ue,!0)+'">'+(De?ge:Be(ge,!0))+`</code></pre>
|
|
`:"<pre><code>"+(De?ge:Be(ge,!0))+`</code></pre>
|
|
`},Ne.blockquote=function(ge){return`<blockquote>
|
|
`+ge+`</blockquote>
|
|
`},Ne.html=function(ge){return ge},Ne.heading=function(ge,Ee,De,ue){return this.options.headerIds?"<h"+Ee+' id="'+this.options.headerPrefix+ue.slug(De)+'">'+ge+"</h"+Ee+`>
|
|
`:"<h"+Ee+">"+ge+"</h"+Ee+`>
|
|
`},Ne.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Ne.list=function(ge,Ee,De){var ue=Ee?"ol":"ul",Fe=Ee&&De!==1?' start="'+De+'"':"";return"<"+ue+Fe+`>
|
|
`+ge+"</"+ue+`>
|
|
`},Ne.listitem=function(ge){return"<li>"+ge+`</li>
|
|
`},Ne.checkbox=function(ge){return"<input "+(ge?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ne.paragraph=function(ge){return"<p>"+ge+`</p>
|
|
`},Ne.table=function(ge,Ee){return Ee&&(Ee="<tbody>"+Ee+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ge+`</thead>
|
|
`+Ee+`</table>
|
|
`},Ne.tablerow=function(ge){return`<tr>
|
|
`+ge+`</tr>
|
|
`},Ne.tablecell=function(ge,Ee){var De=Ee.header?"th":"td",ue=Ee.align?"<"+De+' align="'+Ee.align+'">':"<"+De+">";return ue+ge+"</"+De+`>
|
|
`},Ne.strong=function(ge){return"<strong>"+ge+"</strong>"},Ne.em=function(ge){return"<em>"+ge+"</em>"},Ne.codespan=function(ge){return"<code>"+ge+"</code>"},Ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ne.del=function(ge){return"<del>"+ge+"</del>"},Ne.link=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='<a href="'+Be(ge)+'"';return Ee&&(ue+=' title="'+Ee+'"'),ue+=">"+De+"</a>",ue},Ne.image=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='<img src="'+ge+'" alt="'+De+'"';return Ee&&(ue+=' title="'+Ee+'"'),ue+=this.options.xhtml?"/>":">",ue},Ne.text=function(ge){return ge},He}(),Ke=function(){function He(){}var Ne=He.prototype;return Ne.strong=function(ge){return ge},Ne.em=function(ge){return ge},Ne.codespan=function(ge){return ge},Ne.del=function(ge){return ge},Ne.html=function(ge){return ge},Ne.text=function(ge){return ge},Ne.link=function(ge,Ee,De){return""+De},Ne.image=function(ge,Ee,De){return""+De},Ne.br=function(){return""},He}(),yt=function(){function He(){this.seen={}}var Ne=He.prototype;return Ne.slug=function(ge){var Ee=ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ee)){var De=Ee;do this.seen[De]++,Ee=De+"-"+this.seen[De];while(this.seen.hasOwnProperty(Ee))}return this.seen[Ee]=0,Ee},He}(),Pt=$.defaults,Ht=F.unescape,Xt=function(){function He(Ue){this.options=Ue||Pt,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new yt}He.parse=function(ge,Ee){var De=new He(Ee);return De.parse(ge)};var Ne=He.prototype;return Ne.parse=function(ge,Ee){Ee===void 0&&(Ee=!0);var De="",ue,Fe,at,xt,Gt,$t,Yt,$n,vn,ln,hn,Gn,fr,vr,ir,br,Rr,Jt,Ar=ge.length;for(ue=0;ue<Ar;ue++){ln=ge[ue];switch(ln.type){case"space":continue;case"hr":{De+=this.renderer.hr();continue}case"heading":{De+=this.renderer.heading(this.parseInline(ln.tokens),ln.depth,Ht(this.parseInline(ln.tokens,this.textRenderer)),this.slugger);continue}case"code":{De+=this.renderer.code(ln.text,ln.lang,ln.escaped);continue}case"table":{for($n="",Yt="",xt=ln.header.length,Fe=0;Fe<xt;Fe++)Yt+=this.renderer.tablecell(this.parseInline(ln.tokens.header[Fe]),{header:!0,align:ln.align[Fe]});for($n+=this.renderer.tablerow(Yt),vn="",xt=ln.cells.length,Fe=0;Fe<xt;Fe++){for($t=ln.tokens.cells[Fe],Yt="",Gt=$t.length,at=0;at<Gt;at++)Yt+=this.renderer.tablecell(this.parseInline($t[at]),{header:!1,align:ln.align[at]});vn+=this.renderer.tablerow(Yt)}De+=this.renderer.table($n,vn);continue}case"blockquote":{vn=this.parse(ln.tokens),De+=this.renderer.blockquote(vn);continue}case"list":{for(hn=ln.ordered,Gn=ln.start,fr=ln.loose,xt=ln.items.length,vn="",Fe=0;Fe<xt;Fe++)ir=ln.items[Fe],br=ir.checked,Rr=ir.task,vr="",ir.task&&(Jt=this.renderer.checkbox(br),fr?ir.tokens.length>0&&ir.tokens[0].type==="text"?(ir.tokens[0].text=Jt+" "+ir.tokens[0].text,ir.tokens[0].tokens&&ir.tokens[0].tokens.length>0&&ir.tokens[0].tokens[0].type==="text"&&(ir.tokens[0].tokens[0].text=Jt+" "+ir.tokens[0].tokens[0].text)):ir.tokens.unshift({type:"text",text:Jt}):vr+=Jt),vr+=this.parse(ir.tokens,fr),vn+=this.renderer.listitem(vr,Rr,br);De+=this.renderer.list(vn,hn,Gn);continue}case"html":{De+=this.renderer.html(ln.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(ln.tokens));continue}case"text":{for(vn=ln.tokens?this.parseInline(ln.tokens):ln.text;ue+1<Ar&&ge[ue+1].type==="text";)ln=ge[++ue],vn+=`
|
|
`+(ln.tokens?this.parseInline(ln.tokens):ln.text);De+=Ee?this.renderer.paragraph(vn):vn;continue}default:{var Nn='Token with "'+ln.type+'" type was not found.';if(this.options.silent){console.error(Nn);return}else throw new Error(Nn)}}}return De},Ne.parseInline=function(ge,Ee){Ee=Ee||this.renderer;var De="",ue,Fe,at=ge.length;for(ue=0;ue<at;ue++){Fe=ge[ue];switch(Fe.type){case"escape":{De+=Ee.text(Fe.text);break}case"html":{De+=Ee.html(Fe.text);break}case"link":{De+=Ee.link(Fe.href,Fe.title,this.parseInline(Fe.tokens,Ee));break}case"image":{De+=Ee.image(Fe.href,Fe.title,Fe.text);break}case"strong":{De+=Ee.strong(this.parseInline(Fe.tokens,Ee));break}case"em":{De+=Ee.em(this.parseInline(Fe.tokens,Ee));break}case"codespan":{De+=Ee.codespan(Fe.text);break}case"br":{De+=Ee.br();break}case"del":{De+=Ee.del(this.parseInline(Fe.tokens,Ee));break}case"text":{De+=Ee.text(Fe.text);break}default:{var xt='Token with "'+Fe.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return De},He}(),an=F.merge,tn=F.checkSanitizeDeprecation,et=F.escape,Ze=$.getDefaults,Ct=$.changeDefaults,At=$.defaults;function dt(He,Ne,Ue){if(typeof He=="undefined"||He===null)throw new Error("marked(): input parameter is undefined or null");if(typeof He!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(He)+", string expected");if(typeof Ne=="function"&&(Ue=Ne,Ne=null),Ne=an({},dt.defaults,Ne||{}),tn(Ne),Ue){var ge=Ne.highlight,Ee;try{Ee=st.lex(He,Ne)}catch(at){return Ue(at)}var De=function(xt){var Gt;if(!xt)try{Gt=Xt.parse(Ee,Ne)}catch($t){xt=$t}return Ne.highlight=ge,xt?Ue(xt):Ue(null,Gt)};if(!ge||ge.length<3)return De();if(delete Ne.highlight,!Ee.length)return De();var ue=0;dt.walkTokens(Ee,function(at){at.type==="code"&&(ue++,setTimeout(function(){ge(at.text,at.lang,function(xt,Gt){if(xt)return De(xt);Gt!=null&&Gt!==at.text&&(at.text=Gt,at.escaped=!0),ue--,ue===0&&De()})},0))}),ue===0&&De();return}try{var Fe=st.lex(He,Ne);return Ne.walkTokens&&dt.walkTokens(Fe,Ne.walkTokens),Xt.parse(Fe,Ne)}catch(at){if(at.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Ne.silent)return"<p>An error occurred:</p><pre>"+et(at.message+"",!0)+"</pre>";throw at}}dt.options=dt.setOptions=function(He){return an(dt.defaults,He),Ct(dt.defaults),dt},dt.getDefaults=Ze,dt.defaults=At,dt.use=function(He){var Ne=an({},He);if(He.renderer&&function(){var ge=dt.defaults.renderer||new Ye,Ee=function(Fe){var at=ge[Fe];ge[Fe]=function(){for(var xt=arguments.length,Gt=new Array(xt),$t=0;$t<xt;$t++)Gt[$t]=arguments[$t];var Yt=He.renderer[Fe].apply(ge,Gt);return Yt===!1&&(Yt=at.apply(ge,Gt)),Yt}};for(var De in He.renderer)Ee(De);Ne.renderer=ge}(),He.tokenizer&&function(){var ge=dt.defaults.tokenizer||new we,Ee=function(Fe){var at=ge[Fe];ge[Fe]=function(){for(var xt=arguments.length,Gt=new Array(xt),$t=0;$t<xt;$t++)Gt[$t]=arguments[$t];var Yt=He.tokenizer[Fe].apply(ge,Gt);return Yt===!1&&(Yt=at.apply(ge,Gt)),Yt}};for(var De in He.tokenizer)Ee(De);Ne.tokenizer=ge}(),He.walkTokens){var Ue=dt.defaults.walkTokens;Ne.walkTokens=function(ge){He.walkTokens(ge),Ue&&Ue(ge)}}dt.setOptions(Ne)},dt.walkTokens=function(He,Ne){for(var Ue=K(He),ge;!(ge=Ue()).done;){var Ee=ge.value;Ne(Ee);switch(Ee.type){case"table":{for(var De=K(Ee.tokens.header),ue;!(ue=De()).done;){var Fe=ue.value;dt.walkTokens(Fe,Ne)}for(var at=K(Ee.tokens.cells),xt;!(xt=at()).done;)for(var Gt=xt.value,$t=K(Gt),Yt;!(Yt=$t()).done;){var $n=Yt.value;dt.walkTokens($n,Ne)}break}case"list":{dt.walkTokens(Ee.items,Ne);break}default:Ee.tokens&&dt.walkTokens(Ee.tokens,Ne)}}},dt.Parser=Xt,dt.parser=Xt.parse,dt.Renderer=Ye,dt.TextRenderer=Ke,dt.Lexer=st,dt.lexer=st.lex,dt.Tokenizer=we,dt.Slugger=yt,dt.parse=dt;var ft=dt;return ft})},ELLl:function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},B=te.Pos;te.defineOption("autoCloseBrackets",!1,function(d,s,i){i&&i!=te.Init&&(d.removeKeyMap(K),d.state.closeBrackets=null),s&&(N(J(s,"pairs")),d.state.closeBrackets=s,d.addKeyMap(K))});function J(d,s){return s=="pairs"&&typeof d=="string"?d:typeof d=="object"&&d[s]!=null?d[s]:Q[s]}var K={Backspace:r,Enter:D};function N(d){for(var s=0;s<d.length;s++){var i=d.charAt(s),t="'"+i+"'";K[t]||(K[t]=$(i))}}N(Q.pairs+"`");function $(d){return function(s){return g(s,d)}}function z(d){var s=d.state.closeBrackets;if(!s||s.override)return s;var i=d.getModeAt(d.getCursor());return i.closeBrackets||s}function r(d){var s=z(d);if(!s||d.getOption("disableInput"))return te.Pass;for(var i=J(s,"pairs"),t=d.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return te.Pass;var o=m(d,t[u].head);if(!o||i.indexOf(o)%2!=0)return te.Pass}for(var u=t.length-1;u>=0;u--){var R=t[u].head;d.replaceRange("",B(R.line,R.ch-1),B(R.line,R.ch+1),"+delete")}}function D(d){var s=z(d),i=s&&J(s,"explode");if(!i||d.getOption("disableInput"))return te.Pass;for(var t=d.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return te.Pass;var o=m(d,t[u].head);if(!o||i.indexOf(o)%2!=0)return te.Pass}d.operation(function(){var R=d.lineSeparator()||`
|
|
`;d.replaceSelection(R+R,null),d.execCommand("goCharLeft"),t=d.listSelections();for(var T=0;T<t.length;T++){var S=t[T].head.line;d.indentLine(S,null,!0),d.indentLine(S+1,null,!0)}})}function p(d){var s=te.cmpPos(d.anchor,d.head)>0;return{anchor:new B(d.anchor.line,d.anchor.ch+(s?-1:1)),head:new B(d.head.line,d.head.ch+(s?1:-1))}}function g(d,s){var i=z(d);if(!i||d.getOption("disableInput"))return te.Pass;var t=J(i,"pairs"),u=t.indexOf(s);if(u==-1)return te.Pass;for(var o=J(i,"closeBefore"),R=J(i,"triples"),T=t.charAt(u+1)==s,S=d.listSelections(),A=u%2==0,P,E=0;E<S.length;E++){var b=S[E],h=b.head,f,C=d.getRange(h,B(h.line,h.ch+1));if(A&&!b.empty())f="surround";else if((T||!A)&&C==s)T&&a(d,h)?f="both":R.indexOf(s)>=0&&d.getRange(h,B(h.line,h.ch+3))==s+s+s?f="skipThree":f="skip";else if(T&&h.ch>1&&R.indexOf(s)>=0&&d.getRange(B(h.line,h.ch-2),h)==s+s){if(h.ch>2&&/\bstring/.test(d.getTokenTypeAt(B(h.line,h.ch-2))))return te.Pass;f="addFour"}else if(T){var x=h.ch==0?" ":d.getRange(B(h.line,h.ch-1),h);if(!te.isWordChar(C)&&x!=s&&!te.isWordChar(x))f="both";else return te.Pass}else if(A&&(C.length===0||/\s/.test(C)||o.indexOf(C)>-1))f="both";else return te.Pass;if(!P)P=f;else if(P!=f)return te.Pass}var _=u%2?t.charAt(u-1):s,j=u%2?s:t.charAt(u+1);d.operation(function(){if(P=="skip")d.execCommand("goCharRight");else if(P=="skipThree")for(var W=0;W<3;W++)d.execCommand("goCharRight");else if(P=="surround"){for(var w=d.getSelections(),W=0;W<w.length;W++)w[W]=_+w[W]+j;d.replaceSelections(w,"around"),w=d.listSelections().slice();for(var W=0;W<w.length;W++)w[W]=p(w[W]);d.setSelections(w)}else P=="both"?(d.replaceSelection(_+j,null),d.triggerElectric(_+j),d.execCommand("goCharLeft")):P=="addFour"&&(d.replaceSelection(_+_+_+_,"before"),d.execCommand("goCharRight"))})}function m(d,s){var i=d.getRange(B(s.line,s.ch-1),B(s.line,s.ch+1));return i.length==2?i:null}function a(d,s){var i=d.getTokenAt(B(s.line,s.ch+1));return/\bstring/.test(i.type)&&i.start==s.ch&&(s.ch==0||!/\bstring/.test(d.getTokenTypeAt(s)))}})},FWmy:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return te});function te(Q,B){if(!Q)throw new Error(B?`Assertion failed (${B})`:"Assertion Failed")}},GfqC:function(kt,Ae,U){"use strict";var te=U("q1tI"),Q=U.n(te),B=U("TSYQ"),J=U.n(B);function K(F,I){var v="cannot "+F.method+" "+F.action+" "+I.status+"'",H=new Error(v);return H.status=I.status,H.method=F.method,H.url=F.action,H}function N(F){var I=F.responseText||F.response;if(!I)return I;try{return JSON.parse(I)}catch(v){return I}}function $(F){var I=new XMLHttpRequest;F.onProgress&&I.upload&&(I.upload.onprogress=function(ie){ie.total>0&&(ie.percent=ie.loaded/ie.total*100),F.onProgress(ie)});var v=new FormData;F.data&&Object.keys(F.data).forEach(function(Y){var ie=F.data[Y];if(Array.isArray(ie)){ie.forEach(function(le){v.append(Y+"[]",le)});return}v.append(Y,F.data[Y])}),F.file instanceof Blob?v.append(F.filename,F.file,F.file.name):v.append(F.filename,F.file),I.onerror=function(ie){F.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?F.onError(K(F,I),N(I)):F.onSuccess(N(I),I)},I.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=F.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(Y){H[Y]!==null&&I.setRequestHeader(Y,H[Y])}),I.send(v),{abort:function(){I.abort()}}}var z=+new Date,r=0;function D(){return"rc-upload-"+z+"-"+ ++r}function p(F,I){return F.indexOf(I,F.length-I.length)!==-1}var g=function(F,I){if(F&&I){var v=Array.isArray(I)?I:I.split(","),H=F.name||"",Y=F.type||"",ie=Y.replace(/\/.*$/,"");return v.some(function(le){var he=le.trim();return he.charAt(0)==="."?p(H.toLowerCase(),he.toLowerCase()):/\/\*$/.test(he)?ie===he.replace(/\/.*$/,""):Y===he})}return!0};function m(F,I){var v=F.createReader(),H=[];function Y(){v.readEntries(function(ie){var le=Array.prototype.slice.apply(ie);H=H.concat(le);var he=!le.length;he?I(H):Y()})}Y()}var a=function(I,v,H){var Y=function ie(le,he){he=he||"",le.isFile?le.file(function(we){H(we)&&(le.fullPath&&!we.webkitRelativePath&&(Object.defineProperties(we,{webkitRelativePath:{writable:!0}}),we.webkitRelativePath=le.fullPath.replace(/^\//,""),Object.defineProperties(we,{webkitRelativePath:{writable:!1}})),v([we]))}):le.isDirectory&&m(le,function(we){we.forEach(function(Pe){ie(Pe,""+he+le.name+"/")})})};I.forEach(function(ie){Y(ie.webkitGetAsEntry())})},d=a,s=Object.assign||function(F){for(var I=1;I<arguments.length;I++){var v=arguments[I];for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(F[H]=v[H])}return F},i=function(){function F(I,v){var H=[],Y=!0,ie=!1,le=void 0;try{for(var he=I[Symbol.iterator](),we;!(Y=(we=he.next()).done)&&!(H.push(we.value),v&&H.length===v);Y=!0);}catch(Pe){ie=!0,le=Pe}finally{try{!Y&&he.return&&he.return()}finally{if(ie)throw le}}return H}return function(I,v){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return F(I,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function F(I,v){for(var H=0;H<v.length;H++){var Y=v[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(I,Y.key,Y)}}return function(I,v,H){return v&&F(I.prototype,v),H&&F(I,H),I}}();function u(F,I,v){return I in F?Object.defineProperty(F,I,{value:v,enumerable:!0,configurable:!0,writable:!0}):F[I]=v,F}function o(F,I){var v={};for(var H in F){if(I.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(F,H))continue;v[H]=F[H]}return v}function R(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function T(F,I){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:F}function S(F,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);F.prototype=Object.create(I&&I.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(F,I):F.__proto__=I)}var A=function(I){return Object.keys(I).reduce(function(v,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(v[H]=I[H]),v},{})},P=function(F){S(I,F);function I(){var v,H,Y,ie;R(this,I);for(var le=arguments.length,he=Array(le),we=0;we<le;we++)he[we]=arguments[we];return ie=(H=(Y=T(this,(v=I.__proto__||Object.getPrototypeOf(I)).call.apply(v,[this].concat(he))),Y),Y.state={uid:D()},Y.reqs={},Y.onChange=function(Pe){var xe=Pe.target.files;Y.uploadFiles(xe),Y.reset()},Y.onClick=function(Pe){var xe=Y.fileInput;if(!xe)return;var Oe=Y.props,pe=Oe.children,be=Oe.onClick;pe&&pe.type==="button"&&(xe.parentNode.focus(),xe.parentNode.querySelector("button").blur()),xe.click(),be&&be(Pe)},Y.onKeyDown=function(Pe){Pe.key==="Enter"&&Y.onClick()},Y.onFileDrop=function(Pe){var xe=Y.props.multiple;if(Pe.preventDefault(),Pe.type==="dragover")return;if(Y.props.directory)d(Array.prototype.slice.call(Pe.dataTransfer.items),Y.uploadFiles,function(pe){return g(pe,Y.props.accept)});else{var Oe=Array.prototype.slice.call(Pe.dataTransfer.files).filter(function(pe){return g(pe,Y.props.accept)});xe===!1&&(Oe=Oe.slice(0,1)),Y.uploadFiles(Oe)}},Y.uploadFiles=function(Pe){var xe=Array.prototype.slice.call(Pe);xe.map(function(Oe){return Oe.uid=D(),Oe}).forEach(function(Oe){Y.upload(Oe,xe)})},Y.saveFileInput=function(Pe){Y.fileInput=Pe},H),T(Y,ie)}return t(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,Y){var ie=this,le=this.props;if(!le.beforeUpload)return setTimeout(function(){return ie.post(H)},0);var he=le.beforeUpload(H,Y);he&&he.then?he.then(function(we){var Pe=Object.prototype.toString.call(we);return Pe==="[object File]"||Pe==="[object Blob]"?ie.post(we):ie.post(H)}).catch(function(we){console.log(we)}):he!==!1&&setTimeout(function(){return ie.post(H)},0);return}},{key:"post",value:function(H){var Y=this;if(!this._isMounted)return;var ie=this.props,le=ie.onStart,he=ie.onProgress,we=ie.transformFile,Pe=we===void 0?function(xe){return xe}:we;new Promise(function(xe){var Oe=ie.action;return typeof Oe=="function"&&(Oe=Oe(H)),xe(Oe)}).then(function(xe){var Oe=H.uid,pe=ie.customRequest||$,be=Promise.resolve(Pe(H)).then(function(ne){var fe=ie.data;return typeof fe=="function"&&(fe=fe(ne)),Promise.all([ne,fe])}).catch(function(ne){console.error(ne)});be.then(function(ne){var fe=i(ne,2),_e=fe[0],ke=fe[1],qe={action:xe,filename:ie.name,data:ke,file:_e,headers:ie.headers,withCredentials:ie.withCredentials,method:ie.method||"post",onProgress:he?function(je){he(je,H)}:null,onSuccess:function(st,vt){delete Y.reqs[Oe],ie.onSuccess(st,H,vt)},onError:function(st,vt){delete Y.reqs[Oe],ie.onError(st,vt,H)}};le(H),Y.reqs[Oe]=pe(qe)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(H){var Y=this.reqs;if(H){var ie=H;H&&H.uid&&(ie=H.uid),Y[ie]&&Y[ie].abort&&Y[ie].abort(),delete Y[ie]}else Object.keys(Y).forEach(function(le){Y[le]&&Y[le].abort&&Y[le].abort(),delete Y[le]})}},{key:"render",value:function(){var H,Y=this.props,ie=Y.component,le=Y.prefixCls,he=Y.className,we=Y.disabled,Pe=Y.id,xe=Y.style,Oe=Y.multiple,pe=Y.accept,be=Y.children,ne=Y.directory,fe=Y.openFileDialogOnClick,_e=Y.onMouseEnter,ke=Y.onMouseLeave,qe=o(Y,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),je=J()((H={},u(H,le,!0),u(H,le+"-disabled",we),u(H,he,he),H)),st=we?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:_e,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Q.a.createElement(ie,s({},st,{className:je,role:"button",style:xe}),Q.a.createElement("input",s({},A(qe),{id:Pe,type:"file",ref:this.saveFileInput,onClick:function(Re){return Re.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:pe,directory:ne?"directory":null,webkitdirectory:ne?"webkitdirectory":null,multiple:Oe,onChange:this.onChange})),be)}}]),I}(te.Component),E=P,b=Object.assign||function(F){for(var I=1;I<arguments.length;I++){var v=arguments[I];for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(F[H]=v[H])}return F},h=function(){function F(I,v){for(var H=0;H<v.length;H++){var Y=v[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(I,Y.key,Y)}}return function(I,v,H){return v&&F(I.prototype,v),H&&F(I,H),I}}();function f(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function C(F,I){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:F}function x(F,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);F.prototype=Object.create(I&&I.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(F,I):F.__proto__=I)}function _(){}var j=function(F){x(I,F);function I(){var v,H,Y,ie;f(this,I);for(var le=arguments.length,he=Array(le),we=0;we<le;we++)he[we]=arguments[we];return ie=(H=(Y=C(this,(v=I.__proto__||Object.getPrototypeOf(I)).call.apply(v,[this].concat(he))),Y),Y.saveUploader=function(Pe){Y.uploader=Pe},H),C(Y,ie)}return h(I,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return Q.a.createElement(E,b({},this.props,{ref:this.saveUploader}))}}]),I}(te.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,w=Ae.a=W},HmJG:function(kt,Ae,U){},IBYe:function(kt,Ae,U){"use strict";function te(Q){return null}Ae.a=te},JYp7:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return te});var te;(function(Q){function B(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}Q.is=B;const J=Object.freeze([]);function K(){return J}Q.empty=K;function*N(o){yield o}Q.single=N;function $(o){return o||J}Q.from=$;function z(o){return!o||o[Symbol.iterator]().next().done===!0}Q.isEmpty=z;function r(o){return o[Symbol.iterator]().next().value}Q.first=r;function D(o,R){for(const T of o)if(R(T))return!0;return!1}Q.some=D;function p(o,R){for(const T of o)if(R(T))return T;return}Q.find=p;function*g(o,R){for(const T of o)R(T)&&(yield T)}Q.filter=g;function*m(o,R){let T=0;for(const S of o)yield R(S,T++)}Q.map=m;function*a(...o){for(const R of o)for(const T of R)yield T}Q.concat=a;function*d(o){for(const R of o)for(const T of R)yield T}Q.concatNested=d;function s(o,R,T){let S=T;for(const A of o)S=R(S,A);return S}Q.reduce=s;function*i(o,R,T=o.length){for(R<0&&(R+=o.length),T<0?T+=o.length:T>o.length&&(T=o.length);R<T;R++)yield o[R]}Q.slice=i;function t(o,R=Number.POSITIVE_INFINITY){const T=[];if(R===0)return[T,o];const S=o[Symbol.iterator]();for(let A=0;A<R;A++){const P=S.next();if(P.done)return[T,Q.empty()];T.push(P.value)}return[T,{[Symbol.iterator](){return S}}]}Q.consume=t;function u(o,R,T=(S,A)=>S===A){const S=o[Symbol.iterator](),A=R[Symbol.iterator]();for(;;){const P=S.next(),E=A.next();if(P.done!==E.done)return!1;if(P.done)return!0;if(!T(P.value,E.value))return!1}}Q.equals=u})(te||(te={}))},LYsE:function(kt,Ae,U){"use strict";var te=U("9og8"),Q=U("giR+"),B=U("fyUT"),J=U("2qtc"),K=U("kLXV"),N=U("/zsF"),$=U("PArb"),z=U("14J3"),r=U("BMrR"),D=U("+L6B"),p=U("2/Rp"),g=U("k1fw"),m=U("0Owb"),a=U("tJVT"),d=U("WmNS"),s=U.n(d),i=U("q1tI"),t=U.n(i),u=U("5Dmo"),o=U("3S7+"),R=U("5NDa"),T=U("5rEg"),S=U("jCWc"),A=U("kPKH"),P=U("BoS7"),E=U("Sdc0"),b=U("7Kak"),h=U("9yH6"),f=U("sRBo"),C=U("kaz8"),x=U("miYZ"),_=U("tsqr"),j=U("oBTY"),W=U("PpiC"),w=U("Ty5D"),F=U("9kvl"),I=U("V0Rq"),v=U("Ot1p"),H=U("kqOp"),Y=U("7qnI"),ie=U("1vsH"),le=U("YJx+"),he=U.n(le),we=U("9Bee"),Pe=U("u2Z1"),xe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oe="\u2581",pe=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.editData,gt=Ge.editKey,Ce=Ge.setEditKey,cn=Ce===void 0?function(){}:Ce,hr=Ge.cancelAdd,mr=hr===void 0?function(){}:hr,q=Ge.addCallback,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(""),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useState)(0),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),dn=Dn[0],Ut=Dn[1],zt=Object(i.useState)([]),Vt=Object(a.a)(zt,2),jt=Vt[0],nn=Vt[1],bn=Object(i.useState)(1),gn=Object(a.a)(bn,2),bt=gn[0],lt=gn[1],Je=Object(i.useState)(!1),nt=Object(a.a)(Je,2),ze=nt[0],pt=nt[1],rt=Object(i.useRef)(!1),Tt=Object(w.i)(),Nt=Object(i.useState)([]),St=Object(a.a)(Nt,2),Kt=St[0],Rt=St[1],It=function(lr){Rt([].concat(Object(j.a)(Kt),[Object(g.a)({},lr)]))};Object(i.useEffect)(function(){if(rt.current)return;if(!(Ie!=null&&Ie.question_title)){Pn(!0),ct(""),Sn(!1),_n(2),sn([]),Bn(""),nr(!1);return}ct(Ie==null?void 0:Ie.question_title),Sn(Ie==null?void 0:Ie.is_ordered),lt(Ie==null?void 0:Ie.difficulty),pt(!(Ie!=null&&Ie.repeat_answer)),_n(Ie==null?void 0:Ie.question_score);var xr=Ie==null?void 0:Ie.standard_answer.map(function(lr){return lr.answer_text});sn(Object(j.a)(xr)),nn(Ie.tag_discipline_ids),Yn(Ie==null?void 0:Ie.analysis)},[Ie,kn]),Object(i.useEffect)(function(){nr(!1),kn&&xr();function xr(){return lr.apply(this,arguments)}function lr(){return lr=Object(te.a)(s.a.mark(function wr(){var Er,Cr,Ur;return s.a.wrap(function(Fr){for(;;)switch(Fr.prev=Fr.next){case 0:return Fr.next=2,Object(I.I)({sub_discipline_id:(Er=ve.editData)===null||Er===void 0||((Cr=Er.exercise)===null||Cr===void 0)?void 0:Cr.sub_discipline_id});case 2:Ur=Fr.sent,Rt(Ur.tag_disciplines);case 4:case"end":return Fr.stop()}},wr)})),lr.apply(this,arguments)}},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:on,isEdit:kn}}),Object(i.useEffect)(function(){var xr,lr=ve!=null&&(xr=ve.tagDisciplineData)!==null&&xr!==void 0&&xr.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Rt(lr)},[ve.tagDisciplineData]);var En=function(lr){(lr==null?void 0:lr.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),cn(-1),rt.current=!1,X())},on=function(){var xr=Object(te.a)(s.a.mark(function lr(){var wr,Er,Cr,Ur,Vr,Fr,kr;return s.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(wr=[],Er=!1,Ut(!0),Wt.forEach(function(Si,Zr){wr.push({choice_id:Zr+1,answer_text:[]}),Si.forEach(function(ei,yi){wr[Zr].answer_text.push(ei),(!ei||!Object(ie.db)(ei,1e4))&&(Bn("".concat(Zr,"-").concat(yi)),_.b.info(ei?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Er=!0)})}),!Er){Kr.next=7;break}return Ut(!1),Kr.abrupt("return",!1);case 7:if(rt.current=!0,!Ie.question_id){Kr.next=19;break}if(!((Ie==null?void 0:Ie.is_my)===1)){Kr.next=13;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:bt,is_cover:1,repeat_answer:!ze,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}(),onCancel:function(){var Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}()}),Kr.next=17;break;case 13:return Kr.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 15:Cr=Kr.sent,En(Cr);case 17:Kr.next=23;break;case 19:return Kr.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:Tt.categoryId,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Fr=ve.editData)===null||Fr===void 0||((kr=Fr.exercise)===null||kr===void 0)?void 0:kr.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 21:Cr=Kr.sent,En(Cr);case 23:return Ut(!1),Kr.abrupt("return",{name:Lt,analysis:Cn,standard_answers:wr,is_ordered:pn});case 25:case"end":return Kr.stop()}},lr)}));return function(){return xr.apply(this,arguments)}}(),gr=function(lr,wr,Er){var Cr=Wt.slice();if(wr&&Cr.splice(lr,wr),Er&&Xn||!Ie.question_id)for(var Ur=0;Ur<Er;Ur++)Cr.splice(lr+Ur,0,[""]);yn(Cr==null?void 0:Cr.length),nr(!0),console.log(Cr,"newStandardAnswers"),sn(Cr)},er=function(lr,wr,Er){Bn("");var Cr=Wt.slice();Cr[lr][wr]=Er,sn(Cr)},tr=function(lr){var wr=Wt.slice();wr[lr]=[].concat(Object(j.a)(wr[lr]),[""]),sn(wr)},Qt=function(lr,wr){var Er=Wt.slice();if(!Er[lr][wr]){Er[lr]=Er[lr].filter(function(Cr,Ur){return Ur!==wr}),sn(Er);return}K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){Er[lr]=Er[lr].filter(function(Ur,Vr){return Vr!==wr}),sn(Er)}})},Rn=function(lr){K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){var Er=0;ct(Lt.replace(/\▁/g,function(Cr){return Er++,Er-1===lr?"":Cr})),setTimeout(function(){var Cr=Wt.slice();Cr=Wt.filter(function(Ur,Vr){return lr!==Vr}),sn(Cr)},500)}})},zn=function(){},rr=function(){var lr,wr,Er,Cr,Ur,Vr;return console.log(Wt,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Lt,onChange:function(kr){return ct(kr)},showNullButton:((lr=ve.editData)===null||lr===void 0||((wr=lr.exercise)===null||wr===void 0)?void 0:wr.exercise_status)===1,deleteEmptyDisabled:!(((Er=ve.editData)===null||Er===void 0||((Cr=Er.exercise)===null||Cr===void 0)?void 0:Cr.exercise_status)===1)||dn,onPlaceholderChange:gr})),t.a.createElement("div",{className:"mt20"},Wt.map(function(Fr,kr){var Ti,Kr;return t.a.createElement(Y.a,{key:kr,answers:Fr,index:kr,is_md:!0,exerciseIsPublish:((Ti=ve.editData)===null||Ti===void 0||((Kr=Ti.exercise)===null||Kr===void 0)?void 0:Kr.exercise_status)!==1,activeOptionErrorIndex:Qn,onAnswerChange:er,addChildAnswer:tr,deleteChildAnswer:Qt,deleteChildAnswermain:Rn})})),t.a.createElement("div",{className:"mt20"},Wt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:pn,onChange:function(kr){return Sn(kr.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Cn,onChange:function(kr){return Yn(kr)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:rn,max:1e4,min:0,onChange:function(kr){_n(kr)}})," ","\u5206 \xA0"," ",!!rn&&!!Zn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(rn/Zn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:bt,onChange:function(kr){lt(kr.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:jt,selectvalues:Ie==null?void 0:Ie.tag_discipline_ids,onChange:nn,subId:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:Kt,onAddKnowledgeFinish:It})),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(E.a,{checked:ze,onChange:function(kr){pt(kr)}}))),t.a.createElement("aside",{className:"tr"},(gt!==-1||Ie.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){mr(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){on()}},"\u4FDD\u5B58")))},On=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(xr){var lr,wr;return(ve==null||((lr=ve.editData)===null||lr===void 0||((wr=lr.exercise)===null||wr===void 0))?void 0:wr.exercise_status)===1?xr:xr.id!=="del"&&xr.id!=="add"}),Ir=function(){var xr=Object(te.a)(s.a.mark(function lr(wr){return s.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(!(gt!==-1)){Cr.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Cr.abrupt("return");case 3:Cr.t0=wr.id,Cr.next=Cr.t0==="del"?6:Cr.t0==="up"||Cr.t0==="down"?8:Cr.t0==="edit"?12:Cr.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Vr(){return s.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(I.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)});case 3:case"end":return kr.stop()}},Vr)}))()}}),Cr.abrupt("break",17);case 8:return Cr.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:wr.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)}),Cr.abrupt("break",17);case 12:return cn(Ie.dragKey),Pn(!0),Cr.abrupt("break",17);case 15:return O({key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:3}),Cr.abrupt("break",17);case 17:case"end":return Cr.stop()}},lr)}));return function(wr){return xr.apply(this,arguments)}}(),jr=function(){var lr;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(we.a,{value:Ie.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ie.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ie==null||((lr=Ie.standard_answer)===null||lr===void 0)?void 0:lr.map(function(wr,Er){return t.a.createElement(r.a,{key:Er,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",wr.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},wr.answer_text.map(function(Cr,Ur){return t.a.createElement(A.a,{span:24,key:Ur},t.a.createElement(T.a,{key:Er,checked:Ie.standard_answer.includes(Er),disabled:!0,value:Cr}))}))))})),t.a.createElement("div",{className:he.a.action},!Ie.hideAction&&On.map(function(wr,Er){return wr.id==="up"&&Ie.key===1||wr.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:Er,placement:"bottom",title:wr.name},t.a.createElement("span",{onClick:function(){return Ir(wr)},className:wr.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&&jr(),kn&&rr())},be=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pe)),ne=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],fe=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.editKey,hr=Ge.setEditKey,mr=hr===void 0?function(){}:hr,q=Ge.cancelAdd,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(){}:se,Le=Ge.setIsClaer,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),Lt=Object(i.useState)(),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)([]),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(""),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useRef)(!1),Ut=function(Je){Kn([].concat(Object(j.a)(Ln),[Object(g.a)({},Je)]))},zt=Object(w.i)();Object(i.useEffect)(function(){if(dn.current)return;if(!(Ce!=null&&Ce.question_choices)){Ft(!0),fn(""),Jn(2),Mt("");return}qn(!(Ce!=null&&Ce.repeat_answer)),fn(Ce==null?void 0:Ce.question_title),Jn(Ce==null?void 0:Ce.question_score),wn(Ce==null?void 0:Ce.difficulty),Mt(Ce.standard_answer[0]+""),Un(Ce.tag_discipline_ids),Dn(Ce==null?void 0:Ce.analysis)},[Ce,qt]),Object(i.useEffect)(function(){qt&<();function lt(){return Je.apply(this,arguments)}function Je(){return Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(I.I)({sub_discipline_id:(ze=ve.editData)===null||ze===void 0||((pt=ze.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id});case 2:rt=Nt.sent,Kn(rt.tag_disciplines);case 4:case"end":return Nt.stop()}},nt)})),Je.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:jt,isEdit:qt}}),Object(i.useEffect)(function(){var lt,Je=ve!=null&&(lt=ve.tagDisciplineData)!==null&<!==void 0&<.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Kn(Je)},[ve.tagDisciplineData]);var Vt=function(Je){(Je==null?void 0:Je.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),mr(-1),dn.current=!1,X())},jt=function(){var lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt,rt,Tt,Nt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(Hn){Kt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Kt.abrupt("return",!1);case 3:if(Et){Kt.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Kt.abrupt("return",!1);case 6:if(nt=[{choice_text:"\u6B63\u786E",is_answer:Et==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Et==="2"?2:0}],dn.current=!0,!Ce.question_id){Kt.next=19;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Kt.next=13;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Qt){return Qt.choice_text}),standard_answers:nt.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Mn}});case 2:ze=tr.sent,Vt(ze);case 4:case"end":return tr.stop()}},En)}));function It(){return Rt.apply(this,arguments)}return It}(),onCancel:function(){var Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Qt){return Qt.choice_text}),standard_answers:nt.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 2:ze=tr.sent,Vt(ze);case 4:case"end":return tr.stop()}},En)}));function It(){return Rt.apply(this,arguments)}return It}()}),Kt.next=17;break;case 13:return Kt.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(pt=ve.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 15:ze=Kt.sent,Vt(ze);case 17:Kt.next=23;break;case 19:return Kt.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:zt.categoryId,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(Tt=ve.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 21:ze=Kt.sent,Vt(ze);case 23:return Kt.abrupt("return",{name:Hn,choices:nt});case 24:case"end":return Kt.stop()}},Je)}));return function(){return lt.apply(this,arguments)}}(),nn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(lt){var Je,nt;return(ve==null||((Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0))?void 0:nt.exercise_status)===1?lt:lt.id!=="del"&<.id!=="add"}),bn=function(){var lt=Object(te.a)(s.a.mark(function Je(nt){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(!(cn!==-1)){pt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),pt.abrupt("return");case 3:pt.t0=nt.id,pt.next=pt.t0==="del"?6:pt.t0==="up"||pt.t0==="down"?8:pt.t0==="edit"?12:pt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Tt(){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},zt)});case 3:case"end":return St.stop()}},Tt)}))()}}),pt.abrupt("break",17);case 8:return pt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:nt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},zt)}),pt.abrupt("break",17);case 12:return mr(Ce.dragKey),Ft(!0),pt.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:2}),pt.abrupt("break",17);case 17:case"end":return pt.stop()}},Je)}));return function(nt){return lt.apply(this,arguments)}}(),gn=function(){var Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Je=Ce.question_choices)===null||Je===void 0)?void 0:Je.map(function(nt,ze){return t.a.createElement(h.a,{key:ze,checked:Ce.standard_answer.includes(ze+1),disabled:!0},ne[ze],"."," ",t.a.createElement("span",{className:"c-black font14"},nt.choice_text))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&nn.map(function(nt,ze){return nt.id==="up"&&Ce.key===1||nt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:ze,placement:"bottom",title:nt.name},t.a.createElement("span",{onClick:function(){return bn(nt)},className:nt.icon}))})))},bt=function(){var Je,nt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(pt){return fn(pt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:Et,onChange:function(pt){return Mt(pt.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:he.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mn,onChange:function(pt){return Dn(pt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(pt){Jn(pt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(pt){wn(pt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:un,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Un,subId:(Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Ut})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Vn,onChange:function(pt){qn(pt)}}))),t.a.createElement("aside",{className:"tr"},(cn!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){O(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){jt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!qt&&gn(),qt&&bt())},_e=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(fe)),ke=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],qe=Object(i.forwardRef)(function(mt,Ge){var Ot=mt.problemset,Me=mt.globalSetting,ye=mt.exercise,ve=mt.loading,or=mt.dispatch,en=mt.onRef,Ie=en===void 0?function(){}:en,gt=mt.editData,Ce=mt.cancelAdd,cn=Ce===void 0?function(){}:Ce,hr=mt.editKey,mr=mt.setEditKey,q=mr===void 0?function(){}:mr,O=mt.setIsClaer,M=O===void 0?function(){}:O,X=mt.addCallback,se=X===void 0?function(Nt){}:X,Z=mt.reload,Le=Z===void 0?function(){}:Z,ot=Object(W.a)(mt,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),wt=Object(i.useState)([]),Lt=Object(a.a)(wt,2),ct=Lt[0],Et=Lt[1],Mt=Object(i.useState)(),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)([]),Wt=Object(a.a)(fn,2),sn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(""),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)(),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(!1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)([]),rn=Object(a.a)(Kn,2),_n=rn[0],In=rn[1],wn=Object(i.useState)(1),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)(!1),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useState)(""),dn=Object(a.a)(Dn,2),Ut=dn[0],zt=dn[1],Vt=Object(i.useState)([]),jt=Object(a.a)(Vt,2),nn=jt[0],bn=jt[1],gn=Object(i.useRef)(!1),bt=function(St){bn([].concat(Object(j.a)(nn),[Object(g.a)({},St)]))},lt=Object(w.i)();Object(i.useEffect)(function(){Et(["","","",""])},[]),Object(i.useEffect)(function(){if(gn.current)return;if(!(gt!=null&>.question_choices)){Ln(!0),xn(""),un(5),Et(["","","",""]),qt([]);return}xn(gt==null?void 0:gt.question_title),un(gt==null?void 0:gt.question_score),Mn(!(gt!=null&>.repeat_answer)),Vn(gt==null?void 0:gt.difficulty),Et(gt==null?void 0:gt.question_choices.map(function(St){return St.choice_text}));var Nt=[];gt==null||gt.standard_answer.map(function(St,Kt){Nt.push(St-1)}),qt(Nt),In(gt.tag_discipline_ids),zt(gt==null?void 0:gt.analysis)},[gt,nr]),Object(i.useEffect)(function(){nr&&Nt();function Nt(){return St.apply(this,arguments)}function St(){return St=Object(te.a)(s.a.mark(function Kt(){var Rt,It,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return gr.next=2,Object(I.I)({sub_discipline_id:(Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0)?void 0:It.sub_discipline_id});case 2:En=gr.sent,bn(En.tag_disciplines);case 4:case"end":return gr.stop()}},Kt)})),St.apply(this,arguments)}},[nr]),Object(i.useImperativeHandle)(Ge,function(){return{onSave:nt,isEdit:nr}}),Object(i.useEffect)(function(){var Nt,St=ye!=null&&(Nt=ye.tagDisciplineData)!==null&&Nt!==void 0&&Nt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];bn(St)},[ye.tagDisciplineData]);var Je=function(St){(St==null?void 0:St.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ln(!1),q(-1),gn.current=!1,Le())},nt=function(){var Nt=Object(te.a)(s.a.mark(function St(){var Kt,Rt,It,En,on,gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(Bn){Qt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Qt.abrupt("return",!1);case 3:if(Kt=ct.findIndex(function(Rn){return!Rn}),!(Kt>-1)){Qt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ke[Kt]," \u9009\u9879\u7684\u5185\u5BB9")),Qt.abrupt("return",!1);case 7:if(sn.length){Qt.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"),Qt.abrupt("return",!1);case 10:if(!(sn.length<1)){Qt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Qt.abrupt("return",!1);case 13:if(Rt=ct.map(function(Rn,zn){return{choice_text:Rn,is_answer:sn.includes(zn)?zn+1:0}}),gn.current=!0,!gt.question_id){Qt.next=26;break}if(!((gt==null?void 0:gt.is_my)===1)){Qt.next=20;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,is_cover:1,repeat_answer:!Pn,analysis:Ut}});case 2:It=xr.sent,Je(It);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}(),onCancel:function(){var Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 2:It=xr.sent,Je(It);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}()}),Qt.next=24;break;case 20:return Qt.next=22,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 22:It=Qt.sent,Je(It);case 24:Qt.next=30;break;case 26:return Qt.next=28,or({type:"exercise/addExerciseQuestion",payload:{insert_id:gt==null?void 0:gt.insert_id,categoryId:lt.categoryId,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 28:It=Qt.sent,Je(It);case 30:case"end":return Qt.stop()}},St)}));return function(){return Nt.apply(this,arguments)}}(),ze=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Nt){var St,Kt;return(ye==null||((St=ye.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0))?void 0:Kt.exercise_status)===1?Nt:Nt.id!=="del"&&Nt.id!=="add"}),pt=function(){var Nt=Object(te.a)(s.a.mark(function St(Kt){return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(!(hr!==-1)){It.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),It.abrupt("return");case 3:It.t0=Kt.id,It.next=It.t0==="del"?6:It.t0==="up"||It.t0==="down"?8:It.t0==="edit"?12:It.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function on(){return s.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return er.next=2,Object(I.n)({id:gt.question_id});case 2:or({type:"exercise/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return er.stop()}},on)}))()}}),It.abrupt("break",17);case 8:return It.next=10,or({type:"exercise/exeriseMoveUpDown",payload:{id:gt.question_id,opr:Kt.id}});case 10:return or({type:"exercise/editExercise",payload:Object(g.a)({},lt)}),It.abrupt("break",17);case 12:return q(gt.dragKey),Ln(!0),It.abrupt("break",17);case 15:return se({key:gt.key,insert_id:gt==null?void 0:gt.question_id,question_type:1}),It.abrupt("break",17);case 17:case"end":return It.stop()}},St)}));return function(Kt){return Nt.apply(this,arguments)}}(),rt=function(){var St;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(gt!=null&>.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},gt.key,"\u3001\u591A\u9009\u9898"),"\uFF08",gt.question_score,"\u5206\uFF09")),gt!=null&>.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},gt.key,"."),t.a.createElement(we.a,{value:gt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",gt.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:gt.question_title})),t.a.createElement("div",{className:he.a.questionChoices},gt==null||((St=gt.question_choices)===null||St===void 0)?void 0:St.map(function(Kt,Rt){return t.a.createElement(r.a,{key:Rt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:Rt,checked:gt.standard_answer.includes(Rt+1),disabled:!0},ke[Rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:Kt.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!gt.hideAction&&ze.map(function(Kt,Rt){return Kt.id==="up"&>.key===1||Kt.id==="down"&>.key===gt.len?null:t.a.createElement(o.a,{key:Rt,placement:"bottom",title:Kt.name},t.a.createElement("span",{onClick:function(){return pt(Kt)},className:Kt.icon}))})))},Tt=function(){var St,Kt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Bn,onChange:function(It){return xn(It)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ct.map(function(Rt,It){var En,on;return t.a.createElement("div",{className:he.a.choiceWrap,key:It},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(sn.includes(It)?he.a.activeAnswer:""),onClick:function(){sn.includes(It)?qt(sn.filter(function(er){return er!==It})):qt([].concat(Object(j.a)(sn),[It]))}},ke[It])),t.a.createElement("div",{className:he.a.editorWrap},Yn===It?t.a.createElement(v.a,{id:"single-question-option-".concat(It),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rt,onChange:function(er){ct[It]=er,Et(ct)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Hn(It)}},t.a.createElement(we.a,{value:Rt}))),((En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,It>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Et(ct.filter(function(er,tr){return tr!==It}))}})),It<7&&It===ct.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Et([].concat(Object(j.a)(ct),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ut,onChange:function(It){return zt(It)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Sn,max:1e4,min:0,onChange:function(It){un(It)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:yn,onChange:function(It){Vn(It.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:_n,selectvalues:gt==null?void 0:gt.tag_discipline_ids,onChange:In,subId:(St=ye.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0)?void 0:Kt.sub_discipline_id,knowledgeOptions:nn,onAddKnowledgeFinish:bt})),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(E.a,{checked:Pn,onChange:function(It){Mn(It)}}))),t.a.createElement("aside",{className:"tr"},(hr!==-1||gt.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){cn(),Ln(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){nt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!nr&&rt(),nr&&Tt())}),je=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(qe),st=U("55Ip"),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"],Re=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.editData,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.editKey,hr=Ge.setEditKey,mr=hr===void 0?function(){}:hr,q=Ge.addCallback,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(""),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(""),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)([]),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(""),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(!1),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useState)([]),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),dn=Dn[0],Ut=Dn[1],zt=Object(w.i)(),Vt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Je;if(Vt.current)return;Ie.edit&&(Pn(!0),Yn(""),ct(""),yn([])),ct(Ie.shixun_name),Yn(Ie.question_title);var nt=[];(Je=Ie.shixun)===null||Je===void 0||Je.map(function(ze){nt.push(ze.challenge_score)}),yn(nt)},[Ie]),Object(i.useEffect)(function(){_n(!1)},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:nn,isEdit:kn}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),mr(-1),Vt.current=!1,X())},nn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(ze=[],pt=!1,!pt){Nt.next=4;break}return Nt.abrupt("return",!1);case 4:if(Vt.current=!0,Ut(!0),!Ie.question_id){Nt.next=12;break}return Nt.next=9,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Cn,shixun_name:Lt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn}});case 9:rt=Nt.sent,Nt.next=15;break;case 12:return Nt.next=14,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:zt.categoryId,question_title:Cn,shixun_name:Lt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn,is_copy:Ie.is_copy}});case 14:rt=Nt.sent;case 15:return jt(rt),Ut(!1),Nt.abrupt("return",{name:Cn,analysis:Wt,standard_answers:ze,is_ordered:Xn});case 18:case"end":return Nt.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=function(){var nt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:Lt,onChange:function(pt){ct(pt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Cn,onChange:function(pt){Yn(pt)}})),t.a.createElement("div",{className:"mt20"},(nt=Ie.shixun)===null||nt===void 0?void 0:nt.map(function(ze,pt){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},pt+1,".",ze.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Zn[pt],onChange:function(Tt){Zn[pt]=Tt,yn(Zn),console.log("srore:L",Zn[pt])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Qn.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:Xn,onChange:function(pt){return nr(pt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(cn!==-1||!(Ie!=null&&Ie.edit))&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{loading:dn,className:"ml20",type:"primary",onClick:function(){nn()}},"\u4FDD\u5B58")))},gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Je){var nt,ze;return(ve==null||((nt=ve.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0))?void 0:ze.exercise_status)===1?Je:Je.id!=="del"&&Je.id!=="add"}),bt=function(){var Je=Object(te.a)(s.a.mark(function nt(ze){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(cn!==-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=ze.id,rt.next=rt.t0==="del"?6:rt.t0==="up"||rt.t0==="down"?8:rt.t0==="edit"?12:rt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(I.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},zt)});case 3:case"end":return Kt.stop()}},Nt)}))()}}),rt.abrupt("break",17);case 8:return rt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:ze.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},zt)}),rt.abrupt("break",17);case 12:return mr(Ie.dragKey),Pn(!0),rt.abrupt("break",17);case 15:return en({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:5}}}),rt.abrupt("break",17);case 17:case"end":return rt.stop()}},nt)}));return function(ze){return Je.apply(this,arguments)}}(),lt=function(){var nt,ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(we.a,{value:Ie.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09"),!!((nt=Ie.schools)!==null&&nt!==void 0&&nt.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ie.shixun_name})),t.a.createElement("div",{className:"mt30"}),(ze=Ie.shixun)===null||ze===void 0?void 0:ze.map(function(pt,rt){return t.a.createElement("div",{key:rt},"\u7B2C",rt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},pt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},pt.challenge_score," \u5206"))}),t.a.createElement("div",{className:he.a.action},t.a.createElement(st.a,{target:"_blank",to:"/shixuns/".concat(Ie.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ie.hideAction&&gn.map(function(pt,rt){return pt.id==="up"&&Ie.key===1||pt.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:rt,placement:"bottom",title:pt.name},t.a.createElement("span",{onClick:function(){return bt(pt)},className:pt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&<(),kn&&bn())},Be=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Re)),Ye=["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(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.setIsClaer,X=M===void 0?function(){}:M,se=Ge.reload,Z=se===void 0?function(){}:se,Le=Ge.addCallback,ot=Le===void 0?function(Kt){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(""),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(!1),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useState)(""),Ut=Object(a.a)(dn,2),zt=Ut[0],Vt=Ut[1],jt=Object(w.i)(),nn=Object(i.useRef)(null),bn=Object(i.useRef)(!1),gn=Object(i.useState)([]),bt=Object(a.a)(gn,2),lt=bt[0],Je=bt[1],nt=function(Rt){Je([].concat(Object(j.a)(lt),[Object(g.a)({},Rt)]))};Object(i.useEffect)(function(){Mt(["","","",""])},[]),Object(i.useEffect)(function(){if(bn.current)return;if(!(Ce!=null&&Ce.question_choices)){wn(!0),Jn(""),Un(5),Mt(["","","",""]),Ft([]);return}Jn(Ce==null?void 0:Ce.question_title),Un(Ce==null?void 0:Ce.question_score),Dn(!(Ce!=null&&Ce.repeat_answer)),Vt(Ce==null?void 0:Ce.analysis),qn(Ce==null?void 0:Ce.difficulty),Mt(Ce==null?void 0:Ce.question_choices.map(function(Rt){return Rt.choice_text}));var Kt=[];Ce==null||Ce.standard_answer.map(function(Rt,It){Kt.push(Rt-1)}),Kn(Ce.tag_discipline_ids),Ft(Kt)},[Ce,In]),Object(i.useEffect)(function(){In&&Kt();function Kt(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(te.a)(s.a.mark(function It(){var En,on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(I.I)({sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id});case 2:gr=tr.sent,Je(gr.tag_disciplines);case 4:case"end":return tr.stop()}},It)})),Rt.apply(this,arguments)}},[In]),Object(i.useEffect)(function(){var Kt,Rt=ye!=null&&(Kt=ye.tagDisciplineData)!==null&&Kt!==void 0&&Kt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Je(Rt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:pt,isEdit:In}});var ze=function(Rt){(Rt==null?void 0:Rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),O(-1),bn.current=!1,Z())},pt=function(){var Kt=Object(te.a)(s.a.mark(function Rt(){var It,En,on,gr,er,tr,Qt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(xn){zn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),zn.abrupt("return",!1);case 3:if(It=Et.findIndex(function(rr){return!rr}),!(It>-1)){zn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ye[It]," \u9009\u9879\u7684\u5185\u5BB9")),zn.abrupt("return",!1);case 7:if(qt.length){zn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),zn.abrupt("return",!1);case 10:if(!(qt.length<1)){zn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),zn.abrupt("return",!1);case 13:if(En=Et.map(function(rr,On){return{choice_text:rr,is_answer:qt.includes(On)?On+1:0}}),bn.current=!0,!Ce.question_id){zn.next=26;break}if(!((Ce==null?void 0:Ce.is_my)===1)){zn.next=20;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,is_cover:1,repeat_answer:!Mn,analysis:zt}});case 2:on=wr.sent,ze(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}(),onCancel:function(){var rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 2:on=wr.sent,ze(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}()}),zn.next=24;break;case 20:return zn.next=22,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 22:on=zn.sent,ze(on);case 24:zn.next=30;break;case 26:return zn.next=28,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:jt.categoryId,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(tr=ye.editData)===null||tr===void 0||((Qt=tr.exercise)===null||Qt===void 0)?void 0:Qt.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 28:on=zn.sent,ze(on);case 30:case"end":return zn.stop()}},Rt)}));return function(){return Kt.apply(this,arguments)}}(),rt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Kt){var Rt,It;return(ye==null||((Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0))?void 0:It.exercise_status)===1?Kt:Kt.id!=="del"&&Kt.id!=="add"}),Tt=function(){var Kt=Object(te.a)(s.a.mark(function Rt(It){return s.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(mr!==-1)){on.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),on.abrupt("return");case 3:on.t0=It.id,on.next=on.t0==="del"?6:on.t0==="up"||on.t0==="down"?8:on.t0==="edit"?12:on.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function er(){return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},jt)});case 3:case"end":return Qt.stop()}},er)}))()}}),on.abrupt("break",17);case 8:return on.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:It.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},jt)}),on.abrupt("break",17);case 12:return O(Ce.dragKey),wn(!0),on.abrupt("break",17);case 15:return ot({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),on.abrupt("break",17);case 17:case"end":return on.stop()}},Rt)}));return function(It){return Kt.apply(this,arguments)}}(),Nt=function(){var Rt;return t.a.createElement("aside",{ref:nn},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Rt=Ce.question_choices)===null||Rt===void 0)?void 0:Rt.map(function(It,En){return t.a.createElement(r.a,{key:En},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:En,checked:Ce.standard_answer.includes(En+1),disabled:!0},Ye[En],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:It.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&rt.map(function(It,En){return It.id==="up"&&Ce.key===1||It.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:En,placement:"bottom",title:It.name},t.a.createElement("span",{onClick:function(){return Tt(It)},className:It.icon}))})))},St=function(){var Rt,It;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xn,onChange:function(on){return Jn(on)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Et.map(function(En,on){var gr,er;return t.a.createElement("div",{className:he.a.choiceWrap,key:on},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qt.includes(on)?he.a.activeAnswer:""),onClick:function(){qt.includes(on)?Ft(qt.filter(function(Qt){return Qt!==on})):Ft([].concat(Object(j.a)(qt),[on]))}},Ye[on])),t.a.createElement("div",{className:he.a.editorWrap},Hn===on?t.a.createElement(v.a,{id:"single-question-option-".concat(on),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:En,onChange:function(Qt){Et[on]=Qt,Mt(Et)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return fn(on)}},t.a.createElement(we.a,{value:En}))),((gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,on>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Mt(Et.filter(function(Qt,Rn){return Rn!==on}))}})),on<7&&on===Et.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Mt([].concat(Object(j.a)(Et),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:zt,onChange:function(on){return Vt(on)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(on){Un(on)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Vn,onChange:function(on){qn(on.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:Ln,onChange:Kn,subId:(Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0)?void 0:It.sub_discipline_id,knowledgeOptions:lt,onAddKnowledgeFinish:nt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Mn,onChange:function(on){Dn(on)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){pt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!In&&Nt(),In&&St())},yt=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ke)),Pt=U("Z9P2"),Ht=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Xt=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(){}:se,Le=Ge.setIsClaer,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),Lt=Object(i.useState)(""),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(""),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([[],[]]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useRef)(!1),Ut=Object(w.i)(),zt=Object(i.useState)([]),Vt=Object(a.a)(zt,2),jt=Vt[0],nn=Vt[1],bn=function(rt){nn([].concat(Object(j.a)(jt),[Object(g.a)({},rt)]))};Object(i.useEffect)(function(){var pt;if(dn.current)return;if(!(Ce!=null&&Ce.question_title)){Un(!0),Mt(""),Ft(""),Jn(10);return}qn(!(Ce!=null&&Ce.repeat_answer)),Mt(Ce==null?void 0:Ce.question_title),Ft(Ce==null||((pt=Ce.standard_answer)===null||pt===void 0)?void 0:pt[0]),Jn(Ce==null?void 0:Ce.question_score),Kn(Ce.tag_discipline_ids),wn(Ce==null?void 0:Ce.difficulty),fn(Ce==null?void 0:Ce.analysis),Dn([Ce==null?void 0:Ce.normal_keywords,Ce==null?void 0:Ce.main_keywords])},[Me.editData,un]),Object(i.useEffect)(function(){var pt,rt=ye!=null&&(pt=ye.tagDisciplineData)!==null&&pt!==void 0&&pt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];nn(rt)},[ye.tagDisciplineData]),Object(i.useEffect)(function(){un&&pt();function pt(){return rt.apply(this,arguments)}function rt(){return rt=Object(te.a)(s.a.mark(function Tt(){var Nt,St,Kt;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(I.I)({sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id});case 2:Kt=It.sent,nn(Kt.tag_disciplines);case 4:case"end":return It.stop()}},Tt)})),rt.apply(this,arguments)}},[un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:bt,isEdit:un}});var gn=function(rt){(rt==null?void 0:rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),O(-1),dn.current=!1,X())},bt=function(){var pt=Object(te.a)(s.a.mark(function rt(){var Tt,Nt,St,Kt,Rt,It,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(Et){gr.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),gr.abrupt("return",!1);case 3:if(Tt=Mn[0],Nt=Mn[1],dn.current=!0,!Ce.question_id){gr.next=17;break}if(!((Ce==null?void 0:Ce.is_my)===1)){gr.next=11;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var er=Object(te.a)(s.a.mark(function Qt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Qt)}));function tr(){return er.apply(this,arguments)}return tr}(),onCancel:function(){var er=Object(te.a)(s.a.mark(function Qt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Qt)}));function tr(){return er.apply(this,arguments)}return tr}()}),gr.next=15;break;case 11:return gr.next=13,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Kt=ye.editData)===null||Kt===void 0||((Rt=Kt.exercise)===null||Rt===void 0)?void 0:Rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 13:St=gr.sent,gn(St);case 15:gr.next=21;break;case 17:return gr.next=19,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Ut.categoryId,exercise_bank_id:Ut.categoryId,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(It=ye.editData)===null||It===void 0||((En=It.exercise)===null||En===void 0)?void 0:En.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 19:St=gr.sent,gn(St);case 21:return gr.abrupt("return",{name:Et,answer_texts:[qt],analysis:Hn,normal_keywords:Tt,main_keywords:Nt});case 22:case"end":return gr.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),lt=function(){var rt,Tt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Et,onChange:function(St){return Mt(St)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qt,onChange:function(St){return Ft(St)}}),t.a.createElement(Pt.a,{value:Mn,onChange:Dn}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Hn,onChange:function(St){return fn(St)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(St){Jn(St)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(St){wn(St.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Ln,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Kn,subId:(rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,knowledgeOptions:jt,onAddKnowledgeFinish:bn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Vn,onChange:function(St){qn(St)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){bt()}},"\u4FDD\u5B58")))},Je=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(pt){var rt,Tt;return(ye==null||((rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0))?void 0:Tt.exercise_status)===1?pt:pt.id!=="del"&&pt.id!=="add"}),nt=function(){var pt=Object(te.a)(s.a.mark(function rt(Tt){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!(mr!==-1)){St.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),St.abrupt("return");case 3:St.t0=Tt.id,St.next=St.t0==="del"?6:St.t0==="up"||St.t0==="down"?8:St.t0==="edit"?12:St.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Rt(){return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return En.stop()}},Rt)}))()}}),St.abrupt("break",17);case 8:return St.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Tt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)}),St.abrupt("break",17);case 12:return O(Ce.dragKey),Un(!0),St.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:4}),St.abrupt("break",17);case 17:case"end":return St.stop()}},rt)}));return function(Tt){return pt.apply(this,arguments)}}(),ze=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(we.a,{value:qt||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&Je.map(function(rt,Tt){return rt.id==="up"&&Ce.key===1||rt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:Tt,placement:"bottom",title:rt.name},t.a.createElement("span",{onClick:function(){return nt(rt)},className:rt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!un&&ze(),un&<())},an=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Xt)),tn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],et=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.addCallback,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),ot=Object(i.useState)([]),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(5),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(w.g)(),Kn=Object(w.i)();Object(i.useEffect)(function(){ct(["","","",""])},[]),Object(i.useEffect)(function(){if(!(Ce!=null&&Ce.question_choices)){nr(!0),Bn(""),Sn(5),ct(["","","",""]),sn([]);return}Bn(Ce==null?void 0:Ce.question_title),Sn(Ce==null?void 0:Ce.question_score),ct(Ce==null?void 0:Ce.question_choices.map(function(Vn){return Vn.choice_text}));var yn=[];Ce==null||Ce.standard_answer.map(function(Vn,qn){yn.push(Vn-1)}),sn(yn)},[Ce]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:rn,isEdit:Xn}});var rn=function(){var yn=Object(te.a)(s.a.mark(function Vn(){var qn,kn,Pn;return s.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(Qn){Dn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Dn.abrupt("return",!1);case 3:if(qn=Lt.findIndex(function(dn){return!dn}),!(qn>-1)){Dn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tn[qn]," \u9009\u9879\u7684\u5185\u5BB9")),Dn.abrupt("return",!1);case 7:if(Wt.length){Dn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Dn.abrupt("return",!1);case 10:if(!(Wt.length<1)){Dn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Dn.abrupt("return",!1);case 13:if(kn=Lt.map(function(dn,Ut){return{choice_text:dn,is_answer:Wt.includes(Ut)?Ut+1:0}}),!Ce.question_id){Dn.next=20;break}return Dn.next=17,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Qn,question_type:1,question_score:pn,question_choices:kn.map(function(dn){return dn.choice_text}),standard_answers:kn.filter(function(dn){return dn.is_answer}).map(function(dn){return dn.is_answer})}});case 17:Pn=Dn.sent,Dn.next=23;break;case 20:return Dn.next=22,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Kn.categoryId,question_title:Qn,question_type:1,question_score:"5.0",question_choices:kn.map(function(dn){return dn.choice_text}),standard_answers:kn.filter(function(dn){return dn.is_answer}).map(function(dn){return dn.is_answer})}});case 22:Pn=Dn.sent;case 23:Pn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),nr(!1),en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}));case 24:case"end":return Dn.stop()}},Vn)}));return function(){return yn.apply(this,arguments)}}(),_n=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(yn){var Vn,qn;return(ye==null||((Vn=ye.editData)===null||Vn===void 0||((qn=Vn.exercise)===null||qn===void 0))?void 0:qn.exercise_status)===1?yn:yn.id!=="del"&&yn.id!=="add"}),In=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!(mr!==-1)){Pn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Pn.abrupt("return");case 3:Pn.t0=qn.id,Pn.next=Pn.t0==="del"?6:Pn.t0==="up"||Pn.t0==="down"?8:Pn.t0==="edit"?12:Pn.t0==="add"?14:16;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Dn(){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)});case 3:case"end":return Ut.stop()}},Dn)}))()}}),Pn.abrupt("break",16);case 8:return Pn.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:qn.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}),Pn.abrupt("break",16);case 12:return Ln.push("/problems/".concat(Ce==null?void 0:Ce.hack_identifier,"/edit?type=exercises&express_id=").concat(Kn.categoryId,"&question_id=").concat(Ce==null?void 0:Ce.question_id,"&score=").concat(Ce==null?void 0:Ce.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Pn.abrupt("break",16);case 14:return X({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:6}),Pn.abrupt("break",16);case 16:case"end":return Pn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),wn=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){var kn;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return qn.preventDefault(),Mn.next=3,Object(I.Y)({id:Ce==null?void 0:Ce.hack_identifier});case 3:kn=Mn.sent,kn.status===0&&Object(ie.S)("/myproblems/".concat(kn==null?void 0:kn.identifier));case 5:case"end":return Mn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),Zn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement(we.a,{value:Ce.description||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&_n.map(function(Vn,qn){return Vn.id==="up"&&Ce.key===1||Vn.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:qn,placement:"bottom",title:Vn.name},t.a.createElement("span",{onClick:function(){return In(Vn)},className:Vn.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},Zn())},Ze=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(et)),Ct=U("LvDl"),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],dt=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.setIsClaer,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(bt){}:se,Le=Ge.reload,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(!1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!0),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(w.i)(),_n=Object(i.useRef)(null),In=Object(i.useState)(""),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useRef)(!1),Dn=function(lt){Kn([].concat(Object(j.a)(Ln),[Object(g.a)({},lt)]))};Object(i.useEffect)(function(){var bt;if(Mn.current)return;if(!(Ce!=null&&Ce.question_title)){fn(!0),yn("");return}yn(Ce==null?void 0:Ce.question_title),Un(!(Ce!=null&&Ce.repeat_answer)),Jn(Ce==null?void 0:Ce.difficulty),Mt(Ce.tag_discipline_ids);var lt=Ce==null||((bt=Ce.sub_exercise_questions)===null||bt===void 0)?void 0:bt.map(function(Je){var nt,ze,pt;return Object(g.a)(Object(g.a)({},Je),{},{id:Je.question_id,name:Je.question_title,open:!1,score:Je.question_score,qusList:Je==null||((nt=Je.question_choices)===null||nt===void 0)?void 0:nt.map(function(rt){return rt.choice_text}),activeQusEditor:null,qusAnswer:(ze=[Je==null||((pt=Je.question_choices)===null||pt===void 0)?void 0:pt.findIndex(function(rt){return rt.standard_boolean})])===null||ze===void 0?void 0:ze.filter(function(rt){return rt!==-1})})});Pn(lt)},[Ce,Hn]),Object(i.useEffect)(function(){Hn&&bt();function bt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(nt=ye.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id});case 2:pt=Tt.sent,Kn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Hn]),Object(i.useEffect)(function(){var bt,lt=ye!=null&&(bt=ye.tagDisciplineData)!==null&&bt!==void 0&&bt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Kn(lt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ut,isEdit:Hn}});var dn=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),fn(!1),O(-1),Mn.current=!1,ot())},Ut=function(){var bt=Object(te.a)(s.a.mark(function lt(){var Je,nt,ze,pt,rt,Tt,Nt,St;return s.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(Zn){Rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Rt.abrupt("return",!1);case 3:if(!(kn.length===0)){Rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Rt.abrupt("return",!1);case 6:Je=0;case 7:if(!(Je<kn.length)){Rt.next=25;break}if(ze=kn[Je],ze!=null&&ze.name){Rt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898\u9898\u5E72")),Rt.abrupt("return",!1);case 12:if(ze!=null&&ze.score){Rt.next=15;break}return _.b.info("\u7B2C".concat(Je+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),Rt.abrupt("return",!1);case 15:if(pt=ze==null||((nt=ze.qusList)===null||nt===void 0)?void 0:nt.findIndex(function(It){return!It}),!(pt>-1)){Rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898").concat(At[pt],"\u9009\u9879\u7684\u5185\u5BB9")),Rt.abrupt("return",!1);case 19:if(ze!=null&&ze.qusAnswer.length){Rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Je+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Rt.abrupt("return",!1);case 22:Je++,Rt.next=7;break;case 25:if(rt=kn.map(function(It){var En;return{id:It.id>1?It.id:null,question_title:It.name,question_type:1,question_choices:It.qusList,question_score:It.score,standard_answers:[((En=It.qusAnswer)===null||En===void 0?void 0:En[0])+1]}}),Mn.current=!0,!Ce.question_id){Rt.next=36;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Rt.next=32;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var It=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,is_cover:1,repeat_answer:!un}});case 2:Tt=Qt.sent,dn(Tt);case 4:case"end":return Qt.stop()}},on)}));function En(){return It.apply(this,arguments)}return En}(),onCancel:function(){var It=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 2:Tt=Qt.sent,dn(Tt);case 4:case"end":return Qt.stop()}},on)}));function En(){return It.apply(this,arguments)}return En}()}),Rt.next=36;break;case 32:return Rt.next=34,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 34:Tt=Rt.sent,dn(Tt);case 36:case"end":return Rt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(bt){var lt,Je;return(ye==null||((lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0))?void 0:Je.exercise_status)===1?bt:bt.id!=="del"&&bt.id!=="add"}),Vt=function(){var bt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(!(mr!==-1)){ze.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ze.abrupt("return");case 3:ze.t0=Je.id,ze.next=ze.t0==="del"?6:ze.t0==="up"||ze.t0==="down"?8:ze.t0==="edit"?12:ze.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},rn)});case 3:case"end":return Nt.stop()}},rt)}))()}}),ze.abrupt("break",17);case 8:return ze.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Je.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},rn)}),ze.abrupt("break",17);case 12:return O(Ce.dragKey),fn(!0),ze.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),ze.abrupt("break",17);case 17:case"end":return ze.stop()}},lt)}));return function(Je){return bt.apply(this,arguments)}}(),jt=function(){var lt;return t.a.createElement("aside",{ref:_n},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",Ce==null?void 0:Ce.sub_q_count,"\u5C0F\u9898\uFF0C",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{style:{display:qt?"block":"none"},className:he.a.questionChoices},Ce==null||((lt=Ce.sub_exercise_questions)===null||lt===void 0)?void 0:lt.map(function(Je,nt){var ze;return t.a.createElement("div",{key:nt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,".",nt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(we.a,{value:Je.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Je.question_score,"\u5206\uFF09")),Je==null||((ze=Je.question_choices)===null||ze===void 0)?void 0:ze.map(function(pt,rt){return t.a.createElement(r.a,{key:rt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:rt,checked:Je.standard_answer.includes(rt+1),disabled:!0},At[rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:pt.choice_text}))))}))})),t.a.createElement("div",{className:he.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Ft(!qt)},style:{}},qt?"\u6536\u8D77":"\u5C55\u5F00"),!Ce.hideAction&&zt.map(function(Je,nt){return Je.id==="up"&&Ce.key===1||Je.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return Vt(Je)},className:Je.icon}))})))},nn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:he.a.wrap,style:{padding:0}},t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Zn,onChange:function(ze){return yn(ze)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",kn==null?void 0:kn.length),kn==null?void 0:kn.map(function(nt,ze){var pt;return t.a.createElement("div",{className:he.a.fold,key:nt.id},t.a.createElement("div",{onClick:function(){return gn("open",ze)},className:he.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",ze+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(Tt){Tt.stopPropagation(),gn("delete",ze)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:nt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt==null?void 0:nt.name,onChange:function(Tt){return gn("value",ze,Tt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),nt==null||((pt=nt.qusList)===null||pt===void 0)?void 0:pt.map(function(rt,Tt){var Nt,St;return t.a.createElement("div",{className:he.a.choiceWrap,key:Tt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(nt!=null&&(Nt=nt.qusAnswer)!==null&&Nt!==void 0&&Nt.includes(Tt)?he.a.activeAnswer:""),onClick:function(){return gn("answer",ze,Tt)}},At[Tt])),t.a.createElement("div",{className:he.a.editorWrap},(nt==null?void 0:nt.activeQusEditor)===Tt?t.a.createElement(v.a,{id:"single-question-option-".concat(Tt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:rt,onChange:function(Rt){return gn("details",ze,Rt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return gn("edit",ze,Tt)}},t.a.createElement(we.a,{value:rt}))),Tt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return gn("deleteQus",ze,Tt)}})),Tt<7&&Tt===(nt==null||((St=nt.qusList)===null||St===void 0)?void 0:St.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return gn("addQus",ze)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:nt.score,max:1e4,min:0,onChange:function(Tt){return gn("score",ze,Tt)}})," ","\u5206")))}),kn.length<20&&t.a.createElement(p.a,{type:"primary",onClick:bn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:xn,onChange:function(ze){Jn(ze.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:Et,onChange:Mt,subId:(lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Dn}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),fn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Ut()}},"\u4FDD\u5B58")))},bn=function(){var lt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Pn(kn.concat(lt))},gn=function(lt,Je,nt){var ze=Object(Ct.cloneDeep)(kn);if(lt==="open"&&(ze[Je].open=!ze[Je].open),lt==="delete"&&ze.splice(Je,1),lt==="value"&&(ze[Je].name=nt),lt==="answer"&&(ze[Je].qusAnswer=[nt]),lt==="edit"&&(ze[Je].activeQusEditor=nt),lt==="details"&&(ze[Je].qusList[ze[Je].activeQusEditor]=nt),lt==="addQus"&&(ze[Je].qusList=ze[Je].qusList.concat("")),lt==="deleteQus"){var pt;ze[Je].qusList=ze[Je].qusList.filter(function(rt,Tt){return Tt!==nt}),ze[Je].qusAnswer=(pt=ze[Je].qusAnswer)===null||pt===void 0?void 0:pt.filter(function(rt){return rt!==nt})}lt==="analysis"&&(ze[Je].analysis=nt),lt==="score"&&(ze[Je].score=nt),Pn(ze)};return t.a.createElement("section",{className:he.a.wrap},!Hn&&jt(),Hn&&nn())},ft=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(dt)),He=U("ngQI"),Ne=U("loLm"),Ue=U.n(Ne),ge=U("ErOA"),Ee=U("vCeJ"),De=U("Nog9"),ue=U.n(De),Fe=U("hQp1"),at=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],xt=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(Je){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(""),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(w.i)(),Pn=Object(i.useRef)(null),Mn=Object(i.useRef)(!1),Dn=Object(i.useState)([]),dn=Object(a.a)(Dn,2),Ut=dn[0],zt=dn[1],Vt=function(nt){zt([].concat(Object(j.a)(Ut),[Object(g.a)({},nt)]))};Object(i.useEffect)(function(){se(["","","",""])},[]),Object(i.useEffect)(function(){if(Mn.current)return;if(!(ve!=null&&ve.question_choices)){Un(!0),fn(""),Ft(5),se(["","","",""]),Mt([]);return}fn(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.question_score),wn(!(ve!=null&&ve.repeat_answer)),qn(ve==null?void 0:ve.analysis),Kn(ve==null?void 0:ve.difficulty),se(ve==null?void 0:ve.question_choices.map(function(nt){return nt.choice_text}));var Je=[];ve==null||ve.standard_answer.map(function(nt,ze){Je.push(nt-1)}),Jn(ve.tag_discipline_ids),Mt(Je)},[ve,un]),Object(i.useEffect)(function(){un&&Je();function Je(){return nt.apply(this,arguments)}function nt(){return nt=Object(te.a)(s.a.mark(function ze(){var pt,rt,Tt;return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(I.I)({sub_discipline_id:(pt=Me.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id});case 2:Tt=St.sent,zt(Tt.tag_disciplines);case 4:case"end":return St.stop()}},ze)})),nt.apply(this,arguments)}},[un]),Object(i.useEffect)(function(){var Je,nt=Me!=null&&(Je=Me.tagDisciplineData)!==null&&Je!==void 0&&Je.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];zt(nt)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:nn,isEdit:un}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),Ce(-1),Mn.current=!1,hr())},nn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt,Tt,Nt,St,Kt;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(Hn){It.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),It.abrupt("return",!1);case 3:if(ze=X.findIndex(function(En){return!En}),!(ze>-1)){It.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(at[ze]," \u9009\u9879\u7684\u5185\u5BB9")),It.abrupt("return",!1);case 7:if(Et.length){It.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"),It.abrupt("return",!1);case 10:if(!(Et.length<1)){It.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),It.abrupt("return",!1);case 13:if(pt=X.map(function(En,on){return{choice_text:En,is_answer:Et.includes(on)?1:0}}),Mn.current=!0,!ve.question_id){It.next=22;break}return It.next=18,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:kn.id,question_id:ve.question_id,name:Hn,item_type:Et.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(Tt=Me.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 18:rt=It.sent,jt(rt),It.next=26;break;case 22:return It.next=24,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:kn.id,name:Hn,item_type:Et.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(St=Me.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0)?void 0:Kt.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 24:rt=It.sent,jt(rt);case 26:case"end":return It.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],gn=function(){var Je=Object(te.a)(s.a.mark(function nt(ze){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(Ie!==-1)){rt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=ze.id,rt.next=rt.t0==="del"?6:rt.t0==="edit"?8:rt.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(Ee.g)({exam_id:kn.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},kn)});case 3:case"end":return Kt.stop()}},Nt)}))()}}),rt.abrupt("break",13);case 8:return Ce(ve.dragKey),Un(!0),rt.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),rt.abrupt("break",13);case 13:case"end":return rt.stop()}},nt)}));return function(ze){return Je.apply(this,arguments)}}(),bt=function(){var nt;return t.a.createElement("aside",{ref:Pn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((nt=ve.question_choices)===null||nt===void 0)?void 0:nt.map(function(ze,pt){return t.a.createElement(r.a,{key:pt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:pt,checked:ve.standard_answer.includes(pt+1),disabled:!0},at[pt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:ze.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&bn.map(function(ze,pt){return t.a.createElement(o.a,{key:pt,placement:"bottom",title:ze.name},t.a.createElement("span",{onClick:function(){return gn(ze)},className:ze.icon}))})))},lt=function(){var nt,ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(rt){return fn(rt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),X.map(function(pt,rt){return t.a.createElement("div",{className:ue.a.choiceWrap,key:rt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(Et.includes(rt)?ue.a.activeAnswer:""),onClick:function(){Et.includes(rt)?Mt(function(Nt){return Nt.filter(function(St){return St!==rt})}):Mt(function(Nt){return[].concat(Object(j.a)(Nt),[rt])})}},at[rt])),t.a.createElement("div",{className:ue.a.editorWrap},ot===rt?t.a.createElement(v.a,{id:"single-question-option-".concat(rt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:pt,onChange:function(Nt){X[rt]=Nt,se(X)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return wt(rt)}},t.a.createElement(we.a,{value:pt}))),t.a.createElement(t.a.Fragment,null,rt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return se(X.filter(function(Nt,St){return St!==rt}))}})),rt<7&&rt===X.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return se([].concat(Object(j.a)(X),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vn,onChange:function(rt){return qn(rt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:qt,max:1e4,min:0,onChange:function(rt){Ft(rt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Ln,onChange:function(rt){Kn(rt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:xn,onChange:Jn,subId:(nt=Me.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id,knowledgeOptions:Ut,onAddKnowledgeFinish:Vt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:In,onChange:function(rt){wn(rt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){nn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!un&&bt(),un&<())},Gt=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(xt)),$t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Yt=Object(i.forwardRef)(function(mt,Ge){var Ot=mt.newExercisePaper,Me=mt.dispatch,ye=mt.editData,ve=mt.cancelAdd,or=ve===void 0?function(){}:ve,en=mt.editKey,Ie=mt.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=mt.addCallback,cn=Ce===void 0?function(bt){}:Ce,hr=mt.reload,mr=hr===void 0?function(){}:hr,q=Object(i.useState)([]),O=Object(a.a)(q,2),M=O[0],X=O[1],se=Object(i.useState)(),Z=Object(a.a)(se,2),Le=Z[0],ot=Z[1],wt=Object(i.useState)([]),Lt=Object(a.a)(wt,2),ct=Lt[0],Et=Lt[1],Mt=Object(i.useState)(""),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)(),Wt=Object(a.a)(fn,2),sn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(!1),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)([]),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)(!1),rn=Object(a.a)(Kn,2),_n=rn[0],In=rn[1],wn=Object(i.useState)(""),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)([]),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useRef)(!1),dn=function(lt){Mn([].concat(Object(j.a)(Pn),[Object(g.a)({},lt)]))},Ut=Object(w.i)();Object(i.useEffect)(function(){X(["","","",""])},[]),Object(i.useEffect)(function(){if(Dn.current)return;if(!(ye!=null&&ye.question_choices)){xn(!0),Hn(""),qt(5),X(["","","",""]),Et([]);return}Hn(ye==null?void 0:ye.question_title),qt(ye==null?void 0:ye.question_score),In(!(ye!=null&&ye.repeat_answer)),Ln(ye==null?void 0:ye.difficulty),X(ye==null?void 0:ye.question_choices.map(function(lt){return lt.choice_text}));var bt=[];ye==null||ye.standard_answer.map(function(lt,Je){bt.push(lt-1)}),Et(bt),un(ye.tag_discipline_ids),Vn(ye==null?void 0:ye.analysis)},[ye,Bn]),Object(i.useEffect)(function(){Bn&&bt();function bt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(nt=Ot.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id});case 2:pt=Tt.sent,Mn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Bn]),Object(i.useImperativeHandle)(Ge,function(){return{onSave:Vt,isEdit:Bn}}),Object(i.useEffect)(function(){var bt,lt=Ot!=null&&(bt=Ot.tagDisciplineData)!==null&&bt!==void 0&&bt.tag_disciplines&&Array.isArray(Ot.tagDisciplineData.tag_disciplines)?Ot.tagDisciplineData.tag_disciplines:[];Mn(lt)},[Ot.tagDisciplineData]);var zt=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),gt(-1),Dn.current=!1,mr())},Vt=function(){var bt=Object(te.a)(s.a.mark(function lt(){var Je,nt,ze,pt,rt,Tt,Nt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(Yn){Kt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Kt.abrupt("return",!1);case 3:if(Je=M.findIndex(function(Rt){return!Rt}),!(Je>-1)){Kt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat($t[Je]," \u9009\u9879\u7684\u5185\u5BB9")),Kt.abrupt("return",!1);case 7:if(ct.length){Kt.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"),Kt.abrupt("return",!1);case 10:if(!(ct.length<1)){Kt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Kt.abrupt("return",!1);case 13:if(nt=M.map(function(Rt,It){return{choice_text:Rt,is_answer:ct.includes(It)?1:0}}),Dn.current=!0,!ye.question_id){Kt.next=22;break}return Kt.next=18,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Ut.id,question_id:ye.question_id,name:Yn,item_type:ct.length>1?Fe.a.Multiple:Fe.a.Single,question_score:sn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 18:ze=Kt.sent,zt(ze),Kt.next=26;break;case 22:return Kt.next=24,Me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ye==null?void 0:ye.insert_id,id:Ut.id,name:Yn,item_type:ct.length>1?Fe.a.Multiple:Fe.a.Single,question_score:sn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(Tt=Ot.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 24:ze=Kt.sent,zt(ze);case 26:case"end":return Kt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}(),jt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],nn=function(){var bt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(!(en!==-1)){ze.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ze.abrupt("return");case 3:ze.t0=Je.id,ze.next=ze.t0==="del"?6:ze.t0==="edit"?8:ze.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:Ut.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return Nt.stop()}},rt)}))()}}),ze.abrupt("break",13);case 8:return gt(ye.dragKey),xn(!0),ze.abrupt("break",13);case 11:return cn({key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:1}),ze.abrupt("break",13);case 13:case"end":return ze.stop()}},lt)}));return function(Je){return bt.apply(this,arguments)}}(),bn=function(){var lt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(we.a,{value:ye.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ye.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ye==null||((lt=ye.question_choices)===null||lt===void 0)?void 0:lt.map(function(Je,nt){return t.a.createElement(r.a,{key:nt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:nt,checked:ye.standard_answer.includes(nt+1),disabled:!0},$t[nt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:Je.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ye.hideAction&&jt.map(function(Je,nt){return t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return nn(Je)},className:Je.icon}))})))},gn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Yn,onChange:function(ze){return Hn(ze)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),M.map(function(nt,ze){var pt,rt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:ze},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(ct.includes(ze)?ue.a.activeAnswer:""),onClick:function(){ct.includes(ze)?Et(ct.filter(function(Nt){return Nt!==ze})):Et([].concat(Object(j.a)(ct),[ze]))}},$t[ze])),t.a.createElement("div",{className:ue.a.editorWrap},Le===ze?t.a.createElement(v.a,{id:"single-question-option-".concat(ze),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nt,onChange:function(Nt){M[ze]=Nt,X(M)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return ot(ze)}},t.a.createElement(we.a,{value:nt}))),((pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,ze>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return X(M.filter(function(Nt,St){return St!==ze}))}})),ze<7&&ze===M.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return X([].concat(Object(j.a)(M),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:yn,onChange:function(ze){return Vn(ze)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:sn,max:1e4,min:0,onChange:function(ze){qt(ze)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:nr,onChange:function(ze){Ln(ze.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Sn,selectvalues:ye==null?void 0:ye.tag_discipline_ids,onChange:un,subId:(lt=Ot.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:dn})),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(E.a,{checked:_n,onChange:function(ze){In(ze)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||ye.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){or(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Vt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Bn&&bn(),Bn&&gn())}),$n=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Yt),vn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ln=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.setEditKey,Ie=en===void 0?function(){}:en,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(!1),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(""),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=function(zt){Jn([].concat(Object(j.a)(xn),[Object(g.a)({},zt)]))},Vn=Object(w.i)();Object(i.useEffect)(function(){if(Zn.current)return;if(!(ve!=null&&ve.question_choices)){Mt(!0),wt(""),fn(2),se("");return}Kn(!(ve!=null&&ve.repeat_answer)),wt(ve==null?void 0:ve.question_title),fn(ve==null?void 0:ve.question_score),Un(ve==null?void 0:ve.difficulty),se(ve.standard_answer[0]+""),Ft(ve.tag_discipline_ids),wn(ve==null?void 0:ve.analysis)},[ve,Et]),Object(i.useEffect)(function(){Et&&Ut();function Ut(){return zt.apply(this,arguments)}function zt(){return zt=Object(te.a)(s.a.mark(function Vt(){var jt,nn,bn;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(I.I)({sub_discipline_id:(jt=Me.editData)===null||jt===void 0||((nn=jt.exercise)===null||nn===void 0)?void 0:nn.sub_discipline_id});case 2:bn=bt.sent,Jn(bn.tag_disciplines);case 4:case"end":return bt.stop()}},Vt)})),zt.apply(this,arguments)}},[Et]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:kn,isEdit:Et}}),Object(i.useEffect)(function(){var Ut,zt=Me!=null&&(Ut=Me.tagDisciplineData)!==null&&Ut!==void 0&&Ut.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(zt)},[Me.tagDisciplineData]);var qn=function(zt){(zt==null?void 0:zt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Mt(!1),Ie(-1),Zn.current=!1,hr())},kn=function(){var Ut=Object(te.a)(s.a.mark(function zt(){var Vt,jt,nn,bn,gn,bt;return s.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(ot){Je.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Je.abrupt("return",!1);case 3:if(X){Je.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Je.abrupt("return",!1);case 6:if(Vt=[{choice_text:"\u6B63\u786E",is_answer:X==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:X==="2"?1:0}],Zn.current=!0,!ve.question_id){Je.next=15;break}return Je.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:Vn.id,question_id:ve.question_id,name:ot,item_type:Fe.a.Judge,question_score:Hn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(nn=Me.editData)===null||nn===void 0||((bn=nn.exercise)===null||bn===void 0)?void 0:bn.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 11:jt=Je.sent,qn(jt),Je.next=19;break;case 15:return Je.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:Vn.id,insert_id:ve==null?void 0:ve.insert_id,name:ot,item_type:Fe.a.Judge,question_score:Hn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(gn=Me.editData)===null||gn===void 0||((bt=gn.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 17:jt=Je.sent,qn(jt);case 19:return Je.abrupt("return",{name:ot,choices:Vt});case 20:case"end":return Je.stop()}},zt)}));return function(){return Ut.apply(this,arguments)}}(),Pn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Mn=function(){var Ut=Object(te.a)(s.a.mark(function zt(Vt){return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:if(!(or!==-1)){nn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),nn.abrupt("return");case 3:nn.t0=Vt.id,nn.next=nn.t0==="del"?6:nn.t0==="edit"?8:nn.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function gn(){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:Vn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Vn)});case 3:case"end":return lt.stop()}},gn)}))()}}),nn.abrupt("break",13);case 8:return Ie(ve.dragKey),Mt(!0),nn.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),nn.abrupt("break",13);case 13:case"end":return nn.stop()}},zt)}));return function(Vt){return Ut.apply(this,arguments)}}(),Dn=function(){var zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((zt=ve.question_choices)===null||zt===void 0)?void 0:zt.map(function(Vt,jt){return t.a.createElement(h.a,{key:jt,checked:ve.standard_answer.includes(jt+1),disabled:!0},vn[jt],"."," ",t.a.createElement("span",{className:"c-black font14"},Vt.choice_text))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Pn.map(function(Vt,jt){return t.a.createElement(o.a,{key:jt,placement:"bottom",title:Vt.name},t.a.createElement("span",{onClick:function(){return Mn(Vt)},className:Vt.icon}))})))},dn=function(){var zt,Vt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ot,onChange:function(nn){return wt(nn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:X,onChange:function(nn){return se(nn.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(ue.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:ue.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:In,onChange:function(nn){return wn(nn)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(nn){fn(nn)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(nn){Un(nn.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:qt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Ft,subId:(zt=Me.editData)===null||zt===void 0||((Vt=zt.exercise)===null||Vt===void 0)?void 0:Vt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:yn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Ln,onChange:function(nn){Kn(nn)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),Mt(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){kn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Et&&Dn(),Et&&dn())},hn=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ln)),Gn=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.setEditKey,Ie=en===void 0?function(){}:en,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.addCallback,hr=cn===void 0?function(){}:cn,mr=Ge.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(!1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(0),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useState)(1),Ut=Object(a.a)(dn,2),zt=Ut[0],Vt=Ut[1],jt=Object(i.useState)(!1),nn=Object(a.a)(jt,2),bn=nn[0],gn=nn[1],bt=Object(i.useRef)(!1),lt=Object(w.i)(),Je=Object(i.useState)([]),nt=Object(a.a)(Je,2),ze=nt[0],pt=nt[1],rt=function(Rn){pt([].concat(Object(j.a)(ze),[Object(g.a)({},Rn)]))};Object(i.useEffect)(function(){if(bt.current)return;if(!(ve!=null&&ve.question_title)){wn(!0),se(""),Ft(!1),Un(2),Mt([]),fn(""),Jn(!1);return}se(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.is_ordered),Vt(ve==null?void 0:ve.difficulty),gn(!(ve!=null&&ve.repeat_answer)),Un(ve==null?void 0:ve.question_score);var Qt=ve==null?void 0:ve.standard_answer.map(function(Rn){return Rn.answer_text});Mt(Object(j.a)(Qt)),Dn(ve.tag_discipline_ids),wt(ve==null?void 0:ve.analysis)},[ve,In]),Object(i.useEffect)(function(){Jn(!1),In&&Qt();function Qt(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(te.a)(s.a.mark(function zn(){var rr,On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,Object(I.I)({sub_discipline_id:(rr=Me.editData)===null||rr===void 0||((On=rr.exercise)===null||On===void 0)?void 0:On.sub_discipline_id});case 2:Ir=xr.sent,pt(Ir.tag_disciplines);case 4:case"end":return xr.stop()}},zn)})),Rn.apply(this,arguments)}},[In]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Nt,isEdit:In}}),Object(i.useEffect)(function(){var Qt,Rn=Me!=null&&(Qt=Me.tagDisciplineData)!==null&&Qt!==void 0&&Qt.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];pt(Rn)},[Me.tagDisciplineData]);var Tt=function(Rn){(Rn==null?void 0:Rn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Ie(-1),bt.current=!1,q())},Nt=function(){var Qt=Object(te.a)(s.a.mark(function Rn(){var zn,rr,On,Ir,jr,xr,lr;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:if(zn=[],rr=!1,qn(!0),Et.forEach(function(Cr,Ur){zn.push({position:Ur+1,answer_text:[]}),Cr.forEach(function(Vr,Fr){zn[Ur].answer_text.push(Vr),(!Vr||!Object(ie.db)(Vr,1e4))&&(fn("".concat(Ur,"-").concat(Fr)),_.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),rr=!0)})}),!rr){Er.next=7;break}return qn(!1),Er.abrupt("return",!1);case 7:if(bt.current=!0,!ve.question_id){Er.next=15;break}return Er.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:lt.id,question_id:ve.question_id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(Ir=Me.editData)===null||Ir===void 0||((jr=Ir.exercise)===null||jr===void 0)?void 0:jr.sub_discipline_id,difficulty:zt,repeat_answer:!bn,analysis:ot}});case 11:On=Er.sent,Tt(On),Er.next=19;break;case 15:return Er.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:lt.id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(xr=Me.editData)===null||xr===void 0||((lr=xr.exercise)===null||lr===void 0)?void 0:lr.sub_discipline_id,difficulty:zt,repeat_answer:!bn,analysis:ot}});case 17:On=Er.sent,Tt(On);case 19:return qn(!1),Er.abrupt("return",{name:X,analysis:ot,standard_answers:zn,is_ordered:qt});case 21:case"end":return Er.stop()}},Rn)}));return function(){return Qt.apply(this,arguments)}}(),St=function(Rn,zn,rr){var On=Et.slice();if(zn&&On.splice(Rn,zn),rr&&xn||!ve.question_id)for(var Ir=0;Ir<rr;Ir++)On.splice(Rn+Ir,0,[""]);Kn(On==null?void 0:On.length),Jn(!0),Mt(On)},Kt=function(Rn,zn,rr){fn("");var On=Et.slice();On[Rn][zn]=rr,Mt(On)},Rt=function(Rn){var zn=Et.slice();zn[Rn]=[].concat(Object(j.a)(zn[Rn]),[""]),Mt(zn)},It=function(Rn,zn){var rr=Et.slice();if(!rr[Rn][zn]){rr[Rn]=rr[Rn].filter(function(On,Ir){return Ir!==zn}),Mt(rr);return}K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ue.a.modal,onOk:function(){rr[Rn]=rr[Rn].filter(function(Ir,jr){return jr!==zn}),Mt(rr)}})},En=function(Rn){K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ue.a.modal,onOk:function(){var rr=0;se(X.replace(/\▁/g,function(On){return rr++,rr-1===Rn?"":On})),setTimeout(function(){var On=Et.slice();On=Et.filter(function(Ir,jr){return Rn!==jr}),Mt(On)},500)}})},on=function(){var Rn,zn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:X,onChange:function(On){return se(On)},showNullButton:!0,deleteEmptyDisabled:Vn,onPlaceholderChange:St})),t.a.createElement("div",{className:"mt20"},Et.map(function(rr,On){return t.a.createElement(Y.a,{key:On,answers:rr,index:On,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:Hn,onAnswerChange:Kt,addChildAnswer:Rt,deleteChildAnswer:It,deleteChildAnswermain:En})})),t.a.createElement("div",{className:"mt20"},Et.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:qt,onChange:function(On){return Ft(On.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ot,onChange:function(On){return wt(On)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(On){Un(On)}})," ","\u5206 \xA0"," ",!!un&&!!Ln&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(un/Ln).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:zt,onChange:function(On){Vt(On.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Mn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Dn,subId:(Rn=Me.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,knowledgeOptions:ze,onAddKnowledgeFinish:rt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:bn,onChange:function(On){gn(On)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Nt()}},"\u4FDD\u5B58")))},gr=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],er=function(){var Qt=Object(te.a)(s.a.mark(function Rn(zn){return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(or!==-1)){On.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),On.abrupt("return");case 3:On.t0=zn.id,On.next=On.t0==="del"?6:On.t0==="edit"?8:On.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function jr(){return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:lt.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return lr.stop()}},jr)}))()}}),On.abrupt("break",13);case 8:return Ie(ve.dragKey),wn(!0),On.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),On.abrupt("break",13);case 13:case"end":return On.stop()}},Rn)}));return function(zn){return Qt.apply(this,arguments)}}(),tr=function(){var Rn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((Rn=ve.standard_answer)===null||Rn===void 0)?void 0:Rn.map(function(zn,rr){return t.a.createElement(r.a,{key:rr,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",zn.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},zn.answer_text.map(function(On,Ir){return t.a.createElement(A.a,{span:24,key:Ir},t.a.createElement(T.a,{key:rr,checked:ve.standard_answer.includes(rr),disabled:!0,value:On}))}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&gr.map(function(zn,rr){return zn.id==="up"&&ve.key===1||zn.id==="down"&&ve.key===ve.len?null:t.a.createElement(o.a,{key:rr,placement:"bottom",title:zn.name},t.a.createElement("span",{onClick:function(){return er(zn)},className:zn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!In&&tr(),In&&on())},fr=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Gn)),vr=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(""),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)([[],[]]),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=Object(w.i)(),Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=function(bn){Pn([].concat(Object(j.a)(kn),[Object(g.a)({},bn)]))};Object(i.useEffect)(function(){var nn;if(Zn.current)return;if(!(ve!=null&&ve.question_title)){Ft(!0),se(""),Mt(""),fn(10);return}Kn(!(ve!=null&&ve.repeat_answer)),se(ve==null?void 0:ve.question_title),Mt(ve==null||((nn=ve.standard_answer)===null||nn===void 0)?void 0:nn[0]),fn(ve==null?void 0:ve.question_score),Jn(ve.tag_discipline_ids),Un(ve==null?void 0:ve.difficulty),wt(ve==null?void 0:ve.analysis),wn([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Me.editData,qt]),Object(i.useEffect)(function(){var nn,bn=Me!=null&&(nn=Me.tagDisciplineData)!==null&&nn!==void 0&&nn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Pn(bn)},[Me.tagDisciplineData]),Object(i.useEffect)(function(){qt&&nn();function nn(){return bn.apply(this,arguments)}function bn(){return bn=Object(te.a)(s.a.mark(function gn(){var bt,lt,Je;return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.next=2,Object(I.I)({sub_discipline_id:(bt=Me.editData)===null||bt===void 0||((lt=bt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id});case 2:Je=ze.sent,Pn(Je.tag_disciplines);case 4:case"end":return ze.stop()}},gn)})),bn.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:dn,isEdit:qt}});var Dn=function(bn){(bn==null?void 0:bn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),Ce(-1),Zn.current=!1,hr())},dn=function(){var nn=Object(te.a)(s.a.mark(function bn(){var gn,bt,lt,Je,nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(X){Tt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Tt.abrupt("return",!1);case 3:if(gn=In[0],bt=In[1],Zn.current=!0,!ve.question_id){Tt.next=13;break}return Tt.next=9,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:yn.id,question_id:ve.question_id,name:X,item_type:4,question_score:Hn,answer_texts:[Et],tag_discipline_ids:xn,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:ot,normal_keywords:gn,main_keywords:bt}});case 9:lt=Tt.sent,Dn(lt),Tt.next=17;break;case 13:return Tt.next=15,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:yn.id,name:X,item_type:4,question_score:Hn,answer_texts:[Et],tag_discipline_ids:xn,sub_discipline_id:(ze=Me.editData)===null||ze===void 0||((pt=ze.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:ot,normal_keywords:gn,main_keywords:bt}});case 15:lt=Tt.sent,Dn(lt);case 17:return Tt.abrupt("return",{name:X,answer_texts:[Et],analysis:ot,normal_keywords:gn,main_keywords:bt});case 18:case"end":return Tt.stop()}},bn)}));return function(){return nn.apply(this,arguments)}}(),Ut=function(){var bn,gn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:X,onChange:function(lt){return se(lt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Et,onChange:function(lt){return Mt(lt)}}),t.a.createElement(Pt.a,{value:In,onChange:wn}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ot,onChange:function(lt){return wt(lt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(lt){fn(lt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(lt){Un(lt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:xn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Jn,subId:(bn=Me.editData)===null||bn===void 0||((gn=bn.exercise)===null||gn===void 0)?void 0:gn.sub_discipline_id,knowledgeOptions:kn,onAddKnowledgeFinish:Mn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Ln,onChange:function(lt){Kn(lt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){dn()}},"\u4FDD\u5B58")))},zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7B80\u7B54\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Vt=function(){var nn=Object(te.a)(s.a.mark(function bn(gn){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(Ie!==-1)){lt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),lt.abrupt("return");case 3:lt.t0=gn.id,lt.next=lt.t0==="del"?6:lt.t0==="up"||lt.t0==="down"?8:lt.t0==="edit"?12:lt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function nt(){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:yn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)});case 3:case"end":return pt.stop()}},nt)}))()}}),lt.abrupt("break",17);case 8:return lt.next=10,ye({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:gn.id}});case 10:return ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)}),lt.abrupt("break",17);case 12:return Ce(ve.dragKey),Ft(!0),lt.abrupt("break",17);case 15:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),lt.abrupt("break",17);case 17:case"end":return lt.stop()}},bn)}));return function(gn){return nn.apply(this,arguments)}}(),jt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(we.a,{value:Et||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&zt.map(function(bn,gn){return t.a.createElement(o.a,{key:gn,placement:"bottom",title:bn.name},t.a.createElement("span",{onClick:function(){return Vt(bn)},className:bn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!qt&&jt(),qt&&Ut())},ir=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(vr)),br=function(Ge,Ot){var Me=Ge.dispatch,ye=Ge.editData,ve=Ge.cancelAdd,or=ve===void 0?function(){}:ve,en=Ge.editKey,Ie=Ge.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=Ge.reload,cn=Ce===void 0?function(){}:Ce,hr=Object(i.useState)(""),mr=Object(a.a)(hr,2),q=mr[0],O=mr[1],M=Object(i.useState)(""),X=Object(a.a)(M,2),se=X[0],Z=X[1],Le=Object(i.useState)(""),ot=Object(a.a)(Le,2),wt=ot[0],Lt=ot[1],ct=Object(i.useState)([]),Et=Object(a.a)(ct,2),Mt=Et[0],Cn=Et[1],Yn=Object(i.useState)(),Hn=Object(a.a)(Yn,2),fn=Hn[0],Wt=Hn[1],sn=Object(i.useState)(!1),qt=Object(a.a)(sn,2),Ft=qt[0],Qn=qt[1],Bn=Object(i.useState)([]),xn=Object(a.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=Object(i.useState)(!1),un=Object(a.a)(Sn,2),Un=un[0],Xn=un[1],nr=Object(i.useState)(!1),Ln=Object(a.a)(nr,2),Kn=Ln[0],rn=Ln[1],_n=Object(w.i)(),In=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Pn;if(In.current)return;ye.edit&&(Xn(!0),Z(""),O(""),pn([])),O(ye.shixun_name),Z(ye.question_title);var Mn=[];(Pn=ye.shixun)===null||Pn===void 0||Pn.map(function(Dn){Mn.push(Dn.challenge_score)}),pn(Mn)},[ye]),Object(i.useEffect)(function(){Qn(!1)},[Un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Zn,isEdit:Un}});var wn=function(Mn){(Mn==null?void 0:Mn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Xn(!1),gt(-1),In.current=!1,cn())},Zn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(){var Dn,dn,Ut;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(Dn=[],dn=!1,!dn){Vt.next=4;break}return Vt.abrupt("return",!1);case 4:if(In.current=!0,rn(!0),!ye.question_id){Vt.next=12;break}return Vt.next=9,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:_n.id,question_id:ye.question_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn}});case 9:Ut=Vt.sent,Vt.next=15;break;case 12:return Vt.next=14,Me({type:"newExercisePaper/addExerciseQuestion",payload:{id:_n.id,insert_id:ye==null?void 0:ye.insert_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn,is_copy:ye.is_copy}});case 14:Ut=Vt.sent;case 15:return wn(Ut),rn(!1),Vt.abrupt("return",{name:se,analysis:wt,standard_answers:Dn,is_ordered:fn});case 18:case"end":return Vt.stop()}},Mn)}));return function(){return Pn.apply(this,arguments)}}(),yn=function(){var Mn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:q,onChange:function(dn){O(dn.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:se,onChange:function(dn){Z(dn)}})),t.a.createElement("div",{className:"mt20"},(Mn=ye.shixun)===null||Mn===void 0?void 0:Mn.map(function(Dn,dn){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},dn+1,".",Dn.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Jn[dn],onChange:function(zt){Jn[dn]=zt,pn(Jn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Mt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:fn,onChange:function(dn){return Wt(dn.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(en!==-1||!(ye!=null&&ye.edit))&&t.a.createElement(p.a,{type:"default",onClick:function(){or(),Xn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{loading:Kn,className:"ml20",type:"primary",onClick:function(){Zn()}},"\u4FDD\u5B58")))},Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(Dn){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(en!==-1)){Ut.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ut.abrupt("return");case 3:Ut.t0=Dn.id,Ut.next=Ut.t0==="del"?6:Ut.t0==="edit"?8:Ut.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Vt(){return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:_n.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},_n)});case 3:case"end":return nn.stop()}},Vt)}))()}}),Ut.abrupt("break",13);case 8:return gt(ye.dragKey),Xn(!0),Ut.abrupt("break",13);case 11:return Me({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:5}}}),Ut.abrupt("break",13);case 13:case"end":return Ut.stop()}},Mn)}));return function(Dn){return Pn.apply(this,arguments)}}(),kn=function(){var Mn,Dn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(we.a,{value:ye.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09"),!!((Mn=ye.schools)!==null&&Mn!==void 0&&Mn.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ye.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Dn=ye.shixun)===null||Dn===void 0?void 0:Dn.map(function(dn,Ut){return t.a.createElement("div",{key:Ut},"\u7B2C",Ut+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},dn.challenge_name)," ",t.a.createElement("span",{className:"ml10"},dn.challenge_score," \u5206"))}),t.a.createElement("div",{className:ue.a.action},t.a.createElement(st.a,{target:"_blank",to:"/shixuns/".concat(ye.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!ye.hideAction&&Vn.map(function(dn,Ut){return t.a.createElement(o.a,{key:Ut,placement:"bottom",title:dn.name},t.a.createElement("span",{onClick:function(){return qn(dn)},className:dn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!Un&&kn(),Un&&yn())},Rr=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(br)),Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ar=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.addCallback,Ie=en===void 0?function(){}:en,gt=Object(i.useState)([]),Ce=Object(a.a)(gt,2),cn=Ce[0],hr=Ce[1],mr=Object(i.useState)(),q=Object(a.a)(mr,2),O=q[0],M=q[1],X=Object(i.useState)([]),se=Object(a.a)(X,2),Z=se[0],Le=se[1],ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(5),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(!1),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(w.i)();Object(i.useEffect)(function(){hr(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){sn(!0),ct(""),Yn(5),hr(["","","",""]),Le([]);return}ct(ve==null?void 0:ve.question_title),Yn(ve==null?void 0:ve.question_score),hr(ve==null?void 0:ve.question_choices.map(function(Sn){return Sn.choice_text}));var pn=[];ve==null||ve.standard_answer.map(function(Sn,un){pn.push(Sn-1)}),Le(pn)},[ve]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ft,isEdit:Wt}});var Ft=function(){var pn=Object(te.a)(s.a.mark(function Sn(){var un,Un,Xn;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(Lt){Ln.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ln.abrupt("return",!1);case 3:if(un=cn.findIndex(function(Kn){return!Kn}),!(un>-1)){Ln.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Jt[un]," \u9009\u9879\u7684\u5185\u5BB9")),Ln.abrupt("return",!1);case 7:if(Z.length){Ln.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ln.abrupt("return",!1);case 10:if(!(Z.length<1)){Ln.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ln.abrupt("return",!1);case 13:if(Un=cn.map(function(Kn,rn){return{choice_text:Kn,is_answer:Z.includes(rn)?rn+1:0}}),!ve.question_id){Ln.next=20;break}return Ln.next=17,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:Lt,question_type:1,question_score:Cn,question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 17:Xn=Ln.sent,Ln.next=23;break;case 20:return Ln.next=22,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:qt.categoryId,question_title:Lt,question_type:1,question_score:"5.0",question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 22:Xn=Ln.sent;case 23:Xn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),sn(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)}));case 24:case"end":return Ln.stop()}},Sn)}));return function(){return pn.apply(this,arguments)}}(),Qn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Bn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){return s.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:if(!(or!==-1)){Xn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Xn.abrupt("return");case 3:Xn.t0=un.id,Xn.next=Xn.t0==="del"?6:Xn.t0==="edit"?8:Xn.t0==="add"?10:12;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Ln(){return s.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(Ee.g)({exam_id:qt.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)});case 3:case"end":return rn.stop()}},Ln)}))()}}),Xn.abrupt("break",12);case 8:return F.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(qt.id,"&question_id=").concat(ve==null?void 0:ve.question_id,"&score=").concat(ve==null?void 0:ve.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Xn.abrupt("break",12);case 10:return Ie({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),Xn.abrupt("break",12);case 12:case"end":return Xn.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),xn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){var Un;return s.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return un.preventDefault(),nr.next=3,Object(I.Y)({id:ve==null?void 0:ve.hack_identifier});case 3:Un=nr.sent,Un.status===0&&Object(ie.S)("/myproblems/".concat(Un==null?void 0:Un.identifier));case 5:case"end":return nr.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),Jn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement(we.a,{value:ve.description||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Qn.map(function(Sn,un){return t.a.createElement(o.a,{key:un,placement:"bottom",title:Sn.name},t.a.createElement("span",{onClick:function(){return Bn(Sn)},className:Sn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},Jn())},Nn=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ar)),Tn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pr=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.addCallback,hr=cn===void 0?function(dn){}:cn,mr=Ge.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(!1),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(!0),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(w.i)(),Sn=Object(i.useRef)(null),un=Object(i.useState)(""),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)([]),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useRef)(!1),wn=function(Ut){Jn([].concat(Object(j.a)(xn),[Object(g.a)({},Ut)]))};Object(i.useEffect)(function(){var dn;if(In.current)return;if(!(ve!=null&&ve.question_title)){wt(!0),nr("");return}nr(ve==null?void 0:ve.question_title),Ft(!(ve!=null&&ve.repeat_answer)),fn(ve==null?void 0:ve.difficulty),se(ve.tag_discipline_ids);var Ut=ve==null||((dn=ve.sub_exercise_questions)===null||dn===void 0)?void 0:dn.map(function(zt){return Object(g.a)(Object(g.a)({},zt),{},{id:zt.question_id,name:zt.question_title,open:!1,question_score:zt.question_score,choices:zt==null?void 0:zt.question_choices.map(function(Vt){return{choice_text:Vt.choice_text,is_answer:Vt.standard_boolean?1:0}}),activeQusEditor:null})});_n(Ut)},[ve,ot]),Object(i.useEffect)(function(){ot&&dn();function dn(){return Ut.apply(this,arguments)}function Ut(){return Ut=Object(te.a)(s.a.mark(function zt(){var Vt,jt,nn;return s.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(I.I)({sub_discipline_id:(Vt=Me.editData)===null||Vt===void 0||((jt=Vt.exercise)===null||jt===void 0)?void 0:jt.sub_discipline_id});case 2:nn=gn.sent,Jn(nn.tag_disciplines);case 4:case"end":return gn.stop()}},zt)})),Ut.apply(this,arguments)}},[ot]),Object(i.useEffect)(function(){var dn,Ut=Me!=null&&(dn=Me.tagDisciplineData)!==null&&dn!==void 0&&dn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(Ut)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:yn,isEdit:ot}});var Zn=function(Ut){(Ut==null?void 0:Ut.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),Ce(-1),In.current=!1,q())},yn=function(){var dn=Object(te.a)(s.a.mark(function Ut(){var zt,Vt,jt,nn,bn,gn,bt,lt,Je,nt,ze;return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(Xn){rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),rt.abrupt("return",!1);case 3:if(!(rn.length===0)){rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),rt.abrupt("return",!1);case 6:zt=0;case 7:if(!(zt<rn.length)){rt.next=25;break}if(jt=rn[zt],jt!=null&&jt.name){rt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898\u9898\u5E72")),rt.abrupt("return",!1);case 12:if(jt!=null&&jt.question_score){rt.next=15;break}return _.b.info("\u7B2C".concat(zt+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),rt.abrupt("return",!1);case 15:if(nn=jt==null||((Vt=jt.choices)===null||Vt===void 0)?void 0:Vt.findIndex(function(Tt){return!Tt}),!(nn>-1)){rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898").concat(Tn[nn],"\u9009\u9879\u7684\u5185\u5BB9")),rt.abrupt("return",!1);case 19:if(!(jt.choices.findIndex(function(Tt){return Tt.is_answer===1})===-1)){rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(zt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),rt.abrupt("return",!1);case 22:zt++,rt.next=7;break;case 25:if(bn=rn.map(function(Tt){return{id:Tt.id>1?Tt.id:null,name:Tt.name,item_type:Fe.a.Single,choices:Tt.choices,question_score:Tt.question_score}}),In.current=!0,!ve.question_id){rt.next=34;break}return rt.next=30,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:pn.id,question_id:ve.question_id,name:Xn,item_type:Fe.a.Combine,sub_item_banks:bn,tag_discipline_ids:X,sub_discipline_id:(bt=Me.editData)===null||bt===void 0||((lt=bt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt}});case 30:gn=rt.sent,Zn(gn),rt.next=38;break;case 34:return rt.next=36,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:pn.id,insert_id:ve==null?void 0:ve.insert_id,name:Xn,item_type:Fe.a.Combine,tag_discipline_ids:X,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt,sub_item_banks:bn}});case 36:gn=rt.sent,((ze=gn)===null||ze===void 0?void 0:ze.status)===0&&(Ce(-1),_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)}));case 38:case"end":return rt.stop()}},Ut)}));return function(){return dn.apply(this,arguments)}}(),Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var dn=Object(te.a)(s.a.mark(function Ut(zt){return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(!(Ie!==-1)){jt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),jt.abrupt("return");case 3:jt.t0=zt.id,jt.next=jt.t0==="del"?6:jt.t0==="edit"?8:jt.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function bn(){return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:pn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)});case 3:case"end":return bt.stop()}},bn)}))()}}),jt.abrupt("break",13);case 8:return Ce(ve.dragKey),wt(!0),jt.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Fe.a.Single}),jt.abrupt("break",13);case 13:case"end":return jt.stop()}},Ut)}));return function(zt){return dn.apply(this,arguments)}}(),kn=function(){var Ut;return t.a.createElement("aside",{ref:Sn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.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(we.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:Et?"block":"none"},className:ue.a.questionChoices},ve==null||((Ut=ve.sub_exercise_questions)===null||Ut===void 0)?void 0:Ut.map(function(zt,Vt){var jt;return t.a.createElement("div",{key:Vt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,".",Vt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(we.a,{value:zt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",zt.question_score,"\u5206\uFF09")),zt==null||((jt=zt.question_choices)===null||jt===void 0)?void 0:jt.map(function(nn,bn){return t.a.createElement(r.a,{key:bn},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:bn,checked:nn.standard_boolean,disabled:!0},Tn[bn],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:nn.choice_text}))))}))})),t.a.createElement("div",{className:ue.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Mt(!Et)},style:{}},Et?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Vn.map(function(zt,Vt){return t.a.createElement(o.a,{key:Vt,placement:"bottom",title:zt.name},t.a.createElement("span",{onClick:function(){return qn(zt)},className:zt.icon}))})))},Pn=function(){var Ut,zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ue.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:function(jt){return nr(jt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",rn==null?void 0:rn.length),rn==null?void 0:rn.map(function(Vt,jt){var nn;return t.a.createElement("div",{className:ue.a.fold,key:Vt.id},t.a.createElement("div",{onClick:function(){return Dn("open",jt)},className:ue.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Vt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",jt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(gn){gn.stopPropagation(),Dn("delete",jt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Vt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vt==null?void 0:Vt.name,onChange:function(gn){return Dn("value",jt,gn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vt==null||((nn=Vt.choices)===null||nn===void 0)?void 0:nn.map(function(bn,gn){var bt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:gn},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(bn.is_answer===1?ue.a.activeAnswer:""),onClick:function(){return Dn("answer",jt,gn)}},Tn[gn])),t.a.createElement("div",{className:ue.a.editorWrap},(Vt==null?void 0:Vt.activeQusEditor)===gn?t.a.createElement(v.a,{id:"single-question-option-".concat(gn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:bn.choice_text,onChange:function(Je){return Dn("details",jt,Je)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return Dn("edit",jt,gn)}},t.a.createElement(we.a,{value:bn.choice_text}))),gn>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Dn("deleteQus",jt,gn)}})),gn<7&&gn===(Vt==null||((bt=Vt.choices)===null||bt===void 0)?void 0:bt.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Dn("addQus",jt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Vt.question_score,max:1e4,min:0,onChange:function(gn){return Dn("score",jt,gn)}}),"\u5206")))}),rn.length<20&&t.a.createElement(p.a,{type:"primary",onClick:Mn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Hn,onChange:function(jt){fn(jt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:X,onChange:se,subId:(Ut=Me.editData)===null||Ut===void 0||((zt=Ut.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:wn}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),wt(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){yn()}},"\u4FDD\u5B58")))},Mn=function(){var Ut={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};_n(rn.concat(Ut))},Dn=function(Ut,zt,Vt){var jt=Object(Ct.cloneDeep)(rn);Ut==="open"&&(jt[zt].open=!jt[zt].open),Ut==="delete"&&jt.splice(zt,1),Ut==="value"&&(jt[zt].name=Vt),Ut==="answer"&&jt[zt].choices.forEach(function(nn,bn){nn.is_answer=Vt===bn?1:0}),Ut==="edit"&&(jt[zt].activeQusEditor=Vt),Ut==="details"&&(jt[zt].choices[jt[zt].activeQusEditor].choice_text=Vt),Ut==="addQus"&&(jt[zt].choices=jt[zt].choices.concat({choice_text:"",is_answer:0})),Ut==="deleteQus"&&(jt[zt].choices=jt[zt].choices.filter(function(nn,bn){return bn!==Vt})),Ut==="analysis"&&(jt[zt].analysis=Vt),Ut==="score"&&(jt[zt].question_score=Vt),_n(jt)};return t.a.createElement("section",{className:ue.a.wrap},!ot&&kn(),ot&&Pn())},_r=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pr)),Pr=function(Ge){var Ot=Ge.data,Me=Ge.isDragDisabled,ye=Me===void 0?!1:Me,ve=Ge.editorProps,or=ve===void 0?{}:ve,en=Ge.onDragEnd,Ie=en===void 0?function(){}:en,gt=Ge.dispatch,Ce=Ge.markBtnVisible,cn=Ce===void 0?!1:Ce,hr=Ge.batchScore,mr=hr===void 0?[]:hr,q=Ge.reload,O=q===void 0?function(){}:q,M=Ge.inNewPaperLibrary,X=M===void 0?!1:M,se=Object(i.useRef)(),Z=Object(w.i)(),Le=function(){var Wt,sn,qt,Ft,Qn,Bn,xn,Jn,pn,Sn,un,Un,Xn,nr,Ln,Kn,rn=[{name:"\u5355\u9009\u9898",type:0,count:Ot==null||((Wt=Ot.exercise_types)===null||Wt===void 0)?void 0:Wt.q_singles,score:Ot==null||((sn=Ot.exercise_types)===null||sn===void 0)?void 0:sn.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:Ot==null||((qt=Ot.exercise_types)===null||qt===void 0)?void 0:qt.q_doubles,score:Ot==null||((Ft=Ot.exercise_types)===null||Ft===void 0)?void 0:Ft.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:Ot==null||((Qn=Ot.exercise_types)===null||Qn===void 0)?void 0:Qn.q_judges,score:Ot==null||((Bn=Ot.exercise_types)===null||Bn===void 0)?void 0:Bn.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:Ot==null||((xn=Ot.exercise_types)===null||xn===void 0)?void 0:xn.q_nulls,score:Ot==null||((Jn=Ot.exercise_types)===null||Jn===void 0)?void 0:Jn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:Ot==null||((pn=Ot.exercise_types)===null||pn===void 0)?void 0:pn.q_mains,score:Ot==null||((Sn=Ot.exercise_types)===null||Sn===void 0)?void 0:Sn.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:Ot==null||((un=Ot.exercise_types)===null||un===void 0)?void 0:un.q_shixuns,score:Ot==null||((Un=Ot.exercise_types)===null||Un===void 0)?void 0:Un.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:Ot==null||((Xn=Ot.exercise_types)===null||Xn===void 0)?void 0:Xn.q_pros,score:Ot==null||((nr=Ot.exercise_types)===null||nr===void 0)?void 0:nr.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:Ot==null||((Ln=Ot.exercise_types)===null||Ln===void 0)?void 0:Ln.q_combinations,score:Ot==null||((Kn=Ot.exercise_types)===null||Kn===void 0)?void 0:Kn.q_combination_scores,items:[]}];return rn},ot=function(Wt,sn,qt){var Ft=Array.from(Wt),Qn=Ft.splice(sn,1),Bn=Object(a.a)(Qn,1),xn=Bn[0];return Ft.splice(qt,0,xn),Ft},wt=function(Wt,sn,qt){if(!Wt.destination)return;var Ft=ot(sn,Wt.source.index,Wt.destination.index);X?Ie(Wt,Ft,qt):Ie(Ft,qt)},Lt=function(Wt){gt({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Wt}})},ct=function(Wt,sn){if(sn===0)return X?t.a.createElement(Gt,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(yt,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===1)return X?t.a.createElement($n,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(je,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===2)return X?t.a.createElement(hn,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(_e,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===3)return X?t.a.createElement(fr,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(be,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===4)return X?t.a.createElement(ir,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(an,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===5)return X?t.a.createElement(Rr,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Be,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===6)return X?t.a.createElement(Nn,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Ze,Object(m.a)({editData:Wt},Wt));if(sn===7)return X?t.a.createElement(_r,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(ft,Object(m.a)({reload:O,editData:Wt},Wt))},Et=function(Wt,sn,qt){return t.a.createElement(He.a,{onDragEnd:function(Qn){return wt(Qn,Wt,sn)}},t.a.createElement(He.c,{droppableId:"droppable"},function(Ft,Qn){return t.a.createElement("div",Object(m.a)({ref:Ft.innerRef},Ft.droppableProps,{style:{width:"100%"}}),Wt==null?void 0:Wt.map(function(Bn,xn){var Jn,pn=Object(g.a)(Object(g.a)({},Bn),{},{key:xn+1,hideAction:!0,isPreview:!0,dragKey:sn+"-"+xn},or);return t.a.createElement(He.b,{key:pn==null?void 0:pn.question_id,draggableId:pn==null||((Jn=pn.question_id)===null||Jn===void 0)?void 0:Jn.toString(),index:xn,isDragDisabled:ye},function(Sn,un){return t.a.createElement("aside",Object(m.a)({ref:Sn.innerRef},Sn.draggableProps,Sn.dragHandleProps),t.a.createElement("div",{className:Ue.a.posWarp,id:pn.dragKey},ct(pn,sn),cn&&t.a.createElement(r.a,{className:Ue.a.markWrongBtnWrapper},t.a.createElement(p.a,{onClick:function(){return Lt({value:pn,type:sn})}},pn!=null&&pn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement($.a,null),!ye&&t.a.createElement("div",{className:Ue.a.pos},t.a.createElement("div",{className:Ue.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Mt=function(Wt){var sn=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],qt=["","\u5341","\u767E","\u5343","\u4E07"];Wt=parseInt(Wt);var Ft=function(Jn){for(var pn=Jn.toString().split("").reverse(),Sn="",un=0;un<pn.length;un++)Sn=(un==0&&pn[un]==0||un>0&&pn[un]==0&&pn[un-1]==0?"":sn[pn[un]]+(pn[un]==0?qt[0]:qt[un]))+Sn;return Sn},Qn=Math.floor(Wt/1e4),Bn=Wt%1e4;return Bn.toString().length<4&&(Bn="0"+Bn),Qn?Ft(Qn)+"\u4E07"+Ft(Bn):Ft(Wt)},Cn=function(Wt){var sn={\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 sn[Wt]||0},Yn=function(Wt,sn){se.current=Cn(sn),K.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,sn==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":sn,"\uFF1A"),t.a.createElement(B.a,{min:1,defaultValue:se.current,onChange:function(Ft){se.current=Ft}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),sn==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(te.a)(s.a.mark(function Qn(){var Bn,xn;return s.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(!X){pn.next=6;break}return pn.next=3,Object(Ee.t)(Z.id,{question_type:Wt,score:se.current});case 3:return Bn=pn.sent,Bn.status===0&&O(),pn.abrupt("return");case 6:return pn.next=8,Object(ge.a)("/api/exercises/".concat(Z.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Wt,score:se.current}});case 8:xn=pn.sent,xn.status!==-1&&O();case 10:case"end":return pn.stop()}},Qn)}));function Ft(){return qt.apply(this,arguments)}return Ft}()})},Hn=function(){var Wt,sn=Le();Ot==null||((Wt=Ot.exercise_questions)===null||Wt===void 0)||Wt.forEach(function(Ft,Qn){if(Ft.question_type===0){var Bn,xn;(Bn=sn[Ft.question_type])===null||Bn===void 0||((xn=Bn.items)===null||xn===void 0)||xn.push(Ft)}if(Ft.question_type===1){var Jn,pn;(Jn=sn[Ft.question_type])===null||Jn===void 0||((pn=Jn.items)===null||pn===void 0)||pn.push(Ft)}if(Ft.question_type===2){var Sn,un;(Sn=sn[Ft.question_type])===null||Sn===void 0||((un=Sn.items)===null||un===void 0)||un.push(Ft)}if(Ft.question_type===3){var Un,Xn;(Un=sn[Ft.question_type])===null||Un===void 0||((Xn=Un.items)===null||Xn===void 0)||Xn.push(Ft)}if(Ft.question_type===4){var nr,Ln;(nr=sn[Ft.question_type])===null||nr===void 0||((Ln=nr.items)===null||Ln===void 0)||Ln.push(Ft)}if(Ft.question_type===5){var Kn,rn;(Kn=sn[Ft.question_type])===null||Kn===void 0||((rn=Kn.items)===null||rn===void 0)||rn.push(Ft)}if(Ft.question_type===6){var _n,In;(_n=sn[Ft.question_type])===null||_n===void 0||((In=_n.items)===null||In===void 0)||In.push(Ft)}if(Ft.question_type===7){var wn,Zn;(wn=sn[Ft.question_type])===null||wn===void 0||((Zn=wn.items)===null||Zn===void 0)||Zn.push(Ft)}});var qt=Ot==null?void 0:Ot.map(function(Ft,Qn){return t.a.createElement(t.a.Fragment,{key:Qn},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Mt(Qn+1),"\u3001",Ft.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Ft.count,"\u9898",(Ft==null?void 0:Ft.question_type)===7?"\uFF0C\u5305\u542B".concat(Ft.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Ft.score,"\u5206\uFF09"),(mr==null?void 0:mr.includes(Ft==null?void 0:Ft.name))&&t.a.createElement(p.a,{onClick:function(){return Yn(Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),Et(Ft.items,Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name))});return qt};return t.a.createElement("div",null," ",Hn()," ")},yr=Ae.a=Object(F.a)()(Pr)},LdHM:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return o}),U.d(Ae,"a",function(){return T});var te=U("1OyB"),Q=U("vuIU"),B=U("Ji7U"),J=U("LK+K"),K=U("q1tI"),N=U("rePB"),$=U("Ff2n"),z=U("ODXe"),r=U("4IlW"),D=U("bX4T"),p=U("YrtM"),g=U("TSYQ"),m=U.n(g),a=U("+nKL"),d=U("8OUc"),s=function(H,Y){var ie=H.prefixCls,le=H.id,he=H.flattenOptions,we=H.childrenAsData,Pe=H.values,xe=H.searchValue,Oe=H.multiple,pe=H.defaultActiveFirstOption,be=H.height,ne=H.itemHeight,fe=H.notFoundContent,_e=H.open,ke=H.menuItemSelectedIcon,qe=H.virtual,je=H.onSelect,st=H.onToggleOpen,vt=H.onActiveValue,Re=H.onScroll,Be=H.onMouseEnter,Ye="".concat(ie,"-item"),Ke=Object(p.a)(function(){return he},[_e,he],function(ft,He){return He[0]&&ft[1]!==He[1]}),yt=K.useRef(null),Pt=function(He){He.preventDefault()},Ht=function(He){yt.current&&yt.current.scrollTo({index:He})},Xt=function(He){for(var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=Ke.length,ge=0;ge<Ue;ge+=1){var Ee=(He+ge*Ne+Ue)%Ue,De=Ke[Ee],ue=De.group,Fe=De.data;if(!ue&&!Fe.disabled)return Ee}return-1},an=K.useState(function(){return Xt(0)}),tn=Object(z.a)(an,2),et=tn[0],Ze=tn[1],Ct=function(He){Ze(He);var Ne=Ke[He];if(!Ne){vt(null,-1);return}vt(Ne.data.value,He)};K.useEffect(function(){Ct(pe!==!1?Xt(0):-1)},[Ke.length,xe]),K.useEffect(function(){var ft=setTimeout(function(){if(!Oe&&_e&&Pe.size===1){var He=Array.from(Pe)[0],Ne=Ke.findIndex(function(Ue){var ge=Ue.data;return ge.value===He});Ct(Ne),Ht(Ne)}});return function(){return clearTimeout(ft)}},[_e]);var At=function(He){He!==void 0&&je(He,{selected:!Pe.has(He)}),Oe||st(!1)};if(K.useImperativeHandle(Y,function(){return{onKeyDown:function(He){var Ne=He.which;switch(Ne){case r.a.UP:case r.a.DOWN:{var Ue=0;if(Ne===r.a.UP?Ue=-1:Ne===r.a.DOWN&&(Ue=1),Ue!==0){var ge=Xt(et+Ue,Ue);Ht(ge),Ct(ge)}break}case r.a.ENTER:{var Ee=Ke[et];Ee&&!Ee.data.disabled?At(Ee.data.value):At(void 0),_e&&He.preventDefault();break}case r.a.ESC:st(!1)}},onKeyUp:function(){},scrollTo:function(He){Ht(He)}}}),Ke.length===0)return K.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(Ye,"-empty"),onMouseDown:Pt},fe);function dt(ft){var He=Ke[ft];if(!He)return null;var Ne=He.data||{},Ue=Ne.value,ge=Ne.label,Ee=Ne.children,De=Object(D.a)(Ne,!0),ue=we?Ee:ge;return He?K.createElement("div",Object.assign({"aria-label":typeof ue=="string"?ue:null},De,{key:ft,role:"option",id:"".concat(le,"_list_").concat(ft),"aria-selected":Pe.has(Ue)}),Ue):null}return K.createElement(K.Fragment,null,K.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},dt(et-1),dt(et),dt(et+1)),K.createElement(a.a,{itemKey:"key",ref:yt,data:Ke,height:be,itemHeight:ne,fullHeight:!1,onMouseDown:Pt,onScroll:Re,virtual:qe,onMouseEnter:Be},function(ft,He){var Ne,Ue=ft.group,ge=ft.groupOption,Ee=ft.data,De=Ee.label,ue=Ee.key;if(Ue)return K.createElement("div",{className:m()(Ye,"".concat(Ye,"-group"))},De!==void 0?De:ue);var Fe=Ee.disabled,at=Ee.value,xt=Ee.title,Gt=Ee.children,$t=Ee.style,Yt=Ee.className,$n=Object($.a)(Ee,["disabled","value","title","children","style","className"]),vn=Pe.has(at),ln="".concat(Ye,"-option"),hn=m()(Ye,ln,Yt,(Ne={},Object(N.a)(Ne,"".concat(ln,"-grouped"),ge),Object(N.a)(Ne,"".concat(ln,"-active"),et===He&&!Fe),Object(N.a)(Ne,"".concat(ln,"-disabled"),Fe),Object(N.a)(Ne,"".concat(ln,"-selected"),vn),Ne)),Gn=we?Gt:De,fr=!ke||typeof ke=="function"||vn;return K.createElement("div",Object.assign({},$n,{"aria-selected":vn,className:hn,title:xt,onMouseMove:function(){if(et===He||Fe)return;Ct(He)},onClick:function(){Fe||At(at)},style:$t}),K.createElement("div",{className:"".concat(ln,"-content")},Gn||at),K.isValidElement(ke)||vn,fr&&K.createElement(d.a,{className:"".concat(Ye,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:vn}},vn?"\u2713":null))}))},i=K.forwardRef(s);i.displayName="OptionList";var t=i,u=function(){return null};u.isSelectOption=!0;var o=u,R=function(){return null};R.isSelectOptGroup=!0;var T=R,S=U("VTBJ"),A=U("Zm9Q");function P(v){var H=v.key,Y=v.props,ie=Y.children,le=Y.value,he=Object($.a)(Y,["children","value"]);return Object(S.a)({key:H,value:le!==void 0?le:H,children:ie},he)}function E(v){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(v).map(function(Y,ie){if(!K.isValidElement(Y)||!Y.type)return null;var le=Y.type.isSelectOptGroup,he=Y.key,we=Y.props,Pe=we.children,xe=Object($.a)(we,["children"]);return H||!le?P(Y):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(he===null?ie:he,"__"),label:he},xe),{},{options:E(Pe)})}).filter(function(Y){return Y})}var b=U("2Qr1"),h=U("qNPg"),f=U("U8pU"),C=U("Kwbf"),x=U("WKfj");function _(v){var H=v.mode,Y=v.options,ie=v.children,le=v.backfill,he=v.allowClear,we=v.placeholder,Pe=v.getInputElement,xe=v.showSearch,Oe=v.onSearch,pe=v.defaultOpen,be=v.autoFocus,ne=v.labelInValue,fe=v.value,_e=v.inputValue,ke=v.optionLabelProp,qe=H==="multiple"||H==="tags",je=xe!==void 0?xe:qe||H==="combobox",st=Y||E(ie);if(Object(C.a)(H!=="tags"||st.every(function(Ye){return!Ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var vt=st.some(function(Ye){return Ye.options?Ye.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in Ye?Ye.value:Ye.key)=="number"});Object(C.a)(!vt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!Pe||!he||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!je&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!pe||be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var Re=Object(x.d)(fe);Object(C.a)(!ne||Re.every(function(Ye){return Object(f.a)(Ye)==="object"&&("key"in Ye||"value"in Ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!qe||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Be=null;Object(A.a)(ie).some(function(Ye){if(!K.isValidElement(Ye)||!Ye.type)return!1;var Ke=Ye.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var yt=Object(A.a)(Ye.props.children).every(function(Pt){return!K.isValidElement(Pt)||!Ye.type||Pt.type.isSelectOption?!0:(Be=Pt.type,!1)});return!yt}return Be=Ke,!0}),Be&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Be.displayName||Be.name||Be,"`.")),Object(C.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=_,W=Object(h.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:E,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:j,fillOptionsWithMissingValue:b.a}),w=function(v){Object(B.a)(Y,v);var H=Object(J.a)(Y);function Y(){var ie;return Object(te.a)(this,Y),ie=H.apply(this,arguments),ie.selectRef=K.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(Q.a)(Y,[{key:"render",value:function(){return K.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),Y}(K.Component);w.Option=o,w.OptGroup=T;var F=w,I=Ae.c=F},M8RZ:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return r});var te=U("fWQN"),Q=U("mtLc"),B=U("yKVA"),J=U("879j"),K=U("q1tI"),N=U.n(K),$=U("i8i4"),z=U.n($),r=function(D){Object(B.a)(g,D);var p=Object(J.a)(g);function g(m){var a;Object(te.a)(this,g),a=p.call(this,m);var d=window.document;return a.node=d.createElement("div"),d.body.appendChild(a.node),a}return Object(Q.a)(g,[{key:"render",value:function(){var a=this.props.children;return Object($.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(N.a.Component)},MI8n:function(kt,Ae,U){"use strict";U.d(Ae,"c",function(){return K}),U.d(Ae,"b",function(){return r}),U.d(Ae,"e",function(){return D}),U.d(Ae,"a",function(){return p}),U.d(Ae,"d",function(){return g}),U.d(Ae,"f",function(){return m});var te=U("/cxE"),Q=U("pmY6"),B=U("24hK"),J=U("5Y4S"),K;(function(a){a.None=()=>Q.a.None;function d(_){return(j,W=null,w)=>{let F=!1,I;return I=_(v=>F?void 0:(I?I.dispose():F=!0,j.call(W,v)),null,w),F&&I.dispose(),I}}a.once=d;function s(_,j){return T((W,w=null,F)=>_(I=>W.call(w,j(I)),null,F))}a.map=s;function i(_,j){return T((W,w=null,F)=>_(I=>{j(I),W.call(w,I)},null,F))}a.forEach=i;function t(_,j){return T((W,w=null,F)=>_(I=>j(I)&&W.call(w,I),null,F))}a.filter=t;function u(_){return _}a.signal=u;function o(..._){return(j,W=null,w)=>Object(Q.e)(..._.map(F=>F(I=>j.call(W,I),null,w)))}a.any=o;function R(_,j,W){let w=W;return s(_,F=>(w=j(w,F),w))}a.reduce=R;function T(_){let j;const W=new r({onFirstListenerAdd(){j=_(W.fire,W)},onLastListenerRemove(){j.dispose()}});return W.event}function S(_,j,W=100,w=!1,F){let I,v,H,Y=0;const ie=new r({leakWarningThreshold:F,onFirstListenerAdd(){I=_(le=>{Y++,v=j(v,le),w&&!H&&(ie.fire(v),v=void 0),clearTimeout(H),H=setTimeout(()=>{const he=v;v=void 0,H=void 0,(!w||Y>1)&&ie.fire(he),Y=0},W)})},onLastListenerRemove(){I.dispose()}});return ie.event}a.debounce=S;function A(_,j=(W,w)=>W===w){let W=!0,w;return t(_,F=>{const I=W||!j(F,w);return W=!1,w=F,I})}a.latch=A;function P(_,j){return[a.filter(_,j),a.filter(_,W=>!j(W))]}a.split=P;function E(_,j=!1,W=[]){let w=W.slice(),F=_(H=>{w?w.push(H):v.fire(H)});const I=()=>{w&&w.forEach(H=>v.fire(H)),w=null},v=new r({onFirstListenerAdd(){F||(F=_(H=>v.fire(H)))},onFirstListenerDidAdd(){w&&(j?setTimeout(I):I())},onLastListenerRemove(){F&&F.dispose(),F=null}});return v.event}a.buffer=E;class b{constructor(_){this.event=_}map(_){return new b(s(this.event,_))}forEach(_){return new b(i(this.event,_))}filter(_){return new b(t(this.event,_))}reduce(_,j){return new b(R(this.event,_,j))}latch(){return new b(A(this.event))}debounce(_,j=100,W=!1,w){return new b(S(this.event,_,j,W,w))}on(_,j,W){return this.event(_,j,W)}once(_,j,W){return d(this.event)(_,j,W)}}function h(_){return new b(_)}a.chain=h;function f(_,j,W=w=>w){const w=(...H)=>v.fire(W(...H)),F=()=>_.on(j,w),I=()=>_.removeListener(j,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:I});return v.event}a.fromNodeEventEmitter=f;function C(_,j,W=w=>w){const w=(...H)=>v.fire(W(...H)),F=()=>_.addEventListener(j,w),I=()=>_.removeEventListener(j,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:I});return v.event}a.fromDOMEventEmitter=C;function x(_){return new Promise(j=>d(_)(j))}a.toPromise=x})(K||(K={}));class N{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${N._idPool++}`}start(a){this._stopWatch=new J.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}N._idPool=0;let $=-1;class z{constructor(a,d=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=d,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let d=$;if(typeof this.customThreshold=="number"&&(d=this.customThreshold),d<=0||a<d)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=d*.5;let t,u=0;for(const[o,R]of this._stacks)(!t||u<R)&&(t=o,u=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${u}):`),console.warn(t)}return()=>{const t=this._stacks.get(s)||0;this._stacks.set(s,t-1)}}}class r{constructor(a){var d;this._disposed=!1,this._options=a,this._leakageMon=$>0?new z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((d=this._options)===null||d===void 0?void 0:d._profName)?new N(this._options._profName):void 0}get event(){return this._event||(this._event=(a,d,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(d?[a,d]:a);t&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,d);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),R=Object(Q.i)(()=>{if(o&&o(),!this._disposed&&(u(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return s instanceof Q.b?s.add(R):Array.isArray(s)&&s.push(R),R}),this._event}fire(a){var d,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new B.a);for(let i of this._listeners)this._deliveryQueue.push([i,a]);for((d=this._perfMon)===null||d===void 0||d.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,t]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,t):i[0].call(i[1],t)}catch(u){Object(te.f)(u)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var a,d,s,i,t;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(d=this._deliveryQueue)===null||d===void 0||d.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 p extends D{constructor(a){var d;super(a);this._delay=(d=a.delay)!==null&&d!==void 0?d:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class g{constructor(){this.buffers=[]}wrapEvent(a){return(d,s,i)=>a(t=>{const u=this.buffers[this.buffers.length-1];u?u.push(()=>d.call(s,t)):d.call(s,t)},void 0,i)}bufferEvents(a){const d=[];this.buffers.push(d);const s=a();return this.buffers.pop(),d.forEach(i=>i()),s}}class m{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(kt,Ae,U){"use strict";(function(te,Q){U.d(Ae,"b",function(){return s}),U.d(Ae,"i",function(){return o}),U.d(Ae,"f",function(){return R}),U.d(Ae,"d",function(){return T}),U.d(Ae,"g",function(){return S}),U.d(Ae,"h",function(){return A}),U.d(Ae,"c",function(){return P}),U.d(Ae,"k",function(){return E}),U.d(Ae,"j",function(){return b}),U.d(Ae,"a",function(){return h}),U.d(Ae,"e",function(){return x});var B;const J="en";let K=!1,N=!1,$=!1,z=!1,r=!1,D=!1,p=!1,g,m=J,a,d;const s=typeof self=="object"?self:typeof te=="object"?te:{};let i;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?i=s.vscode.process:typeof Q!="undefined"&&(i=Q);const t=typeof((B=i==null?void 0:i.versions)===null||B===void 0?void 0:B.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!t)d=navigator.userAgent,K=d.indexOf("Windows")>=0,N=d.indexOf("Macintosh")>=0,p=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,$=d.indexOf("Linux")>=0,D=!0,g=navigator.language,m=g;else if(typeof i=="object"){K=i.platform==="win32",N=i.platform==="darwin",$=i.platform==="linux",z=$&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,g=J,m=J;const _=i.env.VSCODE_NLS_CONFIG;if(_)try{const j=JSON.parse(_),W=j.availableLanguages["*"];g=j.locale,m=W||J,a=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let u=0;N?u=1:K?u=3:$&&(u=2);const o=K,R=N,T=$,S=r,A=D,P=p,E=d,b=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 I=0,v=W.length;I<v;I++){const H=W[I];if(H.id===F.data.vscodeSetImmediateId){W.splice(I,1),H.callback();return}}});let w=0;return F=>{const I=++w;W.push({id:I,callback:F}),s.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const j=Promise.resolve();return W=>j.then(W)}(),h=N||p?2:K?1:3;let f=!0,C=!1;function x(){if(!C){C=!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(kt,Ae,U){"use strict";U.d(Ae,"C",function(){return te}),U.d(Ae,"v",function(){return B}),U.d(Ae,"s",function(){return J}),U.d(Ae,"t",function(){return K}),U.d(Ae,"U",function(){return N}),U.d(Ae,"J",function(){return $}),U.d(Ae,"O",function(){return z}),U.d(Ae,"p",function(){return r}),U.d(Ae,"T",function(){return D}),U.d(Ae,"q",function(){return p}),U.d(Ae,"N",function(){return g}),U.d(Ae,"M",function(){return m}),U.d(Ae,"Q",function(){return a}),U.d(Ae,"u",function(){return d}),U.d(Ae,"x",function(){return s}),U.d(Ae,"I",function(){return i}),U.d(Ae,"f",function(){return t}),U.d(Ae,"h",function(){return u}),U.d(Ae,"g",function(){return o}),U.d(Ae,"i",function(){return R}),U.d(Ae,"G",function(){return T}),U.d(Ae,"H",function(){return S}),U.d(Ae,"r",function(){return A}),U.d(Ae,"R",function(){return P}),U.d(Ae,"d",function(){return E}),U.d(Ae,"e",function(){return b}),U.d(Ae,"E",function(){return h}),U.d(Ae,"F",function(){return f}),U.d(Ae,"j",function(){return C}),U.d(Ae,"z",function(){return x}),U.d(Ae,"K",function(){return j}),U.d(Ae,"L",function(){return W}),U.d(Ae,"m",function(){return F}),U.d(Ae,"k",function(){return v}),U.d(Ae,"A",function(){return Y}),U.d(Ae,"a",function(){return ie}),U.d(Ae,"n",function(){return le}),U.d(Ae,"l",function(){return he}),U.d(Ae,"D",function(){return we}),U.d(Ae,"B",function(){return Pe}),U.d(Ae,"b",function(){return xe}),U.d(Ae,"S",function(){return Oe}),U.d(Ae,"o",function(){return pe}),U.d(Ae,"P",function(){return be}),U.d(Ae,"w",function(){return ne}),U.d(Ae,"c",function(){return fe}),U.d(Ae,"y",function(){return qe});function te(Re){return!Re||typeof Re!="string"?!0:Re.trim().length===0}const Q=/{(\d+)}/g;function B(Re,...Be){return Be.length===0?Re:Re.replace(Q,function(Ye,Ke){const yt=parseInt(Ke,10);return isNaN(yt)||yt<0||yt>=Be.length?Ye:Be[yt]})}function J(Re){return Re.replace(/[<>&]/g,function(Be){switch(Be){case"<":return"<";case">":return">";case"&":return"&";default:return Be}})}function K(Re){return Re.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N(Re,Be=" "){const Ye=$(Re,Be);return z(Ye,Be)}function $(Re,Be){if(!Re||!Be)return Re;const Ye=Be.length;if(Ye===0||Re.length===0)return Re;let Ke=0;for(;Re.indexOf(Be,Ke)===Ke;)Ke=Ke+Ye;return Re.substring(Ke)}function z(Re,Be){if(!Re||!Be)return Re;const Ye=Be.length,Ke=Re.length;if(Ye===0||Ke===0)return Re;let yt=Ke,Pt=-1;for(;!(Pt=Re.lastIndexOf(Be,yt-1),Pt===-1||Pt+Ye!==yt);){if(Pt===0)return"";yt=Pt}return Re.substring(0,yt)}function r(Re){return Re.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(Re){return Re.replace(/\*/g,"")}function p(Re,Be,Ye={}){if(!Re)throw new Error("Cannot create regex from empty string");Be||(Re=K(Re)),Ye.wholeWord&&(/\B/.test(Re.charAt(0))||(Re="\\b"+Re),/\B/.test(Re.charAt(Re.length-1))||(Re=Re+"\\b"));let Ke="";return Ye.global&&(Ke+="g"),Ye.matchCase||(Ke+="i"),Ye.multiline&&(Ke+="m"),Ye.unicode&&(Ke+="u"),new RegExp(Re,Ke)}function g(Re){if(Re.source==="^"||Re.source==="^$"||Re.source==="$"||Re.source==="^\\s*$")return!1;const Be=Re.exec("");return!!(Be&&Re.lastIndex===0)}function m(Re){return(Re.global?"g":"")+(Re.ignoreCase?"i":"")+(Re.multiline?"m":"")+(Re.unicode?"u":"")}function a(Re){return Re.split(/\r\n|\r|\n/)}function d(Re){for(let Be=0,Ye=Re.length;Be<Ye;Be++){const Ke=Re.charCodeAt(Be);if(Ke!==32&&Ke!==9)return Be}return-1}function s(Re,Be=0,Ye=Re.length){for(let Ke=Be;Ke<Ye;Ke++){const yt=Re.charCodeAt(Ke);if(yt!==32&&yt!==9)return Re.substring(Be,Ke)}return Re.substring(Be,Ye)}function i(Re,Be=Re.length-1){for(let Ye=Be;Ye>=0;Ye--){const Ke=Re.charCodeAt(Ye);if(Ke!==32&&Ke!==9)return Ye}return-1}function t(Re,Be){return Re<Be?-1:Re>Be?1:0}function u(Re,Be,Ye=0,Ke=Re.length,yt=0,Pt=Be.length){for(;Ye<Ke&&yt<Pt;Ye++,yt++){let an=Re.charCodeAt(Ye),tn=Be.charCodeAt(yt);if(an<tn)return-1;if(an>tn)return 1}const Ht=Ke-Ye,Xt=Pt-yt;return Ht<Xt?-1:Ht>Xt?1:0}function o(Re,Be){return R(Re,Be,0,Re.length,0,Be.length)}function R(Re,Be,Ye=0,Ke=Re.length,yt=0,Pt=Be.length){for(;Ye<Ke&&yt<Pt;Ye++,yt++){let an=Re.charCodeAt(Ye),tn=Be.charCodeAt(yt);if(an===tn)continue;if(an>=128||tn>=128)return u(Re.toLowerCase(),Be.toLowerCase(),Ye,Ke,yt,Pt);T(an)&&(an-=32),T(tn)&&(tn-=32);const et=an-tn;if(et===0)continue;return et}const Ht=Ke-Ye,Xt=Pt-yt;return Ht<Xt?-1:Ht>Xt?1:0}function T(Re){return Re>=97&&Re<=122}function S(Re){return Re>=65&&Re<=90}function A(Re,Be){return Re.length===Be.length&&R(Re,Be)===0}function P(Re,Be){const Ye=Be.length;return Be.length>Re.length?!1:R(Re,Be,0,Ye)===0}function E(Re,Be){let Ye,Ke=Math.min(Re.length,Be.length);for(Ye=0;Ye<Ke;Ye++)if(Re.charCodeAt(Ye)!==Be.charCodeAt(Ye))return Ye;return Ke}function b(Re,Be){let Ye,Ke=Math.min(Re.length,Be.length);const yt=Re.length-1,Pt=Be.length-1;for(Ye=0;Ye<Ke;Ye++)if(Re.charCodeAt(yt-Ye)!==Be.charCodeAt(Pt-Ye))return Ye;return Ke}function h(Re){return 55296<=Re&&Re<=56319}function f(Re){return 56320<=Re&&Re<=57343}function C(Re,Be){return(Re-55296<<10)+(Be-56320)+65536}function x(Re,Be,Ye){const Ke=Re.charCodeAt(Ye);if(h(Ke)&&Ye+1<Be){const yt=Re.charCodeAt(Ye+1);if(f(yt))return C(Ke,yt)}return Ke}function _(Re,Be){const Ye=Re.charCodeAt(Be-1);if(f(Ye)&&Be>1){const Ke=Re.charCodeAt(Be-2);if(h(Ke))return C(Ke,Ye)}return Ye}function j(Re,Be){const Ye=_e.getInstance(),Ke=Be,yt=Re.length,Pt=x(Re,yt,Be);Be+=Pt>=65536?2:1;let Ht=Ye.getGraphemeBreakType(Pt);for(;Be<yt;){const Xt=x(Re,yt,Be),an=Ye.getGraphemeBreakType(Xt);if(fe(Ht,an))break;Be+=Xt>=65536?2:1,Ht=an}return Be-Ke}function W(Re,Be){const Ye=_e.getInstance(),Ke=Be,yt=_(Re,Be);Be-=yt>=65536?2:1;let Pt=Ye.getGraphemeBreakType(yt);for(;Be>0;){const Ht=_(Re,Be),Xt=Ye.getGraphemeBreakType(Ht);if(fe(Xt,Pt))break;Be-=Ht>=65536?2:1,Pt=Xt}return Ke-Be}const w=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function F(Re){return w.test(Re)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function v(Re){return I.test(Re)}const H=/^[\t\n\r\x20-\x7E]*$/;function Y(Re){return H.test(Re)}const ie=/[\u2028\u2029]/;function le(Re){return ie.test(Re)}function he(Re){for(let Be=0,Ye=Re.length;Be<Ye;Be++)if(we(Re.charCodeAt(Be)))return!0;return!1}function we(Re){return Re=+Re,Re>=11904&&Re<=55215||Re>=63744&&Re<=64255||Re>=65281&&Re<=65374}function Pe(Re){return Re>=127462&&Re<=127487||Re===8986||Re===8987||Re===9200||Re===9203||Re>=9728&&Re<=10175||Re===11088||Re===11093||Re>=127744&&Re<=128591||Re>=128640&&Re<=128764||Re>=128992&&Re<=129003||Re>=129280&&Re<=129535||Re>=129648&&Re<=129750}const xe=String.fromCharCode(65279);function Oe(Re){return!!(Re&&Re.length>0&&Re.charCodeAt(0)===65279)}function pe(Re,Be=!1){return Re?(Be&&(Re=Re.replace(/\\./g,"")),Re.toLowerCase()!==Re):!1}function be(Re){const Be=90-65+1;return Re=Re%(2*Be),Re<Be?String.fromCharCode(97+Re):String.fromCharCode(65+Re-Be)}function ne(Re){const Be=_e.getInstance();return Be.getGraphemeBreakType(Re)}function fe(Re,Be){return Re===0?Be!==5&&Be!==7:Re===2&&Be===3?!1:Re===4||Re===2||Re===3||(Be===4||Be===2||Be===3)?!0:Re===8&&(Be===8||Be===9||Be===11||Be===12)||((Re===11||Re===9)&&(Be===9||Be===10)||((Re===12||Re===10)&&Be===10||(Be===5||Be===13||(Be===7||(Re===1||Re===13&&Be===14)))))?!1:!(Re===6&&Be===6)}class _e{constructor(){this._data=ke()}static getInstance(){return _e._INSTANCE||(_e._INSTANCE=new _e),_e._INSTANCE}getGraphemeBreakType(Re){if(Re<32)return Re===10?3:Re===13?2:4;if(Re<127)return 0;const Be=this._data,Ye=Be.length/3;let Ke=1;for(;Ke<=Ye;)if(Re<Be[3*Ke])Ke=2*Ke;else if(Re>Be[3*Ke+1])Ke=2*Ke+1;else return Be[3*Ke+2];return 0}}_e._INSTANCE=null;function ke(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function qe(Re,Be){if(Re===0)return 0;const Ye=je(Re,Be);if(Ye!==void 0)return Ye;const Ke=_(Be,Re);return Re-=st(Ke),Re}function je(Re,Be){let Ye=_(Be,Re);for(Re-=st(Ye);vt(Ye)||Ye===65039||Ye===8419;){if(Re===0)return;Ye=_(Be,Re),Re-=st(Ye)}if(!Pe(Ye))return;if(Re>=0){const Ke=_(Be,Re);Ke===8205&&(Re-=st(Ke))}return Re}function st(Re){return Re>=65536?2:1}function vt(Re){return 127995<=Re&&Re<=127999}},NLgs:function(kt,Ae,U){"use strict";U.d(Ae,"e",function(){return i}),U.d(Ae,"f",function(){return t}),U.d(Ae,"d",function(){return o}),U.d(Ae,"c",function(){return R}),U.d(Ae,"a",function(){return T}),U.d(Ae,"b",function(){return S});var te=U("miYZ"),Q=U("tsqr"),B=U("9og8"),J=U("2qtc"),K=U("kLXV"),N=U("WmNS"),$=U.n(N),z=U("q1tI"),r=U.n(z),D=U("9kvl"),p=U("xKgJ"),g=U("1vsH"),m=U("RCxd"),a=U("yTi+"),d=U.n(a),s=U("m3rI"),i=function(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(t(P)&&u(E))},t=function(P){return Object(p.p)()?!0:(P({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},u=function(){var P,E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=Object(D.c)()._store.getState(),h=b.user;return(P=h.userInfo)!==null&&P!==void 0&&P.profile_completed?!0:(K.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:E?"\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,E=Object(D.c)()._store.getState(),b=E.user;return(P=b.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(g.S)("/account/certification")}}),!1)},R=function(){var P;if(Object(p.a)())return!0;var E=Object(D.c)()._store.getState(),b=E.user,h=E.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},T=function(P,E){var b;if(P)return!0;var h=Object(D.c)()._store.getState(),f=h.user,C=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,E||"\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+(C==null||((b=C.setting)===null||b===void 0)?void 0:b.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(g.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=Object(D.c)()._store.getState(),h=b.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(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",E,"\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:d.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(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",E,"\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(m.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var C=Object(B.a)($.a.mark(function _(){var j;return $.a.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,P({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=w.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 w.stop()}},_)}));function x(){return C.apply(this,arguments)}return x}()})}}),!0):!1}},Nog9:function(kt,Ae,U){kt.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(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return N});var te=U("Kwbf");function Q($,z){var r=new Set;return $.forEach(function(D){z.has(D)||r.add(D)}),r}function B($){var z=$||{},r=z.disabled,D=z.disableCheckbox,p=z.checkable;return!!(r||D)||p===!1}function J($,z,r,D){for(var p=new Set($),g=new Set,m=0;m<=r;m+=1){var a=z.get(m)||new Set;a.forEach(function(t){var u=t.key,o=t.node,R=t.children,T=R===void 0?[]:R;p.has(u)&&!D(o)&&T.filter(function(S){return!D(S.node)}).forEach(function(S){p.add(S.key)})})}for(var d=new Set,s=r;s>=0;s-=1){var i=z.get(s)||new Set;i.forEach(function(t){var u=t.parent,o=t.node;if(D(o)||!t.parent||d.has(t.parent.key))return;if(D(t.parent.node)){d.add(u.key);return}var R=!0,T=!1;(u.children||[]).filter(function(S){return!D(S.node)}).forEach(function(S){var A=S.key,P=p.has(A);R&&!P&&(R=!1),!T&&(P||g.has(A))&&(T=!0)}),R&&p.add(u.key),T&&g.add(u.key),d.add(u.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Q(g,p))}}function K($,z,r,D,p){for(var g=new Set($),m=new Set(z),a=0;a<=D;a+=1){var d=r.get(a)||new Set;d.forEach(function(u){var o=u.key,R=u.node,T=u.children,S=T===void 0?[]:T;!g.has(o)&&!m.has(o)&&!p(R)&&S.filter(function(A){return!p(A.node)}).forEach(function(A){g.delete(A.key)})})}m=new Set;for(var s=new Set,i=D;i>=0;i-=1){var t=r.get(i)||new Set;t.forEach(function(u){var o=u.parent,R=u.node;if(p(R)||!u.parent||s.has(u.parent.key))return;if(p(u.parent.node)){s.add(o.key);return}var T=!0,S=!1;(o.children||[]).filter(function(A){return!p(A.node)}).forEach(function(A){var P=A.key,E=g.has(P);T&&!E&&(T=!1),!S&&(E||m.has(P))&&(S=!0)}),T||g.delete(o.key),S&&m.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(Q(m,g))}}function N($,z,r,D){var p=[],g;D?g=D:g=B;var m=new Set($.filter(function(i){var t=!!r[i];return t||p.push(i),t})),a=new Map,d=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),d=Math.max(d,u)}),Object(te.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return z===!0?s=J(m,a,d,g):s=K(m,z.halfCheckedKeys,a,d,g),s}},O2Wb:function(kt,Ae,U){kt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return D}),U.d(Ae,"a",function(){return p}),U.d(Ae,"k",function(){return g}),U.d(Ae,"h",function(){return m}),U.d(Ae,"i",function(){return a}),U.d(Ae,"g",function(){return d}),U.d(Ae,"c",function(){return s}),U.d(Ae,"d",function(){return i}),U.d(Ae,"j",function(){return o}),U.d(Ae,"e",function(){return R}),U.d(Ae,"f",function(){return T});var te=U("KQm4"),Q=U("U8pU"),B=U("Ff2n"),J=U("q1tI"),K=U.n(J),N=U("Kwbf"),$=U("WaYH"),z=.25,r=2;function D(S,A){var P=S.slice(),E=P.indexOf(A);return E>=0&&P.splice(E,1),P}function p(S,A){var P=S.slice();return P.indexOf(A)===-1&&P.push(A),P}function g(S){return S.split("-")}function m(S,A){return"".concat(S,"-").concat(A)}function a(S){return S&&S.type&&S.type.isTreeNode}function d(S,A){var P=[S],E=A[S];function b(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(f){var C=f.key,x=f.children;P.push(C),b(x)})}return b(E.children),P}function s(S,A){var P=S.clientY,E=A.selectHandle.getBoundingClientRect(),b=E.top,h=E.bottom,f=E.height,C=Math.max(f*z,r);return P<=b+C?-1:P>=h-C?1:0}function i(S,A){if(!S)return;var P=A.multiple;return P?S.slice():S.length?[S[0]]:S}var t=function(A){return A};function u(S,A){if(!S)return[];var P=A||{},E=P.processProps,b=E===void 0?t:E,h=Array.isArray(S)?S:[S];return h.map(function(f){var C=f.children,x=Object(B.a)(f,["children"]),_=u(C,A);return K.a.createElement($.a,Object.assign({},b(x)),_)})}function o(S){if(!S)return null;var A;if(Array.isArray(S))A={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Q.a)(S)==="object")A={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(N.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function R(S,A){var P=new Set;function E(b){if(P.has(b))return;var h=A[b];if(!h)return;P.add(b);var f=h.parent,C=h.node;if(C.disabled)return;f&&E(f.key)}return(S||[]).forEach(function(b){E(b)}),Object(te.a)(P)}function T(S){var A={};return Object.keys(S).forEach(function(P){(P.startsWith("data-")||P.startsWith("aria-"))&&(A[P]=S[P])}),A}},Ot1p:function(kt,Ae,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("rAM+"),J=U("miYZ"),K=U("tsqr"),N=U("9og8"),$=U("tJVT"),z=U("jrin"),r=U("WmNS"),D=U.n(r),p=U("q1tI"),g=U.n(p),m=U("VrN/"),a=U.n(m),d=U("bdgK"),s=U("p77/"),i=U("Bd2K"),t=U("ELLl"),u=U("19Vz"),o=U("lZu9"),R=U("+NIl"),T=U("kSUc"),S=U("9Bee"),A=function(Fe){var at=Fe.value,xt=at===void 0?"":at,Gt=Fe.className,$t=Fe.showTextOnly,Yt=Fe.showLines,$n=Fe.style,vn=$n===void 0?{}:$n,ln=Object(p.useMemo)(function(){return""},[xt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:ln}}))},P=U("0Owb"),E=U("dejd"),b=U("C+DQ"),h=U("1vsH"),f=U("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function x(Fe){var at=Fe.onActionCallback,xt=Fe.title,Gt=Fe.icon,$t=Fe.actionName,Yt=Fe.className,$n=Yt===void 0?"":Yt,vn=Fe.children;function ln(){at($t)}return g.a.createElement("a",{title:xt,className:$n,onClick:ln},g.a.createElement("i",{className:"md-iconfont ".concat(Gt)}),vn)}var _=function(Fe){var at=Fe.watch,xt=Fe.showNullButton,Gt=Fe.onActionCallback,$t=Fe.fullScreen,Yt=Fe.insertTemp,$n=Fe.hidetoolBar,vn=Fe.uuid,ln=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(vn,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var hn=[].concat(C,[{title:"".concat(at?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(at?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!$n&&hn.map(function(Gn,fr){return g.a.createElement("li",{key:fr},Gn.actionName?g.a.createElement(x,Object(P.a)({},Gn,{onActionCallback:Gt})):g.a.createElement("span",{className:"v-line"}))}),xt?g.a.createElement("li",null,g.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Gt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Yt&&g.a.createElement("li",null,g.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Yt),onActionCallback:Gt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(x,{icon:"".concat($t?"icon-shrink":"icon-enlarge"),title:$t?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Gt})))},j=U("M8RZ"),W=U("+L6B"),w=U("2/Rp"),F=U("y8nQ"),I=U("Vl3Y"),v=U("5NDa"),H=U("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ie=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Gt($t){at($t)}return g.a.createElement(I.a,Object(P.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Gt}),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(H.a,null)),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(H.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},le=U("7ahc"),he=U("HmJG"),we=U("BjJ7"),Pe=I.a.useForm,xe={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},pe=function(Fe){var at=Fe.callback,xt=Fe.onCancel,Gt=Pe(),$t=Object($.a)(Gt,1),Yt=$t[0];function $n(hn){at(hn)}function vn(hn,Gn){if(hn.status===-1){K.b.error(hn.message);return}Yt.setFieldsValue({src:"/api/attachments/".concat(hn.id),type:Gn.type})}function ln(hn){var Gn=hn.target.files[0];ne(Gn,vn)}return g.a.createElement(I.a,Object(P.a)({form:Yt},Oe,{className:"upload-image-panel",onFinish:$n}),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(H.a,{style:xe})),g.a.createElement(be,{onFileChange:ln}))),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(H.a,{style:{width:264}})),g.a.createElement(I.a.Item,{style:{textAlign:"right"}},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))};function be(Fe){var at=Fe.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:at}))}function ne(Fe,at){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var xt=new FormData;xt.append("editormd-image-file",Fe),xt.append("file_param_name","editormd-image-file"),xt.append("byxhr","true");var Gt=new window.XMLHttpRequest;Gt.withCredentials=!0,Gt.addEventListener("load",function($t){at(JSON.parse($t.target.responseText),Fe)},!1),Gt.addEventListener("error",function($t){console.error($t)},!1),Gt.open("POST","".concat(we.a,"/api/attachments.json")),Gt.send(xt)}var fe=U("giR+"),_e=U("fyUT"),ke=U("7Kak"),qe=U("9yH6"),je=qe.a.Group,st={margin:"0 8px"},vt=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Gt($t){at($t)}return g.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Gt},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:st},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:st},"\u884C\u6570"),g.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(_e.a,null)),g.a.createElement("span",{style:st},"\u5217\u6570"),g.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(_e.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:st},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(I.a.Item,{name:"align"},g.a.createElement(je,null,g.a.createElement(qe.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(qe.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(qe.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(qe.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},Re=U("ErOA"),Be=U("7Cbv"),Ye="link",Ke="upload-image",yt="code-block",Pt="add-table",Ht="------------",Xt={default:Ht,left:":".concat(Ht),center:":".concat(Ht,":"),right:"".concat(Ht,":")},an=U("9VGf"),tn,et;function Ze(){}var Ct=0,At=1e4,dt="\u2581",ft=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function He(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var Ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ue=Ne?"Cmd":"Ctrl",ge=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ee=(tn={},Object(z.a)(tn,Ue+"-B","bold"),Object(z.a)(tn,Ue+"-I","italic"),tn),De=(et={},Object(z.a)(et,Ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(z.a)(et,yt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(z.a)(et,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(z.a)(et,Pt,"\u6DFB\u52A0\u8868\u683C"),et),ue=Ae.a=function(Fe){var at=Fe.defaultValue,xt=at===void 0?"":at,Gt=Fe.onChange,$t=Fe.width,Yt=$t===void 0?"100%":$t,$n=Fe.height,vn=$n===void 0?400:$n,ln=Fe.miniToolbar,hn=ln===void 0?!1:ln,Gn=Fe.isFocus,fr=Gn===void 0?!1:Gn,vr=Fe.watch,ir=Fe.insertTemp,br=Fe.mode,Rr=br===void 0?"markdown":br,Jt=Fe.id,Ar=Jt===void 0?"markdown-editor-id":Jt,Nn=Fe.showResizeBar,Tn=Nn===void 0?!1:Nn,pr=Fe.noStorage,_r=pr===void 0?!1:pr,Pr=Fe.showNullButton,yr=Pr===void 0?!1:Pr,mt=Fe.hidetoolBar,Ge=mt===void 0?!1:mt,Ot=Fe.fullScreen,Me=Ot===void 0?!1:Ot,ye=Fe.onBlur,ve=Fe.onCMBeforeChange,or=Fe.onFullScreen,en=Fe.className,Ie=en===void 0?"":en,gt=Fe.disablePaste,Ce=gt===void 0?!1:gt,cn=Fe.placeholder,hr=cn===void 0?"":cn,mr=Fe.values,q=mr===void 0?"":mr,O=Object(p.useState)(null),M=Object($.a)(O,2),X=M[0],se=M[1],Z=Object(p.useState)(xt),Le=Object($.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(p.useState)(vr),ct=Object($.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(p.useState)(Me),Yn=Object($.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(p.useState)(""),sn=Object($.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(p.useState)(0),Bn=Object($.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(p.useState)(vn),Sn=Object($.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(p.useState)(!1),nr=Object($.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(p.useRef)(Object(Be.a)()),_n=Object(p.useRef)(!1),In=Object(p.useRef)(),wn=Object(p.useRef)(),Zn=Object(p.useRef)(),yn=Object(p.useRef)(),Vn=Object(p.useRef)(),qn=function(){var bt=Object(N.a)(D.a.mark(function lt(){var Je,nt;return D.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Re.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rn.current}});case 2:nt=pt.sent,nt!=null&&(Je=nt.attachments)!==null&&Je!==void 0&&Je.length&&(console.log("cm:",X,wn),nt.attachments.map(function(rt){rt.content_type.indexOf("image")>-1?X.replaceSelection(".concat(rt.content_type,")")):rt.content_type.indexOf("video")>-1?X.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):rt.content_type.indexOf("pdf")>-1?X.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,'&disposition=inline" target="_blank">').concat(rt.name,"</a>")):X.replaceSelection("[".concat(rt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,")"))}));case 4:case"end":return pt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}();Object(p.useEffect)(function(){wt(q),X==null||X.setValue(q)},[q]),Object(p.useEffect)(function(){or==null||or(Hn)},[Hn]),Object(p.useEffect)(function(){if(wn.current){var bt=a.a.fromTextArea(wn.current,{mode:Rr,lineNumbers:!hn,lineWrapping:!0,value:xt,autoCloseTags:!0,autoCloseBrackets:!0});fr&&bt.focus();function lt(Je,nt){if(Ce){nt.preventDefault();return}var ze=nt.clipboardData;if(ze){var pt=ze.types.toString(),rt=ze.items;if(pt==="Files"||ze.types.indexOf("Files")>-1){if(nt.preventDefault(),Rr=="stex")return;try{var Tt,Nt=rt[1];((Tt=rt[0])===null||Tt===void 0?void 0:Tt.kind)==="file"&&(Nt=rt[0]);var St=Nt.getAsFile(),Kt=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var It,En,on;(St==null||((It=St.type)===null||It===void 0)?void 0:It.indexOf("image"))>-1?bt.replaceSelection(".concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?bt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ge.includes(Kt)?bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):bt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})}catch(Rt){K.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return bt.on("paste",lt),bt.on("dragleave",function(Je,nt){Zn.current.classList.remove("mouse-hover-md")}),bt.on("dragover",function(Je,nt){Zn.current.classList.add("mouse-hover-md")}),bt.on("drop",function(Je,nt){Zn.current.classList.add("mouse-hover-md");var ze;if(ze=nt.dataTransfer.files,ze.length>0){nt.preventDefault(),nt.stopPropagation();for(var pt=function(Nt){var St=ze[Nt],Kt=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var It,En,on;(St==null||((It=St.type)===null||It===void 0)?void 0:It.indexOf("image"))>-1?bt.replaceSelection(".concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?bt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ge.includes(Kt)?bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):bt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})},rt=0;rt<ze.length;rt++)pt(rt)}}),se(bt),function(){bt.off("paste",lt)}}},[]);var kn=Object(p.useCallback)(function(){if(Zn.current)try{}catch(bt){console.log(bt,"---- to set md editor body height")}},[un,Zn,Hn]);Object(p.useEffect)(function(){function bt(){var Je=new d.default(function(nt){var ze=Object(B.a)(nt),pt;try{for(ze.s();!(pt=ze.n()).done;){var rt=pt.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&(kn(),X.setSize("100%","100%"),X.refresh())}}catch(Tt){ze.e(Tt)}finally{ze.f()}});return Je.observe(wn.current.parentElement),Je}if(X){var lt=bt();return function(){lt.unobserve(wn.current.parentElement)}}},[X,kn]),Object(p.useEffect)(function(){if(X){for(var bt=[],lt=function(){var rt=nt[Je];ze=Object($.a)(rt,2);var Tt=ze[0],Nt=ze[1],St=Object(z.a)({},Tt,function(){Pn(Nt)});bt.push(St),X.addKeyMap(St)},Je=0,nt=Object.entries(Ee);Je<nt.length;Je++){var ze;lt()}return In.current=setInterval(function(){_n.current&&qn()},4e3),function(){clearInterval(In.current);var pt=Object(B.a)(bt),rt;try{for(pt.s();!(rt=pt.n()).done;){var Tt=rt.value;X.removeKeyMap(Tt)}}catch(Nt){pt.e(Nt)}finally{pt.f()}}}},[X]),Object(p.useEffect)(function(){Me!==Hn&&fn(Me)},[Me]),Object(an.a)(function(){if(!_r&&xn>0){var bt=new Date().getTime(),lt=window.sessionStorage.getItem(Ar);bt>=xn+At&&(!lt||lt!==ot)&&(window.sessionStorage.setItem(Ar,ot),Kn(!0))}},At),Object(p.useEffect)(function(){Mt(vr)},[X,vr]),Object(p.useEffect)(function(){X&&(fr&&X.focus())},[X,fr]),Object(p.useEffect)(function(){if(Et&&X){var bt=X.getScrollerElement();function lt(Je){var nt=Je.target;if(Vn.current){var ze=nt.scrollTop/nt.scrollHeight;Vn.current.scrollTop=Vn.current.scrollHeight*ze}}return bt.addEventListener("scroll",lt),function(){bt.removeEventListener("scroll",lt)}}},[X,Et]),Object(p.useEffect)(function(){if(X&&ve){function bt(lt,Je){ve(lt,Je)}return X.on("beforeChange",bt),function(){X.off("beforeChange",bt)}}},[X,ve]),Object(p.useEffect)(function(){if(X&&ye){function bt(){ye(X.getValue())}return X.on("blur",bt),function(){X.off("blur",bt)}}},[X,ye]),Object(p.useEffect)(function(){if(X){function bt(lt){var Je=lt.getValue();wt(Je),Jn(new Date().getTime()),lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Gt&&Gt(Je)}return X.on("change",bt),function(){X.off("change",bt)}}},[X,Gt]),Object(p.useEffect)(function(){X&&(xt==null?(X.setValue(""),wt("")):xt!==X.getValue()&&(X.setValue(xt),wt(xt),X.setCursor(X.lineCount(),0)))},[X,xt]);var Pn=Object(p.useCallback)(function(bt){var lt=X.getCursor(),Je=X.getSelection(),nt=Je.split(`
|
|
`);switch(bt){case"bold":return X.replaceSelection("**"+Je+"**"),Je===""&&X.setCursor(lt.line,lt.ch+2),X.focus();case"italic":return X.replaceSelection("*"+Je+"*"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"code":return X.replaceSelection("`"+Je+"`"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+Je+"$$`"),Je===""&&X.setCursor(lt.line,lt.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+Je+"\n```"),X.setCursor(lt.line+1,Je.length+1),X.focus();case"line-break":return X.replaceSelection(`<br/>
|
|
`),X.focus();case"list-ul":return Je===""?X.replaceSelection("- "+Je):X.replaceSelection(nt.map(function(ze){return ze===""?"":"- ".concat(ze)}).join(`
|
|
`)),X.focus();case"list-ol":return Je===""?X.replaceSelection("1. "+Je):X.replaceSelection(nt.map(function(ze,pt){return ze===""?"":"".concat(pt+1,". ").concat(ze)}).join(`
|
|
`)),X.focus();case"add-null-ch":return Je===""&&X.setCursor(lt.line,lt.ch+1),X.replaceSelection(dt),X.focus();case"inster-template-1":return Je===""&&X.setCursor(lt.line,lt.ch),X.replaceSelection(ft),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return Mt(!Et),X.focus();case"trigger-full-screen":return fn(!Hn),X.focus();case Ye:Ft(Ye);return;case yt:Ft(yt);return;case Ke:Ft(Ke);return;case Pt:Ft(Pt);return;default:throw new Error}},[X,Et,Hn]),Mn=Object(p.useCallback)(function(bt){Ft("");switch(qt){case Ye:var lt=bt.title,Je=bt.link;return X.replaceSelection("[".concat(lt,"](").concat(Je,")")),X.focus();case yt:var nt=bt.language,ze=bt.content;return X.replaceSelection(["```"+nt,ze,"```"].join(`
|
|
`)),X.focus();case Ke:var pt=bt.src,rt=bt.alt;return rt?X.replaceSelection(".concat(pt,' "').concat(rt,'" )')):X.replaceSelection("")),X.focus();case Pt:for(var Tt=bt.row,Nt=bt.col,St=bt.align,Kt=`
|
|
`,Rt=0;Rt<Tt;Rt++){for(var It=[],En=[],on=0;on<Nt;on++)Rt===1&&En.push(Xt[St]),It.push(" ");Rt===1&&(Kt+="| ".concat(En.join(" | "),` |
|
|
`)),Kt+="| ".concat(It.join(Nt===1?"":" | "),` |
|
|
`)}return X.replaceSelection(Kt+`
|
|
`),X.focus();default:throw new Error}},[X,qt]),Dn=Object(p.useMemo)(function(){switch(qt){case Ye:return g.a.createElement(ie,{callback:Mn,onCancel:dn});case yt:return g.a.createElement(le.b,{callback:Mn,onCancel:dn});case Ke:return g.a.createElement(pe,{callback:Mn,onCancel:dn});case Pt:return g.a.createElement(vt,{callback:Mn,onCancel:dn});default:return null}},[qt]);function dn(){Ft("")}Object(p.useEffect)(function(){if(yn.current){var bt=yn.current,lt=!1,Je=0;function nt(rt){lt=!0,Je=rt.pageY}function ze(){lt=!1}function pt(rt){if(lt){var Tt=rt.pageY-Je;Tt<0&&(Tt=0),Tt>300&&(Tt=300);var Nt=vn+Tt+"px";Un(Nt)}}return bt.addEventListener("mousedown",nt),document.addEventListener("mousemove",pt),document.addEventListener("mouseup",ze),function(){bt.removeEventListener("mousedown",nt),document.removeEventListener("mousemove",pt),document.removeEventListener("mouseup",ze)}}},[X,yn]),Object(p.useEffect)(function(){Un(vn)},[vn]);var Ut=He(Yt),zt=He(un),Vt={width:Ut,height:zt},jt=Object(p.useMemo)(function(){if(xn){var bt=new Date(xn),lt=bt.getHours(),Je=bt.getMinutes(),nt=bt.getSeconds();return lt=lt<10?"0"+lt:lt,Je=Je<10?"0"+Je:Je,nt=nt<10?"0"+nt:nt,"".concat(lt,":").concat(Je,":").concat(nt)}return 0},[xn]);function nn(){window.sessionStorage.removeItem(Ar),Kn(!1),Jn(0)}function bn(){Kn(!1),Jn(0),X.setValue(window.sessionStorage.getItem(Ar))}function gn(bt,lt){var Je=X.getValue();Je=Je.replace(bt,lt),wt(Je),X==null||X.setValue(Je)}return g.a.createElement(p.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Zn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Ie," ").concat(Et?"on-preview":""," ").concat(hn?"mini":""," ").concat(Hn?"full-screen":""),style:Vt},g.a.createElement(_,{insertTemp:ir,watch:Et,fullScreen:Hn,showNullButton:yr,onActionCallback:Pn,hidetoolBar:Ge,uuid:rn.current,setOpenPhones:function(){_n.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:wn,placeholder:hr})),Et?g.a.createElement("div",{ref:Vn,className:"preview-container"},Rr==="stex"&&g.a.createElement(A,{value:ot}),Rr!=="stex"&&g.a.createElement(S.a,{edit:!0,value:ot,replaces:gn})):null))),Tn?g.a.createElement("a",{ref:yn,className:"editor-resize"}):null,g.a.createElement(j.a,null,De[qt]?g.a.createElement(Q.a,{centered:!0,title:De[qt],visible:!0,onCancel:dn,footer:null,className:"markdown-popup-form"},Dn):null))}},Pxm8:function(kt,Ae,U){kt.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(kt,Ae,U){"use strict";var te=U("q1tI"),Q=U("uciX"),B=U("2W6z"),J=U.n(B),K=U("4IlW"),N=U("uK0f"),$=U.n(N);function z(xe,Oe){if(xe===Oe)return!0;if(!xe||!Oe)return!1;var pe=xe.length;if(Oe.length!==pe)return!1;for(var be=0;be<pe;be++)if(xe[be]!==Oe[be])return!1;return!0}function r(xe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(pe){return typeof pe}:r=function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},r(xe)}function D(xe,Oe){if(!(xe instanceof Oe))throw new TypeError("Cannot call a class as a function")}function p(xe,Oe){for(var pe=0;pe<Oe.length;pe++){var be=Oe[pe];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(xe,be.key,be)}}function g(xe,Oe,pe){return Oe&&p(xe.prototype,Oe),pe&&p(xe,pe),xe}function m(xe,Oe){if(typeof Oe!="function"&&Oe!==null)throw new TypeError("Super expression must either be null or a function");xe.prototype=Object.create(Oe&&Oe.prototype,{constructor:{value:xe,writable:!0,configurable:!0}}),Oe&&a(xe,Oe)}function a(xe,Oe){return a=Object.setPrototypeOf||function(be,ne){return be.__proto__=ne,be},a(xe,Oe)}function d(xe){var Oe=t();return function(){var pe=u(xe),be;if(Oe){var ne=u(this).constructor;be=Reflect.construct(pe,arguments,ne)}else be=pe.apply(this,arguments);return s(this,be)}}function s(xe,Oe){return Oe&&(r(Oe)==="object"||typeof Oe=="function")?Oe:i(xe)}function i(xe){if(xe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return xe}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(xe){return!1}}function u(xe){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(pe){return pe.__proto__||Object.getPrototypeOf(pe)},u(xe)}var o=function(){var xe=function(Oe){m(be,Oe);var pe=d(be);function be(){var ne;return D(this,be),ne=pe.apply(this,arguments),ne.menuItems={},ne.saveMenuItem=function(fe){return function(_e){ne.menuItems[fe]=_e}},ne}return g(be,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(fe){!fe.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(fe){var _e=this.props,ke=_e.fieldNames,qe=_e.defaultFieldNames;return ke[fe]||qe[fe]}},{key:"getOption",value:function(fe,_e){var ke=this.props,qe=ke.prefixCls,je=ke.expandTrigger,st=ke.expandIcon,vt=ke.loadingIcon,Re=this.props.onSelect.bind(this,fe,_e),Be=this.props.onItemDoubleClick.bind(this,fe,_e),Ye={onClick:Re,onDoubleClick:Be},Ke="".concat(qe,"-menu-item"),yt=null,Pt=fe[this.getFieldName("children")]&&fe[this.getFieldName("children")].length>0;(Pt||fe.isLeaf===!1)&&(Ke+=" ".concat(qe,"-menu-item-expand"),fe.loading||(yt=te.createElement("span",{className:"".concat(qe,"-menu-item-expand-icon")},st))),je==="hover"&&(Pt||fe.isLeaf===!1)&&(Ye={onMouseEnter:this.delayOnSelect.bind(this,Re),onMouseLeave:this.delayOnSelect.bind(this),onClick:Re}),this.isActiveOption(fe,_e)&&(Ke+=" ".concat(qe,"-menu-item-active"),Ye.ref=this.saveMenuItem(_e)),fe.disabled&&(Ke+=" ".concat(qe,"-menu-item-disabled"));var Ht=null;fe.loading&&(Ke+=" ".concat(qe,"-menu-item-loading"),Ht=vt||null);var Xt="";return"title"in fe?Xt=fe.title:typeof fe[this.getFieldName("label")]=="string"&&(Xt=fe[this.getFieldName("label")]),te.createElement("li",Object.assign({key:fe[this.getFieldName("value")],className:Ke,title:Xt},Ye,{role:"menuitem",onMouseDown:function(tn){return tn.preventDefault()}}),fe[this.getFieldName("label")],yt,Ht)}},{key:"getActiveOptions",value:function(fe){var _e=this,ke=this.props.options,qe=fe||this.props.activeValue;return $()(ke,function(je,st){return je[_e.getFieldName("value")]===qe[st]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var fe=this,_e=this.props.options,ke=this.getActiveOptions().map(function(qe){return qe[fe.getFieldName("children")]}).filter(function(qe){return!!qe});return ke.unshift(_e),ke}},{key:"delayOnSelect",value:function(fe){for(var _e=this,ke=arguments.length,qe=new Array(ke>1?ke-1:0),je=1;je<ke;je++)qe[je-1]=arguments[je];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof fe=="function"&&(this.delayTimer=window.setTimeout(function(){fe(qe),_e.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var fe=this.getShowOptions().length,_e=0;_e<fe;_e++){var ke=this.menuItems[_e];ke&&ke.parentElement&&(ke.parentElement.scrollTop=ke.offsetTop)}}},{key:"isActiveOption",value:function(fe,_e){var ke=this.props.activeValue,qe=ke===void 0?[]:ke;return qe[_e]===fe[this.getFieldName("value")]}},{key:"render",value:function(){var fe=this,_e=this.props,ke=_e.prefixCls,qe=_e.dropdownMenuColumnStyle;return te.createElement("div",null,this.getShowOptions().map(function(je,st){return te.createElement("ul",{className:"".concat(ke,"-menu"),key:st,style:qe},je.map(function(vt){return fe.getOption(vt,st)}))}))}}]),be}(te.Component);return xe.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},xe}(),R=o,T={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},S=T;function A(xe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(pe){return typeof pe}:A=function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},A(xe)}function P(xe,Oe){if(xe==null)return{};var pe=E(xe,Oe),be,ne;if(Object.getOwnPropertySymbols){var fe=Object.getOwnPropertySymbols(xe);for(ne=0;ne<fe.length;ne++){if(be=fe[ne],Oe.indexOf(be)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(xe,be))continue;pe[be]=xe[be]}}return pe}function E(xe,Oe){if(xe==null)return{};var pe={},be=Object.keys(xe),ne,fe;for(fe=0;fe<be.length;fe++){if(ne=be[fe],Oe.indexOf(ne)>=0)continue;pe[ne]=xe[ne]}return pe}function b(xe){return x(xe)||C(xe)||f(xe)||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(xe,Oe){if(!xe)return;if(typeof xe=="string")return _(xe,Oe);var pe=Object.prototype.toString.call(xe).slice(8,-1);if(pe==="Object"&&xe.constructor&&(pe=xe.constructor.name),pe==="Map"||pe==="Set")return Array.from(xe);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return _(xe,Oe)}function C(xe){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(xe))return Array.from(xe)}function x(xe){if(Array.isArray(xe))return _(xe)}function _(xe,Oe){(Oe==null||Oe>xe.length)&&(Oe=xe.length);for(var pe=0,be=new Array(Oe);pe<Oe;pe++)be[pe]=xe[pe];return be}function j(xe,Oe){if(!(xe instanceof Oe))throw new TypeError("Cannot call a class as a function")}function W(xe,Oe){for(var pe=0;pe<Oe.length;pe++){var be=Oe[pe];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(xe,be.key,be)}}function w(xe,Oe,pe){return Oe&&W(xe.prototype,Oe),pe&&W(xe,pe),xe}function F(xe,Oe){if(typeof Oe!="function"&&Oe!==null)throw new TypeError("Super expression must either be null or a function");xe.prototype=Object.create(Oe&&Oe.prototype,{constructor:{value:xe,writable:!0,configurable:!0}}),Oe&&I(xe,Oe)}function I(xe,Oe){return I=Object.setPrototypeOf||function(be,ne){return be.__proto__=ne,be},I(xe,Oe)}function v(xe){var Oe=ie();return function(){var pe=le(xe),be;if(Oe){var ne=le(this).constructor;be=Reflect.construct(pe,arguments,ne)}else be=pe.apply(this,arguments);return H(this,be)}}function H(xe,Oe){return Oe&&(A(Oe)==="object"||typeof Oe=="function")?Oe:Y(xe)}function Y(xe){if(xe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return xe}function ie(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(xe){return!1}}function le(xe){return le=Object.setPrototypeOf?Object.getPrototypeOf:function(pe){return pe.__proto__||Object.getPrototypeOf(pe)},le(xe)}var he=function(){var xe=function(Oe){F(be,Oe);var pe=v(be);function be(ne){var fe;j(this,be),fe=pe.call(this,ne),fe.setPopupVisible=function(ke){var qe=fe.state.value;"popupVisible"in fe.props||fe.setState({popupVisible:ke}),ke&&!fe.state.popupVisible&&fe.setState({activeValue:qe}),fe.props.onPopupVisibleChange(ke)},fe.handleChange=function(ke,qe,je){var st=qe.visible;(je.type!=="keydown"||je.keyCode===K.a.ENTER)&&(fe.props.onChange(ke.map(function(vt){return vt[fe.getFieldName("value")]}),ke),fe.setPopupVisible(st))},fe.handlePopupVisibleChange=function(ke){fe.setPopupVisible(ke)},fe.handleMenuSelect=function(ke,qe,je){var st=fe.trigger.getRootDomNode();st&&st.focus&&st.focus();var vt=fe.props,Re=vt.changeOnSelect,Be=vt.loadData,Ye=vt.expandTrigger;if(!ke||ke.disabled)return;var Ke=fe.state.activeValue;Ke=Ke.slice(0,qe+1),Ke[qe]=ke[fe.getFieldName("value")];var yt=fe.getActiveOptions(Ke);if(ke.isLeaf===!1&&!ke[fe.getFieldName("children")]&&Be){Re&&fe.handleChange(yt,{visible:!0},je),fe.setState({activeValue:Ke}),Be(yt);return}var Pt={};!ke[fe.getFieldName("children")]||!ke[fe.getFieldName("children")].length?(fe.handleChange(yt,{visible:!1},je),Pt.value=Ke):Re&&(je.type==="click"||je.type==="keydown")&&(Ye==="hover"?fe.handleChange(yt,{visible:!1},je):fe.handleChange(yt,{visible:!0},je),Pt.value=Ke),Pt.activeValue=Ke,("value"in fe.props||je.type==="keydown"&&je.keyCode!==K.a.ENTER)&&delete Pt.value,fe.setState(Pt)},fe.handleItemDoubleClick=function(){var ke=fe.props.changeOnSelect;ke&&fe.setPopupVisible(!1)},fe.handleKeyDown=function(ke){var qe=fe.props.children;if(qe&&qe.props.onKeyDown){qe.props.onKeyDown(ke);return}var je=b(fe.state.activeValue),st=je.length-1<0?0:je.length-1,vt=fe.getCurrentLevelOptions(),Re=vt.map(function(yt){return yt[fe.getFieldName("value")]}).indexOf(je[st]);if(ke.keyCode!==K.a.DOWN&&ke.keyCode!==K.a.UP&&ke.keyCode!==K.a.LEFT&&ke.keyCode!==K.a.RIGHT&&ke.keyCode!==K.a.ENTER&&ke.keyCode!==K.a.SPACE&&ke.keyCode!==K.a.BACKSPACE&&ke.keyCode!==K.a.ESC&&ke.keyCode!==K.a.TAB)return;if(!fe.state.popupVisible&&ke.keyCode!==K.a.BACKSPACE&&ke.keyCode!==K.a.LEFT&&ke.keyCode!==K.a.RIGHT&&ke.keyCode!==K.a.ESC&&ke.keyCode!==K.a.TAB){fe.setPopupVisible(!0);return}if(ke.keyCode===K.a.DOWN||ke.keyCode===K.a.UP){ke.preventDefault();var Be=Re;Be!==-1?ke.keyCode===K.a.DOWN?(Be+=1,Be=Be>=vt.length?0:Be):(Be-=1,Be=Be<0?vt.length-1:Be):Be=0,je[st]=vt[Be][fe.getFieldName("value")]}else if(ke.keyCode===K.a.LEFT||ke.keyCode===K.a.BACKSPACE)ke.preventDefault(),je.splice(je.length-1,1);else if(ke.keyCode===K.a.RIGHT)ke.preventDefault(),vt[Re]&&vt[Re][fe.getFieldName("children")]&&je.push(vt[Re][fe.getFieldName("children")][0][fe.getFieldName("value")]);else if(ke.keyCode===K.a.ESC||ke.keyCode===K.a.TAB){fe.setPopupVisible(!1);return}(!je||je.length===0)&&fe.setPopupVisible(!1);var Ye=fe.getActiveOptions(je),Ke=Ye[Ye.length-1];fe.handleMenuSelect(Ke,Ye.length-1,ke),fe.props.onKeyDown&&fe.props.onKeyDown(ke)},fe.saveTrigger=function(ke){fe.trigger=ke};var _e=[];return"value"in ne?_e=ne.value||[]:"defaultValue"in ne&&(_e=ne.defaultValue||[]),J()(!("filedNames"in ne),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),fe.state={popupVisible:ne.popupVisible,activeValue:_e,value:_e,prevProps:ne},fe.defaultFieldNames={label:"label",value:"value",children:"children"},fe}return w(be,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(fe){var _e=this.defaultFieldNames,ke=this.props,qe=ke.fieldNames,je=ke.filedNames;return"filedNames"in this.props?je[fe]||_e[fe]:qe[fe]||_e[fe]}},{key:"getFieldNames",value:function(){var fe=this.props,_e=fe.fieldNames,ke=fe.filedNames;return"filedNames"in this.props?ke:_e}},{key:"getCurrentLevelOptions",value:function(){var fe=this,_e=this.props.options,ke=_e===void 0?[]:_e,qe=this.state.activeValue,je=qe===void 0?[]:qe,st=$()(ke,function(vt,Re){return vt[fe.getFieldName("value")]===je[Re]},{childrenKeyName:this.getFieldName("children")});return st[st.length-2]?st[st.length-2][this.getFieldName("children")]:b(ke).filter(function(vt){return!vt.disabled})}},{key:"getActiveOptions",value:function(fe){var _e=this;return $()(this.props.options||[],function(ke,qe){return ke[_e.getFieldName("value")]===fe[qe]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var fe=this.props,_e=fe.prefixCls,ke=fe.transitionName,qe=fe.popupClassName,je=fe.options,st=je===void 0?[]:je,vt=fe.disabled,Re=fe.builtinPlacements,Be=fe.popupPlacement,Ye=fe.children,Ke=fe.dropdownRender,yt=P(fe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Pt=te.createElement("div",null),Ht="";st&&st.length>0?Pt=te.createElement(R,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Ht=" ".concat(_e,"-menus-empty");var Xt=Pt;return Ke&&(Xt=Ke(Pt)),te.createElement(Q.a,Object.assign({ref:this.saveTrigger},yt,{popupPlacement:Be,builtinPlacements:Re,popupTransitionName:ke,action:vt?[]:["click"],popupVisible:vt?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(_e,"-menus"),popupClassName:qe+Ht,popup:Xt}),te.cloneElement(Ye,{onKeyDown:this.handleKeyDown,tabIndex:vt?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(fe,_e){var ke=_e.prevProps,qe=ke===void 0?{}:ke,je={prevProps:fe};return"value"in fe&&!z(qe.value,fe.value)&&(je.value=fe.value||[],"loadData"in fe||(je.activeValue=fe.value||[])),"popupVisible"in fe&&(je.popupVisible=fe.popupVisible),je}}]),be}(te.Component);return xe.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:S,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},xe}(),we=he,Pe=Ae.a=we},"SA+Z":function(kt,Ae,U){var te=U("wTVA"),Q=U("EbDI"),B=U("ZhPi"),J=U("wkBT");function K(N){return te(N)||Q(N)||B(N)||J()}kt.exports=K,kt.exports.__esModule=!0,kt.exports.default=kt.exports},SJMd:function(kt,Ae){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var U,te,Q,B=!1,J,K;window.PR_SHOULD_USE_CONTINUATION=!0;var N,$;(function(){var z=window,r=["break,continue,do,else,for,if,return,while"],D=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],p=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[p,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[p,"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"],d="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=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",t=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],u=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],o=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[g,a,m,s,i,t,u,o],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",A="kwd",P="com",E="typ",b="lit",h="pun",f="pln",C="tag",x="dec",_="src",j="atn",W="atv",w="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(je){for(var st=0,vt=!1,Re=!1,Be=0,Ye=je.length;Be<Ye;++Be){var Ke=je[Be];if(Ke.ignoreCase)Re=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){vt=!0,Re=!1;break}}var yt={b:8,t:9,n:10,v:11,f:12,r:13};function Pt(et){var Ze=et.charCodeAt(0);if(Ze!==92)return Ze;var Ct=et.charAt(1);return Ze=yt[Ct],Ze||("0"<=Ct&&Ct<="7"?parseInt(et.substring(1),8):Ct==="u"||Ct==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function Ht(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var Ze=String.fromCharCode(et);return Ze==="\\"||Ze==="-"||Ze==="]"||Ze==="^"?"\\"+Ze:Ze}function Xt(et){var Ze=et.substring(1,et.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ct=[],At=Ze[0]==="^",dt=["["];At&&dt.push("^");for(var ft=At?1:0,He=Ze.length;ft<He;++ft){var Ne=Ze[ft];if(/\\[bdsw]/i.test(Ne))dt.push(Ne);else{var Ue=Pt(Ne),ge;ft+2<He&&Ze[ft+1]==="-"?(ge=Pt(Ze[ft+2]),ft+=2):ge=Ue,Ct.push([Ue,ge]),ge<65||Ue>122||(ge<65||Ue>90||Ct.push([Math.max(65,Ue)|32,Math.min(ge,90)|32]),ge<97||Ue>122||Ct.push([Math.max(97,Ue)&~32,Math.min(ge,122)&~32]))}}Ct.sort(function(Fe,at){return Fe[0]-at[0]||at[1]-Fe[1]});for(var Ee=[],De=[],ft=0;ft<Ct.length;++ft){var ue=Ct[ft];ue[0]<=De[1]+1?De[1]=Math.max(De[1],ue[1]):Ee.push(De=ue)}for(var ft=0;ft<Ee.length;++ft){var ue=Ee[ft];dt.push(Ht(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&dt.push("-"),dt.push(Ht(ue[1])))}return dt.push("]"),dt.join("")}function an(et){for(var Ze=et.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ct=Ze.length,At=[],dt=0,ft=0;dt<Ct;++dt){var He=Ze[dt];if(He==="(")++ft;else if(He.charAt(0)==="\\"){var Ne=+He.substring(1);Ne&&(Ne<=ft?At[Ne]=-1:Ze[dt]=Ht(Ne))}}for(var dt=1;dt<At.length;++dt)At[dt]===-1&&(At[dt]=++st);for(var dt=0,ft=0;dt<Ct;++dt){var He=Ze[dt];if(He==="(")++ft,At[ft]||(Ze[dt]="(?:");else if(He.charAt(0)==="\\"){var Ne=+He.substring(1);Ne&&Ne<=ft&&(Ze[dt]="\\"+At[Ne])}}for(var dt=0;dt<Ct;++dt)Ze[dt]==="^"&&Ze[dt+1]!=="^"&&(Ze[dt]="");if(et.ignoreCase&&vt)for(var dt=0;dt<Ct;++dt){var He=Ze[dt],Ue=He.charAt(0);He.length>=2&&Ue==="["?Ze[dt]=Xt(He):Ue!=="\\"&&(Ze[dt]=He.replace(/[a-zA-Z]/g,function(De){var ue=De.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Ze.join("")}for(var tn=[],Be=0,Ye=je.length;Be<Ye;++Be){var Ke=je[Be];if(Ke.global||Ke.multiline)throw new Error(""+Ke);tn.push("(?:"+an(Ke)+")")}return new RegExp(tn.join("|"),Re?"gi":"g")}function v(je,st){var vt=/(?:^|\s)nocode(?:\s|$)/,Re=[],Be=0,Ye=[],Ke=0;function yt(Pt){var Ht=Pt.nodeType;if(Ht==1){if(vt.test(Pt.className))return;for(var Xt=Pt.firstChild;Xt;Xt=Xt.nextSibling)yt(Xt);var an=Pt.nodeName.toLowerCase();(an==="br"||an==="li")&&(Re[Ke]=`
|
|
`,Ye[Ke<<1]=Be++,Ye[Ke++<<1|1]=Pt)}else if(Ht==3||Ht==4){var tn=Pt.nodeValue;tn.length&&(st?tn=tn.replace(/\r\n?/g,`
|
|
`):tn=tn.replace(/[ \t\r\n]+/g," "),Re[Ke]=tn,Ye[Ke<<1]=Be,Be+=tn.length,Ye[Ke++<<1|1]=Pt)}}return yt(je),{sourceCode:Re.join("").replace(/\n$/,""),spans:Ye}}function H(je,st,vt,Re,Be){if(!vt)return;var Ye={sourceNode:je,pre:1,langExtension:null,numberLines:null,sourceCode:vt,spans:null,basePos:st,decorations:null};Re(Ye),Be.push.apply(Be,Ye.decorations)}var Y=/\S/;function ie(je){for(var st=void 0,vt=je.firstChild;vt;vt=vt.nextSibling){var Re=vt.nodeType;st=Re===1?st?je:vt:Re===3&&Y.test(vt.nodeValue)?je:st}return st===je?void 0:st}function le(je,st){var vt={},Re;(function(){for(var Ke=je.concat(st),yt=[],Pt={},Ht=0,Xt=Ke.length;Ht<Xt;++Ht){var an=Ke[Ht],tn=an[3];if(tn)for(var et=tn.length;--et>=0;)vt[tn.charAt(et)]=an;var Ze=an[1],Ct=""+Ze;Pt.hasOwnProperty(Ct)||(yt.push(Ze),Pt[Ct]=null)}yt.push(/[\0-\uffff]/),Re=I(yt)})();var Be=st.length,Ye=function(Ke){for(var yt=Ke.sourceCode,Pt=Ke.basePos,Ht=Ke.sourceNode,Xt=[Pt,f],an=0,tn=yt.match(Re)||[],et={},Ze=0,Ct=tn.length;Ze<Ct;++Ze){var At=tn[Ze],dt=et[At],ft=void 0,He;if(typeof dt=="string")He=!1;else{var Ne=vt[At.charAt(0)];if(Ne)ft=At.match(Ne[1]),dt=Ne[0];else{for(var Ue=0;Ue<Be;++Ue)if(Ne=st[Ue],ft=At.match(Ne[1]),ft){dt=Ne[0];break}ft||(dt=f)}He=dt.length>=5&&dt.substring(0,5)==="lang-",He&&!(ft&&typeof ft[1]=="string")&&(He=!1,dt=_),He||(et[At]=dt)}var ge=an;if(an+=At.length,!He)Xt.push(Pt+ge,dt);else{var Ee=ft[1],De=At.indexOf(Ee),ue=De+Ee.length;ft[2]&&(ue=At.length-ft[2].length,De=ue-Ee.length);var Fe=dt.substring(5);H(Ht,Pt+ge,At.substring(0,De),Ye,Xt),H(Ht,Pt+ge+De,Ee,be(Fe,Ee),Xt),H(Ht,Pt+ge+ue,At.substring(ue),Ye,Xt)}}Ke.decorations=Xt};return Ye}function he(je){var st=[],vt=[];je.tripleQuotedStrings?st.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):je.multiLineStrings?st.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):st.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),je.verbatimStrings&&vt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=je.hashComments;Re&&(je.cStyleComments?(Re>1?st.push([P,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):st.push([P,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),vt.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):st.push([P,/^#[^\r\n]*/,null,"#"])),je.cStyleComments&&(vt.push([P,/^\/\/[^\r\n]*/,null]),vt.push([P,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Be=je.regexLiterals;if(Be){var Ye=Be>1?"":`
|
|
\r`,Ke=Ye?".":"[\\S\\s]",yt="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";vt.push(["lang-regex",RegExp("^"+F+"("+yt+")")])}var Pt=je.types;Pt&&vt.push([E,Pt]);var Ht=(""+je.keywords).replace(/^ | $/g,"");Ht.length&&vt.push([A,new RegExp("^(?:"+Ht.replace(/[\s,]+/g,"|")+")\\b"),null]),st.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Xt="^.[^\\s\\w.$@'\"`/\\\\]*";return je.regexLiterals&&(Xt+="(?!s*/)"),vt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[E,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[h,new RegExp(Xt),null]),le(st,vt)}var we=he({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(je,st,vt){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Be=/\r\n?|\n/,Ye=je.ownerDocument,Ke=Ye.createElement("li");je.firstChild;)Ke.appendChild(je.firstChild);var yt=[Ke];function Pt(Ze){var Ct=Ze.nodeType;if(Ct==1&&!Re.test(Ze.className))if(Ze.nodeName==="br")Ht(Ze),Ze.parentNode&&Ze.parentNode.removeChild(Ze);else for(var At=Ze.firstChild;At;At=At.nextSibling)Pt(At);else if((Ct==3||Ct==4)&&vt){var dt=Ze.nodeValue,ft=dt.match(Be);if(ft){var He=dt.substring(0,ft.index);Ze.nodeValue=He;var Ne=dt.substring(ft.index+ft[0].length);if(Ne){var Ue=Ze.parentNode;Ue.insertBefore(Ye.createTextNode(Ne),Ze.nextSibling)}Ht(Ze),He||Ze.parentNode.removeChild(Ze)}}}function Ht(Ze){for(;!Ze.nextSibling;)if(Ze=Ze.parentNode,!Ze)return;function Ct(ft,He){var Ne=He?ft.cloneNode(!1):ft,Ue=ft.parentNode;if(Ue){var ge=Ct(Ue,1),Ee=ft.nextSibling;ge.appendChild(Ne);for(var De=Ee;De;De=Ee)Ee=De.nextSibling,ge.appendChild(De)}return Ne}for(var At=Ct(Ze.nextSibling,0),dt;(dt=At.parentNode)&&dt.nodeType===1;)At=dt;yt.push(At)}for(var Xt=0;Xt<yt.length;++Xt)Pt(yt[Xt]);st===(st|0)&&yt[0].setAttribute("value",st);var an=Ye.createElement("ol");an.className="linenums";for(var tn=Math.max(0,st-1|0)||0,Xt=0,et=yt.length;Xt<et;++Xt)Ke=yt[Xt],Ke.className="L"+(Xt+tn)%10,Ke.firstChild||Ke.appendChild(Ye.createTextNode("\xA0")),an.appendChild(Ke);je.appendChild(an)}function xe(je){var st=/\bMSIE\s(\d+)/.exec(navigator.userAgent);st=st&&+st[1]<=8;var vt=/\n/g,Re=je.sourceCode,Be=Re.length,Ye=0,Ke=je.spans,yt=Ke.length,Pt=0,Ht=je.decorations,Xt=Ht.length,an=0;Ht[Xt]=Be;var tn,et;for(et=tn=0;et<Xt;)Ht[et]!==Ht[et+2]?(Ht[tn++]=Ht[et++],Ht[tn++]=Ht[et++]):et+=2;for(Xt=tn,et=tn=0;et<Xt;){for(var Ze=Ht[et],Ct=Ht[et+1],At=et+2;At+2<=Xt&&Ht[At+1]===Ct;)At+=2;Ht[tn++]=Ze,Ht[tn++]=Ct,et=At}Xt=Ht.length=tn;var dt=je.sourceNode,ft="";dt&&(ft=dt.style.display,dt.style.display="none");try{for(var He=null;Pt<yt;){var Ne=Ke[Pt],Ue=Ke[Pt+2]||Be,ge=Ht[an+2]||Be,At=Math.min(Ue,ge),Ee=Ke[Pt+1],De;if(Ee.nodeType!==1&&(De=Re.substring(Ye,At))){st&&(De=De.replace(vt,"\r")),Ee.nodeValue=De;var ue=Ee.ownerDocument,Fe=ue.createElement("span");Fe.className=Ht[an+1];var at=Ee.parentNode;at.replaceChild(Fe,Ee),Fe.appendChild(Ee),Ye<Ue&&(Ke[Pt+1]=Ee=ue.createTextNode(Re.substring(At,Ue)),at.insertBefore(Ee,Fe.nextSibling))}Ye=At,Ye>=Ue&&(Pt+=2),Ye>=ge&&(an+=2)}}finally{dt&&(dt.style.display=ft)}}var Oe={};function pe(je,st){for(var vt=st.length;--vt>=0;){var Re=st[vt];Oe.hasOwnProperty(Re)?z.console&&console.warn("cannot override language handler %s",Re):Oe[Re]=je}}function be(je,st){return je&&Oe.hasOwnProperty(je)||(je=/^\s*</.test(st)?"default-markup":"default-code"),Oe[je]}pe(we,["default-code"]),pe(le([],[[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"]),pe(le([[f,/^[\s]+/,null,` \r
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[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"]),pe(le([],[[W,/^[\s\S]+/]]),["uq.val"]),pe(he({keywords:g,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),pe(he({keywords:"null,true,false"}),["json"]),pe(he({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),pe(he({keywords:m,cStyleComments:!0}),["java"]),pe(he({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(he({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(he({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(he({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(he({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(he({keywords:d,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(le([],[[S,/^[\s\S]+/]]),["regex"]);function ne(je){var st=je.langExtension;try{var vt=v(je.sourceNode,je.pre),Re=vt.sourceCode;je.sourceCode=Re,je.spans=vt.spans,je.basePos=0,be(st,Re)(je),xe(je)}catch(Be){z.console&&console.log(Be&&Be.stack||Be)}}function fe(je,st,vt){var Re=vt||!1,Be=st||null,Ye=document.createElement("div");Ye.innerHTML="<pre>"+je+"</pre>",Ye=Ye.firstChild,Re&&Pe(Ye,Re,!0);var Ke={langExtension:Be,numberLines:Re,sourceNode:Ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Ke),Ye.innerHTML}function _e(je,st){var vt=st||document.body,Re=vt.ownerDocument||document;function Be(Ne){return vt.getElementsByTagName(Ne)}for(var Ye=[Be("pre"),Be("code"),Be("xmp")],Ke=[],yt=0;yt<Ye.length;++yt)for(var Pt=0,Ht=Ye[yt].length;Pt<Ht;++Pt)Ke.push(Ye[yt][Pt]);Ye=null;var Xt=Date;Xt.now||(Xt={now:function(){return+new Date}});var an=0,tn=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,Ze=/\bprettyprinted\b/,Ct=/pre|xmp/i,At=/^code$/i,dt=/^(?:pre|code|xmp)$/i,ft={};function He(){for(var Ne=z.PR_SHOULD_USE_CONTINUATION?Xt.now()+250:Infinity;an<Ke.length&&Xt.now()<Ne;an++){for(var Ue=Ke[an],ge=ft,Ee=Ue;Ee=Ee.previousSibling;){var De=Ee.nodeType,ue=(De===7||De===8)&&Ee.nodeValue;if(ue?!/^\??prettify\b/.test(ue):De!==3||/\S/.test(Ee.nodeValue))break;if(ue){ge={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vr,ir,br){ge[ir]=br});break}}var Fe=Ue.className;if((ge!==ft||et.test(Fe))&&!Ze.test(Fe)){for(var at=!1,xt=Ue.parentNode;xt;xt=xt.parentNode){var Gt=xt.tagName;if(dt.test(Gt)&&xt.className&&et.test(xt.className)){at=!0;break}}if(!at){Ue.className+=" prettyprinted";var $t=ge.lang;if(!$t){$t=Fe.match(tn);var Yt;!$t&&(Yt=ie(Ue))&&At.test(Yt.tagName)&&($t=Yt.className.match(tn)),$t&&($t=$t[1])}var $n;if(Ct.test(Ue.tagName))$n=1;else{var vn=Ue.currentStyle,ln=Re.defaultView,hn=vn?vn.whiteSpace:ln&&ln.getComputedStyle?ln.getComputedStyle(Ue,null).getPropertyValue("white-space"):0;$n=hn&&hn.substring(0,3)==="pre"}var Gn=ge.linenums;(Gn=Gn==="true"||+Gn)||(Gn=Fe.match(/\blinenums\b(?::(\d+))?/),Gn=Gn?Gn[1]&&Gn[1].length?+Gn[1]:!0:!1),Gn&&Pe(Ue,Gn,$n);var fr={langExtension:$t,sourceNode:Ue,numberLines:Gn,pre:$n,sourceCode:null,basePos:null,spans:null,decorations:null};ne(fr)}}}an<Ke.length?z.setTimeout(He,250):typeof je=="function"&&je()}He()}var ke=z.PR={createSimpleLexer:le,registerLangHandler:pe,sourceDecorator:he,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:W,PR_COMMENT:P,PR_DECLARATION:x,PR_KEYWORD:A,PR_LITERAL:b,PR_NOCODE:w,PR_PLAIN:f,PR_PUNCTUATION:h,PR_SOURCE:_,PR_STRING:S,PR_TAG:C,PR_TYPE:E,prettyPrintOne:B?z.prettyPrintOne=fe:N=fe,prettyPrint:$=B?z.prettyPrint=_e:$=_e},qe=z.define;typeof qe=="function"&&qe.amd&&qe("google-code-prettify",[],function(){return ke})})()},T1X5:function(kt,Ae){kt.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(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return $}),U.d(Ae,"e",function(){return z}),U.d(Ae,"c",function(){return h}),U.d(Ae,"b",function(){return f}),U.d(Ae,"d",function(){return C}),U.d(Ae,"f",function(){return j});var te=U("MNsG"),Q=U("N0LK"),B=U("Cg/j");let J=te.k||"";const K=new Map;K.set("false",!1),K.set("true",!0),K.set("isMac",te.f),K.set("isLinux",te.d),K.set("isWindows",te.i),K.set("isWeb",te.h),K.set("isMacNative",te.f&&!te.h),K.set("isEdge",J.indexOf("Edg/")>=0),K.set("isFirefox",J.indexOf("Firefox")>=0),K.set("isChrome",J.indexOf("Chrome")>=0),K.set("isSafari",J.indexOf("Safari")>=0);const N=Object.prototype.hasOwnProperty;class ${static has(w){return g.create(w)}static equals(w,F){return m.create(w,F)}static regex(w,F){return S.create(w,F)}static not(w){return i.create(w)}static and(...w){return E.create(w,null)}static or(...w){return b.create(w,null,!0)}static deserialize(w,F=!1){return w?this._deserializeOrExpression(w,F):void 0}static _deserializeOrExpression(w,F){let I=w.split("||");return b.create(I.map(v=>this._deserializeAndExpression(v,F)),null,!0)}static _deserializeAndExpression(w,F){let I=w.split("&&");return E.create(I.map(v=>this._deserializeOne(v,F)),null)}static _deserializeOne(w,F){if(w=w.trim(),w.indexOf("!=")>=0){let I=w.split("!=");return s.create(I[0].trim(),this._deserializeValue(I[1],F))}if(w.indexOf("==")>=0){let I=w.split("==");return m.create(I[0].trim(),this._deserializeValue(I[1],F))}if(w.indexOf("=~")>=0){let I=w.split("=~");return S.create(I[0].trim(),this._deserializeRegexValue(I[1],F))}if(w.indexOf(" in ")>=0){let I=w.split(" in ");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const I=w.split(">=");return o.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const I=w.split(">");return u.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const I=w.split("<=");return T.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const I=w.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(w)?i.create(w.substr(1).trim()):g.create(w)}static _deserializeValue(w,F){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let I=/^'([^']*)'$/.exec(w);return I?I[1].trim():w}static _deserializeRegexValue(w,F){if(Object(Q.C)(w)){if(F)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=w.indexOf("/"),v=w.lastIndexOf("/");if(I===v||I<0){if(F)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let H=w.slice(I+1,v),Y=w[v+1]==="i"?"i":"";try{return new RegExp(H,Y)}catch(ie){if(F)throw new Error(`bad regexp-value '${w}', parse error: ${ie}`);return console.warn(`bad regexp-value '${w}', parse error: ${ie}`),null}}}function z(w,F){const I=w?w.substituteConstants():void 0,v=F?F.substituteConstants():void 0;return!I&&!v?!0:!I||!v?!1:I.equals(v)}function r(w,F){return w.cmp(F)}class D{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return p.INSTANCE}}D.INSTANCE=new D;class p{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}p.INSTANCE=new p;class g{constructor(w,F){this.key=w,this.negated=F,this.type=2}static create(w,F=null){const I=K.get(w);return typeof I=="boolean"?I?p.INSTANCE:D.INSTANCE:new g(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:x(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=K.get(this.key);return typeof w=="boolean"?w?p.INSTANCE:D.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class m{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=4}static create(w,F,I=null){if(typeof F=="boolean")return F?g.create(w,I):i.create(w,I);const v=K.get(w);if(typeof v=="boolean"){const H=v?"true":"false";return F===H?p.INSTANCE:D.INSTANCE}return new m(w,F,I)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=K.get(this.key);if(typeof w=="boolean"){const F=w?"true":"false";return this.value===F?p.INSTANCE:D.INSTANCE}return this}evaluate(w){return w.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class a{constructor(w,F){this.key=w,this.valueKey=F,this.type=10,this.negated=null}static create(w,F){return new a(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const F=w.getValue(this.valueKey),I=w.getValue(this.key);return Array.isArray(F)?F.indexOf(I)>=0:typeof I=="string"&&typeof F=="object"&&F!==null?N.call(F,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=d.create(this)),this.negated}}class d{constructor(w){this._actual=w,this.type=11}static create(w){return new d(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=5}static create(w,F,I=null){if(typeof F=="boolean")return F?i.create(w,I):g.create(w,I);const v=K.get(w);if(typeof v=="boolean"){const H=v?"true":"false";return F===H?D.INSTANCE:p.INSTANCE}return new s(w,F,I)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=K.get(this.key);if(typeof w=="boolean"){const F=w?"true":"false";return this.value===F?D.INSTANCE:p.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class i{constructor(w,F){this.key=w,this.negated=F,this.type=3}static create(w,F=null){const I=K.get(w);return typeof I=="boolean"?I?D.INSTANCE:p.INSTANCE:new i(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:x(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=K.get(this.key);return typeof w=="boolean"?w?D.INSTANCE:p.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function t(w,F){if(typeof w=="string"){const I=parseFloat(w);isNaN(I)||(w=I)}return typeof w=="string"||typeof w=="number"?F(w):D.INSTANCE}class u{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=12}static create(w,F,I=null){return t(F,v=>new u(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class o{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=13}static create(w,F,I=null){return t(F,v=>new o(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=14}static create(w,F,I=null){return t(F,v=>new R(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class T{constructor(w,F,I){this.key=w,this.value=F,this.negated=I,this.type=15}static create(w,F,I=null){return t(F,v=>new T(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class S{constructor(w,F){this.key=w,this.regexp=F,this.type=7,this.negated=null}static create(w,F){return new S(w,F)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const F=this.regexp?this.regexp.source:"",I=w.regexp?w.regexp.source:"";return F<I?-1:F>I?1:0}equals(w){if(w.type===this.type){const F=this.regexp?this.regexp.source:"",I=w.regexp?w.regexp.source:"";return this.key===w.key&&F===I}return!1}substituteConstants(){return this}evaluate(w){let F=w.getValue(this.key);return this.regexp?this.regexp.test(F):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(w){this._actual=w,this.type=8}static create(w){return new A(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function P(w){let F=null;for(let I=0,v=w.length;I<v;I++){const H=w[I].substituteConstants();if(w[I]!==H&&F===null){F=[];for(let Y=0;Y<I;Y++)F[Y]=w[Y]}F!==null&&(F[I]=H)}return F===null?w:F}class E{constructor(w,F){this.expr=w,this.negated=F,this.type=6}static create(w,F){return E._normalizeArr(w,F)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let F=0,I=this.expr.length;F<I;F++){const v=r(this.expr[F],w.expr[F]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let F=0,I=this.expr.length;F<I;F++)if(!this.expr[F].equals(w.expr[F]))return!1;return!0}return!1}substituteConstants(){const w=P(this.expr);return w===this.expr?this:E.create(w,this.negated)}evaluate(w){for(let F=0,I=this.expr.length;F<I;F++)if(!this.expr[F].evaluate(w))return!1;return!0}static _normalizeArr(w,F){const I=[];let v=!1;for(const H of w){if(!H)continue;if(H.type===1){v=!0;continue}if(H.type===0)return D.INSTANCE;if(H.type===6){I.push(...H.expr);continue}I.push(H)}if(I.length===0&&v)return p.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(r);for(let H=1;H<I.length;H++)I[H-1].equals(I[H])&&(I.splice(H,1),H--);if(I.length===1)return I[0];for(;I.length>1;){const H=I[I.length-1];if(H.type!==9)break;I.pop();const Y=I.pop(),ie=I.length===0,le=b.create(H.expr.map(he=>E.create([he,Y],null)),null,ie);le&&(I.push(le),I.sort(r))}return I.length===1?I[0]:new E(I,F)}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let F of this.expr)w.push(...F.keys());return w}negate(){if(!this.negated){const w=[];for(let F of this.expr)w.push(F.negate());this.negated=b.create(w,this,!0)}return this.negated}}class b{constructor(w,F){this.expr=w,this.negated=F,this.type=9}static create(w,F,I){return b._normalizeArr(w,F,I)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let F=0,I=this.expr.length;F<I;F++){const v=r(this.expr[F],w.expr[F]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let F=0,I=this.expr.length;F<I;F++)if(!this.expr[F].equals(w.expr[F]))return!1;return!0}return!1}substituteConstants(){const w=P(this.expr);return w===this.expr?this:b.create(w,this.negated,!1)}evaluate(w){for(let F=0,I=this.expr.length;F<I;F++)if(this.expr[F].evaluate(w))return!0;return!1}static _normalizeArr(w,F,I){let v=[],H=!1;if(w){for(let Y=0,ie=w.length;Y<ie;Y++){const le=w[Y];if(!le)continue;if(le.type===0){H=!0;continue}if(le.type===1)return p.INSTANCE;if(le.type===9){v=v.concat(le.expr);continue}v.push(le)}if(v.length===0&&H)return D.INSTANCE;v.sort(r)}if(v.length===0)return;if(v.length===1)return v[0];for(let Y=1;Y<v.length;Y++)v[Y-1].equals(v[Y])&&(v.splice(Y,1),Y--);if(v.length===1)return v[0];if(I){for(let Y=0;Y<v.length;Y++)for(let ie=Y+1;ie<v.length;ie++)j(v[Y],v[ie])&&(v.splice(ie,1),ie--);if(v.length===1)return v[0]}return new b(v,F)}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let F of this.expr)w.push(...F.keys());return w}negate(){if(!this.negated){let w=[];for(let F of this.expr)w.push(F.negate());for(;w.length>1;){const F=w.shift(),I=w.shift(),v=[];for(const Y of W(F))for(const ie of W(I))v.push(E.create([Y,ie],null));const H=w.length===0;w.unshift(b.create(v,null,H))}this.negated=w[0]}return this.negated}}class h extends g{constructor(w,F,I){super(w,null);this._defaultValue=F,typeof I=="object"?h._info.push(Object.assign(Object.assign({},I),{key:w})):I!==!0&&h._info.push({key:w,description:I,type:F!=null?typeof F:void 0})}static all(){return h._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return m.create(this.key,w)}}h._info=[];const f=Object(B.c)("contextKeyService"),C="setContext";function x(w,F){return w<F?-1:w>F?1:0}function _(w,F,I,v){return w<I?-1:w>I?1:F<v?-1:F>v?1:0}function j(w,F){if(F.type===6&&w.type!==9&&w.type!==6){for(const H of F.expr)if(w.equals(H))return!0}const I=w.negate(),v=W(I).concat(W(F));v.sort(r);for(let H=0;H<v.length;H++){const Y=v[H],ie=Y.negate();for(let le=H+1;le<v.length;le++){const he=v[le];if(ie.equals(he))return!0}}return!1}function W(w){return w.type===9?w.expr:[w]}},TXwP:function(kt,Ae,U){var te,Q;(function(){var B;(function(){"use strict";var K=[,,function(r){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(m))return!0;return!1},D.prototype.set_indent=function(m,a){this.is_empty()&&(this.__indent_count=m||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var a=m.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=m.length-a:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function p(m,a){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),a=a||"",m.indent_level>0&&(a=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}p.prototype.get_indent_size=function(m,a){var d=this.__base_string_length;return a=a||0,m<0&&(d=0),d+=m*this.__indent_size,d+=a,d},p.prototype.get_indent_string=function(m,a){var d=this.__base_string;return a=a||0,m<0&&(m=0,d=""),a+=m*this.__indent_size,this.__ensure_cache(a),d+=this.__cache[a],d},p.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var m=this.__cache.length,a=0,d="";this.__indent_size&&m>=this.__indent_size&&(a=Math.floor(m/this.__indent_size),m-=a*this.__indent_size,d=new Array(a+1).join(this.__indent_string)),m&&(d+=new Array(m+1).join(" ")),this.__cache.push(d)};function g(m,a){this.__indent_cache=new p(m,a),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,a){return this.__indent_cache.get_indent_string(m,a)},g.prototype.get_indent_size=function(m,a){return this.__indent_cache.get_indent_size(m,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){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 d=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(d=d.replace(/[\n]/g,m)),d},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,a){return m=m||0,a=a||0,this.next_line.set_indent(m,a),this.__lines.length>1?(this.current_line.set_indent(m,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var a=0;a<m.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},g.prototype.remove_indent=function(m){for(var a=this.__lines.length;m<a;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,a){for(var d=this.__lines.length-2;d>=0;){var s=this.__lines[d];if(s.is_empty())break;if(s.item(0).indexOf(m)!==0&&s.item(-1)!==a){this.__lines.splice(d+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},r.exports.Output=g},,,,function(r){function D(m,a){this.raw_options=p(m,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(m,a){var d=this.raw_options[m],s=a||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(s=d.concat()):typeof d=="string"&&(s=d.split(/[^a-zA-Z0-9_\/\-]+/)),s},D.prototype._get_boolean=function(m,a){var d=this.raw_options[m],s=d===void 0?!!a:!!d;return s},D.prototype._get_characters=function(m,a){var d=this.raw_options[m],s=a||"";return typeof d=="string"&&(s=d.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},D.prototype._get_number=function(m,a){var d=this.raw_options[m];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(d,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(m,a,d){var s=this._get_selection_list(m,a,d);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s[0]},D.prototype._get_selection_list=function(m,a,d){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[a[0]],!this._is_valid_selection(d,a))throw new Error("Invalid Default Value!");var s=this._get_array(m,d);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s},D.prototype._is_valid_selection=function(m,a){return m.length&&a.length&&!m.some(function(d){return a.indexOf(d)===-1})};function p(m,a){var d={};m=g(m);var s;for(s in m)s!==a&&(d[s]=m[s]);if(a&&m[a])for(s in m[a])d[s]=m[a][s];return d}function g(m){var a={},d;for(d in m){var s=d.replace(/-/g,"_");a[s]=m[d]}return a}r.exports.Options=D,r.exports.normalizeOpts=g,r.exports.mergeOpts=p},,function(r){var D=RegExp.prototype.hasOwnProperty("sticky");function p(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},p.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(m=this.__input.charAt(g)),m},p.prototype.__match=function(g,m){g.lastIndex=m;var a=g.exec(this.__input);return a&&!(D&&g.sticky)&&(a.index!==m&&(a=null)),a},p.prototype.test=function(g,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(g,m):!1},p.prototype.testChar=function(g,m){var a=this.peek(m);return g.lastIndex=0,a!==null&&g.test(a)},p.prototype.match=function(g){var m=this.__match(g,this.__position);return m?this.__position+=m[0].length:m=null,m},p.prototype.read=function(g,m,a){var d="",s;return g&&(s=this.match(g),s&&(d+=s[0])),m&&(s||!g)&&(d+=this.readUntil(m,a)),d},p.prototype.readUntil=function(g,m){var a="",d=this.__position;g.lastIndex=this.__position;var s=g.exec(this.__input);return s?(d=s.index,m&&(d+=s[0].length)):d=this.__input_length,a=this.__input.substring(this.__position,d),this.__position=d,a},p.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},p.prototype.get_regexp=function(g,m){var a=null,d="g";return m&&D&&(d="y"),typeof g=="string"&&g!==""?a=new RegExp(g,d):g&&(a=new RegExp(g.source,d)),a},p.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(g){var m=this.__position,a=this.readUntilAfter(g);return this.__position=m,a},p.prototype.lookBack=function(g){var m=this.__position-1;return m>=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},r.exports.InputScanner=p},,,,,function(r){function D(p,g){p=typeof p=="string"?p:p.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(p);m;)g[m[1]]=m[2],m=this.__directive_pattern.exec(p);return g},D.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},,function(r,D,p){var g=p(16).Beautifier,m=p(17).Options;function a(d,s){var i=new g(d,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new m}},function(r,D,p){var g=p(17).Options,m=p(2).Output,a=p(8).InputScanner,d=p(13).Directives,s=new d(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,u=/\s/,o=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(A,P){this._source_text=A||"",this._options=new g(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"]}S.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},S.prototype.eatWhitespace=function(A){for(var P=u.test(this._input.peek()),E=0;u.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
|
|
`&&((E===0||E<this._options.max_preserve_newlines)&&(E++,this._output.add_new_line(!0)));return P},S.prototype.foundNestedPseudoClass=function(){for(var A=0,P=1,E=this._input.peek(P);E;){if(E==="{")return!0;if(E==="(")A+=1;else if(E===")"){if(A===0)return!1;A-=1}else if(E===";"||E==="}")return!1;P++,E=this._input.peek(P)}return!1},S.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},S.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,P=this._options.eol;P==="auto"&&(P=`
|
|
`,A&&i.test(A||"")&&(P=A.match(i)[0])),A=A.replace(t,`
|
|
`);var E=A.match(/^[\t ]*/)[0];this._output=new m(this._options,E),this._input=new a(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,h=!1,f=!1,C=!1,x=!1,_=!1,j=!1,W=this._ch,w=!1,F,I,v;F=this._input.read(o),I=F!=="",v=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(R),Y=s.get_directives(H);Y&&Y.ignore==="start"&&(H+=s.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?x=!0:ie==="import"&&(_=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!h&&b===0&&ie.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(v==="("?this._output.space_before_token=!1:v!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),v==="{"&&this._output.trim(!0),_=!1,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 le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){w=!0;break}(h||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!x&&b===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var he=v==='"'||v==="'";this.preserveSingleSpace(he||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")w=!1,b===0?(f&&(this.outdent(),f=!1),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(),b++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),b&&(b--,this.outdent()));else{var we=!1;this._input.lookBack("with")&&(we=!0),this.preserveSingleSpace(I||we),this.print_string(this._ch),f&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,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)&&b===0&&!_&&!x?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&b===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),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 Pe=v==='"'||v==="'";this.preserveSingleSpace(Pe||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&w&&this._output.add_new_line()}var xe=this._output.get_code(P);return xe},r.exports.Beautifier=S},function(r,D,p){var g=p(6).Options;function m(a){g.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var d=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||d;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]}m.prototype=new g,r.exports.Options=m}],N={};function $(r){var D=N[r];if(D!==void 0)return D.exports;var p=N[r]={exports:{}};return K[r](p,p.exports,$),p.exports}var z=$(15);B=z})();var J=B;!(te=[],Q=function(){return{css_beautify:J}}.apply(Ae,te),Q!==void 0&&(kt.exports=Q))})()},VYcG:function(kt,Ae,U){"use strict";U.r(Ae),U.d(Ae,"useCourseOptions",function(){return I});var te=U("T2oS"),Q=U("W9HT"),B=U("+L6B"),J=U("2/Rp"),K=U("7Kak"),N=U("9yH6"),$=U("giR+"),z=U("fyUT"),r=U("5NDa"),D=U("5rEg"),p=U("6UJt"),g=U("DFOY"),m=U("14J3"),a=U("BMrR"),d=U("jCWc"),s=U("kPKH"),i=U("sPJy"),t=U("bE4q"),u=U("k1fw"),o=U("rAM+"),R=U("y8nQ"),T=U("Vl3Y"),S=U("9og8"),A=U("tJVT"),P=U("WmNS"),E=U.n(P),b=U("q1tI"),h=U.n(b),f=U("Ty5D"),C=U("55Ip"),x=U("9kvl"),_=U("Pxm8"),j=U.n(_),W=U("vCeJ"),w=U("6fQ5"),F=U("ZWs3"),I=function(){var Y=Object(b.useState)([]),ie=Object(A.a)(Y,2),le=ie[0],he=ie[1];return Object(b.useEffect)(function(){var we=function(){var Pe=Object(S.a)(E.a.mark(function xe(){var Oe;return E.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return be.next=2,Object(W.k)({source:"new_question"});case 2:Oe=be.sent,Oe!=null&&Oe.disciplines&&he(Object(w.a)(Oe==null?void 0:Oe.disciplines));case 4:case"end":return be.stop()}},xe)}));return function(){return Pe.apply(this,arguments)}}();we()},[]),le},v=function(Y){var ie=Y.user,le=Object(f.i)(),he=I(),we=T.a.useForm(),Pe=Object(A.a)(we,1),xe=Pe[0],Oe=Object(b.useState)(),pe=Object(A.a)(Oe,2),be=pe[0],ne=pe[1],fe=Object(b.useState)(!1),_e=Object(A.a)(fe,2),ke=_e[0],qe=_e[1];return Object(b.useEffect)(function(){if(le.id){var je=function(){var st=Object(S.a)(E.a.mark(function vt(){var Re,Be,Ye,Ke,yt,Pt,Ht,Xt,an,tn,et,Ze,Ct;return E.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return qe(!0),dt.next=3,Object(W.l)({id:le.id});case 3:Ye=dt.sent,qe(!1),Ke=Ye==null||((Re=Ye.exercise)===null||Re===void 0)?void 0:Re.sub_discipline_id,yt=[],Pt=Object(o.a)(he);try{for(Pt.s();!(Ht=Pt.n()).done;){Xt=Ht.value,an=Object(o.a)(Xt.children);try{for(an.s();!(tn=an.n()).done;)et=tn.value,et.value===Ke&&(yt=[Xt.value,et.value])}catch(ft){an.e(ft)}finally{an.f()}}}catch(ft){Pt.e(ft)}finally{Pt.f()}Ze=Ye==null||((Be=Ye.exercise)===null||Be===void 0)?void 0:Be.time,Ct=Object(u.a)(Object(u.a)({},Ye.exercise),{},{sub_discipline_id:yt,time:Ze===-1?null:Ze}),ne(Ct);case 12:case"end":return dt.stop()}},vt)}));return function(){return st.apply(this,arguments)}}();if(!he.length)return;je()}else ne({})},[he]),h.a.createElement("section",{className:"edu-container"},h.a.createElement("section",{className:"animated fadeIn"},h.a.createElement("aside",{className:"mt10"},h.a.createElement(t.a,{separator:">"},h.a.createElement(t.a.Item,null,h.a.createElement(C.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),h.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),h.a.createElement("aside",{className:"".concat(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:ke,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},h.a.createElement("section",{className:[j.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},be&&h.a.createElement(T.a,{layout:"vertical",form:xe,className:j.a.formWrap,initialValues:be},h.a.createElement(T.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},h.a.createElement(g.a,{placeholder:"\u8BF7\u9009\u62E9...",options:he})),h.a.createElement(T.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},h.a.createElement(D.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),h.a.createElement(T.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},h.a.createElement("div",{style:{display:"flex"}},h.a.createElement(z.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"}),h.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),h.a.createElement(T.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},h.a.createElement(N.a.Group,null,h.a.createElement(N.a.Button,{value:1},"\u7B80\u5355"),h.a.createElement(N.a.Button,{value:2},"\u9002\u4E2D"),h.a.createElement(N.a.Button,{value:3},"\u56F0\u96BE"))),h.a.createElement(T.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},h.a.createElement(D.a.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})))),h.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},h.a.createElement(J.a,{style:{marginRight:"5px"},onClick:function(){x.d.push("/paperlibrary")}},"\u53D6\u6D88"),h.a.createElement(F.a,{onClick:Object(S.a)(E.a.mark(function je(){var st,vt,Re,Be;return E.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Ke.next=2,xe.validateFields();case 2:if(st=xe.getFieldsValue(),st.sub_discipline_id=st.sub_discipline_id[1],!le.id){Ke.next=10;break}return Ke.next=7,Object(W.z)(Object(u.a)({id:le.id},st));case 7:return vt=Ke.sent,vt.status===0&&x.d.push("/paperlibrary/edit/".concat(le.id,"?fromadd=1")),Ke.abrupt("return");case 10:return Ke.next=12,Object(W.e)(st);case 12:Re=Ke.sent,Re.status===0&&x.d.push("/paperlibrary/edit/".concat(Re==null||((Be=Re.data)===null||Be===void 0)?void 0:Be.exam_id,"?fromadd=1"));case 14:case"end":return Ke.stop()}},je)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};Ae.default=Object(x.a)(function(H){var Y=H.user;return{user:Y}})(v)},Vhoy:function(kt,Ae,U){"use strict";U.d(Ae,"d",function(){return J}),U.d(Ae,"e",function(){return K}),U.d(Ae,"c",function(){return N}),U.d(Ae,"b",function(){return $}),U.d(Ae,"a",function(){return z});var te=U("MI8n");class Q{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(r){const D=this._icons.get(r.id);D?r.description?D.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const B=new Q,J=B;function K(r,D){return new $(r,D)}function N(r){return r?r.replace(/\$\((.*?)\)/g,(D,p)=>` ${p} `).trim():""}class ${constructor(r,D,p){this.id=r,this.definition=D,this.description=p,B.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var z;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function p(a){if(a instanceof $)return["codicon","codicon-"+a.id];const d=D.exec(a.id);if(!d)return p($.error);let[,s,i]=d;const t=["codicon","codicon-"+s];return i&&t.push("codicon-modifier-"+i.substr(1)),t}r.asClassNameArray=p;function g(a){return p(a).join(" ")}r.asClassName=g;function m(a){return"."+p(a).join(".")}r.asCSSSelector=m})(z||(z={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}($||($={}))},"VrN/":function(kt,Ae,U){(function(te,Q){kt.exports=Q()})(this,function(){"use strict";var te=navigator.userAgent,Q=navigator.platform,B=/gecko\/\d/i.test(te),J=/MSIE \d/.test(te),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(te),N=/Edge\/(\d+)/.exec(te),$=J||K||N,z=$&&(J?document.documentMode||6:+(N||K)[1]),r=!N&&/WebKit\//.test(te),D=r&&/Qt\/\d+\.\d+/.test(te),p=!N&&/Chrome\//.test(te),g=/Opera\//.test(te),m=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),d=/PhantomJS/.test(te),s=!N&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),i=/Android/.test(te),t=s||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),u=s||/Mac/.test(Q),o=/\bCrOS\b/.test(te),R=/win/i.test(Q),T=g&&te.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(g=!1,r=!0);var S=u&&(D||g&&(T==null||T<12.11)),A=B||$&&z>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E=function(e,n){var c=e.className,l=P(n).exec(c);if(l){var y=c.slice(l.index+l[0].length);e.className=c.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function h(e,n){return b(e).appendChild(n)}function f(e,n,c,l){var y=document.createElement(e);if(c&&(y.className=c),l&&(y.style.cssText=l),typeof n=="string")y.appendChild(document.createTextNode(n));else if(n)for(var G=0;G<n.length;++G)y.appendChild(n[G]);return y}function C(e,n,c,l){var y=f(e,n,c,l);return y.setAttribute("role","presentation"),y}var x;document.createRange?x=function(e,n,c,l){var y=document.createRange();return y.setEnd(l||e,c),y.setStart(e,n),y}:x=function(e,n,c){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",c),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 c=e.className;P(n).test(c)||(e.className+=(c?" ":"")+n)}function w(e,n){for(var c=e.split(" "),l=0;l<c.length;l++)c[l]&&!P(c[l]).test(n)&&(n+=" "+c[l]);return n}var F=function(e){e.select()};s?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:$&&(F=function(e){try{e.select()}catch(n){}});function I(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function v(e,n,c){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(c!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function H(e,n,c,l,y){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var G=l||0,ee=y||0;;){var ae=e.indexOf(" ",G);if(ae<0||ae>=n)return ee+(n-G);ee+=ae-G,ee+=c-ee%c,G=ae+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,n){this.f=n;var c=+new Date+e;(!this.id||c<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=c)};function ie(e,n){for(var c=0;c<e.length;++c)if(e[c]==n)return c;return-1}var le=50,he={toString:function(){return"CodeMirror.Pass"}},we={scroll:!1},Pe={origin:"*mouse"},xe={origin:"+move"};function Oe(e,n,c){for(var l=0,y=0;;){var G=e.indexOf(" ",l);G==-1&&(G=e.length);var ee=G-l;if(G==e.length||y+ee>=n)return l+Math.min(ee,n-y);if(y+=G-l,y+=c-y%c,l=G+1,y>=n)return l}}var pe=[""];function be(e){for(;pe.length<=e;)pe.push(ne(pe)+" ");return pe[e]}function ne(e){return e[e.length-1]}function fe(e,n){for(var c=[],l=0;l<e.length;l++)c[l]=n(e[l],l);return c}function _e(e,n,c){for(var l=0,y=c(n);l<e.length&&c(e[l])<=y;)l++;e.splice(l,0,n)}function ke(){}function qe(e,n){var c;return Object.create?c=Object.create(e):(ke.prototype=e,c=new ke),n&&v(n,c),c}var je=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function st(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||je.test(e))}function vt(e,n){return n?n.source.indexOf("\\w")>-1&&st(e)?!0:n.test(e):st(e)}function Re(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ye(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Ke(e,n,c){for(;(c<0?n>0:n<e.length)&&Ye(e.charAt(n));)n+=c;return n}function yt(e,n,c){for(var l=n>c?-1:1;;){if(n==c)return n;var y=(n+c)/2,G=l<0?Math.ceil(y):Math.floor(y);if(G==n)return e(G)?n:c;e(G)?c=G:n=G+l}}function Pt(e,n,c,l){if(!e)return l(n,c,"ltr",0);for(var y=!1,G=0;G<e.length;++G){var ee=e[G];(ee.from<c&&ee.to>n||n==c&&ee.to==n)&&(l(Math.max(ee.from,n),Math.min(ee.to,c),ee.level==1?"rtl":"ltr",G),y=!0)}y||l(n,c,"ltr")}var Ht=null;function Xt(e,n,c){var l;Ht=null;for(var y=0;y<e.length;++y){var G=e[y];if(G.from<n&&G.to>n)return y;G.to==n&&(G.from!=G.to&&c=="before"?l=y:Ht=y),G.from==n&&(G.from!=G.to&&c!="before"?l=y:Ht=y)}return l!=null?l:Ht}var an=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function c(me){return me<=247?e.charAt(me):1424<=me&&me<=1524?"R":1536<=me&&me<=1785?n.charAt(me-1536):1774<=me&&me<=2220?"r":8192<=me&&me<=8203?"w":me==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,G=/[LRr]/,ee=/[Lb1n]/,ae=/[1n]/;function oe(me,We,Qe){this.level=me,this.from=We,this.to=Qe}return function(me,We){var Qe=We=="ltr"?"L":"R";if(me.length==0||We=="ltr"&&!l.test(me))return!1;for(var _t=me.length,ht=[],Bt=0;Bt<_t;++Bt)ht.push(c(me.charCodeAt(Bt)));for(var Zt=0,mn=Qe;Zt<_t;++Zt){var jn=ht[Zt];jn=="m"?ht[Zt]=mn:mn=jn}for(var sr=0,Wn=Qe;sr<_t;++sr){var cr=ht[sr];cr=="1"&&Wn=="r"?ht[sr]="n":G.test(cr)&&(Wn=cr,cr=="r"&&(ht[sr]="R"))}for(var Or=1,Tr=ht[0];Or<_t-1;++Or){var Dr=ht[Or];Dr=="+"&&Tr=="1"&&ht[Or+1]=="1"?ht[Or]="1":Dr==","&&Tr==ht[Or+1]&&(Tr=="1"||Tr=="n")&&(ht[Or]=Tr),Tr=Dr}for(var Wr=0;Wr<_t;++Wr){var ri=ht[Wr];if(ri==",")ht[Wr]="N";else if(ri=="%"){var zr=void 0;for(zr=Wr+1;zr<_t&&ht[zr]=="%";++zr);for(var Ei=Wr&&ht[Wr-1]=="!"||zr<_t&&ht[zr]=="1"?"1":"N",gi=Wr;gi<zr;++gi)ht[gi]=Ei;Wr=zr-1}}for(var Qr=0,vi=Qe;Qr<_t;++Qr){var oi=ht[Qr];vi=="L"&&oi=="1"?ht[Qr]="L":G.test(oi)&&(vi=oi)}for(var qr=0;qr<_t;++qr)if(y.test(ht[qr])){var Jr=void 0;for(Jr=qr+1;Jr<_t&&y.test(ht[Jr]);++Jr);for(var Xr=(qr?ht[qr-1]:Qe)=="L",_i=(Jr<_t?ht[Jr]:Qe)=="L",vs=Xr==_i?Xr?"L":"R":Qe,wa=qr;wa<Jr;++wa)ht[wa]=vs;qr=Jr-1}for(var di=[],Hi,ii=0;ii<_t;)if(ee.test(ht[ii])){var nu=ii;for(++ii;ii<_t&&ee.test(ht[ii]);++ii);di.push(new oe(0,nu,ii))}else{var Qi=ii,Ga=di.length,za=We=="rtl"?1:0;for(++ii;ii<_t&&ht[ii]!="L";++ii);for(var hi=Qi;hi<ii;)if(ae.test(ht[hi])){Qi<hi&&(di.splice(Ga,0,new oe(1,Qi,hi)),Ga+=za);var _s=hi;for(++hi;hi<ii&&ae.test(ht[hi]);++hi);di.splice(Ga,0,new oe(2,_s,hi)),Ga+=za,Qi=hi}else++hi;Qi<ii&&di.splice(Ga,0,new oe(1,Qi,ii))}return We=="ltr"&&(di[0].level==1&&(Hi=me.match(/^\s+/))&&(di[0].from=Hi[0].length,di.unshift(new oe(0,0,Hi[0].length))),ne(di).level==1&&(Hi=me.match(/\s+$/))&&(ne(di).to-=Hi[0].length,di.push(new oe(0,_t-Hi[0].length,_t)))),We=="rtl"?di.reverse():di}}();function tn(e,n){var c=e.order;return c==null&&(c=e.order=an(e.text,n)),c}var et=[],Ze=function(e,n,c){if(e.addEventListener)e.addEventListener(n,c,!1);else if(e.attachEvent)e.attachEvent("on"+n,c);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||et).concat(c)}};function Ct(e,n){return e._handlers&&e._handlers[n]||et}function At(e,n,c){if(e.removeEventListener)e.removeEventListener(n,c,!1);else if(e.detachEvent)e.detachEvent("on"+n,c);else{var l=e._handlers,y=l&&l[n];if(y){var G=ie(y,c);G>-1&&(l[n]=y.slice(0,G).concat(y.slice(G+1)))}}}function dt(e,n){var c=Ct(e,n);if(!c.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<c.length;++y)c[y].apply(null,l)}function ft(e,n,c){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),dt(e,c||n.type,e,n),De(n)||n.codemirrorIgnore}function He(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var c=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)ie(c,n[l])==-1&&c.push(n[l])}function Ne(e,n){return Ct(e,n).length>0}function Ue(e){e.prototype.on=function(n,c){Ze(this,n,c)},e.prototype.off=function(n,c){At(this,n,c)}}function ge(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){ge(e),Ee(e)}function Fe(e){return e.target||e.srcElement}function at(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),u&&e.ctrlKey&&n==1&&(n=3),n}var xt=function(){if($&&z<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Gt;function $t(e){if(Gt==null){var n=f("span","\u200B");h(e,f("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Gt=n.offsetWidth<=1&&n.offsetHeight>2&&!($&&z<8))}var c=Gt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}var Yt;function $n(e){if(Yt!=null)return Yt;var n=h(e,document.createTextNode("A\u062EA")),c=x(n,0,1).getBoundingClientRect(),l=x(n,1,2).getBoundingClientRect();return b(e),!c||c.left==c.right?!1:Yt=l.right-c.right<3}var vn=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var n=0,c=[],l=e.length;n<=l;){var y=e.indexOf(`
|
|
`,n);y==-1&&(y=e.length);var G=e.slice(n,e.charAt(y-1)=="\r"?y-1:y),ee=G.indexOf("\r");ee!=-1?(c.push(G.slice(0,ee)),n+=ee+1):(c.push(G),n=y+1)}return c}:function(e){return e.split(/\r\n?|\n/)},ln=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(c){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},hn=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gn=null;function fr(e){if(Gn!=null)return Gn;var n=h(e,f("span","x")),c=n.getBoundingClientRect(),l=x(n,0,1).getBoundingClientRect();return Gn=Math.abs(c.left-l.left)>1}var vr={},ir={};function br(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),vr[e]=n}function Rr(e,n){ir[e]=n}function Jt(e){if(typeof e=="string"&&ir.hasOwnProperty(e))e=ir[e];else if(e&&typeof e.name=="string"&&ir.hasOwnProperty(e.name)){var n=ir[e.name];typeof n=="string"&&(n={name:n}),e=qe(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Jt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Jt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ar(e,n){n=Jt(n);var c=vr[n.name];if(!c)return Ar(e,"text/plain");var l=c(e,n);if(Nn.hasOwnProperty(n.name)){var y=Nn[n.name];for(var G in y){if(!y.hasOwnProperty(G))continue;l.hasOwnProperty(G)&&(l["_"+G]=l[G]),l[G]=y[G]}}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var ee in n.modeProps)l[ee]=n.modeProps[ee];return l}var Nn={};function Tn(e,n){var c=Nn.hasOwnProperty(e)?Nn[e]:Nn[e]={};v(n,c)}function pr(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var c={};for(var l in n){var y=n[l];y instanceof Array&&(y=y.concat([])),c[l]=y}return c}function _r(e,n){for(var c;e.innerMode&&!(c=e.innerMode(n),!c||c.mode==e);)n=c.state,e=c.mode;return c||{mode:e,state:n}}function Pr(e,n,c){return e.startState?e.startState(n,c):!0}var yr=function(e,n,c){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};yr.prototype.eol=function(){return this.pos>=this.string.length},yr.prototype.sol=function(){return this.pos==this.lineStart},yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yr.prototype.eat=function(e){var n=this.string.charAt(this.pos),c;if(typeof e=="string"?c=n==e:c=n&&(e.test?e.test(n):e(n)),c)return++this.pos,n},yr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},yr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yr.prototype.skipToEnd=function(){this.pos=this.string.length},yr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},yr.prototype.backUp=function(e){this.pos-=e},yr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},yr.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},yr.prototype.match=function(e,n,c){if(typeof e=="string"){var l=function(ee){return c?ee.toLowerCase():ee},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var G=this.string.slice(this.pos).match(e);return G&&G.index>0?null:(G&&n!==!1&&(this.pos+=G[0].length),G)}},yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},yr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},yr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},yr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function mt(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var c=e;!c.lines;)for(var l=0;;++l){var y=c.children[l],G=y.chunkSize();if(n<G){c=y;break}n-=G}return c.lines[n]}function Ge(e,n,c){var l=[],y=n.line;return e.iter(n.line,c.line+1,function(G){var ee=G.text;y==c.line&&(ee=ee.slice(0,c.ch)),y==n.line&&(ee=ee.slice(n.ch)),l.push(ee),++y}),l}function Ot(e,n,c){var l=[];return e.iter(n,c,function(y){l.push(y.text)}),l}function Me(e,n){var c=n-e.height;if(c)for(var l=e;l;l=l.parent)l.height+=c}function ye(e){if(e.parent==null)return null;for(var n=e.parent,c=ie(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var y=0;!(l.children[y]==n);++y)c+=l.children[y].chunkSize();return c+n.first}function ve(e,n){var c=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],G=y.height;if(n<G){e=y;continue e}n-=G,c+=y.chunkSize()}return c}while(!e.lines);for(var ee=0;ee<e.lines.length;++ee){var ae=e.lines[ee],oe=ae.height;if(n<oe)break;n-=oe}return c+ee}function or(e,n){return n>=e.first&&n<e.first+e.size}function en(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function Ie(e,n,c){if(c===void 0&&(c=null),!(this instanceof Ie))return new Ie(e,n,c);this.line=e,this.ch=n,this.sticky=c}function gt(e,n){return e.line-n.line||e.ch-n.ch}function Ce(e,n){return e.sticky==n.sticky&>(e,n)==0}function cn(e){return Ie(e.line,e.ch)}function hr(e,n){return gt(e,n)<0?n:e}function mr(e,n){return gt(e,n)<0?e:n}function q(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function O(e,n){if(n.line<e.first)return Ie(e.first,0);var c=e.first+e.size-1;return n.line>c?Ie(c,mt(e,c).text.length):M(n,mt(e,n.line).text.length)}function M(e,n){var c=e.ch;return c==null||c>n?Ie(e.line,n):c<0?Ie(e.line,0):e}function X(e,n){for(var c=[],l=0;l<n.length;l++)c[l]=O(e,n[l]);return c}var se=function(e,n){this.state=e,this.lookAhead=n},Z=function(e,n,c,l){this.state=n,this.doc=e,this.line=c,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Z.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Z.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Z.fromSaved=function(e,n,c){return n instanceof se?new Z(e,pr(e.mode,n.state),c,n.lookAhead):new Z(e,pr(e.mode,n),c)},Z.prototype.save=function(e){var n=e!==!1?pr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new se(n,this.maxLookAhead):n};function Le(e,n,c,l){var y=[e.state.modeGen],G={};Hn(e,n.text,e.doc.mode,c,function(me,We){return y.push(me,We)},G,l);for(var ee=c.state,ae=function(me){c.baseTokens=y;var We=e.state.overlays[me],Qe=1,_t=0;c.state=!0,Hn(e,n.text,We.mode,c,function(ht,Bt){for(var Zt=Qe;_t<ht;){var mn=y[Qe];mn>ht&&y.splice(Qe,1,ht,y[Qe+1],mn),Qe+=2,_t=Math.min(ht,mn)}if(!Bt)return;if(We.opaque)y.splice(Zt,Qe-Zt,ht,"overlay "+Bt),Qe=Zt+2;else for(;Zt<Qe;Zt+=2){var jn=y[Zt+1];y[Zt+1]=(jn?jn+" ":"")+"overlay "+Bt}},G),c.state=ee,c.baseTokens=null,c.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ae(oe);return{styles:y,classes:G.bgClass||G.textClass?G:null}}function ot(e,n,c){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=wt(e,ye(n)),y=n.text.length>e.options.maxHighlightLength&&pr(e.doc.mode,l.state),G=Le(e,n,l);y&&(l.state=y),n.stateAfter=l.save(!y),n.styles=G.styles,G.classes?n.styleClasses=G.classes:n.styleClasses&&(n.styleClasses=null),c===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function wt(e,n,c){var l=e.doc,y=e.display;if(!l.mode.startState)return new Z(l,!0,n);var G=fn(e,n,c),ee=G>l.first&&mt(l,G-1).stateAfter,ae=ee?Z.fromSaved(l,ee,G):new Z(l,Pr(l.mode),G);return l.iter(G,n,function(oe){Lt(e,oe.text,ae);var me=ae.line;oe.stateAfter=me==n-1||me%5==0||me>=y.viewFrom&&me<y.viewTo?ae.save():null,ae.nextLine()}),c&&(l.modeFrontier=ae.line),ae}function Lt(e,n,c,l){var y=e.doc.mode,G=new yr(n,e.options.tabSize,c);for(G.start=G.pos=l||0,n==""&&ct(y,c.state);!G.eol();)Et(y,G,c.state),G.start=G.pos}function ct(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var c=_r(e,n);if(c.mode.blankLine)return c.mode.blankLine(c.state)}function Et(e,n,c,l){for(var y=0;y<10;y++){l&&(l[0]=_r(e,c).mode);var G=e.token(n,c);if(n.pos>n.start)return G}throw new Error("Mode "+e.name+" failed to advance stream.")}var Mt=function(e,n,c){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=c};function Cn(e,n,c,l){var y=e.doc,G=y.mode,ee;n=O(y,n);var ae=mt(y,n.line),oe=wt(e,n.line,c),me=new yr(ae.text,e.options.tabSize,oe),We;for(l&&(We=[]);(l||me.pos<n.ch)&&!me.eol();)me.start=me.pos,ee=Et(G,me,oe.state),l&&We.push(new Mt(me,ee,pr(y.mode,oe.state)));return l?We:new Mt(me,ee,oe.state)}function Yn(e,n){if(e)for(;;){var c=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;e=e.slice(0,c.index)+e.slice(c.index+c[0].length);var l=c[1]?"bgClass":"textClass";n[l]==null?n[l]=c[2]:new RegExp("(?:^|\\s)"+c[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+c[2])}return e}function Hn(e,n,c,l,y,G,ee){var ae=c.flattenSpans;ae==null&&(ae=e.options.flattenSpans);var oe=0,me=null,We=new yr(n,e.options.tabSize,l),Qe,_t=e.options.addModeClass&&[null];for(n==""&&Yn(ct(c,l.state),G);!We.eol();){if(We.pos>e.options.maxHighlightLength?(ae=!1,ee&&Lt(e,n,l,We.pos),We.pos=n.length,Qe=null):Qe=Yn(Et(c,We,l.state,_t),G),_t){var ht=_t[0].name;ht&&(Qe="m-"+(Qe?ht+" "+Qe:ht))}if(!ae||me!=Qe){for(;oe<We.start;)oe=Math.min(We.start,oe+5e3),y(oe,me);me=Qe}We.start=We.pos}for(;oe<We.pos;){var Bt=Math.min(We.pos,oe+5e3);y(Bt,me),oe=Bt}}function fn(e,n,c){for(var l,y,G=e.doc,ee=c?-1:n-(e.doc.mode.innerMode?1e3:100),ae=n;ae>ee;--ae){if(ae<=G.first)return G.first;var oe=mt(G,ae-1),me=oe.stateAfter;if(me&&(!c||ae+(me instanceof se?me.lookAhead:0)<=G.modeFrontier))return ae;var We=H(oe.text,null,e.options.tabSize);(y==null||l>We)&&(y=ae-1,l=We)}return y}function Wt(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var c=e.first,l=n-1;l>c;l--){var y=mt(e,l).stateAfter;if(y&&(!(y instanceof se)||l+y.lookAhead<n)){c=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,c)}var sn=!1,qt=!1;function Ft(){sn=!0}function Qn(){qt=!0}function Bn(e,n,c){this.marker=e,this.from=n,this.to=c}function xn(e,n){if(e)for(var c=0;c<e.length;++c){var l=e[c];if(l.marker==n)return l}}function Jn(e,n){for(var c,l=0;l<e.length;++l)e[l]!=n&&(c||(c=[])).push(e[l]);return c}function pn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function Sn(e,n,c){var l;if(e)for(var y=0;y<e.length;++y){var G=e[y],ee=G.marker,ae=G.from==null||(ee.inclusiveLeft?G.from<=n:G.from<n);if(ae||G.from==n&&ee.type=="bookmark"&&(!c||!G.marker.insertLeft)){var oe=G.to==null||(ee.inclusiveRight?G.to>=n:G.to>n);(l||(l=[])).push(new Bn(ee,G.from,oe?null:G.to))}}return l}function un(e,n,c){var l;if(e)for(var y=0;y<e.length;++y){var G=e[y],ee=G.marker,ae=G.to==null||(ee.inclusiveRight?G.to>=n:G.to>n);if(ae||G.from==n&&ee.type=="bookmark"&&(!c||G.marker.insertLeft)){var oe=G.from==null||(ee.inclusiveLeft?G.from<=n:G.from<n);(l||(l=[])).push(new Bn(ee,oe?null:G.from-n,G.to==null?null:G.to-n))}}return l}function Un(e,n){if(n.full)return null;var c=or(e,n.from.line)&&mt(e,n.from.line).markedSpans,l=or(e,n.to.line)&&mt(e,n.to.line).markedSpans;if(!c&&!l)return null;var y=n.from.ch,G=n.to.ch,ee=gt(n.from,n.to)==0,ae=Sn(c,y,ee),oe=un(l,G,ee),me=n.text.length==1,We=ne(n.text).length+(me?y:0);if(ae)for(var Qe=0;Qe<ae.length;++Qe){var _t=ae[Qe];if(_t.to==null){var ht=xn(oe,_t.marker);ht?me&&(_t.to=ht.to==null?null:ht.to+We):_t.to=y}}if(oe)for(var Bt=0;Bt<oe.length;++Bt){var Zt=oe[Bt];if(Zt.to!=null&&(Zt.to+=We),Zt.from==null){var mn=xn(ae,Zt.marker);mn||(Zt.from=We,me&&(ae||(ae=[])).push(Zt))}else Zt.from+=We,me&&(ae||(ae=[])).push(Zt)}ae&&(ae=Xn(ae)),oe&&oe!=ae&&(oe=Xn(oe));var jn=[ae];if(!me){var sr=n.text.length-2,Wn;if(sr>0&&ae)for(var cr=0;cr<ae.length;++cr)ae[cr].to==null&&(Wn||(Wn=[])).push(new Bn(ae[cr].marker,null,null));for(var Or=0;Or<sr;++Or)jn.push(Wn);jn.push(oe)}return jn}function Xn(e){for(var n=0;n<e.length;++n){var c=e[n];c.from!=null&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function nr(e,n,c){var l=null;if(e.iter(n.line,c.line+1,function(ht){if(ht.markedSpans)for(var Bt=0;Bt<ht.markedSpans.length;++Bt){var Zt=ht.markedSpans[Bt].marker;Zt.readOnly&&(!l||ie(l,Zt)==-1)&&(l||(l=[])).push(Zt)}}),!l)return null;for(var y=[{from:n,to:c}],G=0;G<l.length;++G)for(var ee=l[G],ae=ee.find(0),oe=0;oe<y.length;++oe){var me=y[oe];if(gt(me.to,ae.from)<0||gt(me.from,ae.to)>0)continue;var We=[oe,1],Qe=gt(me.from,ae.from),_t=gt(me.to,ae.to);(Qe<0||!ee.inclusiveLeft&&!Qe)&&We.push({from:me.from,to:ae.from}),(_t>0||!ee.inclusiveRight&&!_t)&&We.push({from:ae.to,to:me.to}),y.splice.apply(y,We),oe+=We.length-3}return y}function Ln(e){var n=e.markedSpans;if(!n)return;for(var c=0;c<n.length;++c)n[c].marker.detachLine(e);e.markedSpans=null}function Kn(e,n){if(!n)return;for(var c=0;c<n.length;++c)n[c].marker.attachLine(e);e.markedSpans=n}function rn(e){return e.inclusiveLeft?-1:0}function _n(e){return e.inclusiveRight?1:0}function In(e,n){var c=e.lines.length-n.lines.length;if(c!=0)return c;var l=e.find(),y=n.find(),G=gt(l.from,y.from)||rn(e)-rn(n);if(G)return-G;var ee=gt(l.to,y.to)||_n(e)-_n(n);return ee||n.id-e.id}function wn(e,n){var c=qt&&e.markedSpans,l;if(c)for(var y=void 0,G=0;G<c.length;++G)y=c[G],y.marker.collapsed&&(n?y.from:y.to)==null&&(!l||In(l,y.marker)<0)&&(l=y.marker);return l}function Zn(e){return wn(e,!0)}function yn(e){return wn(e,!1)}function Vn(e,n){var c=qt&&e.markedSpans,l;if(c)for(var y=0;y<c.length;++y){var G=c[y];G.marker.collapsed&&(G.from==null||G.from<n)&&(G.to==null||G.to>n)&&(!l||In(l,G.marker)<0)&&(l=G.marker)}return l}function qn(e,n,c,l,y){var G=mt(e,n),ee=qt&&G.markedSpans;if(ee)for(var ae=0;ae<ee.length;++ae){var oe=ee[ae];if(!oe.marker.collapsed)continue;var me=oe.marker.find(0),We=gt(me.from,c)||rn(oe.marker)-rn(y),Qe=gt(me.to,l)||_n(oe.marker)-_n(y);if(We>=0&&Qe<=0||We<=0&&Qe>=0)continue;if(We<=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?gt(me.to,c)>=0:gt(me.to,c)>0)||We>=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?gt(me.from,l)<=0:gt(me.from,l)<0))return!0}}function kn(e){for(var n;n=Zn(e);)e=n.find(-1,!0).line;return e}function Pn(e){for(var n;n=yn(e);)e=n.find(1,!0).line;return e}function Mn(e){for(var n,c;n=yn(e);)e=n.find(1,!0).line,(c||(c=[])).push(e);return c}function Dn(e,n){var c=mt(e,n),l=kn(c);return c==l?n:ye(l)}function dn(e,n){if(n>e.lastLine())return n;var c=mt(e,n),l;if(!Ut(e,c))return n;for(;l=yn(c);)c=l.find(1,!0).line;return ye(c)+1}function Ut(e,n){var c=qt&&n.markedSpans;if(c)for(var l=void 0,y=0;y<c.length;++y){if(l=c[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&zt(e,n,l))return!0}}function zt(e,n,c){if(c.to==null){var l=c.marker.find(1,!0);return zt(e,l.line,xn(l.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==n.text.length)return!0;for(var y=void 0,G=0;G<n.markedSpans.length;++G)if(y=n.markedSpans[G],y.marker.collapsed&&!y.marker.widgetNode&&y.from==c.to&&(y.to==null||y.to!=c.from)&&(y.marker.inclusiveLeft||c.marker.inclusiveRight)&&zt(e,n,y))return!0}function Vt(e){e=kn(e);for(var n=0,c=e.parent,l=0;l<c.lines.length;++l){var y=c.lines[l];if(y==e)break;n+=y.height}for(var G=c.parent;G;c=G,G=c.parent)for(var ee=0;ee<G.children.length;++ee){var ae=G.children[ee];if(ae==c)break;n+=ae.height}return n}function jt(e){if(e.height==0)return 0;for(var n=e.text.length,c,l=e;c=Zn(l);){var y=c.find(0,!0);l=y.from.line,n+=y.from.ch-y.to.ch}for(l=e;c=yn(l);){var G=c.find(0,!0);n-=l.text.length-G.from.ch,l=G.to.line,n+=l.text.length-G.to.ch}return n}function nn(e){var n=e.display,c=e.doc;n.maxLine=mt(c,c.first),n.maxLineLength=jt(n.maxLine),n.maxLineChanged=!0,c.iter(function(l){var y=jt(l);y>n.maxLineLength&&(n.maxLineLength=y,n.maxLine=l)})}var bn=function(e,n,c){this.text=e,Kn(this,n),this.height=c?c(this):1};bn.prototype.lineNo=function(){return ye(this)},Ue(bn);function gn(e,n,c,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ln(e),Kn(e,c);var y=l?l(e):1;y!=e.height&&Me(e,y)}function bt(e){e.parent=null,Ln(e)}var lt={},Je={};function nt(e,n){if(!e||/^\s*$/.test(e))return null;var c=n.addModeClass?Je:lt;return c[e]||(c[e]=e.replace(/\S+/g,"cm-$&"))}function ze(e,n){var c=C("span",null,null,r?"padding-right: .1px":null),l={pre:C("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var y=0;y<=(n.rest?n.rest.length:0);y++){var G=y?n.rest[y-1]:n.line,ee=void 0;l.pos=0,l.addToken=rt,$n(e.display.measure)&&(ee=tn(G,e.doc.direction))&&(l.addToken=Nt(l.addToken,ee)),l.map=[];var ae=n!=e.display.externalMeasured&&ye(G);Kt(G,l,ot(e,G,ae)),G.styleClasses&&(G.styleClasses.bgClass&&(l.bgClass=w(G.styleClasses.bgClass,l.bgClass||"")),G.styleClasses.textClass&&(l.textClass=w(G.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild($t(e.display.measure))),y==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(r){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return dt(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=w(l.pre.className,l.textClass||"")),l}function pt(e){var n=f("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function rt(e,n,c,l,y,G,ee){if(!n)return;var ae=e.splitSpaces?Tt(n,e.trailingSpace):n,oe=e.cm.state.specialChars,me=!1,We;if(!oe.test(n))e.col+=n.length,We=document.createTextNode(ae),e.map.push(e.pos,e.pos+n.length,We),$&&z<9&&(me=!0),e.pos+=n.length;else{We=document.createDocumentFragment();for(var Qe=0;;){oe.lastIndex=Qe;var _t=oe.exec(n),ht=_t?_t.index-Qe:n.length-Qe;if(ht){var Bt=document.createTextNode(ae.slice(Qe,Qe+ht));$&&z<9?We.appendChild(f("span",[Bt])):We.appendChild(Bt),e.map.push(e.pos,e.pos+ht,Bt),e.col+=ht,e.pos+=ht}if(!_t)break;Qe+=ht+1;var Zt=void 0;if(_t[0]==" "){var mn=e.cm.options.tabSize,jn=mn-e.col%mn;Zt=We.appendChild(f("span",be(jn),"cm-tab")),Zt.setAttribute("role","presentation"),Zt.setAttribute("cm-text"," "),e.col+=jn}else _t[0]=="\r"||_t[0]==`
|
|
`?(Zt=We.appendChild(f("span",_t[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Zt.setAttribute("cm-text",_t[0]),e.col+=1):(Zt=e.cm.options.specialCharPlaceholder(_t[0]),Zt.setAttribute("cm-text",_t[0]),$&&z<9?We.appendChild(f("span",[Zt])):We.appendChild(Zt),e.col+=1);e.map.push(e.pos,e.pos+1,Zt),e.pos++}}if(e.trailingSpace=ae.charCodeAt(n.length-1)==32,c||l||y||me||G||ee){var sr=c||"";l&&(sr+=l),y&&(sr+=y);var Wn=f("span",[We],sr,G);if(ee)for(var cr in ee)ee.hasOwnProperty(cr)&&cr!="style"&&cr!="class"&&Wn.setAttribute(cr,ee[cr]);return e.content.appendChild(Wn)}e.content.appendChild(We)}function Tt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var c=n,l="",y=0;y<e.length;y++){var G=e.charAt(y);G==" "&&c&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(G="\xA0"),l+=G,c=G==" "}return l}function Nt(e,n){return function(c,l,y,G,ee,ae,oe){y=y?y+" cm-force-border":"cm-force-border";for(var me=c.pos,We=me+l.length;;){for(var Qe=void 0,_t=0;_t<n.length&&!(Qe=n[_t],Qe.to>me&&Qe.from<=me);_t++);if(Qe.to>=We)return e(c,l,y,G,ee,ae,oe);e(c,l.slice(0,Qe.to-me),y,G,null,ae,oe),G=null,l=l.slice(Qe.to-me),me=Qe.to}}}function St(e,n,c,l){var y=!l&&c.widgetNode;y&&e.map.push(e.pos,e.pos+n,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",c.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=n,e.trailingSpace=!1}function Kt(e,n,c){var l=e.markedSpans,y=e.text,G=0;if(!l){for(var ee=1;ee<c.length;ee+=2)n.addToken(n,y.slice(G,G=c[ee]),nt(c[ee+1],n.cm.options));return}for(var ae=y.length,oe=0,me=1,We="",Qe,_t,ht=0,Bt,Zt,mn,jn,sr;;){if(ht==oe){Bt=Zt=mn=_t="",sr=null,jn=null,ht=Infinity;for(var Wn=[],cr=void 0,Or=0;Or<l.length;++Or){var Tr=l[Or],Dr=Tr.marker;if(Dr.type=="bookmark"&&Tr.from==oe&&Dr.widgetNode)Wn.push(Dr);else if(Tr.from<=oe&&(Tr.to==null||Tr.to>oe||Dr.collapsed&&Tr.to==oe&&Tr.from==oe)){if(Tr.to!=null&&Tr.to!=oe&&ht>Tr.to&&(ht=Tr.to,Zt=""),Dr.className&&(Bt+=" "+Dr.className),Dr.css&&(_t=(_t?_t+";":"")+Dr.css),Dr.startStyle&&Tr.from==oe&&(mn+=" "+Dr.startStyle),Dr.endStyle&&Tr.to==ht&&(cr||(cr=[])).push(Dr.endStyle,Tr.to),Dr.title&&((sr||(sr={})).title=Dr.title),Dr.attributes)for(var Wr in Dr.attributes)(sr||(sr={}))[Wr]=Dr.attributes[Wr];Dr.collapsed&&(!jn||In(jn.marker,Dr)<0)&&(jn=Tr)}else Tr.from>oe&&ht>Tr.from&&(ht=Tr.from)}if(cr)for(var ri=0;ri<cr.length;ri+=2)cr[ri+1]==ht&&(Zt+=" "+cr[ri]);if(!jn||jn.from==oe)for(var zr=0;zr<Wn.length;++zr)St(n,0,Wn[zr]);if(jn&&(jn.from||0)==oe){if(St(n,(jn.to==null?ae+1:jn.to)-oe,jn.marker,jn.from==null),jn.to==null)return;jn.to==oe&&(jn=!1)}}if(oe>=ae)break;for(var Ei=Math.min(ae,ht);;){if(We){var gi=oe+We.length;if(!jn){var Qr=gi>Ei?We.slice(0,Ei-oe):We;n.addToken(n,Qr,Qe?Qe+Bt:Bt,mn,oe+Qr.length==ht?Zt:"",_t,sr)}if(gi>=Ei){We=We.slice(Ei-oe),oe=Ei;break}oe=gi,mn=""}We=y.slice(G,G=c[me++]),Qe=nt(c[me++],n.cm.options)}}}function Rt(e,n,c){this.line=n,this.rest=Mn(n),this.size=this.rest?ye(ne(this.rest))-c+1:1,this.node=this.text=null,this.hidden=Ut(e,n)}function It(e,n,c){for(var l=[],y,G=n;G<c;G=y){var ee=new Rt(e.doc,mt(e.doc,G),G);y=G+ee.size,l.push(ee)}return l}var En=null;function on(e){En?En.ops.push(e):e.ownsGroup=En={ops:[e],delayedCallbacks:[]}}function gr(e){var n=e.delayedCallbacks,c=0;do{for(;c<n.length;c++)n[c].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(c<n.length)}function er(e,n){var c=e.ownsGroup;if(!c)return;try{gr(c)}finally{En=null,n(c)}}var tr=null;function Qt(e,n){var c=Ct(e,n);if(!c.length)return;var l=Array.prototype.slice.call(arguments,2),y;En?y=En.delayedCallbacks:tr?y=tr:(y=tr=[],setTimeout(Rn,0));for(var G=function(ae){y.push(function(){return c[ae].apply(null,l)})},ee=0;ee<c.length;++ee)G(ee)}function Rn(){var e=tr;tr=null;for(var n=0;n<e.length;++n)e[n]()}function zn(e,n,c,l){for(var y=0;y<n.changes.length;y++){var G=n.changes[y];G=="text"?jr(e,n):G=="gutter"?lr(e,n,c,l):G=="class"?xr(e,n):G=="widget"&&wr(e,n,l)}n.changes=null}function rr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),$&&z<8&&(e.node.style.zIndex=2)),e.node}function On(e,n){var c=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(c&&(c+=" CodeMirror-linebackground"),n.background)c?n.background.className=c:(n.background.parentNode.removeChild(n.background),n.background=null);else if(c){var l=rr(n);n.background=l.insertBefore(f("div",null,c),l.firstChild),e.display.input.setUneditable(n.background)}}function Ir(e,n){var c=e.display.externalMeasured;return c&&c.line==n.line?(e.display.externalMeasured=null,n.measure=c.measure,c.built):ze(e,n)}function jr(e,n){var c=n.text.className,l=Ir(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,xr(e,n)):c&&(n.text.className=c)}function xr(e,n){On(e,n),n.line.wrapClass?rr(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var c=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=c||""}function lr(e,n,c,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var y=rr(n);n.gutterBackground=f("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),y.insertBefore(n.gutterBackground,n.text)}var G=n.line.gutterMarkers;if(e.options.lineNumbers||G){var ee=rr(n),ae=n.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ae),ee.insertBefore(ae,n.text),n.line.gutterClass&&(ae.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!G||!G["CodeMirror-linenumbers"])&&(n.lineNumber=ae.appendChild(f("div",en(e.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),G)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=e.display.gutterSpecs[oe].className,We=G.hasOwnProperty(me)&&G[me];We&&ae.appendChild(f("div",[We],"CodeMirror-gutter-elt","left: "+l.gutterLeft[me]+"px; width: "+l.gutterWidth[me]+"px"))}}}function wr(e,n,c){n.alignable&&(n.alignable=null);for(var l=P("CodeMirror-linewidget"),y=n.node.firstChild,G=void 0;y;y=G)G=y.nextSibling,l.test(y.className)&&n.node.removeChild(y);Cr(e,n,c)}function Er(e,n,c,l){var y=Ir(e,n);return n.text=n.node=y.pre,y.bgClass&&(n.bgClass=y.bgClass),y.textClass&&(n.textClass=y.textClass),xr(e,n),lr(e,n,c,l),Cr(e,n,l),n.node}function Cr(e,n,c){if(Ur(e,n.line,n,c,!0),n.rest)for(var l=0;l<n.rest.length;l++)Ur(e,n.rest[l],n,c,!1)}function Ur(e,n,c,l,y){if(!n.widgets)return;for(var G=rr(c),ee=0,ae=n.widgets;ee<ae.length;++ee){var oe=ae[ee],me=f("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||me.setAttribute("cm-ignore-events","true"),Vr(oe,me,c,l),e.display.input.setUneditable(me),y&&oe.above?G.insertBefore(me,c.gutter||c.text):G.appendChild(me),Qt(oe,"redraw")}}function Vr(e,n,c,l){if(e.noHScroll){(c.alignable||(c.alignable=[])).push(n);var y=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=y+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Fr(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!_(document.body,e.node)){var c="position: relative;";e.coverGutter&&(c+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(c+="width: "+n.display.wrapper.clientWidth+"px;"),h(n.display.measure,f("div",[e.node],null,c))}return e.height=e.node.parentNode.offsetHeight}function kr(e,n){for(var c=Fe(n);c!=e.wrapper;c=c.parentNode)if(!c||c.nodeType==1&&c.getAttribute("cm-ignore-events")=="true"||c.parentNode==e.sizer&&c!=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")),c=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Zr(e){return le-e.display.nativeBarWidth}function ei(e){return e.display.scroller.clientWidth-Zr(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-Zr(e)-e.display.barHeight}function Ri(e,n,c){var l=e.options.lineWrapping,y=l&&ei(e);if(!n.measure.heights||l&&n.measure.width!=y){var G=n.measure.heights=[];if(l){n.measure.width=y;for(var ee=n.text.firstChild.getClientRects(),ae=0;ae<ee.length-1;ae++){var oe=ee[ae],me=ee[ae+1];Math.abs(oe.bottom-me.bottom)>2&&G.push((oe.bottom+me.top)/2-c.top)}}G.push(c.bottom-c.top)}}function Va(e,n,c){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(ye(e.rest[y])>c)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function fi(e,n){n=kn(n);var c=ye(n),l=e.display.externalMeasured=new Rt(e.doc,n,c);l.lineN=c;var y=l.built=ze(e,l);return l.text=y.pre,h(e.display.lineMeasure,y.pre),l}function Xa(e,n,c,l){return ai(e,ki(e,n),c,l)}function Ki(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[zi(e,n)];var c=e.display.externalMeasured;if(c&&n>=c.lineN&&n<c.lineN+c.size)return c}function ki(e,n){var c=ye(n),l=Ki(e,c);l&&!l.text?l=null:l&&l.changes&&(zn(e,l,c,As(e)),e.curOp.forceUpdate=!0),l||(l=fi(e,n));var y=Va(l,n,c);return{line:n,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function ai(e,n,c,l,y){n.before&&(c=-1);var G=c+(l||""),ee;return n.cache.hasOwnProperty(G)?ee=n.cache[G]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ri(e,n.view,n.rect),n.hasHeights=!0),ee=Es(e,n,c,l),ee.bogus||(n.cache[G]=ee)),{left:ee.left,right:ee.right,top:y?ee.rtop:ee.top,bottom:y?ee.rbottom:ee.bottom}}var Ji={left:0,right:0,top:0,bottom:0};function ys(e,n,c){for(var l,y,G,ee,ae,oe,me=0;me<e.length;me+=3)if(ae=e[me],oe=e[me+1],n<ae?(y=0,G=1,ee="left"):n<oe?(y=n-ae,G=y+1):(me==e.length-3||n==oe&&e[me+3]>n)&&(G=oe-ae,y=G-1,n>=oe&&(ee="right")),y!=null){if(l=e[me+2],ae==oe&&c==(l.insertLeft?"left":"right")&&(ee=c),c=="left"&&y==0)for(;me&&e[me-2]==e[me-3]&&e[me-1].insertLeft;)l=e[(me-=3)+2],ee="left";if(c=="right"&&y==oe-ae)for(;me<e.length-3&&e[me+3]==e[me+4]&&!e[me+5].insertLeft;)l=e[(me+=3)+2],ee="right";break}return{node:l,start:y,end:G,collapse:ee,coverStart:ae,coverEnd:oe}}function bs(e,n){var c=Ji;if(n=="left")for(var l=0;l<e.length&&!((c=e[l]).left!=c.right);l++);else for(var y=e.length-1;y>=0&&!((c=e[y]).left!=c.right);y--);return c}function Es(e,n,c,l){var y=ys(n.map,c,l),G=y.node,ee=y.start,ae=y.end,oe=y.collapse,me;if(G.nodeType==3){for(var We=0;We<4;We++){for(;ee&&Ye(n.line.text.charAt(y.coverStart+ee));)--ee;for(;y.coverStart+ae<y.coverEnd&&Ye(n.line.text.charAt(y.coverStart+ae));)++ae;if($&&z<9&&ee==0&&ae==y.coverEnd-y.coverStart?me=G.parentNode.getBoundingClientRect():me=bs(x(G,ee,ae).getClientRects(),l),me.left||me.right||ee==0)break;ae=ee,ee=ee-1,oe="right"}$&&z<11&&(me=co(e.display.measure,me))}else{ee>0&&(oe=l="right");var Qe;e.options.lineWrapping&&(Qe=G.getClientRects()).length>1?me=Qe[l=="right"?Qe.length-1:0]:me=G.getBoundingClientRect()}if($&&z<9&&!ee&&(!me||!me.left&&!me.right)){var _t=G.parentNode.getClientRects()[0];_t?me={left:_t.left,right:_t.left+qi(e.display),top:_t.top,bottom:_t.bottom}:me=Ji}for(var ht=me.top-n.rect.top,Bt=me.bottom-n.rect.top,Zt=(ht+Bt)/2,mn=n.view.measure.heights,jn=0;jn<mn.length-1&&!(Zt<mn[jn]);jn++);var sr=jn?mn[jn-1]:0,Wn=mn[jn],cr={left:(oe=="right"?me.right:me.left)-n.rect.left,right:(oe=="left"?me.left:me.right)-n.rect.left,top:sr,bottom:Wn};return!me.left&&!me.right&&(cr.bogus=!0),e.options.singleCursorHeightPerLine||(cr.rtop=ht,cr.rbottom=Bt),cr}function co(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!fr(e))return n;var c=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*c,right:n.right*c,top:n.top*l,bottom:n.bottom*l}}function ho(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function xs(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)ho(e.display.view[n])}function Ca(e){xs(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fo(){return p&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function po(){return p&&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 c=0;c<e.widgets.length;++c)e.widgets[c].above&&(n+=Fr(e.widgets[c]));return n}function $a(e,n,c,l,y){if(!y){var G=ws(n);c.top+=G,c.bottom+=G}if(l=="line")return c;l||(l="local");var ee=Vt(n);if(l=="local"?ee+=Ti(e.display):ee-=e.display.viewOffset,l=="page"||l=="window"){var ae=e.display.lineSpace.getBoundingClientRect();ee+=ae.top+(l=="window"?0:po());var oe=ae.left+(l=="window"?0:fo());c.left+=oe,c.right+=oe}return c.top+=ee,c.bottom+=ee,c}function Cs(e,n,c){if(c=="div")return n;var l=n.left,y=n.top;if(c=="page")l-=fo(),y-=po();else if(c=="local"||!c){var G=e.display.sizer.getBoundingClientRect();l+=G.left,y+=G.top}var ee=e.display.lineSpace.getBoundingClientRect();return{left:l-ee.left,top:y-ee.top}}function Ts(e,n,c,l,y){return l||(l=mt(e.doc,n.line)),$a(e,l,Xa(e,l,n.ch,y),c)}function xi(e,n,c,l,y,G){l=l||mt(e.doc,n.line),y||(y=ki(e,l));function ee(Bt,Zt){var mn=ai(e,y,Bt,Zt?"right":"left",G);return Zt?mn.left=mn.right:mn.right=mn.left,$a(e,l,mn,c)}var ae=tn(l,e.doc.direction),oe=n.ch,me=n.sticky;if(oe>=l.text.length?(oe=l.text.length,me="before"):oe<=0&&(oe=0,me="after"),!ae)return ee(me=="before"?oe-1:oe,me=="before");function We(Bt,Zt,mn){var jn=ae[Zt],sr=jn.level==1;return ee(mn?Bt-1:Bt,sr!=mn)}var Qe=Xt(ae,oe,me),_t=Ht,ht=We(oe,Qe,me=="before");return _t!=null&&(ht.other=We(oe,_t,me!="before")),ht}function mo(e,n){var c=0;n=O(e.doc,n),e.options.lineWrapping||(c=qi(e.display)*n.ch);var l=mt(e.doc,n.line),y=Vt(l)+Ti(e.display);return{left:c,right:c,top:y,bottom:y+l.height}}function Ss(e,n,c,l,y){var G=Ie(e,n,c);return G.xRel=y,l&&(G.outside=l),G}function Rs(e,n,c){var l=e.doc;if(c+=e.display.viewOffset,c<0)return Ss(l.first,0,null,-1,-1);var y=ve(l,c),G=l.first+l.size-1;if(y>G)return Ss(l.first+l.size-1,mt(l,G).text.length,null,1,1);n<0&&(n=0);for(var ee=mt(l,y);;){var ae=El(e,ee,y,n,c),oe=Vn(ee,ae.ch+(ae.xRel>0||ae.outside>0?1:0));if(!oe)return ae;var me=oe.find(1);if(me.line==y)return me;ee=mt(l,y=me.line)}}function go(e,n,c,l){l-=ws(n);var y=n.text.length,G=yt(function(ee){return ai(e,c,ee-1).bottom<=l},y,0);return y=yt(function(ee){return ai(e,c,ee).top>l},G,y),{begin:G,end:y}}function vo(e,n,c,l){c||(c=ki(e,n));var y=$a(e,n,ai(e,c,l),"line").top;return go(e,n,c,y)}function Os(e,n,c,l){return e.bottom<=c?!1:e.top>c?!0:(l?e.left:e.right)>n}function El(e,n,c,l,y){y-=Vt(n);var G=ki(e,n),ee=ws(n),ae=0,oe=n.text.length,me=!0,We=tn(n,e.doc.direction);if(We){var Qe=(e.options.lineWrapping?Ya:Ta)(e,n,c,G,We,l,y);me=Qe.level!=1,ae=me?Qe.from:Qe.to-1,oe=me?Qe.to:Qe.from-1}var _t=null,ht=null,Bt=yt(function(Or){var Tr=ai(e,G,Or);return Tr.top+=ee,Tr.bottom+=ee,Os(Tr,l,y,!1)?(Tr.top<=y&&Tr.left<=l&&(_t=Or,ht=Tr),!0):!1},ae,oe),Zt,mn,jn=!1;if(ht){var sr=l-ht.left<ht.right-l,Wn=sr==me;Bt=_t+(Wn?0:1),mn=Wn?"after":"before",Zt=sr?ht.left:ht.right}else{!me&&(Bt==oe||Bt==ae)&&Bt++,mn=Bt==0?"after":Bt==n.text.length?"before":ai(e,G,Bt-(me?1:0)).bottom+ee<=y==me?"after":"before";var cr=xi(e,Ie(c,Bt,mn),"line",n,G);Zt=cr.left,jn=y<cr.top?-1:y>=cr.bottom?1:0}return Bt=Ke(n.text,Bt,1),Ss(c,Bt,mn,jn,l-Zt)}function Ta(e,n,c,l,y,G,ee){var ae=yt(function(Qe){var _t=y[Qe],ht=_t.level!=1;return Os(xi(e,Ie(c,ht?_t.to:_t.from,ht?"before":"after"),"line",n,l),G,ee,!0)},0,y.length-1),oe=y[ae];if(ae>0){var me=oe.level!=1,We=xi(e,Ie(c,me?oe.from:oe.to,me?"after":"before"),"line",n,l);Os(We,G,ee,!0)&&We.top>ee&&(oe=y[ae-1])}return oe}function Ya(e,n,c,l,y,G,ee){var ae=go(e,n,l,ee),oe=ae.begin,me=ae.end;/\s/.test(n.text.charAt(me-1))&&me--;for(var We=null,Qe=null,_t=0;_t<y.length;_t++){var ht=y[_t];if(ht.from>=me||ht.to<=oe)continue;var Bt=ht.level!=1,Zt=ai(e,l,Bt?Math.min(me,ht.to)-1:Math.max(oe,ht.from)).right,mn=Zt<G?G-Zt+1e9:Zt-G;(!We||Qe>mn)&&(We=ht,Qe=mn)}return We||(We=y[y.length-1]),We.from<oe&&(We={from:oe,to:We.to,level:We.level}),We.to>me&&(We={from:We.from,to:me,level:We.level}),We}var Oi;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Oi==null){Oi=f("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Oi.appendChild(document.createTextNode("x")),Oi.appendChild(f("br"));Oi.appendChild(document.createTextNode("x"))}h(e.measure,Oi);var c=Oi.offsetHeight/50;return c>3&&(e.cachedTextHeight=c),b(e.measure),c||1}function qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=f("span","xxxxxxxxxx"),c=f("pre",[n],"CodeMirror-line-like");h(e.measure,c);var l=n.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function As(e){for(var n=e.display,c={},l={},y=n.gutters.clientLeft,G=n.gutters.firstChild,ee=0;G;G=G.nextSibling,++ee){var ae=e.display.gutterSpecs[ee].className;c[ae]=G.offsetLeft+G.clientLeft+y,l[ae]=G.clientWidth}return{fixedPos:Ds(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:c,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),c=e.options.lineWrapping,l=c&&Math.max(5,e.display.scroller.clientWidth/qi(e.display)-3);return function(y){if(Ut(e.doc,y))return 0;var G=0;if(y.widgets)for(var ee=0;ee<y.widgets.length;ee++)y.widgets[ee].height&&(G+=y.widgets[ee].height);return c?G+(Math.ceil(y.text.length/l)||1)*n:G+n}}function Ps(e){var n=e.doc,c=_o(e);n.iter(function(l){var y=c(l);y!=l.height&&Me(l,y)})}function Gi(e,n,c,l){var y=e.display;if(!c&&Fe(n).getAttribute("cm-not-content")=="true")return null;var G,ee,ae=y.lineSpace.getBoundingClientRect();try{G=n.clientX-ae.left,ee=n.clientY-ae.top}catch(Qe){return null}var oe=Rs(e,G,ee),me;if(l&&oe.xRel>0&&(me=mt(e.doc,oe.line).text).length==oe.ch){var We=H(me,me.length,e.options.tabSize)-me.length;oe=Ie(oe.line,Math.max(0,Math.round((G-Si(e.display).left)/qi(e.display))-We))}return oe}function zi(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var c=e.display.view,l=0;l<c.length;l++)if(n-=c[l].size,n<0)return l}function li(e,n,c,l){n==null&&(n=e.doc.first),c==null&&(c=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&c<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>n)&&(y.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=y.viewTo)qt&&Dn(e.doc,n)<y.viewTo&&Ni(e);else if(c<=y.viewFrom)qt&&dn(e.doc,c+l)>y.viewFrom?Ni(e):(y.viewFrom+=l,y.viewTo+=l);else if(n<=y.viewFrom&&c>=y.viewTo)Ni(e);else if(n<=y.viewFrom){var G=ea(e,c,c+l,1);G?(y.view=y.view.slice(G.index),y.viewFrom=G.lineN,y.viewTo+=l):Ni(e)}else if(c>=y.viewTo){var ee=ea(e,n,n,-1);ee?(y.view=y.view.slice(0,ee.index),y.viewTo=ee.lineN):Ni(e)}else{var ae=ea(e,n,n,-1),oe=ea(e,c,c+l,1);ae&&oe?(y.view=y.view.slice(0,ae.index).concat(It(e,ae.lineN,oe.lineN)).concat(y.view.slice(oe.index)),y.viewTo+=l):Ni(e)}var me=y.externalMeasured;me&&(c<me.lineN?me.lineN+=l:n<me.lineN+me.size&&(y.externalMeasured=null))}function Mi(e,n,c){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&n>=y.lineN&&n<y.lineN+y.size&&(l.externalMeasured=null),n<l.viewFrom||n>=l.viewTo)return;var G=l.view[zi(e,n)];if(G.node==null)return;var ee=G.changes||(G.changes=[]);ie(ee,c)==-1&&ee.push(c)}function Ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ea(e,n,c,l){var y=zi(e,n),G,ee=e.display.view;if(!qt||c==e.doc.first+e.doc.size)return{index:y,lineN:c};for(var ae=e.display.viewFrom,oe=0;oe<y;oe++)ae+=ee[oe].size;if(ae!=n){if(l>0){if(y==ee.length-1)return null;G=ae+ee[y].size-n,y++}else G=ae-n;n+=G,c+=G}for(;Dn(e.doc,c)!=c;){if(y==(l<0?0:ee.length-1))return null;c+=l*ee[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:c}}function xl(e,n,c){var l=e.display,y=l.view;y.length==0||n>=l.viewTo||c<=l.viewFrom?(l.view=It(e,n,c),l.viewFrom=n):(l.viewFrom>n?l.view=It(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(zi(e,n))),l.viewFrom=n,l.viewTo<c?l.view=l.view.concat(It(e,l.viewTo,c)):l.viewTo>c&&(l.view=l.view.slice(0,zi(e,c)))),l.viewTo=c}function Ls(e){for(var n=e.display.view,c=0,l=0;l<n.length;l++){var y=n[l];!y.hidden&&(!y.node||y.changes)&&++c}return c}function ta(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Is(e,n){n===void 0&&(n=!0);for(var c=e.doc,l={},y=l.cursors=document.createDocumentFragment(),G=l.selection=document.createDocumentFragment(),ee=0;ee<c.sel.ranges.length;ee++){if(!n&&ee==c.sel.primIndex)continue;var ae=c.sel.ranges[ee];if(ae.from().line>=e.display.viewTo||ae.to().line<e.display.viewFrom)continue;var oe=ae.empty();(oe||e.options.showCursorWhenSelecting)&&yo(e,ae.head,y),oe||bo(e,ae,G)}return l}function yo(e,n,c){var l=xi(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),y=c.appendChild(f("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var G=c.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,c){var l=e.display,y=e.doc,G=document.createDocumentFragment(),ee=Si(e.display),ae=ee.left,oe=Math.max(l.sizerWidth,ei(e)-l.sizer.offsetLeft)-ee.right,me=y.direction=="ltr";function We(Wn,cr,Or,Tr){cr<0&&(cr=0),cr=Math.round(cr),Tr=Math.round(Tr),G.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Wn+`px;
|
|
top: `+cr+"px; width: "+(Or==null?oe-Wn:Or)+`px;
|
|
height: `+(Tr-cr)+"px"))}function Qe(Wn,cr,Or){var Tr=mt(y,Wn),Dr=Tr.text.length,Wr,ri;function zr(Qr,vi){return Ts(e,Ie(Wn,Qr),"div",Tr,vi)}function Ei(Qr,vi,oi){var qr=vo(e,Tr,null,Qr),Jr=vi=="ltr"==(oi=="after")?"left":"right",Xr=oi=="after"?qr.begin:qr.end-(/\s/.test(Tr.text.charAt(qr.end-1))?2:1);return zr(Xr,Jr)[Jr]}var gi=tn(Tr,y.direction);return Pt(gi,cr||0,Or==null?Dr:Or,function(Qr,vi,oi,qr){var Jr=oi=="ltr",Xr=zr(Qr,Jr?"left":"right"),_i=zr(vi-1,Jr?"right":"left"),vs=cr==null&&Qr==0,wa=Or==null&&vi==Dr,di=qr==0,Hi=!gi||qr==gi.length-1;if(_i.top-Xr.top<=3){var ii=(me?vs:wa)&&di,nu=(me?wa:vs)&&Hi,Qi=ii?ae:(Jr?Xr:_i).left,Ga=nu?oe:(Jr?_i:Xr).right;We(Qi,Xr.top,Ga-Qi,Xr.bottom)}else{var za,hi,_s,ru;Jr?(za=me&&vs&&di?ae:Xr.left,hi=me?oe:Ei(Qr,oi,"before"),_s=me?ae:Ei(vi,oi,"after"),ru=me&&wa&&Hi?oe:_i.right):(za=me?Ei(Qr,oi,"before"):ae,hi=!me&&vs&&di?oe:Xr.right,_s=!me&&wa&&Hi?ae:_i.left,ru=me?Ei(vi,oi,"after"):oe),We(za,Xr.top,hi-za,Xr.bottom),Xr.bottom<_i.top&&We(ae,Xr.bottom,null,_i.top),We(_s,_i.top,ru-_s,_i.bottom)}(!Wr||Qa(Xr,Wr)<0)&&(Wr=Xr),Qa(_i,Wr)<0&&(Wr=_i),(!ri||Qa(Xr,ri)<0)&&(ri=Xr),Qa(_i,ri)<0&&(ri=_i)}),{start:Wr,end:ri}}var _t=n.from(),ht=n.to();if(_t.line==ht.line)Qe(_t.line,_t.ch,ht.ch);else{var Bt=mt(y,_t.line),Zt=mt(y,ht.line),mn=kn(Bt)==kn(Zt),jn=Qe(_t.line,_t.ch,mn?Bt.text.length+1:null).end,sr=Qe(ht.line,mn?0:null,ht.ch).start;mn&&(jn.top<sr.top-2?(We(jn.right,jn.top,null,jn.bottom),We(ae,sr.top,sr.left,sr.bottom)):We(jn.right,jn.top,sr.left-jn.right,jn.bottom)),jn.bottom<sr.top&&We(ae,jn.bottom,null,sr.top)}c.appendChild(G)}function ks(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var c=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||na(e),n.cursorDiv.style.visibility=(c=!c)?"":"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||(dt(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&&(dt(e,"blur",e,n),e.state.focused=!1,E(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,c=n.lineDiv.offsetTop,l=0;l<n.view.length;l++){var y=n.view[l],G=e.options.lineWrapping,ee=void 0,ae=0;if(y.hidden)continue;if($&&z<8){var oe=y.node.offsetTop+y.node.offsetHeight;ee=oe-c,c=oe}else{var me=y.node.getBoundingClientRect();ee=me.bottom-me.top,!G&&y.text.firstChild&&(ae=y.text.firstChild.getBoundingClientRect().right-me.left-1)}var We=y.line.height-ee;if((We>.005||We<-.005)&&(Me(y.line,ee),Ai(y.line),y.rest))for(var Qe=0;Qe<y.rest.length;Qe++)Ai(y.rest[Qe]);if(ae>e.display.sizerWidth){var _t=Math.ceil(ae/qi(e.display));_t>e.display.maxLineLength&&(e.display.maxLineLength=_t,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Ai(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var c=e.widgets[n],l=c.node.parentNode;l&&(c.height=l.offsetHeight)}}function Za(e,n,c){var l=c&&c.top!=null?Math.max(0,c.top):e.scroller.scrollTop;l=Math.floor(l-Ti(e));var y=c&&c.bottom!=null?c.bottom:l+e.wrapper.clientHeight,G=ve(n,l),ee=ve(n,y);if(c&&c.ensure){var ae=c.ensure.from.line,oe=c.ensure.to.line;ae<G?(G=ae,ee=ve(n,Vt(mt(n,ae))+e.wrapper.clientHeight)):Math.min(oe,n.lastLine())>=ee&&(G=ve(n,Vt(mt(n,oe))-e.wrapper.clientHeight),ee=oe)}return{from:G,to:Math.max(ee,G+1)}}function xo(e,n){if(ft(e,"scrollCursorIntoView"))return;var c=e.display,l=c.sizer.getBoundingClientRect(),y=null;if(n.top+l.top<0?y=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!d){var G=f("div","\u200B",null,`position: absolute;
|
|
top: `+(n.top-c.viewOffset-Ti(e.display))+`px;
|
|
height: `+(n.bottom-n.top+Zr(e)+c.barHeight)+`px;
|
|
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(G),G.scrollIntoView(y),e.display.lineSpace.removeChild(G)}}function Us(e,n,c,l){l==null&&(l=0);var y;!e.options.lineWrapping&&n==c&&(n=n.ch?Ie(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,c=n.sticky=="before"?Ie(n.line,n.ch+1,"before"):n);for(var G=0;G<5;G++){var ee=!1,ae=xi(e,n),oe=!c||c==n?ae:xi(e,c);y={left:Math.min(ae.left,oe.left),top:Math.min(ae.top,oe.top)-l,right:Math.max(ae.left,oe.left),bottom:Math.max(ae.bottom,oe.bottom)+l};var me=qa(e,y),We=e.doc.scrollTop,Qe=e.doc.scrollLeft;if(me.scrollTop!=null&&(aa(e,me.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(ee=!0)),me.scrollLeft!=null&&(Di(e,me.scrollLeft),Math.abs(e.doc.scrollLeft-Qe)>1&&(ee=!0)),!ee)break}return y}function wl(e,n){var c=qa(e,n);c.scrollTop!=null&&aa(e,c.scrollTop),c.scrollLeft!=null&&Di(e,c.scrollLeft)}function qa(e,n){var c=e.display,l=Zi(e.display);n.top<0&&(n.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:c.scroller.scrollTop,G=yi(e),ee={};n.bottom-n.top>G&&(n.bottom=n.top+G);var ae=e.doc.height+Kr(c),oe=n.top<l,me=n.bottom>ae-l;if(n.top<y)ee.scrollTop=oe?0:n.top;else if(n.bottom>y+G){var We=Math.min(n.top,(me?ae:n.bottom)-G);We!=y&&(ee.scrollTop=We)}var Qe=e.options.fixedGutter?0:c.gutters.offsetWidth,_t=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:c.scroller.scrollLeft-Qe,ht=ei(e)-c.gutters.offsetWidth,Bt=n.right-n.left>ht;return Bt&&(n.right=n.left+ht),n.left<10?ee.scrollLeft=0:n.left<_t?ee.scrollLeft=Math.max(0,n.left+Qe-(Bt?0:10)):n.right>ht+_t-3&&(ee.scrollLeft=n.right+(Bt?0:10)-ht),ee}function es(e,n){if(n==null)return;ts(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ra(e){ts(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ia(e,n,c){(n!=null||c!=null)&&ts(e),n!=null&&(e.curOp.scrollLeft=n),c!=null&&(e.curOp.scrollTop=c)}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 c=mo(e,n.from),l=mo(e,n.to);Co(e,c,l,n.margin)}}function Co(e,n,c,l){var y=qa(e,{left:Math.min(n.left,c.left),top:Math.min(n.top,c.top)-l,right:Math.max(n.right,c.right),bottom:Math.max(n.bottom,c.bottom)+l});ia(e,y.scrollLeft,y.scrollTop)}function aa(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;B||js(e,{top:n}),To(e,n,!0),B&&js(e),ti(e,100)}function To(e,n,c){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!c)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Di(e,n,c,l){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(c?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,c=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?c:0,docHeight:l,scrollHeight:l+Zr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:c}}var Pi=function(e,n,c){this.cm=c;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),Ze(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),Ze(y,"scroll",function(){y.clientWidth&&n(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,$&&z<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,c=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var y=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=c?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var G=e.viewWidth-e.barLeft-(c?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:c?l:0,bottom:n?l:0}},Pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pi.prototype.zeroWidthHack=function(){var e=u&&!a?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},Pi.prototype.enableZeroWidthBar=function(e,n,c){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),G=c=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);G!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function Ui(e,n){n||(n=sa(e));var c=e.display.barWidth,l=e.display.barHeight;So(e,n);for(var y=0;y<4&&c!=e.display.barWidth||l!=e.display.barHeight;y++)c!=e.display.barWidth&&e.options.lineWrapping&&Ja(e),So(e,sa(e)),c=e.display.barWidth,l=e.display.barHeight}function So(e,n){var c=e.display,l=c.scrollbars.update(n);c.sizer.style.paddingRight=(c.barWidth=l.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=l.bottom)+"px",c.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=l.bottom+"px",c.scrollbarFiller.style.width=l.right+"px"):c.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=l.bottom+"px",c.gutterFiller.style.width=n.gutterWidth+"px"):c.gutterFiller.style.display=""}var Ro={native:Pi,null:Sa};function Oo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ro[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Ze(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,c){c=="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},on(e.curOp)}function Xi(e){var n=e.curOp;n&&er(n,function(c){for(var l=0;l<c.ops.length;l++)c.ops[l].cm.curOp=null;Cl(c)})}function Cl(e){for(var n=e.ops,c=0;c<n.length;c++)oa(n[c]);for(var l=0;l<n.length;l++)la(n[l]);for(var y=0;y<n.length;y++)Fs(n[y]);for(var G=0;G<n.length;G++)Tl(n[G]);for(var ee=0;ee<n.length;ee++)Do(n[ee])}function oa(e){var n=e.cm,c=n.display;Sl(n),e.updateMaxLine&&nn(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<c.viewFrom||e.scrollToPos.to.line>=c.viewTo)||c.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,c=n.display;e.updatedDisplay&&Ja(n),e.barMeasure=sa(n),c.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Xa(n,c.maxLine,c.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+e.adjustWidthTo+Zr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+e.adjustWidthTo-ei(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=c.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 c=e.focus&&e.focus==j();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,c),(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),c&&Ms(e.cm)}function Do(e){var n=e.cm,c=n.display,l=n.doc;if(e.updatedDisplay&&Lo(n,e.update),c.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(c.wheelStartX=c.wheelStartY=null),e.scrollTop!=null&&To(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(n,e.scrollLeft,!0,!0),e.scrollToPos){var y=Us(n,O(l,e.scrollToPos.from),O(l,e.scrollToPos.to),e.scrollToPos.margin);xo(n,y)}var G=e.maybeHiddenMarkers,ee=e.maybeUnhiddenMarkers;if(G)for(var ae=0;ae<G.length;++ae)G[ae].lines.length||dt(G[ae],"hide");if(ee)for(var oe=0;oe<ee.length;++oe)ee[oe].lines.length&&dt(ee[oe],"unhide");c.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&dt(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,I(Bs,e))}function Bs(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var c=+new Date+e.options.workTime,l=wt(e,n.highlightFrontier),y=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(G){if(l.line>=e.display.viewFrom){var ee=G.styles,ae=G.text.length>e.options.maxHighlightLength?pr(n.mode,l.state):null,oe=Le(e,G,l,!0);ae&&(l.state=ae),G.styles=oe.styles;var me=G.styleClasses,We=oe.classes;We?G.styleClasses=We:me&&(G.styleClasses=null);for(var Qe=!ee||ee.length!=G.styles.length||me!=We&&(!me||!We||me.bgClass!=We.bgClass||me.textClass!=We.textClass),_t=0;!Qe&&_t<ee.length;++_t)Qe=ee[_t]!=G.styles[_t];Qe&&y.push(l.line),G.stateAfter=l.save(),l.nextLine()}else G.text.length<=e.options.maxHighlightLength&&Lt(e,G.text,l),G.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>c)return ti(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),y.length&&ci(e,function(){for(var G=0;G<y.length;G++)Mi(e,y[G],"text")})}var Ra=function(e,n,c){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=c,this.dims=As(e),this.events=[]};Ra.prototype.signal=function(e,n){Ne(e,n)&&this.events.push(arguments)},Ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)dt.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 c={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&_(e.display.lineDiv,l.anchorNode)&&(c.anchorNode=l.anchorNode,c.anchorOffset=l.anchorOffset,c.focusNode=l.focusNode,c.focusOffset=l.focusOffset)}return c}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(),c=document.createRange();c.setEnd(e.anchorNode,e.anchorOffset),c.collapse(!1),n.removeAllRanges(),n.addRange(c),n.extend(e.focusNode,e.focusOffset)}}function ns(e,n){var c=e.display,l=e.doc;if(n.editorIsHidden)return Ni(e),!1;if(!n.force&&n.visible.from>=c.viewFrom&&n.visible.to<=c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&Ls(e)==0)return!1;ko(e)&&(Ni(e),n.dims=As(e));var y=l.first+l.size,G=Math.max(n.visible.from-e.options.viewportMargin,l.first),ee=Math.min(y,n.visible.to+e.options.viewportMargin);c.viewFrom<G&&G-c.viewFrom<20&&(G=Math.max(l.first,c.viewFrom)),c.viewTo>ee&&c.viewTo-ee<20&&(ee=Math.min(y,c.viewTo)),qt&&(G=Dn(e.doc,G),ee=dn(e.doc,ee));var ae=G!=c.viewFrom||ee!=c.viewTo||c.lastWrapHeight!=n.wrapperHeight||c.lastWrapWidth!=n.wrapperWidth;xl(e,G,ee),c.viewOffset=Vt(mt(e.doc,c.viewFrom)),e.display.mover.style.top=c.viewOffset+"px";var oe=Ls(e);if(!ae&&oe==0&&!n.force&&c.renderedView==c.view&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo))return!1;var me=Po(e);return oe>4&&(c.lineDiv.style.display="none"),Rl(e,c.updateLineNumbers,n.dims),oe>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,Oa(me),b(c.cursorDiv),b(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,ae&&(c.lastWrapHeight=n.wrapperHeight,c.lastWrapWidth=n.wrapperWidth,ti(e,400)),c.updateLineNumbers=null,!0}function Lo(e,n){for(var c=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==ei(e)){if(c&&c.top!=null&&(c={top:Math.min(e.doc.height+Kr(e.display)-yi(e),c.top)}),n.visible=Za(e.display,e.doc,c),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Za(e.display,e.doc,c));if(!ns(e,n))break;Ja(e);var y=sa(e);ta(e),Ui(e,y),$i(e,y),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function js(e,n){var c=new Ra(e,n);if(ns(e,c)){Ja(e),Lo(e,c);var l=sa(e);ta(e),Ui(e,l),$i(e,l),c.finish()}}function Rl(e,n,c){var l=e.display,y=e.options.lineNumbers,G=l.lineDiv,ee=G.firstChild;function ae(Bt){var Zt=Bt.nextSibling;return r&&u&&e.display.currentWheelTarget==Bt?Bt.style.display="none":Bt.parentNode.removeChild(Bt),Zt}for(var oe=l.view,me=l.viewFrom,We=0;We<oe.length;We++){var Qe=oe[We];if(!Qe.hidden)if(!Qe.node||Qe.node.parentNode!=G){var _t=Er(e,Qe,me,c);G.insertBefore(_t,ee)}else{for(;ee!=Qe.node;)ee=ae(ee);var ht=y&&n!=null&&n<=me&&Qe.lineNumber;Qe.changes&&(ie(Qe.changes,"gutter")>-1&&(ht=!1),zn(e,Qe,me,c)),ht&&(b(Qe.lineNumber),Qe.lineNumber.appendChild(document.createTextNode(en(e.options,me)))),ee=Qe.node.nextSibling}me+=Qe.size}for(;ee;)ee=ae(ee)}function Aa(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function $i(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Zr(e)+"px"}function Io(e){var n=e.display,c=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Ds(n)-n.scroller.scrollLeft+e.doc.scrollLeft,y=n.gutters.offsetWidth,G=l+"px",ee=0;ee<c.length;ee++)if(!c[ee].hidden){e.options.fixedGutter&&(c[ee].gutter&&(c[ee].gutter.style.left=G),c[ee].gutterBackground&&(c[ee].gutterBackground.style.left=G));var ae=c[ee].alignable;if(ae)for(var oe=0;oe<ae.length;oe++)ae[oe].style.left=G}e.options.fixedGutter&&(n.gutters.style.left=l+y+"px")}function ko(e){if(!e.options.lineNumbers)return!1;var n=e.doc,c=en(e.options,n.first+n.size-1),l=e.display;if(c.length!=l.lineNumChars){var y=l.measure.appendChild(f("div",[f("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),G=y.firstChild.offsetWidth,ee=y.offsetWidth-G;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(G,l.lineGutter.offsetWidth-ee)+1,l.lineNumWidth=l.lineNumInnerWidth+ee,l.lineNumChars=l.lineNumInnerWidth?c.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Aa(e.display),!0}return!1}function Ws(e,n){for(var c=[],l=!1,y=0;y<e.length;y++){var G=e[y],ee=null;if(typeof G!="string"&&(ee=G.style,G=G.className),G=="CodeMirror-linenumbers")if(n)l=!0;else continue;c.push({className:G,style:ee})}return n&&!l&&c.push({className:"CodeMirror-linenumbers",style:null}),c}function Hs(e){var n=e.gutters,c=e.gutterSpecs;b(n),e.lineGutter=null;for(var l=0;l<c.length;++l){var y=c[l],G=y.className,ee=y.style,ae=n.appendChild(f("div",null,"CodeMirror-gutter "+G));ee&&(ae.style.cssText=ee),G=="CodeMirror-linenumbers"&&(e.lineGutter=ae,ae.style.width=(e.lineNumWidth||1)+"px")}n.style.display=c.length?"":"none",Aa(e)}function Da(e){Hs(e.display),li(e),Io(e)}function Ol(e,n,c,l){var y=this;this.input=c,y.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=f("div",null,"CodeMirror-cursors"),y.measure=f("div",null,"CodeMirror-measure"),y.lineMeasure=f("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var G=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=f("div",[G],null,"position: relative"),y.sizer=f("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=f("div",null,null,"position: absolute; height: "+le+"px; width: 1px;"),y.gutters=f("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=f("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=f("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),$&&z<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!r&&!(B&&t)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=n.first,y.reportedViewFrom=y.reportedViewTo=n.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=Ws(l.gutters,l.lineNumbers),Hs(y),c.init(y)}var ua=0,pi=null;$?pi=-.53:B?pi=15:p?pi=-.7:m&&(pi=-1/3);function Mo(e){var n=e.wheelDeltaX,c=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),c==null&&e.detail&&e.axis==e.VERTICAL_AXIS?c=e.detail:c==null&&(c=e.wheelDelta),{x:n,y:c}}function rs(e){var n=Mo(e);return n.x*=pi,n.y*=pi,n}function No(e,n){var c=Mo(n),l=c.x,y=c.y,G=e.display,ee=G.scroller,ae=ee.scrollWidth>ee.clientWidth,oe=ee.scrollHeight>ee.clientHeight;if(!(l&&ae||y&&oe))return;if(y&&u&&r){e:for(var me=n.target,We=G.view;me!=ee;me=me.parentNode)for(var Qe=0;Qe<We.length;Qe++)if(We[Qe].node==me){e.display.currentWheelTarget=me;break e}}if(l&&!B&&!g&&pi!=null){y&&oe&&aa(e,Math.max(0,ee.scrollTop+y*pi)),Di(e,Math.max(0,ee.scrollLeft+l*pi)),(!y||y&&oe)&&ge(n),G.wheelStartX=null;return}if(y&&pi!=null){var _t=y*pi,ht=e.doc.scrollTop,Bt=ht+G.wrapper.clientHeight;_t<0?ht=Math.max(0,ht+_t-50):Bt=Math.min(e.doc.height,Bt+_t+50),js(e,{top:ht,bottom:Bt})}ua<20&&(G.wheelStartX==null?(G.wheelStartX=ee.scrollLeft,G.wheelStartY=ee.scrollTop,G.wheelDX=l,G.wheelDY=y,setTimeout(function(){if(G.wheelStartX==null)return;var Zt=ee.scrollLeft-G.wheelStartX,mn=ee.scrollTop-G.wheelStartY,jn=mn&&G.wheelDY&&mn/G.wheelDY||Zt&&G.wheelDX&&Zt/G.wheelDX;if(G.wheelStartX=G.wheelStartY=null,!jn)return;pi=(pi*ua+jn)/(ua+1),++ua},200)):(G.wheelDX+=l,G.wheelDY+=y))}var mi=function(e,n){this.ranges=e,this.primIndex=n};mi.prototype.primary=function(){return this.ranges[this.primIndex]},mi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var c=this.ranges[n],l=e.ranges[n];if(!Ce(c.anchor,l.anchor)||!Ce(c.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(cn(this.ranges[n].anchor),cn(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 c=0;c<this.ranges.length;c++){var l=this.ranges[c];if(gt(n,l.from())>=0&>(e,l.to())<=0)return c}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,c){var l=e&&e.options.selectionsMayTouch,y=n[c];n.sort(function(_t,ht){return gt(_t.from(),ht.from())}),c=ie(n,y);for(var G=1;G<n.length;G++){var ee=n[G],ae=n[G-1],oe=gt(ae.to(),ee.from());if(l&&!ee.empty()?oe>0:oe>=0){var me=mr(ae.from(),ee.from()),We=hr(ae.to(),ee.to()),Qe=ae.empty()?ee.from()==ee.head:ae.from()==ae.head;G<=c&&--c,n.splice(--G,2,new Nr(Qe?We:me,Qe?me:We))}}return new mi(n,c)}function Fi(e,n){return new mi([new Nr(e,n||e)],0)}function Yi(e){return e.text?Ie(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Uo(e,n){if(gt(e,n.from)<0)return e;if(gt(e,n.to)<=0)return Yi(n);var c=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=Yi(n).ch-n.to.ch),Ie(c,l)}function Pa(e,n){for(var c=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];c.push(new Nr(Uo(y.anchor,n),Uo(y.head,n)))}return wi(e.cm,c,e.sel.primIndex)}function da(e,n,c){return e.line==n.line?Ie(c.line,e.ch-n.ch+c.ch):Ie(c.line+(e.line-n.line),e.ch)}function Al(e,n,c){for(var l=[],y=Ie(e.first,0),G=y,ee=0;ee<n.length;ee++){var ae=n[ee],oe=da(ae.from,y,G),me=da(Yi(ae),y,G);if(y=ae.to,G=me,c=="around"){var We=e.sel.ranges[ee],Qe=gt(We.head,We.anchor)<0;l[ee]=new Nr(Qe?me:oe,Qe?oe:me)}else l[ee]=new Nr(oe,oe)}return new mi(l,e.sel.primIndex)}function La(e){e.doc.mode=Ar(e.options,e.doc.modeOption),Ia(e)}function Ia(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&li(e)}function Fo(e,n){return n.from.ch==0&&n.to.ch==0&&ne(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ks(e,n,c,l){function y(sr){return c?c[sr]:null}function G(sr,Wn,cr){gn(sr,Wn,cr,l),Qt(sr,"change",sr,n)}function ee(sr,Wn){for(var cr=[],Or=sr;Or<Wn;++Or)cr.push(new bn(me[Or],y(Or),l));return cr}var ae=n.from,oe=n.to,me=n.text,We=mt(e,ae.line),Qe=mt(e,oe.line),_t=ne(me),ht=y(me.length-1),Bt=oe.line-ae.line;if(n.full)e.insert(0,ee(0,me.length)),e.remove(me.length,e.size-me.length);else if(Fo(e,n)){var Zt=ee(0,me.length-1);G(Qe,Qe.text,ht),Bt&&e.remove(ae.line,Bt),Zt.length&&e.insert(ae.line,Zt)}else if(We==Qe)if(me.length==1)G(We,We.text.slice(0,ae.ch)+_t+We.text.slice(oe.ch),ht);else{var mn=ee(1,me.length-1);mn.push(new bn(_t+We.text.slice(oe.ch),ht,l)),G(We,We.text.slice(0,ae.ch)+me[0],y(0)),e.insert(ae.line+1,mn)}else if(me.length==1)G(We,We.text.slice(0,ae.ch)+me[0]+Qe.text.slice(oe.ch),y(0)),e.remove(ae.line+1,Bt);else{G(We,We.text.slice(0,ae.ch)+me[0],y(0)),G(Qe,_t+Qe.text.slice(oe.ch),ht);var jn=ee(1,me.length-1);Bt>1&&e.remove(ae.line+1,Bt-1),e.insert(ae.line+1,jn)}Qt(e,"change",e,n)}function Ci(e,n,c){function l(y,G,ee){if(y.linked)for(var ae=0;ae<y.linked.length;++ae){var oe=y.linked[ae];if(oe.doc==G)continue;var me=ee&&oe.sharedHist;if(c&&!me)continue;n(oe.doc,me),l(oe.doc,y,me)}}l(e,null,!0)}function Gs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ps(e),La(e),Bo(e),e.options.lineWrapping||nn(e),e.options.mode=n.modeOption,li(e)}function Bo(e){(e.doc.direction=="rtl"?W:E)(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 c={from:cn(n.from),to:Yi(n),text:Ge(e,n.from,n.to)};return Vs(e,c,n.from.line,n.to.line+1),Ci(e,function(l){return Vs(l,c,n.from.line,n.to.line+1)},!0),c}function jo(e){for(;e.length;){var n=ne(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return jo(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function Wo(e,n,c,l){var y=e.history;y.undone.length=0;var G=+new Date,ee,ae;if((y.lastOp==l||y.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&y.lastModTime>G-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(ee=Pl(y,y.lastOp==l)))ae=ne(ee.changes),gt(n.from,n.to)==0&>(n.from,ae.to)==0?ae.to=Yi(n):ee.changes.push(zs(e,n));else{var oe=ne(y.done);for((!oe||!oe.ranges)&&ss(e.sel,y.done),ee={changes:[zs(e,n)],generation:y.generation},y.done.push(ee);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(c),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=G,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=n.origin,ae||dt(e,"historyAdded")}function Ll(e,n,c,l){var y=n.charAt(0);return y=="*"||y=="+"&&c.ranges.length==l.ranges.length&&c.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function as(e,n,c,l){var y=e.history,G=l&&l.origin;c==y.lastSelOp||G&&y.lastSelOrigin==G&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==G||Ll(e,G,ne(y.done),n))?y.done[y.done.length-1]=n:ss(n,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=G,y.lastSelOp=c,l&&l.clearRedo!==!1&&jo(y.undone)}function ss(e,n){var c=ne(n);c&&c.ranges&&c.equals(e)||n.push(e)}function Vs(e,n,c,l){var y=n["spans_"+e.id],G=0;e.iter(Math.max(e.first,c),Math.min(e.first+e.size,l),function(ee){ee.markedSpans&&((y||(y=n["spans_"+e.id]={}))[G]=ee.markedSpans),++G})}function os(e){if(!e)return null;for(var n,c=0;c<e.length;++c)e[c].marker.explicitlyCleared?n||(n=e.slice(0,c)):n&&n.push(e[c]);return n?n.length?n:null:e}function Ho(e,n){var c=n["spans_"+e.id];if(!c)return null;for(var l=[],y=0;y<n.text.length;++y)l.push(os(c[y]));return l}function Xs(e,n){var c=Ho(e,n),l=Un(e,n);if(!c)return l;if(!l)return c;for(var y=0;y<c.length;++y){var G=c[y],ee=l[y];if(G&&ee){e:for(var ae=0;ae<ee.length;++ae){for(var oe=ee[ae],me=0;me<G.length;++me)if(G[me].marker==oe.marker)continue e;G.push(oe)}}else ee&&(c[y]=ee)}return c}function ca(e,n,c){for(var l=[],y=0;y<e.length;++y){var G=e[y];if(G.ranges){l.push(c?mi.prototype.deepCopy.call(G):G);continue}var ee=G.changes,ae=[];l.push({changes:ae});for(var oe=0;oe<ee.length;++oe){var me=ee[oe],We=void 0;if(ae.push({from:me.from,to:me.to,text:me.text}),n)for(var Qe in me)(We=Qe.match(/^spans_(\d+)$/))&&(ie(n,Number(We[1]))>-1&&(ne(ae)[Qe]=me[Qe],delete me[Qe]))}}return l}function ls(e,n,c,l){if(l){var y=e.anchor;if(c){var G=gt(n,y)<0;G!=gt(c,y)<0?(y=n,n=c):G!=gt(n,c)<0&&(n=c)}return new Nr(y,n)}else return new Nr(c||n,n)}function us(e,n,c,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new mi([ls(e.sel.primary(),n,c,y)],0),l)}function Ko(e,n,c){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),G=0;G<e.sel.ranges.length;G++)l[G]=ls(e.sel.ranges[G],n[G],null,y);var ee=wi(e.cm,l,e.sel.primIndex);ni(e,ee,c)}function Bi(e,n,c,l){var y=e.sel.ranges.slice(0);y[n]=c,ni(e,wi(e.cm,y,e.sel.primIndex),l)}function Go(e,n,c,l){ni(e,Fi(n,c),l)}function Il(e,n,c){var l={ranges:n.ranges,update:function(y){this.ranges=[];for(var G=0;G<y.length;G++)this.ranges[G]=new Nr(O(e,y[G].anchor),O(e,y[G].head))},origin:c&&c.origin};return dt(e,"beforeSelectionChange",e,l),e.cm&&dt(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?wi(e.cm,l.ranges,l.ranges.length-1):n}function zo(e,n,c){var l=e.history.done,y=ne(l);y&&y.ranges?(l[l.length-1]=n,ha(e,n,c)):ni(e,n,c)}function ni(e,n,c){ha(e,n,c),as(e,e.sel,e.cm?e.cm.curOp.id:NaN,c)}function ha(e,n,c){(Ne(e,"beforeSelectionChange")||e.cm&&Ne(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,c));var l=c&&c.bias||(gt(n.primary().head,e.sel.primary().head)<0?-1:1);Vo(e,$o(e,n,l,!0)),!(c&&c.scroll===!1)&&e.cm&&ra(e.cm)}function Vo(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,He(e.cm)),Qt(e,"cursorActivity",e)}function Xo(e){Vo(e,$o(e,e.sel,null,!1))}function $o(e,n,c,l){for(var y,G=0;G<n.ranges.length;G++){var ee=n.ranges[G],ae=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[G],oe=ds(e,ee.anchor,ae&&ae.anchor,c,l),me=ds(e,ee.head,ae&&ae.head,c,l);(y||oe!=ee.anchor||me!=ee.head)&&(y||(y=n.ranges.slice(0,G)),y[G]=new Nr(oe,me))}return y?wi(e.cm,y,n.primIndex):n}function fa(e,n,c,l,y){var G=mt(e,n.line);if(G.markedSpans)for(var ee=0;ee<G.markedSpans.length;++ee){var ae=G.markedSpans[ee],oe=ae.marker,me="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,We="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ae.from==null||(me?ae.from<=n.ch:ae.from<n.ch))&&(ae.to==null||(We?ae.to>=n.ch:ae.to>n.ch))){if(y&&(dt(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(G.markedSpans){--ee;continue}else break;if(!oe.atomic)continue;if(c){var Qe=oe.find(l<0?1:-1),_t=void 0;if((l<0?We:me)&&(Qe=Yo(e,Qe,-l,Qe&&Qe.line==n.line?G:null)),Qe&&Qe.line==n.line&&(_t=gt(Qe,c))&&(l<0?_t<0:_t>0))return fa(e,Qe,n,l,y)}var ht=oe.find(l<0?-1:1);return(l<0?me:We)&&(ht=Yo(e,ht,l,ht.line==n.line?G:null)),ht?fa(e,ht,n,l,y):null}}return n}function ds(e,n,c,l,y){var G=l||1,ee=fa(e,n,c,G,y)||!y&&fa(e,n,c,G,!0)||fa(e,n,c,-G,y)||!y&&fa(e,n,c,-G,!0);return ee||(e.cantEdit=!0,Ie(e.first,0))}function Yo(e,n,c,l){return c<0&&n.ch==0?n.line>e.first?O(e,Ie(n.line-1)):null:c>0&&n.ch==(l||mt(e,n.line)).text.length?n.line<e.first+e.size-1?Ie(n.line+1,0):null:new Ie(n.line,n.ch+c)}function Qo(e){e.setSelection(Ie(e.firstLine(),0),Ie(e.lastLine()),we)}function $s(e,n,c){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return c&&(l.update=function(y,G,ee,ae){y&&(l.from=O(e,y)),G&&(l.to=O(e,G)),ee&&(l.text=ee),ae!==void 0&&(l.origin=ae)}),dt(e,"beforeChange",e,l),e.cm&&dt(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,c){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,pa)(e,n,c);if(e.cm.state.suppressEdits)return}if((Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"))&&(n=$s(e,n,!0),!n))return;var l=sn&&!c&&nr(e,n.from,n.to);if(l)for(var y=l.length-1;y>=0;--y)Jo(e,{from:l[y].from,to:l[y].to,text:y?[""]:n.text,origin:n.origin});else Jo(e,n)}function Jo(e,n){if(n.text.length==1&&n.text[0]==""&>(n.from,n.to)==0)return;var c=Pa(e,n);Wo(e,n,c,e.cm?e.cm.curOp.id:NaN),ma(e,n,c,Un(e,n));var l=[];Ci(e,function(y,G){!G&&ie(l,y.history)==-1&&(tl(y.history,n),l.push(y.history)),ma(y,n,null,Un(y,n))})}function cs(e,n,c){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!c)return;for(var y=e.history,G,ee=e.sel,ae=n=="undo"?y.done:y.undone,oe=n=="undo"?y.undone:y.done,me=0;me<ae.length&&!(G=ae[me],c?G.ranges&&!G.equals(e.sel):!G.ranges);me++);if(me==ae.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(G=ae.pop(),G.ranges){if(ss(G,oe),c&&!G.equals(e.sel)){ni(e,G,{clearRedo:!1});return}ee=G}else if(l){ae.push(G);return}else break;var We=[];ss(ee,oe),oe.push({changes:We,generation:y.generation}),y.generation=G.generation||++y.maxGeneration;for(var Qe=Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"),_t=function(Zt){var mn=G.changes[Zt];if(mn.origin=n,Qe&&!$s(e,mn,!1))return ae.length=0,{};We.push(zs(e,mn));var jn=Zt?Pa(e,mn):ne(ae);ma(e,mn,jn,Xs(e,mn)),!Zt&&e.cm&&e.cm.scrollIntoView({from:mn.from,to:Yi(mn)});var sr=[];Ci(e,function(Wn,cr){!cr&&ie(sr,Wn.history)==-1&&(tl(Wn.history,mn),sr.push(Wn.history)),ma(Wn,mn,null,Xs(Wn,mn))})},ht=G.changes.length-1;ht>=0;--ht){var Bt=_t(ht);if(Bt)return Bt.v}}function Zo(e,n){if(n==0)return;if(e.first+=n,e.sel=new mi(fe(e.sel.ranges,function(y){return new Nr(Ie(y.anchor.line+n,y.anchor.ch),Ie(y.head.line+n,y.head.ch))}),e.sel.primIndex),e.cm){li(e.cm,e.first,e.first-n,n);for(var c=e.cm.display,l=c.viewFrom;l<c.viewTo;l++)Mi(e.cm,l,"gutter")}}function ma(e,n,c,l){if(e.cm&&!e.cm.curOp)return Gr(e.cm,ma)(e,n,c,l);if(n.to.line<e.first){Zo(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var y=n.text.length-1-(e.first-n.from.line);Zo(e,y),n={from:Ie(e.first,0),to:Ie(n.to.line+y,n.to.ch),text:[ne(n.text)],origin:n.origin}}var G=e.lastLine();n.to.line>G&&(n={from:n.from,to:Ie(G,mt(e,G).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Ge(e,n.from,n.to),c||(c=Pa(e,n)),e.cm?kl(e.cm,n,l):Ks(e,n,l),ha(e,c,we),e.cantEdit&&ds(e,Ie(e.firstLine(),0))&&(e.cantEdit=!1)}function kl(e,n,c){var l=e.doc,y=e.display,G=n.from,ee=n.to,ae=!1,oe=G.line;e.options.lineWrapping||(oe=ye(kn(mt(l,G.line))),l.iter(oe,ee.line+1,function(ht){if(ht==y.maxLine)return ae=!0,!0})),l.sel.contains(n.from,n.to)>-1&&He(e),Ks(l,n,c,_o(e)),e.options.lineWrapping||(l.iter(oe,G.line+n.text.length,function(ht){var Bt=jt(ht);Bt>y.maxLineLength&&(y.maxLine=ht,y.maxLineLength=Bt,y.maxLineChanged=!0,ae=!1)}),ae&&(e.curOp.updateMaxLine=!0)),Wt(l,G.line),ti(e,400);var me=n.text.length-(ee.line-G.line)-1;n.full?li(e):G.line==ee.line&&n.text.length==1&&!Fo(e.doc,n)?Mi(e,G.line,"text"):li(e,G.line,ee.line+1,me);var We=Ne(e,"changes"),Qe=Ne(e,"change");if(Qe||We){var _t={from:G,to:ee,text:n.text,removed:n.removed,origin:n.origin};Qe&&Qt(e,"change",e,_t),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(_t)}e.display.selForContextMenu=null}function ga(e,n,c,l,y){var G;l||(l=c),gt(l,c)<0&&(G=[l,c],c=G[0],l=G[1]),typeof n=="string"&&(n=e.splitLines(n)),pa(e,{from:c,to:l,text:n,origin:y})}function qo(e,n,c,l){c<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function el(e,n,c,l){for(var y=0;y<e.length;++y){var G=e[y],ee=!0;if(G.ranges){G.copied||(G=e[y]=G.deepCopy(),G.copied=!0);for(var ae=0;ae<G.ranges.length;ae++)qo(G.ranges[ae].anchor,n,c,l),qo(G.ranges[ae].head,n,c,l);continue}for(var oe=0;oe<G.changes.length;++oe){var me=G.changes[oe];if(c<me.from.line)me.from=Ie(me.from.line+l,me.from.ch),me.to=Ie(me.to.line+l,me.to.ch);else if(n<=me.to.line){ee=!1;break}}ee||(e.splice(0,y+1),y=0)}}function tl(e,n){var c=n.from.line,l=n.to.line,y=n.text.length-(l-c)-1;el(e.done,c,l,y),el(e.undone,c,l,y)}function ka(e,n,c,l){var y=n,G=n;return typeof n=="number"?G=mt(e,q(e,n)):y=ye(n),y==null?null:(l(G,y)&&e.cm&&Mi(e.cm,y,c),G)}function ji(e){this.lines=e,this.parent=null;for(var n=0,c=0;c<e.length;++c)e[c].parent=this,n+=e[c].height;this.height=n}ji.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var c=e,l=e+n;c<l;++c){var y=this.lines[c];this.height-=y.height,bt(y),Qt(y,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,c){this.height+=c,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,c){for(var l=e+n;e<l;++e)if(c(this.lines[e]))return!0}};function va(e){this.children=e;for(var n=0,c=0,l=0;l<e.length;++l){var y=e[l];n+=y.chunkSize(),c+=y.height,y.parent=this}this.size=n,this.height=c,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var c=0;c<this.children.length;++c){var l=this.children[c],y=l.chunkSize();if(e<y){var G=Math.min(n,y-e),ee=l.height;if(l.removeInner(e,G),this.height-=ee-l.height,y==G&&(this.children.splice(c--,1),l.parent=null),(n-=G)==0)break;e=0}else e-=y}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof ji))){var ae=[];this.collapse(ae),this.children=[new ji(ae)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,c){this.size+=n.length,this.height+=c;for(var l=0;l<this.children.length;++l){var y=this.children[l],G=y.chunkSize();if(e<=G){if(y.insertInner(e,n,c),y.lines&&y.lines.length>50){for(var ee=y.lines.length%25+25,ae=ee;ae<y.lines.length;){var oe=new ji(y.lines.slice(ae,ae+=25));y.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}y.lines=y.lines.slice(0,ee),this.maybeSpill()}break}e-=G}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),c=new va(n);if(e.parent){e.size-=c.size,e.height-=c.height;var y=ie(e.parent.children,e);e.parent.children.splice(y+1,0,c)}else{var l=new va(e.children);l.parent=e,e.children=[l,c],e=l}c.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,c){for(var l=0;l<this.children.length;++l){var y=this.children[l],G=y.chunkSize();if(e<G){var ee=Math.min(n,G-e);if(y.iterN(e,ee,c))return!0;if((n-=ee)==0)break;e=0}else e-=G}}};var Ma=function(e,n,c){if(c)for(var l in c)c.hasOwnProperty(l)&&(this[l]=c[l]);this.doc=e,this.node=n};Ma.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,c=this.line,l=ye(c);if(l==null||!n)return;for(var y=0;y<n.length;++y)n[y]==this&&n.splice(y--,1);n.length||(c.widgets=null);var G=Fr(this);Me(c,Math.max(0,c.height-G)),e&&(ci(e,function(){nl(e,c,-G),Mi(e,l,"widget")}),Qt(e,"lineWidgetCleared",e,this,l))},Ma.prototype.changed=function(){var e=this,n=this.height,c=this.doc.cm,l=this.line;this.height=null;var y=Fr(this)-n;if(!y)return;Ut(this.doc,l)||Me(l,l.height+y),c&&ci(c,function(){c.curOp.forceUpdate=!0,nl(c,l,y),Qt(c,"lineWidgetChanged",c,e,ye(l))})},Ue(Ma);function nl(e,n,c){Vt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&es(e,c)}function Ml(e,n,c,l){var y=new Ma(e,c,l),G=e.cm;return G&&y.noHScroll&&(G.display.alignWidgets=!0),ka(e,n,"widget",function(ee){var ae=ee.widgets||(ee.widgets=[]);if(y.insertAt==null?ae.push(y):ae.splice(Math.min(ae.length-1,Math.max(0,y.insertAt)),0,y),y.line=ee,G&&!Ut(e,ee)){var oe=Vt(ee)<e.scrollTop;Me(ee,ee.height+Fr(y)),oe&&es(G,y.height),G.curOp.forceUpdate=!0}return!0}),G&&Qt(G,"lineWidgetAdded",G,y,typeof n=="number"?n:ye(n)),y}var rl=0,bi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++rl};bi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&Vi(e),Ne(this,"clear")){var c=this.find();c&&Qt(this,"clear",c.from,c.to)}for(var l=null,y=null,G=0;G<this.lines.length;++G){var ee=this.lines[G],ae=xn(ee.markedSpans,this);e&&!this.collapsed?Mi(e,ye(ee),"text"):e&&(ae.to!=null&&(y=ye(ee)),ae.from!=null&&(l=ye(ee))),ee.markedSpans=Jn(ee.markedSpans,ae),ae.from==null&&this.collapsed&&!Ut(this.doc,ee)&&e&&Me(ee,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var me=kn(this.lines[oe]),We=jt(me);We>e.display.maxLineLength&&(e.display.maxLine=me,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&li(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&Qt(e,"markerCleared",e,this,l,y),n&&Xi(e),this.parent&&this.parent.clear()},bi.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var c,l,y=0;y<this.lines.length;++y){var G=this.lines[y],ee=xn(G.markedSpans,this);if(ee.from!=null&&(c=Ie(n?G:ye(G),ee.from),e==-1))return c;if(ee.to!=null&&(l=Ie(n?G:ye(G),ee.to),e==1))return l}return c&&{from:c,to:l}},bi.prototype.changed=function(){var e=this,n=this.find(-1,!0),c=this,l=this.doc.cm;if(!n||!l)return;ci(l,function(){var y=n.line,G=ye(n.line),ee=Ki(l,G);if(ee&&(ho(ee),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ut(c.doc,y)&&c.height!=null){var ae=c.height;c.height=null;var oe=Fr(c)-ae;oe&&Me(y,y.height+oe)}Qt(l,"markerChanged",l,e)})},bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ie(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bi.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ue(bi);function _a(e,n,c,l,y){if(l&&l.shared)return Nl(e,n,c,l,y);if(e.cm&&!e.cm.curOp)return Gr(e.cm,_a)(e,n,c,l,y);var G=new bi(e,y),ee=gt(n,c);if(l&&v(l,G,!1),ee>0||ee==0&&G.clearWhenEmpty!==!1)return G;if(G.replacedWith&&(G.collapsed=!0,G.widgetNode=C("span",[G.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||G.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(G.widgetNode.insertLeft=!0)),G.collapsed){if(qn(e,n.line,n,c,G)||n.line!=c.line&&qn(e,c.line,n,c,G))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qn()}G.addToHistory&&Wo(e,{from:n,to:c,origin:"markText"},e.sel,NaN);var ae=n.line,oe=e.cm,me;if(e.iter(ae,c.line+1,function(Qe){oe&&G.collapsed&&!oe.options.lineWrapping&&kn(Qe)==oe.display.maxLine&&(me=!0),G.collapsed&&ae!=n.line&&Me(Qe,0),pn(Qe,new Bn(G,ae==n.line?n.ch:null,ae==c.line?c.ch:null)),++ae}),G.collapsed&&e.iter(n.line,c.line+1,function(Qe){Ut(e,Qe)&&Me(Qe,0)}),G.clearOnEnter&&Ze(G,"beforeCursorEnter",function(){return G.clear()}),G.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),G.collapsed&&(G.id=++rl,G.atomic=!0),oe){if(me&&(oe.curOp.updateMaxLine=!0),G.collapsed)li(oe,n.line,c.line+1);else if(G.className||G.startStyle||G.endStyle||G.css||G.attributes||G.title)for(var We=n.line;We<=c.line;We++)Mi(oe,We,"text");G.atomic&&Xo(oe.doc),Qt(oe,"markerAdded",oe,G)}return G}var ya=function(e,n){this.markers=e,this.primary=n;for(var c=0;c<e.length;++c)e[c].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();Qt(this,"clear")},ya.prototype.find=function(e,n){return this.primary.find(e,n)},Ue(ya);function Nl(e,n,c,l,y){l=v(l),l.shared=!1;var G=[_a(e,n,c,l,y)],ee=G[0],ae=l.widgetNode;return Ci(e,function(oe){ae&&(l.widgetNode=ae.cloneNode(!0)),G.push(_a(oe,O(oe,n),O(oe,c),l,y));for(var me=0;me<oe.linked.length;++me)if(oe.linked[me].isParent)return;ee=ne(G)}),new ya(G,ee)}function il(e){return e.findMarks(Ie(e.first,0),e.clipPos(Ie(e.lastLine())),function(n){return n.parent})}function iu(e,n){for(var c=0;c<n.length;c++){var l=n[c],y=l.find(),G=e.clipPos(y.from),ee=e.clipPos(y.to);if(gt(G,ee)){var ae=_a(e,G,ee,l.primary,l.primary.type);l.markers.push(ae),ae.parent=l}}}function Ul(e){for(var n=function(l){var y=e[l],G=[y.primary.doc];Ci(y.primary.doc,function(oe){return G.push(oe)});for(var ee=0;ee<y.markers.length;ee++){var ae=y.markers[ee];ie(G,ae.doc)==-1&&(ae.parent=null,y.markers.splice(ee--,1))}},c=0;c<e.length;c++)n(c)}var Ys=0,ui=function(e,n,c,l,y){if(!(this instanceof ui))return new ui(e,n,c,l,y);c==null&&(c=0),va.call(this,[new ji([new bn("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var G=Ie(c,0);this.sel=Fi(G),this.history=new is(null),this.id=++Ys,this.modeOption=n,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ks(this,{from:G,to:G,text:e}),ni(this,Fi(G),we)};ui.prototype=qe(va.prototype,{constructor:ui,iter:function(e,n,c){c?this.iterN(e-this.first,n-e,c):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var c=0,l=0;l<n.length;++l)c+=n[l].height;this.insertInner(e-this.first,n,c)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Ot(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yr(function(e){var n=Ie(this.first,0),c=this.first+this.size-1;pa(this,{from:n,to:Ie(c,mt(this,c).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),ni(this,Fi(n),we)}),replaceRange:function(e,n,c,l){n=O(this,n),c=c?O(this,c):n,ga(this,e,n,c,l)},getRange:function(e,n,c){var l=Ge(this,O(this,e),O(this,n));return c===!1?l:l.join(c||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(or(this,e))return mt(this,e)},getLineNumber:function(e){return ye(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=mt(this,e)),kn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return O(this,e)},getCursor:function(e){var n=this.sel.primary(),c;return e==null||e=="head"?c=n.head:e=="anchor"?c=n.anchor:e=="end"||e=="to"||e===!1?c=n.to():c=n.from(),c},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yr(function(e,n,c){Go(this,O(this,typeof e=="number"?Ie(e,n||0):e),null,c)}),setSelection:Yr(function(e,n,c){Go(this,O(this,e),O(this,n||e),c)}),extendSelection:Yr(function(e,n,c){us(this,O(this,e),n&&O(this,n),c)}),extendSelections:Yr(function(e,n){Ko(this,X(this,e),n)}),extendSelectionsBy:Yr(function(e,n){var c=fe(this.sel.ranges,e);Ko(this,X(this,c),n)}),setSelections:Yr(function(e,n,c){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Nr(O(this,e[y].anchor),O(this,e[y].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),ni(this,wi(this.cm,l,n),c)}),addSelection:Yr(function(e,n,c){var l=this.sel.ranges.slice(0);l.push(new Nr(O(this,e),O(this,n||e))),ni(this,wi(this.cm,l,l.length-1),c)}),getSelection:function(e){for(var n=this.sel.ranges,c,l=0;l<n.length;l++){var y=Ge(this,n[l].from(),n[l].to());c=c?c.concat(y):y}return e===!1?c:c.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],c=this.sel.ranges,l=0;l<c.length;l++){var y=Ge(this,c[l].from(),c[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),n[l]=y}return n},replaceSelection:function(e,n,c){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,n,c||"+input")},replaceSelections:Yr(function(e,n,c){for(var l=[],y=this.sel,G=0;G<y.ranges.length;G++){var ee=y.ranges[G];l[G]={from:ee.from(),to:ee.to(),text:this.splitLines(e[G]),origin:c}}for(var ae=n&&n!="end"&&Al(this,l,n),oe=l.length-1;oe>=0;oe--)pa(this,l[oe]);ae?zo(this,ae):this.cm&&ra(this.cm)}),undo:Yr(function(){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,c=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++c;return{undo:n,redo:c}},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,c){return ka(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[n]=c,!c&&Re(y)&&(l.gutterMarkers=null),!0})}),clearGutter:Yr(function(e){var n=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[e]&&ka(n,c,"gutter",function(){return c.gutterMarkers[e]=null,Re(c.gutterMarkers)&&(c.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!or(this,e))return null;if(n=e,e=mt(this,e),!e)return null}else if(n=ye(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Yr(function(e,n,c){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var y=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=c;else{if(P(c).test(l[y]))return!1;l[y]+=" "+c}return!0})}),removeLineClass:Yr(function(e,n,c){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var y=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",G=l[y];if(G)if(c==null)l[y]=null;else{var ee=G.match(P(c));if(!ee)return!1;var ae=ee.index+ee[0].length;l[y]=G.slice(0,ee.index)+(!ee.index||ae==G.length?"":" ")+G.slice(ae)||null}else return!1;return!0})}),addLineWidget:Yr(function(e,n,c){return Ml(this,e,n,c)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,c){return _a(this,O(this,e),O(this,n),c,c&&c.type||"range")},setBookmark:function(e,n){var c={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=O(this,e),_a(this,e,e,c,"bookmark")},findMarksAt:function(e){e=O(this,e);var n=[],c=mt(this,e.line).markedSpans;if(c)for(var l=0;l<c.length;++l){var y=c[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&n.push(y.marker.parent||y.marker)}return n},findMarks:function(e,n,c){e=O(this,e),n=O(this,n);var l=[],y=e.line;return this.iter(e.line,n.line+1,function(G){var ee=G.markedSpans;if(ee)for(var ae=0;ae<ee.length;ae++){var oe=ee[ae];!(oe.to!=null&&y==e.line&&e.ch>=oe.to||oe.from==null&&y!=e.line||oe.from!=null&&y==n.line&&oe.from>=n.ch)&&(!c||c(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var c=n.markedSpans;if(c)for(var l=0;l<c.length;++l)c[l].from!=null&&e.push(c[l].marker)}),e},posFromIndex:function(e){var n,c=this.first,l=this.lineSeparator().length;return this.iter(function(y){var G=y.text.length+l;if(G>e)return n=e,!0;e-=G,++c}),O(this,Ie(c,n))},indexFromPos:function(e){e=O(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+c}),n},copy:function(e){var n=new ui(Ot(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,c=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<c&&(c=e.to);var l=new ui(Ot(this,n,c),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 c=this.linked[n];if(c.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Ul(il(this));break}if(e.history==this.history){var l=[e.id];Ci(e,function(y){return l.push(y.id)},!0),e.history=new is(null),e.history.done=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):vn(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Yr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Dl(this.cm)})}),ui.prototype.eachLine=ui.prototype.iter;var al=0;function Fl(e){var n=this;if(Qs(n),ft(n,e)||kr(n.display,e))return;ge(e),$&&(al=+new Date);var c=Gi(n,e,!0),l=e.dataTransfer.files;if(!c||n.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,G=Array(y),ee=0,ae=function(){++ee==y&&Gr(n,function(){c=O(n.doc,c);var ht={from:c,to:c,text:n.doc.splitLines(G.filter(function(Bt){return Bt!=null}).join(n.doc.lineSeparator())),origin:"paste"};pa(n.doc,ht),zo(n.doc,Fi(O(n.doc,c),O(n.doc,Yi(ht))))})()},oe=function(ht,Bt){if(n.options.allowDropFileTypes&&ie(n.options.allowDropFileTypes,ht.type)==-1){ae();return}var Zt=new FileReader;Zt.onerror=function(){return ae()},Zt.onload=function(){var mn=Zt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(mn)){ae();return}G[Bt]=mn,ae()},Zt.readAsText(ht)},me=0;me<l.length;me++)oe(l[me],me);else{if(n.state.draggingText&&n.doc.sel.contains(c)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Qe;if(n.state.draggingText&&!n.state.draggingText.copy&&(Qe=n.listSelections()),ha(n.doc,Fi(c,c)),Qe)for(var _t=0;_t<Qe.length;++_t)ga(n.doc,"",Qe[_t].anchor,Qe[_t].head,"drag");n.replaceSelection(We,"around","paste"),n.display.input.focus()}}catch(ht){}}}function sl(e,n){if($&&(!e.state.draggingText||+new Date-al<100)){ue(n);return}if(ft(e,n)||kr(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!m){var c=f("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(c.width=c.height=1,e.display.wrapper.appendChild(c),c._top=c.offsetTop),n.dataTransfer.setDragImage(c,0,0),g&&c.parentNode.removeChild(c)}}function Bl(e,n){var c=Gi(e,n);if(!c)return;var l=document.createDocumentFragment();yo(e,c,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"),c=[],l=0;l<n.length;l++){var y=n[l].CodeMirror;y&&c.push(y)}c.length&&c[0].operation(function(){for(var G=0;G<c.length;G++)e(c[G])})}var Js=!1;function au(){if(Js)return;Zs(),Js=!0}function Zs(){var e;Ze(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ol(jl)},100))}),Ze(window,"blur",function(){return ol(na)})}function jl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Wi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Na=0;Na<10;Na++)Wi[Na+48]=Wi[Na+96]=String(Na);for(var hs=65;hs<=90;hs++)Wi[hs]=String.fromCharCode(hs);for(var Ua=1;Ua<=12;Ua++)Wi[Ua+111]=Wi[Ua+63235]="F"+Ua;var Li={};Li.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Li.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Li.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Li.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Li.default=u?Li.macDefault:Li.pcDefault;function Wl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var c,l,y,G,ee=0;ee<n.length-1;ee++){var ae=n[ee];if(/^(cmd|meta|m)$/i.test(ae))G=!0;else if(/^a(lt)?$/i.test(ae))c=!0;else if(/^(c|ctrl|control)$/i.test(ae))l=!0;else if(/^s(hift)?$/i.test(ae))y=!0;else throw new Error("Unrecognized modifier name: "+ae)}return c&&(e="Alt-"+e),l&&(e="Ctrl-"+e),G&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function ll(e){var n={};for(var c in e)if(e.hasOwnProperty(c)){var l=e[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if(l=="..."){delete e[c];continue}for(var y=fe(c.split(" "),Wl),G=0;G<y.length;G++){var ee=void 0,ae=void 0;G==y.length-1?(ae=y.join(" "),ee=l):(ae=y.slice(0,G+1).join(" "),ee="...");var oe=n[ae];if(!oe)n[ae]=ee;else if(oe!=ee)throw new Error("Inconsistent bindings for "+ae)}delete e[c]}for(var me in n)e[me]=n[me];return e}function Ii(e,n,c,l){n=Ba(n);var y=n.call?n.call(e,l):n[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&c(y))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ii(e,n.fallthrough,c,l);for(var G=0;G<n.fallthrough.length;G++){var ee=Ii(e,n.fallthrough[G],c,l);if(ee)return ee}}}function Fa(e){var n=typeof e=="string"?e:Wi[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ul(e,n,c){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(S?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(S?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!c&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function fs(e,n){if(g&&e.keyCode==34&&e.char)return!1;var c=Wi[e.keyCode];return c==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(c=e.code),ul(c,e,n))}function Ba(e){return typeof e=="string"?Li[e]:e}function ba(e,n){for(var c=e.doc.sel.ranges,l=[],y=0;y<c.length;y++){for(var G=n(c[y]);l.length&>(G.from,ne(l).to)<=0;){var ee=l.pop();if(gt(ee.from,G.from)<0){G.from=ee.from;break}}l.push(G)}ci(e,function(){for(var ae=l.length-1;ae>=0;ae--)ga(e.doc,"",l[ae].from,l[ae].to,"+delete");ra(e)})}function qs(e,n,c){var l=Ke(e.text,n+c,c);return l<0||l>e.text.length?null:l}function eo(e,n,c){var l=qs(e,n.ch,c);return l==null?null:new Ie(n.line,l,c<0?"after":"before")}function to(e,n,c,l,y){if(e){n.doc.direction=="rtl"&&(y=-y);var G=tn(c,n.doc.direction);if(G){var ee=y<0?ne(G):G[0],ae=y<0==(ee.level==1),oe=ae?"after":"before",me;if(ee.level>0||n.doc.direction=="rtl"){var We=ki(n,c);me=y<0?c.text.length-1:0;var Qe=ai(n,We,me).top;me=yt(function(_t){return ai(n,We,_t).top==Qe},y<0==(ee.level==1)?ee.from:ee.to-1,me),oe=="before"&&(me=qs(c,me,1))}else me=y<0?ee.to:ee.from;return new Ie(l,me,oe)}}return new Ie(l,y<0?c.text.length:0,y<0?"before":"after")}function no(e,n,c,l){var y=tn(n,e.doc.direction);if(!y)return eo(n,c,l);c.ch>=n.text.length?(c.ch=n.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var G=Xt(y,c.ch,c.sticky),ee=y[G];if(e.doc.direction=="ltr"&&ee.level%2==0&&(l>0?ee.to>c.ch:ee.from<c.ch))return eo(n,c,l);var ae=function(jn,sr){return qs(n,jn instanceof Ie?jn.ch:jn,sr)},oe,me=function(jn){return e.options.lineWrapping?(oe=oe||ki(e,n),vo(e,n,oe,jn)):{begin:0,end:n.text.length}},We=me(c.sticky=="before"?ae(c,-1):c.ch);if(e.doc.direction=="rtl"||ee.level==1){var Qe=ee.level==1==l<0,_t=ae(c,Qe?1:-1);if(_t!=null&&(Qe?_t<=ee.to&&_t<=We.end:_t>=ee.from&&_t>=We.begin)){var ht=Qe?"before":"after";return new Ie(c.line,_t,ht)}}var Bt=function(jn,sr,Wn){for(var cr=function(Wr,ri){return ri?new Ie(c.line,ae(Wr,1),"before"):new Ie(c.line,Wr,"after")};jn>=0&&jn<y.length;jn+=sr){var Or=y[jn],Tr=sr>0==(Or.level!=1),Dr=Tr?Wn.begin:ae(Wn.end,-1);if(Or.from<=Dr&&Dr<Or.to)return cr(Dr,Tr);if(Dr=Tr?Or.from:ae(Or.to,-1),Wn.begin<=Dr&&Dr<Wn.end)return cr(Dr,Tr)}},Zt=Bt(G+l,l,We);if(Zt)return Zt;var mn=l>0?We.end:ae(We.begin,-1);return mn!=null&&!(l>0&&mn==n.text.length)&&(Zt=Bt(l>0?0:y.length-1,l,me(mn)),Zt)?Zt:null}var Ea={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),we)},killLine:function(e){return ba(e,function(n){if(n.empty()){var c=mt(e.doc,n.head.line).text.length;return n.head.ch==c&&n.head.line<e.lastLine()?{from:n.head,to:Ie(n.head.line+1,0)}:{from:n.head,to:Ie(n.head.line,c)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ba(e,function(n){return{from:Ie(n.from().line,0),to:O(e.doc,Ie(n.to().line+1,0))}})},delLineLeft:function(e){return ba(e,function(n){return{from:Ie(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ba(e,function(n){var c=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:c},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ba(e,function(n){var c=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ie(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ie(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return ps(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return 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 c=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div")},xe)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var c=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:c},"div")},xe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var c=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:c},"div");return l.ch<e.getLine(l.line).search(/\S/)?dl(e,n.head):l},xe)},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=[],c=e.listSelections(),l=e.options.tabSize,y=0;y<c.length;y++){var G=c[y].from(),ee=H(e.getLine(G.line),G.ch,l);n.push(be(l-ee%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ci(e,function(){for(var n=e.listSelections(),c=[],l=0;l<n.length;l++){if(!n[l].empty())continue;var y=n[l].head,G=mt(e.doc,y.line).text;if(G){if(y.ch==G.length&&(y=new Ie(y.line,y.ch-1)),y.ch>0)y=new Ie(y.line,y.ch+1),e.replaceRange(G.charAt(y.ch-1)+G.charAt(y.ch-2),Ie(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var ee=mt(e.doc,y.line-1).text;ee&&(y=new Ie(y.line,1),e.replaceRange(G.charAt(0)+e.doc.lineSeparator()+ee.charAt(ee.length-1),Ie(y.line-1,ee.length-1),y,"+transpose"))}}c.push(new Nr(y,y))}e.setSelections(c)})},newlineAndIndent:function(e){return ci(e,function(){for(var n=e.listSelections(),c=n.length-1;c>=0;c--)e.replaceRange(e.doc.lineSeparator(),n[c].anchor,n[c].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 c=mt(e.doc,n),l=kn(c);return l!=c&&(n=ye(l)),to(!0,e,l,n,1)}function ro(e,n){var c=mt(e.doc,n),l=Pn(c);return l!=c&&(n=ye(l)),to(!0,e,c,n,-1)}function dl(e,n){var c=ps(e,n.line),l=mt(e.doc,c.line),y=tn(l,e.doc.direction);if(!y||y[0].level==0){var G=Math.max(c.ch,l.text.search(/\S/)),ee=n.line==c.line&&n.ch<=G&&n.ch;return Ie(c.line,ee?0:G,c.sticky)}return c}function ms(e,n,c){if(typeof n=="string"&&(n=Ea[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),c&&(e.display.shift=!1),y=n(e)!=he}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Hl(e,n,c){for(var l=0;l<e.state.keyMaps.length;l++){var y=Ii(n,e.state.keyMaps[l],c,e);if(y)return y}return e.options.extraKeys&&Ii(n,e.options.extraKeys,c,e)||Ii(n,e.options.keyMap,c,e)}var Kl=new Y;function ja(e,n,c,l){var y=e.state.keySeq;if(y){if(Fa(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Kl.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),io(e,y+" "+n,c,l))return!0}return io(e,n,c,l)}function io(e,n,c,l){var y=Hl(e,n,l);return y=="multi"&&(e.state.keySeq=n),y=="handled"&&Qt(e,"keyHandled",e,n,c),(y=="handled"||y=="multi")&&(ge(c),ks(e)),!!y}function cl(e,n){var c=fs(n,!0);return c?n.shiftKey&&!e.state.keySeq?ja(e,"Shift-"+c,n,function(l){return ms(e,l,!0)})||ja(e,c,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return ms(e,l)}):ja(e,c,n,function(l){return ms(e,l)}):!1}function Gl(e,n,c){return ja(e,"'"+c+"'",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(),ft(n,e))return;$&&z<11&&e.keyCode==27&&(e.returnValue=!1);var c=e.keyCode;n.display.shift=c==16||e.shiftKey;var l=cl(n,e);g&&(ao=l?c:null,!l&&c==88&&!hn&&(u?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),B&&!u&&!l&&c==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),c==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zl(n)}function zl(e){var n=e.display.lineDiv;W(n,"CodeMirror-crosshair");function c(l){(l.keyCode==18||!l.altKey)&&(E(n,"CodeMirror-crosshair"),At(document,"keyup",c),At(document,"mouseover",c))}Ze(document,"keyup",c),Ze(document,"mouseover",c)}function fl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ft(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(kr(n.display,e)||ft(n,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var c=e.keyCode,l=e.charCode;if(g&&c==ao){ao=null,ge(e);return}if(g&&(!e.which||e.which<10)&&cl(n,e))return;var y=String.fromCharCode(l==null?c:l);if(y=="\b")return;if(Gl(n,e,y))return;n.display.input.onKeyPress(e)}var Vl=400,so=function(e,n,c){this.time=e,this.pos=n,this.button=c};so.prototype.compare=function(e,n,c){return this.time+Vl>e&>(n,this.pos)==0&&c==this.button};var Wa,Ha;function Xl(e,n){var c=+new Date;return Ha&&Ha.compare(c,e,n)?(Wa=Ha=null,"triple"):Wa&&Wa.compare(c,e,n)?(Ha=new so(c,e,n),Wa=null,"double"):(Wa=new so(c,e,n),Ha=null,"single")}function oo(e){var n=this,c=n.display;if(ft(n,e)||c.activeTouch&&c.input.supportsTouch())return;if(c.input.ensurePolled(),c.shift=e.shiftKey,kr(c,e)){r||(c.scroller.draggable=!1,setTimeout(function(){return c.scroller.draggable=!0},100));return}if(uo(n,e))return;var l=Gi(n,e),y=at(e),G=l?Xl(l,y):"single";if(window.focus(),y==1&&n.state.selectingText&&n.state.selectingText(e),l&&ml(n,y,l,G,e))return;y==1?l?Yl(n,l,G,e):Fe(e)==c.scroller&&ge(e):y==2?(l&&us(n.doc,l),setTimeout(function(){return c.input.focus()},20)):y==3&&(A?n.display.input.onContextMenu(e):Eo(n))}function ml(e,n,c,l,y){var G="Click";return l=="double"?G="Double"+G:l=="triple"&&(G="Triple"+G),G=(n==1?"Left":n==2?"Middle":"Right")+G,ja(e,ul(G,y),y,function(ee){if(typeof ee=="string"&&(ee=Ea[ee]),!ee)return!1;var ae=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ae=ee(e,c)!=he}finally{e.state.suppressEdits=!1}return ae})}function $l(e,n,c){var l=e.getOption("configureMouse"),y=l?l(e,n,c):{};if(y.unit==null){var G=o?c.shiftKey&&c.metaKey:c.altKey;y.unit=G?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||c.shiftKey),y.addNew==null&&(y.addNew=u?c.metaKey:c.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(u?c.altKey:c.ctrlKey)),y}function Yl(e,n,c,l){$?setTimeout(I(Ms,e),0):e.curOp.focus=j();var y=$l(e,c,l),G=e.doc.sel,ee;e.options.dragDrop&&xt&&!e.isReadOnly()&&c=="single"&&(ee=G.contains(n))>-1&&(gt((ee=G.ranges[ee]).from(),n)<0||n.xRel>0)&&(gt(ee.to(),n)>0||n.xRel<0)?Ql(e,l,n,y):Jl(e,l,n,y)}function Ql(e,n,c,l){var y=e.display,G=!1,ee=Gr(e,function(me){r&&(y.scroller.draggable=!1),e.state.draggingText=!1,At(y.wrapper.ownerDocument,"mouseup",ee),At(y.wrapper.ownerDocument,"mousemove",ae),At(y.scroller,"dragstart",oe),At(y.scroller,"drop",ee),G||(ge(me),l.addNew||us(e.doc,c,null,null,l.extend),r&&!m||$&&z==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ae=function(me){G=G||Math.abs(n.clientX-me.clientX)+Math.abs(n.clientY-me.clientY)>=10},oe=function(){return G=!0};r&&(y.scroller.draggable=!0),e.state.draggingText=ee,ee.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ze(y.wrapper.ownerDocument,"mouseup",ee),Ze(y.wrapper.ownerDocument,"mousemove",ae),Ze(y.scroller,"dragstart",oe),Ze(y.scroller,"drop",ee),Eo(e),setTimeout(function(){return y.input.focus()},20)}function lo(e,n,c){if(c=="char")return new Nr(n,n);if(c=="word")return e.findWordAt(n);if(c=="line")return new Nr(Ie(n.line,0),O(e.doc,Ie(n.line+1,0)));var l=c(e,n);return new Nr(l.from,l.to)}function Jl(e,n,c,l){var y=e.display,G=e.doc;ge(n);var ee,ae,oe=G.sel,me=oe.ranges;if(l.addNew&&!l.extend?(ae=G.sel.contains(c),ae>-1?ee=me[ae]:ee=new Nr(c,c)):(ee=G.sel.primary(),ae=G.sel.primIndex),l.unit=="rectangle")l.addNew||(ee=new Nr(c,c)),c=Gi(e,n,!0,!0),ae=-1;else{var We=lo(e,c,l.unit);l.extend?ee=ls(ee,We.anchor,We.head,l.extend):ee=We}l.addNew?ae==-1?(ae=me.length,ni(G,wi(e,me.concat([ee]),ae),{scroll:!1,origin:"*mouse"})):me.length>1&&me[ae].empty()&&l.unit=="char"&&!l.extend?(ni(G,wi(e,me.slice(0,ae).concat(me.slice(ae+1)),0),{scroll:!1,origin:"*mouse"}),oe=G.sel):Bi(G,ae,ee,Pe):(ae=0,ni(G,new mi([ee],0),Pe),oe=G.sel);var Qe=c;function _t(Wn){if(gt(Qe,Wn)==0)return;if(Qe=Wn,l.unit=="rectangle"){for(var cr=[],Or=e.options.tabSize,Tr=H(mt(G,c.line).text,c.ch,Or),Dr=H(mt(G,Wn.line).text,Wn.ch,Or),Wr=Math.min(Tr,Dr),ri=Math.max(Tr,Dr),zr=Math.min(c.line,Wn.line),Ei=Math.min(e.lastLine(),Math.max(c.line,Wn.line));zr<=Ei;zr++){var gi=mt(G,zr).text,Qr=Oe(gi,Wr,Or);Wr==ri?cr.push(new Nr(Ie(zr,Qr),Ie(zr,Qr))):gi.length>Qr&&cr.push(new Nr(Ie(zr,Qr),Ie(zr,Oe(gi,ri,Or))))}cr.length||cr.push(new Nr(c,c)),ni(G,wi(e,oe.ranges.slice(0,ae).concat(cr),ae),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Wn)}else{var vi=ee,oi=lo(e,Wn,l.unit),qr=vi.anchor,Jr;gt(oi.anchor,qr)>0?(Jr=oi.head,qr=mr(vi.from(),oi.anchor)):(Jr=oi.anchor,qr=hr(vi.to(),oi.head));var Xr=oe.ranges.slice(0);Xr[ae]=Zl(e,new Nr(O(G,qr),Jr)),ni(G,wi(e,Xr,ae),Pe)}}var ht=y.wrapper.getBoundingClientRect(),Bt=0;function Zt(Wn){var cr=++Bt,Or=Gi(e,Wn,!0,l.unit=="rectangle");if(!Or)return;if(gt(Or,Qe)!=0){e.curOp.focus=j(),_t(Or);var Tr=Za(y,G);(Or.line>=Tr.to||Or.line<Tr.from)&&setTimeout(Gr(e,function(){Bt==cr&&Zt(Wn)}),150)}else{var Dr=Wn.clientY<ht.top?-20:Wn.clientY>ht.bottom?20:0;Dr&&setTimeout(Gr(e,function(){if(Bt!=cr)return;y.scroller.scrollTop+=Dr,Zt(Wn)}),50)}}function mn(Wn){e.state.selectingText=!1,Bt=Infinity,Wn&&(ge(Wn),y.input.focus()),At(y.wrapper.ownerDocument,"mousemove",jn),At(y.wrapper.ownerDocument,"mouseup",sr),G.history.lastSelOrigin=null}var jn=Gr(e,function(Wn){Wn.buttons===0||!at(Wn)?mn(Wn):Zt(Wn)}),sr=Gr(e,mn);e.state.selectingText=sr,Ze(y.wrapper.ownerDocument,"mousemove",jn),Ze(y.wrapper.ownerDocument,"mouseup",sr)}function Zl(e,n){var c=n.anchor,l=n.head,y=mt(e.doc,c.line);if(gt(c,l)==0&&c.sticky==l.sticky)return n;var G=tn(y);if(!G)return n;var ee=Xt(G,c.ch,c.sticky),ae=G[ee];if(ae.from!=c.ch&&ae.to!=c.ch)return n;var oe=ee+(ae.from==c.ch==(ae.level!=1)?0:1);if(oe==0||oe==G.length)return n;var me;if(l.line!=c.line)me=(l.line-c.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=Xt(G,l.ch,l.sticky),Qe=We-ee||(l.ch-c.ch)*(ae.level==1?-1:1);We==oe-1||We==oe?me=Qe<0:me=Qe>0}var _t=G[oe+(me?-1:0)],ht=me==(_t.level==1),Bt=ht?_t.from:_t.to,Zt=ht?"after":"before";return c.ch==Bt&&c.sticky==Zt?n:new Nr(new Ie(c.line,Bt,Zt),l)}function gl(e,n,c,l){var y,G;if(n.touches)y=n.touches[0].clientX,G=n.touches[0].clientY;else try{y=n.clientX,G=n.clientY}catch(_t){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ge(n);var ee=e.display,ae=ee.lineDiv.getBoundingClientRect();if(G>ae.bottom||!Ne(e,c))return De(n);G-=ae.top-ee.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=ee.gutters.childNodes[oe];if(me&&me.getBoundingClientRect().right>=y){var We=ve(e.doc,G),Qe=e.display.gutterSpecs[oe];return dt(e,c,e,We,Qe.className,n),De(n)}}}function uo(e,n){return gl(e,n,"gutterClick",!0)}function vl(e,n){if(kr(e.display,n)||_l(e,n))return;if(ft(e,n,"contextmenu"))return;A||e.display.input.onContextMenu(n)}function _l(e,n){return Ne(e,"gutterContextMenu")?gl(e,n,"gutterContextMenu",!1):!1}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ca(e)}var xa={toString:function(){return"CodeMirror.Init"}},gs={},Ka={};function ql(e){var n=e.optionHandlers;function c(l,y,G,ee){e.defaults[l]=y,G&&(n[l]=ee?function(ae,oe,me){me!=xa&&G(ae,oe,me)}:G)}e.defineOption=c,e.Init=xa,c("value","",function(l,y){return l.setValue(y)},!0),c("mode",null,function(l,y){l.doc.modeOption=y,La(l)},!0),c("indentUnit",2,La,!0),c("indentWithTabs",!1),c("smartIndent",!0),c("tabSize",4,function(l){Ia(l),Ca(l),li(l)},!0),c("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var G=[],ee=l.doc.first;l.doc.iter(function(oe){for(var me=0;;){var We=oe.text.indexOf(y,me);if(We==-1)break;me=We+y.length,G.push(Ie(ee,We))}ee++});for(var ae=G.length-1;ae>=0;ae--)ga(l.doc,y,G[ae],Ie(G[ae].line,G[ae].ch+y.length))}),c("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,G){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),G!=xa&&l.refresh()}),c("specialCharPlaceholder",pt,function(l){return l.refresh()},!0),c("electricChars",!0),c("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),c("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),c("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),c("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),c("rtlMoveVisually",!R),c("wholeLineUpdateBefore",!0),c("theme","default",function(l){yl(l),Da(l)},!0),c("keyMap","default",function(l,y,G){var ee=Ba(y),ae=G!=xa&&Ba(G);ae&&ae.detach&&ae.detach(l,ee),ee.attach&&ee.attach(l,ae||null)}),c("extraKeys",null),c("configureMouse",null),c("lineWrapping",!1,tu,!0),c("gutters",[],function(l,y){l.display.gutterSpecs=Ws(y,l.options.lineNumbers),Da(l)},!0),c("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Ds(l.display)+"px":"0",l.refresh()},!0),c("coverGutterNextToScrollbar",!1,function(l){return Ui(l)},!0),c("scrollbarStyle","native",function(l){Oo(l),Ui(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),c("lineNumbers",!1,function(l,y){l.display.gutterSpecs=Ws(l.options.gutters,y),Da(l)},!0),c("firstLineNumber",1,Da,!0),c("lineNumberFormatter",function(l){return l},Da,!0),c("showCursorWhenSelecting",!1,ta,!0),c("resetSelectionOnContextMenu",!0),c("lineWiseCopyCut",!0),c("pasteLinesPerSelection",!0),c("selectionsMayTouch",!1),c("readOnly",!1,function(l,y){y=="nocursor"&&(na(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),c("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),c("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),c("dragDrop",!0,eu),c("allowDropFileTypes",null),c("cursorBlinkRate",530),c("cursorScrollMargin",0),c("cursorHeight",1,ta,!0),c("singleCursorHeightPerLine",!0,ta,!0),c("workTime",100),c("workDelay",100),c("flattenSpans",!0,Ia,!0),c("addModeClass",!1,Ia,!0),c("pollInterval",100),c("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),c("historyEventDelay",1250),c("viewportMargin",10,function(l){return l.refresh()},!0),c("maxHighlightLength",1e4,Ia,!0),c("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),c("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),c("autofocus",null),c("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),c("phrases",null)}function eu(e,n,c){var l=c&&c!=xa;if(!n!=!l){var y=e.display.dragFunctions,G=n?Ze:At;G(e.display.scroller,"dragstart",y.start),G(e.display.scroller,"dragenter",y.enter),G(e.display.scroller,"dragover",y.over),G(e.display.scroller,"dragleave",y.leave),G(e.display.scroller,"drop",y.drop)}}function tu(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),nn(e)),Ps(e),li(e),Ca(e),setTimeout(function(){return Ui(e)},100)}function Hr(e,n){var c=this;if(!(this instanceof Hr))return new Hr(e,n);this.options=n=n?v(n):{},v(gs,n,!1);var l=n.value;typeof l=="string"?l=new ui(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var y=new Hr.inputStyles[n.inputStyle](this),G=this.display=new Ol(e,l,y,n);G.wrapper.CodeMirror=this,yl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Y,keySeq:null,specialChars:null},n.autofocus&&!t&&G.input.focus(),$&&z<11&&setTimeout(function(){return c.display.input.reset(!0)},20),bl(this),au(),Vi(this),this.curOp.forceUpdate=!0,Gs(this,l),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){c.hasFocus()&&!c.state.focused&&Ns(c)},20):na(this);for(var ee in Ka)Ka.hasOwnProperty(ee)&&Ka[ee](this,n[ee],xa);ko(this),n.finishInit&&n.finishInit(this);for(var ae=0;ae<L.length;++ae)L[ae](this);Xi(this),r&&n.lineWrapping&&getComputedStyle(G.lineDiv).textRendering=="optimizelegibility"&&(G.lineDiv.style.textRendering="auto")}Hr.defaults=gs,Hr.optionHandlers=Ka;function bl(e){var n=e.display;Ze(n.scroller,"mousedown",Gr(e,oo)),$&&z<11?Ze(n.scroller,"dblclick",Gr(e,function(oe){if(ft(e,oe))return;var me=Gi(e,oe);if(!me||uo(e,oe)||kr(e.display,oe))return;ge(oe);var We=e.findWordAt(me);us(e.doc,We.anchor,We.head)})):Ze(n.scroller,"dblclick",function(oe){return ft(e,oe)||ge(oe)}),Ze(n.scroller,"contextmenu",function(oe){return vl(e,oe)}),Ze(n.input.getField(),"contextmenu",function(oe){n.scroller.contains(oe.target)||vl(e,oe)});var c,l={end:0};function y(){n.activeTouch&&(c=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function G(oe){if(oe.touches.length!=1)return!1;var me=oe.touches[0];return me.radiusX<=1&&me.radiusY<=1}function ee(oe,me){if(me.left==null)return!0;var We=me.left-oe.left,Qe=me.top-oe.top;return We*We+Qe*Qe>20*20}Ze(n.scroller,"touchstart",function(oe){if(!ft(e,oe)&&!G(oe)&&!uo(e,oe)){n.input.ensurePolled(),clearTimeout(c);var me=+new Date;n.activeTouch={start:me,moved:!1,prev:me-l.end<=300?l:null},oe.touches.length==1&&(n.activeTouch.left=oe.touches[0].pageX,n.activeTouch.top=oe.touches[0].pageY)}}),Ze(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Ze(n.scroller,"touchend",function(oe){var me=n.activeTouch;if(me&&!kr(n,oe)&&me.left!=null&&!me.moved&&new Date-me.start<300){var We=e.coordsChar(n.activeTouch,"page"),Qe;!me.prev||ee(me,me.prev)?Qe=new Nr(We,We):!me.prev.prev||ee(me,me.prev.prev)?Qe=e.findWordAt(We):Qe=new Nr(Ie(We.line,0),O(e.doc,Ie(We.line+1,0))),e.setSelection(Qe.anchor,Qe.head),e.focus(),ge(oe)}y()}),Ze(n.scroller,"touchcancel",y),Ze(n.scroller,"scroll",function(){n.scroller.clientHeight&&(aa(e,n.scroller.scrollTop),Di(e,n.scroller.scrollLeft,!0),dt(e,"scroll",e))}),Ze(n.scroller,"mousewheel",function(oe){return No(e,oe)}),Ze(n.scroller,"DOMMouseScroll",function(oe){return No(e,oe)}),Ze(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(oe){ft(e,oe)||ue(oe)},over:function(oe){ft(e,oe)||(Bl(e,oe),ue(oe))},start:function(oe){return sl(e,oe)},drop:Gr(e,Fl),leave:function(oe){ft(e,oe)||Qs(e)}};var ae=n.input.getField();Ze(ae,"keyup",function(oe){return fl.call(e,oe)}),Ze(ae,"keydown",Gr(e,hl)),Ze(ae,"keypress",Gr(e,pl)),Ze(ae,"focus",function(oe){return Ns(e,oe)}),Ze(ae,"blur",function(oe){return na(e,oe)})}var L=[];Hr.defineInitHook=function(e){return L.push(e)};function k(e,n,c,l){var y=e.doc,G;c==null&&(c="add"),c=="smart"&&(y.mode.indent?G=wt(e,n).state:c="prev");var ee=e.options.tabSize,ae=mt(y,n),oe=H(ae.text,null,ee);ae.stateAfter&&(ae.stateAfter=null);var me=ae.text.match(/^\s*/)[0],We;if(!l&&!/\S/.test(ae.text))We=0,c="not";else if(c=="smart"&&(We=y.mode.indent(G,ae.text.slice(me.length),ae.text),We==he||We>150)){if(!l)return;c="prev"}c=="prev"?n>y.first?We=H(mt(y,n-1).text,null,ee):We=0:c=="add"?We=oe+e.options.indentUnit:c=="subtract"?We=oe-e.options.indentUnit:typeof c=="number"&&(We=oe+c),We=Math.max(0,We);var Qe="",_t=0;if(e.options.indentWithTabs)for(var ht=Math.floor(We/ee);ht;--ht)_t+=ee,Qe+=" ";if(_t<We&&(Qe+=be(We-_t)),Qe!=me)return ga(y,Qe,Ie(n,0),Ie(n,me.length),"+input"),ae.stateAfter=null,!0;for(var Bt=0;Bt<y.sel.ranges.length;Bt++){var Zt=y.sel.ranges[Bt];if(Zt.head.line==n&&Zt.head.ch<me.length){var mn=Ie(n,me.length);Bi(y,Bt,new Nr(mn,mn));break}}}var V=null;function re(e){V=e}function de(e,n,c,l,y){var G=e.doc;e.display.shift=!1,l||(l=G.sel);var ee=+new Date-200,ae=y=="paste"||e.state.pasteIncoming>ee,oe=vn(n),me=null;if(ae&&l.ranges.length>1)if(V&&V.text.join(`
|
|
`)==n){if(l.ranges.length%V.text.length==0){me=[];for(var We=0;We<V.text.length;We++)me.push(G.splitLines(V.text[We]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(me=fe(oe,function(jn){return[jn]}));for(var Qe=e.curOp.updateInput,_t=l.ranges.length-1;_t>=0;_t--){var ht=l.ranges[_t],Bt=ht.from(),Zt=ht.to();ht.empty()&&(c&&c>0?Bt=Ie(Bt.line,Bt.ch-c):e.state.overwrite&&!ae?Zt=Ie(Zt.line,Math.min(mt(G,Zt.line).text.length,Zt.ch+ne(oe).length)):ae&&V&&V.lineWise&&V.text.join(`
|
|
`)==oe.join(`
|
|
`)&&(Bt=Zt=Ie(Bt.line,0)));var mn={from:Bt,to:Zt,text:me?me[_t%me.length]:oe,origin:y||(ae?"paste":e.state.cutIncoming>ee?"cut":"+input")};pa(e.doc,mn),Qt(e,"inputRead",e,mn)}n&&!ae&&Te(e,n),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Qe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ce(e,n){var c=e.clipboardData&&e.clipboardData.getData("Text");if(c)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&ci(n,function(){return de(n,c,0,null,"paste")}),!0}function Te(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var c=e.doc.sel,l=c.ranges.length-1;l>=0;l--){var y=c.ranges[l];if(y.head.ch>100||l&&c.ranges[l-1].head.line==y.head.line)continue;var G=e.getModeAt(y.head),ee=!1;if(G.electricChars){for(var ae=0;ae<G.electricChars.length;ae++)if(n.indexOf(G.electricChars.charAt(ae))>-1){ee=k(e,y.head.line,"smart");break}}else G.electricInput&&(G.electricInput.test(mt(e.doc,y.head.line).text.slice(0,y.head.ch))&&(ee=k(e,y.head.line,"smart")));ee&&Qt(e,"electricInput",e,y.head.line)}}function Se(e){for(var n=[],c=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,G={anchor:Ie(y,0),head:Ie(y+1,0)};c.push(G),n.push(e.getRange(G.anchor,G.head))}return{text:n,ranges:c}}function Ve(e,n,c,l){e.setAttribute("autocorrect",c?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function it(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),Ve(e),n}function ut(e){var n=e.optionHandlers,c=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var G=this.options,ee=G[l];if(G[l]==y&&l!="mode")return;G[l]=y,n.hasOwnProperty(l)&&Gr(this,n[l])(this,y,ee),dt(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](Ba(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,G=0;G<y.length;++G)if(y[G]==l||y[G].name==l)return y.splice(G,1),!0},addOverlay:si(function(l,y){var G=l.token?l:e.getMode(this.options,l);if(G.startState)throw new Error("Overlays may not be stateful.");_e(this.state.overlays,{mode:G,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function(ee){return ee.priority}),this.state.modeGen++,li(this)}),removeOverlay:si(function(l){for(var y=this.state.overlays,G=0;G<y.length;++G){var ee=y[G].modeSpec;if(ee==l||typeof l=="string"&&ee.name==l){y.splice(G,1),this.state.modeGen++,li(this);return}}}),indentLine:si(function(l,y,G){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),or(this.doc,l)&&k(this,l,y,G)}),indentSelection:si(function(l){for(var y=this.doc.sel.ranges,G=-1,ee=0;ee<y.length;ee++){var ae=y[ee];if(ae.empty())ae.head.line>G&&(k(this,ae.head.line,l,!0),G=ae.head.line,ee==this.doc.sel.primIndex&&ra(this));else{var oe=ae.from(),me=ae.to(),We=Math.max(G,oe.line);G=Math.min(this.lastLine(),me.line-(me.ch?0:1))+1;for(var Qe=We;Qe<G;++Qe)k(this,Qe,l);var _t=this.doc.sel.ranges;oe.ch==0&&y.length==_t.length&&_t[ee].from().ch>0&&Bi(this.doc,ee,new Nr(oe,_t[ee].to()),we)}}}),getTokenAt:function(l,y){return Cn(this,l,y)},getLineTokens:function(l,y){return Cn(this,Ie(l),y,!0)},getTokenTypeAt:function(l){l=O(this.doc,l);var y=ot(this,mt(this.doc,l.line)),G=0,ee=(y.length-1)/2,ae=l.ch,oe;if(ae==0)oe=y[2];else for(;;){var me=G+ee>>1;if((me?y[me*2-1]:0)>=ae)ee=me;else if(y[me*2+1]<ae)G=me+1;else{oe=y[me*2+2];break}}var We=oe?oe.indexOf("overlay "):-1;return We<0?oe:We==0?null:oe.slice(0,We-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var G=[];if(!c.hasOwnProperty(y))return G;var ee=c[y],ae=this.getModeAt(l);if(typeof ae[y]=="string")ee[ae[y]]&&G.push(ee[ae[y]]);else if(ae[y])for(var oe=0;oe<ae[y].length;oe++){var me=ee[ae[y][oe]];me&&G.push(me)}else ae.helperType&&ee[ae.helperType]?G.push(ee[ae.helperType]):ee[ae.name]&&G.push(ee[ae.name]);for(var We=0;We<ee._global.length;We++){var Qe=ee._global[We];Qe.pred(ae,this)&&ie(G,Qe.val)==-1&&G.push(Qe.val)}return G},getStateAfter:function(l,y){var G=this.doc;return l=q(G,l==null?G.first+G.size-1:l),wt(this,l+1,y).state},cursorCoords:function(l,y){var G,ee=this.doc.sel.primary();return l==null?G=ee.head:typeof l=="object"?G=O(this.doc,l):G=l?ee.from():ee.to(),xi(this,G,y||"page")},charCoords:function(l,y){return Ts(this,O(this.doc,l),y||"page")},coordsChar:function(l,y){return l=Cs(this,l,y||"page"),Rs(this,l.left,l.top)},lineAtHeight:function(l,y){return l=Cs(this,{top:l,left:0},y||"page").top,ve(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,G){var ee=!1,ae;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,ee=!0),ae=mt(this.doc,l)}else ae=l;return $a(this,ae,{top:0,left:0},y||"page",G||ee).top+(ee?this.doc.height-Vt(ae):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,G,ee,ae){var oe=this.display;l=xi(this,O(this.doc,l));var me=l.bottom,We=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),oe.sizer.appendChild(y),ee=="over")me=l.top;else if(ee=="above"||ee=="near"){var Qe=Math.max(oe.wrapper.clientHeight,this.doc.height),_t=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(ee=="above"||l.bottom+y.offsetHeight>Qe)&&l.top>y.offsetHeight?me=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=Qe&&(me=l.bottom),We+y.offsetWidth>_t&&(We=_t-y.offsetWidth)}y.style.top=me+"px",y.style.left=y.style.right="",ae=="right"?(We=oe.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ae=="left"?We=0:ae=="middle"&&(We=(oe.sizer.clientWidth-y.offsetWidth)/2),y.style.left=We+"px"),G&&wl(this,{left:We,top:me,right:We+y.offsetWidth,bottom:me+y.offsetHeight})},triggerOnKeyDown:si(hl),triggerOnKeyPress:si(pl),triggerOnKeyUp:fl,triggerOnMouseDown:si(oo),execCommand:function(l){if(Ea.hasOwnProperty(l))return Ea[l].call(null,this)},triggerElectric:si(function(l){Te(this,l)}),findPosH:function(l,y,G,ee){var ae=1;y<0&&(ae=-1,y=-y);for(var oe=O(this.doc,l),me=0;me<y&&!(oe=$e(this.doc,oe,ae,G,ee),oe.hitSide);++me);return oe},moveH:si(function(l,y){var G=this;this.extendSelectionsBy(function(ee){return G.display.shift||G.doc.extend||ee.empty()?$e(G.doc,ee.head,l,y,G.options.rtlMoveVisually):l<0?ee.from():ee.to()},xe)}),deleteH:si(function(l,y){var G=this.doc.sel,ee=this.doc;G.somethingSelected()?ee.replaceSelection("",null,"+delete"):ba(this,function(ae){var oe=$e(ee,ae.head,l,y,!1);return l<0?{from:oe,to:ae.head}:{from:ae.head,to:oe}})}),findPosV:function(l,y,G,ee){var ae=1,oe=ee;y<0&&(ae=-1,y=-y);for(var me=O(this.doc,l),We=0;We<y;++We){var Qe=xi(this,me,"div");if(oe==null?oe=Qe.left:Qe.left=oe,me=Xe(this,Qe,ae,G),me.hitSide)break}return me},moveV:si(function(l,y){var G=this,ee=this.doc,ae=[],oe=!this.display.shift&&!ee.extend&&ee.sel.somethingSelected();if(ee.extendSelectionsBy(function(We){if(oe)return l<0?We.from():We.to();var Qe=xi(G,We.head,"div");We.goalColumn!=null&&(Qe.left=We.goalColumn),ae.push(Qe.left);var _t=Xe(G,Qe,l,y);return y=="page"&&We==ee.sel.primary()&&es(G,Ts(G,_t,"div").top-Qe.top),_t},xe),ae.length)for(var me=0;me<ee.sel.ranges.length;me++)ee.sel.ranges[me].goalColumn=ae[me]}),findWordAt:function(l){var y=this.doc,G=mt(y,l.line).text,ee=l.ch,ae=l.ch;if(G){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||ae==G.length)&&ee?--ee:++ae;for(var me=G.charAt(ee),We=vt(me,oe)?function(Qe){return vt(Qe,oe)}:/\s/.test(me)?function(Qe){return/\s/.test(Qe)}:function(Qe){return!/\s/.test(Qe)&&!vt(Qe)};ee>0&&We(G.charAt(ee-1));)--ee;for(;ae<G.length&&We(G.charAt(ae));)++ae}return new Nr(Ie(l.line,ee),Ie(l.line,ae))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),dt(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,y){ia(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Zr(this)-this.display.barHeight,width:l.scrollWidth-Zr(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:ei(this)}},scrollIntoView:si(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:Ie(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?wo(this,l):Co(this,l.from,l.to,l.margin)}),setSize:si(function(l,y){var G=this,ee=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=ee(l)),y!=null&&(this.display.wrapper.style.height=ee(y)),this.options.lineWrapping&&xs(this);var ae=this.display.viewFrom;this.doc.iter(ae,this.display.viewTo,function(oe){if(oe.widgets){for(var me=0;me<oe.widgets.length;me++)if(oe.widgets[me].noHScroll){Mi(G,ae,"widget");break}}++ae}),this.curOp.forceUpdate=!0,dt(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),dt(this,"refresh",this)}),swapDoc:si(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),Gs(this,l),Ca(this),this.display.input.reset(),ia(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Qt(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ue(e),e.registerHelper=function(l,y,G){c.hasOwnProperty(l)||(c[l]=e[l]={_global:[]}),c[l][y]=G},e.registerGlobalHelper=function(l,y,G,ee){e.registerHelper(l,y,ee),c[l]._global.push({pred:G,val:ee})}}function $e(e,n,c,l,y){var G=n,ee=c,ae=mt(e,n.line),oe=y&&e.direction=="rtl"?-c:c;function me(){var sr=n.line+oe;return sr<e.first||sr>=e.first+e.size?!1:(n=new Ie(sr,n.ch,n.sticky),ae=mt(e,sr))}function We(sr){var Wn;if(l=="codepoint"){var cr=ae.text.charCodeAt(n.ch+(l>0?0:-1));isNaN(cr)?Wn=null:Wn=new Ie(n.line,Math.max(0,Math.min(ae.text.length,n.ch+c*(cr>=55296&&cr<56320?2:1))),-c)}else y?Wn=no(e.cm,ae,n,c):Wn=eo(ae,n,c);if(Wn==null)if(!sr&&me())n=to(y,e.cm,ae,n.line,oe);else return!1;else n=Wn;return!0}if(l=="char"||l=="codepoint")We();else if(l=="column")We(!0);else if(l=="word"||l=="group")for(var Qe=null,_t=l=="group",ht=e.cm&&e.cm.getHelper(n,"wordChars"),Bt=!0;!(c<0&&!We(!Bt));Bt=!1){var Zt=ae.text.charAt(n.ch)||`
|
|
`,mn=vt(Zt,ht)?"w":_t&&Zt==`
|
|
`?"n":!_t||/\s/.test(Zt)?null:"p";if(_t&&!Bt&&!mn&&(mn="s"),Qe&&Qe!=mn){c<0&&(c=1,We(),n.sticky="after");break}if(mn&&(Qe=mn),c>0&&!We(!Bt))break}var jn=ds(e,n,G,ee,!0);return Ce(G,jn)&&(jn.hitSide=!0),jn}function Xe(e,n,c,l){var y=e.doc,G=n.left,ee;if(l=="page"){var ae=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ae-.5*Zi(e.display),3);ee=(c>0?n.bottom:n.top)+c*oe}else l=="line"&&(ee=c>0?n.bottom+3:n.top-3);for(var me;!(me=Rs(e,G,ee),!me.outside);){if(c<0?ee<=0:ee>=y.height){me.hitSide=!0;break}ee+=c*5}return me}var tt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};tt.prototype.init=function(e){var n=this,c=this,l=c.cm,y=c.div=e.lineDiv;Ve(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function G(ae){for(var oe=ae.target;oe;oe=oe.parentNode){if(oe==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Ze(y,"paste",function(ae){if(!G(ae)||ft(l,ae)||ce(ae,l))return;z<=11&&setTimeout(Gr(l,function(){return n.updateFromDOM()}),20)}),Ze(y,"compositionstart",function(ae){n.composing={data:ae.data,done:!1}}),Ze(y,"compositionupdate",function(ae){n.composing||(n.composing={data:ae.data,done:!1})}),Ze(y,"compositionend",function(ae){n.composing&&(ae.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Ze(y,"touchstart",function(){return c.forceCompositionEnd()}),Ze(y,"input",function(){n.composing||n.readFromDOMSoon()});function ee(ae){if(!G(ae)||ft(l,ae))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()}),ae.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=Se(l);re({lineWise:!0,text:oe.text}),ae.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,we),l.replaceSelection("",null,"cut")})}else return;if(ae.clipboardData){ae.clipboardData.clearData();var me=V.text.join(`
|
|
`);if(ae.clipboardData.setData("Text",me),ae.clipboardData.getData("Text")==me){ae.preventDefault();return}}var We=it(),Qe=We.firstChild;l.display.lineSpace.insertBefore(We,l.display.lineSpace.firstChild),Qe.value=V.text.join(`
|
|
`);var _t=document.activeElement;F(Qe),setTimeout(function(){l.display.lineSpace.removeChild(We),_t.focus(),_t==y&&c.showPrimarySelection()},50)}Ze(y,"copy",ee),Ze(y,"cut",ee)},tt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},tt.prototype.prepareSelection=function(){var e=Is(this.cm,!1);return e.focus=document.activeElement==this.div,e},tt.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},tt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},tt.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,c=n.doc.sel.primary(),l=c.from(),y=c.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||y.line<n.display.viewFrom){e.removeAllRanges();return}var G=dr(n,e.anchorNode,e.anchorOffset),ee=dr(n,e.focusNode,e.focusOffset);if(G&&!G.bad&&ee&&!ee.bad&>(mr(G,ee),l)==0&>(hr(G,ee),y)==0)return;var ae=n.display.view,oe=l.line>=n.display.viewFrom&&Dt(n,l)||{node:ae[0].measure.map[2],offset:0},me=y.line<n.display.viewTo&&Dt(n,y);if(!me){var We=ae[ae.length-1].measure,Qe=We.maps?We.maps[We.maps.length-1]:We.map;me={node:Qe[Qe.length-1],offset:Qe[Qe.length-2]-Qe[Qe.length-3]}}if(!oe||!me){e.removeAllRanges();return}var _t=e.rangeCount&&e.getRangeAt(0),ht;try{ht=x(oe.node,oe.offset,me.offset,me.node)}catch(Bt){}ht&&(!B&&n.state.focused?(e.collapse(oe.node,oe.offset),ht.collapsed||(e.removeAllRanges(),e.addRange(ht))):(e.removeAllRanges(),e.addRange(ht)),_t&&e.anchorNode==null?e.addRange(_t):B&&this.startGracePeriod()),this.rememberSelection()},tt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},tt.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},tt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},tt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return _(this.div,n)},tt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},tt.prototype.blur=function(){this.div.blur()},tt.prototype.getField=function(){return this.div},tt.prototype.supportsTouch=function(){return!0},tt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():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)},tt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},tt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(i&&p&&this.cm.display.gutterSpecs.length&&An(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var c=dr(n,e.anchorNode,e.anchorOffset),l=dr(n,e.focusNode,e.focusOffset);c&&l&&ci(n,function(){ni(n.doc,Fi(c,l),we),(c.bad||l.bad)&&(n.curOp.selectionChanged=!0)})},tt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,c=e.doc.sel.primary(),l=c.from(),y=c.to();if(l.ch==0&&l.line>e.firstLine()&&(l=Ie(l.line-1,mt(e.doc,l.line-1).length)),y.ch==mt(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=Ie(y.line+1,0)),l.line<n.viewFrom||y.line>n.viewTo-1)return!1;var G,ee,ae;l.line==n.viewFrom||(G=zi(e,l.line))==0?(ee=ye(n.view[0].line),ae=n.view[0].node):(ee=ye(n.view[G].line),ae=n.view[G-1].node.nextSibling);var oe=zi(e,y.line),me,We;if(oe==n.view.length-1?(me=n.viewTo-1,We=n.lineDiv.lastChild):(me=ye(n.view[oe+1].line)-1,We=n.view[oe+1].node.previousSibling),!ae)return!1;for(var Qe=e.doc.splitLines(ar(e,ae,We,ee,me)),_t=Ge(e.doc,Ie(ee,0),Ie(me,mt(e.doc,me).text.length));Qe.length>1&&_t.length>1;)if(ne(Qe)==ne(_t))Qe.pop(),_t.pop(),me--;else if(Qe[0]==_t[0])Qe.shift(),_t.shift(),ee++;else break;for(var ht=0,Bt=0,Zt=Qe[0],mn=_t[0],jn=Math.min(Zt.length,mn.length);ht<jn&&Zt.charCodeAt(ht)==mn.charCodeAt(ht);)++ht;for(var sr=ne(Qe),Wn=ne(_t),cr=Math.min(sr.length-(Qe.length==1?ht:0),Wn.length-(_t.length==1?ht:0));Bt<cr&&sr.charCodeAt(sr.length-Bt-1)==Wn.charCodeAt(Wn.length-Bt-1);)++Bt;if(Qe.length==1&&_t.length==1&&ee==l.line)for(;ht&&ht>l.ch&&sr.charCodeAt(sr.length-Bt-1)==Wn.charCodeAt(Wn.length-Bt-1);)ht--,Bt++;Qe[Qe.length-1]=sr.slice(0,sr.length-Bt).replace(/^\u200b+/,""),Qe[0]=Qe[0].slice(ht).replace(/\u200b+$/,"");var Or=Ie(ee,ht),Tr=Ie(me,_t.length?ne(_t).length-Bt:0);if(Qe.length>1||Qe[0]||gt(Or,Tr))return ga(e.doc,Qe,Or,Tr,"+input"),!0},tt.prototype.ensurePolled=function(){this.forceCompositionEnd()},tt.prototype.reset=function(){this.forceCompositionEnd()},tt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},tt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},tt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ci(this.cm,function(){return li(e.cm)})},tt.prototype.setUneditable=function(e){e.contentEditable="false"},tt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,de)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},tt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},tt.prototype.onContextMenu=function(){},tt.prototype.resetPosition=function(){},tt.prototype.needsContentAttribute=!0;function Dt(e,n){var c=Ki(e,n.line);if(!c||c.hidden)return null;var l=mt(e.doc,n.line),y=Va(c,l,n.line),G=tn(l,e.doc.direction),ee="left";if(G){var ae=Xt(G,n.ch);ee=ae%2?"right":"left"}var oe=ys(y.map,n.ch,ee);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function An(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Fn(e,n){return n&&(e.bad=!0),e}function ar(e,n,c,l,y){var G="",ee=!1,ae=e.doc.lineSeparator(),oe=!1;function me(ht){return function(Bt){return Bt.id==ht}}function We(){ee&&(G+=ae,oe&&(G+=ae),ee=oe=!1)}function Qe(ht){ht&&(We(),G+=ht)}function _t(ht){if(ht.nodeType==1){var Bt=ht.getAttribute("cm-text");if(Bt){Qe(Bt);return}var Zt=ht.getAttribute("cm-marker"),mn;if(Zt){var jn=e.findMarks(Ie(l,0),Ie(y+1,0),me(+Zt));jn.length&&(mn=jn[0].find(0))&&Qe(Ge(e.doc,mn.from,mn.to).join(ae));return}if(ht.getAttribute("contenteditable")=="false")return;var sr=/^(pre|div|p|li|table|br)$/i.test(ht.nodeName);if(!/^br$/i.test(ht.nodeName)&&ht.textContent.length==0)return;sr&&We();for(var Wn=0;Wn<ht.childNodes.length;Wn++)_t(ht.childNodes[Wn]);/^(pre|p)$/i.test(ht.nodeName)&&(oe=!0),sr&&(ee=!0)}else ht.nodeType==3&&Qe(ht.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(_t(n),n==c);)n=n.nextSibling,oe=!1;return G}function dr(e,n,c){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[c],!l)return Fn(e.clipPos(Ie(e.display.viewTo-1)),!0);n=null,c=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var G=e.display.view[y];if(G.node==l)return Sr(G,n,c)}}function Sr(e,n,c){var l=e.text.firstChild,y=!1;if(!n||!_(l,n))return Fn(Ie(ye(e.line),0),!0);if(n==l&&(y=!0,n=l.childNodes[c],c=0,!n)){var G=e.rest?ne(e.rest):e.line;return Fn(Ie(ye(G),G.text.length),y)}var ee=n.nodeType==3?n:null,ae=n;for(!ee&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(ee=n.firstChild,c&&(c=ee.nodeValue.length));ae.parentNode!=l;)ae=ae.parentNode;var oe=e.measure,me=oe.maps;function We(mn,jn,sr){for(var Wn=-1;Wn<(me?me.length:0);Wn++)for(var cr=Wn<0?oe.map:me[Wn],Or=0;Or<cr.length;Or+=3){var Tr=cr[Or+2];if(Tr==mn||Tr==jn){var Dr=ye(Wn<0?e.line:e.rest[Wn]),Wr=cr[Or]+sr;return(sr<0||Tr!=mn)&&(Wr=cr[Or+(sr?1:0)]),Ie(Dr,Wr)}}}var Qe=We(ee,ae,c);if(Qe)return Fn(Qe,y);for(var _t=ae.nextSibling,ht=ee?ee.nodeValue.length-c:0;_t;_t=_t.nextSibling){if(Qe=We(_t,_t.firstChild,0),Qe)return Fn(Ie(Qe.line,Qe.ch-ht),y);ht+=_t.textContent.length}for(var Bt=ae.previousSibling,Zt=c;Bt;Bt=Bt.previousSibling){if(Qe=We(Bt,Bt.firstChild,-1),Qe)return Fn(Ie(Qe.line,Qe.ch+Zt),y);Zt+=Bt.textContent.length}}var ur=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};ur.prototype.init=function(e){var n=this,c=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(y.style.width="0px"),Ze(y,"input",function(){$&&z>=9&&n.hasSelection&&(n.hasSelection=null),c.poll()}),Ze(y,"paste",function(ee){if(ft(l,ee)||ce(ee,l))return;l.state.pasteIncoming=+new Date,c.fastPoll()});function G(ee){if(ft(l,ee))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ae=Se(l);re({lineWise:!0,text:ae.text}),ee.type=="cut"?l.setSelections(ae.ranges,null,we):(c.prevInput="",y.value=ae.text.join(`
|
|
`),F(y))}else return;ee.type=="cut"&&(l.state.cutIncoming=+new Date)}Ze(y,"cut",G),Ze(y,"copy",G),Ze(e.scroller,"paste",function(ee){if(kr(e,ee)||ft(l,ee))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,c.focus();return}var ae=new Event("paste");ae.clipboardData=ee.clipboardData,y.dispatchEvent(ae)}),Ze(e.lineSpace,"selectstart",function(ee){kr(e,ee)||ge(ee)}),Ze(y,"compositionstart",function(){var ee=l.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:ee,range:l.markText(ee,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(y,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},ur.prototype.createField=function(e){this.wrapper=it(),this.textarea=this.wrapper.firstChild},ur.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ur.prototype.prepareSelection=function(){var e=this.cm,n=e.display,c=e.doc,l=Is(e);if(e.options.moveInputWithCursor){var y=xi(e,c.sel.primary().head,"div"),G=n.wrapper.getBoundingClientRect(),ee=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,y.top+ee.top-G.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,y.left+ee.left-G.left))}return l},ur.prototype.showSelection=function(e){var n=this.cm,c=n.display;h(c.cursorDiv,e.cursors),h(c.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ur.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var c=n.getSelection();this.textarea.value=c,n.state.focused&&F(this.textarea),$&&z>=9&&(this.hasSelection=c)}else e||(this.prevInput=this.textarea.value="",$&&z>=9&&(this.hasSelection=null))},ur.prototype.getField=function(){return this.textarea},ur.prototype.supportsTouch=function(){return!1},ur.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},ur.prototype.blur=function(){this.textarea.blur()},ur.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ur.prototype.receivedFocus=function(){this.slowPoll()},ur.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ur.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function c(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,c)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,c)},ur.prototype.poll=function(){var e=this,n=this.cm,c=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||ln(c)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var y=c.value;if(y==l&&!n.somethingSelected())return!1;if($&&z>=9&&this.hasSelection===y||u&&/[\uf700-\uf7ff]/.test(y))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var G=y.charCodeAt(0);if(G==8203&&!l&&(l="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var ee=0,ae=Math.min(l.length,y.length);ee<ae&&l.charCodeAt(ee)==y.charCodeAt(ee);)++ee;return ci(n,function(){de(n,y.slice(ee),l.length-ee,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
|
|
`)>-1?c.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ur.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ur.prototype.onKeyPress=function(){$&&z>=9&&(this.hasSelection=null),this.fastPoll()},ur.prototype.onContextMenu=function(e){var n=this,c=n.cm,l=c.display,y=n.textarea;n.contextMenuPending&&n.contextMenuPending();var G=Gi(c,e),ee=l.scroller.scrollTop;if(!G||g)return;var ae=c.options.resetSelectionOnContextMenu;ae&&c.doc.sel.contains(G)==-1&&Gr(c,ni)(c.doc,Fi(G),we);var oe=y.style.cssText,me=n.wrapper.style.cssText,We=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px;
|
|
z-index: 1000; background: `+($?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Qe;r&&(Qe=window.scrollY),l.input.focus(),r&&window.scrollTo(null,Qe),l.input.reset(),c.somethingSelected()||(y.value=n.prevInput=" "),n.contextMenuPending=ht,l.selForContextMenu=c.doc.sel,clearTimeout(l.detectingSelectAll);function _t(){if(y.selectionStart!=null){var Zt=c.somethingSelected(),mn="\u200B"+(Zt?y.value:"");y.value="\u21DA",y.value=mn,n.prevInput=Zt?"":"\u200B",y.selectionStart=1,y.selectionEnd=mn.length,l.selForContextMenu=c.doc.sel}}function ht(){if(n.contextMenuPending!=ht)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=me,y.style.cssText=oe,$&&z<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=ee),y.selectionStart!=null){(!$||$&&z<9)&&_t();var Zt=0,mn=function(){l.selForContextMenu==c.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&n.prevInput=="\u200B"?Gr(c,Qo)(c):Zt++<10?l.detectingSelectAll=setTimeout(mn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(mn,200)}}if($&&z>=9&&_t(),A){ue(e);var Bt=function(){At(window,"mouseup",Bt),setTimeout(ht,20)};Ze(window,"mouseup",Bt)}else setTimeout(ht,50)},ur.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ur.prototype.setUneditable=function(){},ur.prototype.needsContentAttribute=!1;function Mr(e,n){if(n=n?v(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var c=j();n.autofocus=c==e||e.getAttribute("autofocus")!=null&&c==document.body}function l(){e.value=ae.getValue()}var y;if(e.form&&(Ze(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var G=e.form;y=G.submit;try{var ee=G.submit=function(){l(),G.submit=y,G.submit(),G.submit=ee}}catch(oe){}}n.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ae=Hr(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},n);return ae}function Lr(e){e.off=At,e.on=Ze,e.wheelEventPixels=rs,e.Doc=ui,e.splitLines=vn,e.countColumn=H,e.findColumn=Oe,e.isWordChar=st,e.Pass=he,e.signal=dt,e.Line=bn,e.changeEnd=Yi,e.scrollbarModel=Ro,e.Pos=Ie,e.cmpPos=gt,e.modes=vr,e.mimeModes=ir,e.resolveMode=Jt,e.getMode=Ar,e.modeExtensions=Nn,e.extendMode=Tn,e.copyState=pr,e.startState=Pr,e.innerMode=_r,e.commands=Ea,e.keyMap=Li,e.keyName=fs,e.isModifierKey=Fa,e.lookupKey=Ii,e.normalizeKeyMap=ll,e.StringStream=yr,e.SharedTextMarker=ya,e.TextMarker=bi,e.LineWidget=Ma,e.e_preventDefault=ge,e.e_stopPropagation=Ee,e.e_stop=ue,e.addClass=W,e.contains=_,e.rmClass=E,e.keyNames=Wi}ql(Hr),ut(Hr);var Br="iter insert remove copy getEditor constructor".split(" ");for(var $r in ui.prototype)ui.prototype.hasOwnProperty($r)&&ie(Br,$r)<0&&(Hr.prototype[$r]=function(e){return function(){return e.apply(this.doc,arguments)}}(ui.prototype[$r]));return Ue(ui),Hr.inputStyles={textarea:ur,contenteditable:tt},Hr.defineMode=function(e){!Hr.defaults.mode&&e!="null"&&(Hr.defaults.mode=e),br.apply(this,arguments)},Hr.defineMIME=Rr,Hr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Hr.defineMIME("text/plain","null"),Hr.defineExtension=function(e,n){Hr.prototype[e]=n},Hr.defineDocExtension=function(e,n){ui.prototype[e]=n},Hr.fromTextArea=Mr,Lr(Hr),Hr.version="5.58.2",Hr})},WaYH:function(kt,Ae,U){"use strict";var te=U("rePB"),Q=U("Ff2n"),B=U("VTBJ"),J=U("1OyB"),K=U("vuIU"),N=U("JX7q"),$=U("Ji7U"),z=U("LK+K"),r=U("q1tI"),D=U("TSYQ"),p=U.n(D),g=U("sboe"),m=U("OZM5"),a=function(A){var P=A.prefixCls,E=A.level,b=A.isStart,h=A.isEnd;if(!E)return null;for(var f="".concat(P,"-indent-unit"),C=[],x=0;x<E;x+=1){var _;C.push(r.createElement("span",{key:x,className:p()(f,(_={},Object(te.a)(_,"".concat(f,"-start"),b[x+1]),Object(te.a)(_,"".concat(f,"-end"),h[x+1]),Object(te.a)(_,"".concat(f,"-end-first-level"),!x&&h[0]),_))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(P,"-indent")},C)},d=a,s=U("815F"),i="open",t="close",u="---",o=function(S){Object($.a)(P,S);var A=Object(z.a)(P);function P(){var E;return Object(J.a)(this,P),E=A.apply(this,arguments),E.state={dragNodeHighlight:!1},E.onSelectorClick=function(b){var h=E.props.context.onNodeClick;h(b,Object(s.b)(E.props)),E.isSelectable()?E.onSelect(b):E.onCheck(b)},E.onSelectorDoubleClick=function(b){var h=E.props.context.onNodeDoubleClick;h(b,Object(s.b)(E.props))},E.onSelect=function(b){if(E.isDisabled())return;var h=E.props.context.onNodeSelect;b.preventDefault(),h(b,Object(s.b)(E.props))},E.onCheck=function(b){if(E.isDisabled())return;var h=E.props,f=h.disableCheckbox,C=h.checked,x=E.props.context.onNodeCheck;if(!E.isCheckable()||f)return;b.preventDefault();var _=!C;x(b,Object(s.b)(E.props),_)},E.onMouseEnter=function(b){var h=E.props.context.onNodeMouseEnter;h(b,Object(s.b)(E.props))},E.onMouseLeave=function(b){var h=E.props.context.onNodeMouseLeave;h(b,Object(s.b)(E.props))},E.onContextMenu=function(b){var h=E.props.context.onNodeContextMenu;h(b,Object(s.b)(E.props))},E.onDragStart=function(b){var h=E.props.context.onNodeDragStart;b.stopPropagation(),E.setState({dragNodeHighlight:!0}),h(b,Object(N.a)(E));try{b.dataTransfer.setData("text/plain","")}catch(f){}},E.onDragEnter=function(b){var h=E.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),h(b,Object(N.a)(E))},E.onDragOver=function(b){var h=E.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),h(b,Object(N.a)(E))},E.onDragLeave=function(b){var h=E.props.context.onNodeDragLeave;b.stopPropagation(),h(b,Object(N.a)(E))},E.onDragEnd=function(b){var h=E.props.context.onNodeDragEnd;b.stopPropagation(),E.setState({dragNodeHighlight:!1}),h(b,Object(N.a)(E))},E.onDrop=function(b){var h=E.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),E.setState({dragNodeHighlight:!1}),h(b,Object(N.a)(E))},E.onExpand=function(b){var h=E.props.context.onNodeExpand;h(b,Object(s.b)(E.props))},E.setSelectHandle=function(b){E.selectHandle=b},E.getNodeState=function(){var b=E.props.expanded;return E.isLeaf()?null:b?i:t},E.hasChildren=function(){var b=E.props.eventKey,h=E.props.context.keyEntities,f=h[b]||{},C=f.children;return!!(C||[]).length},E.isLeaf=function(){var b=E.props,h=b.isLeaf,f=b.loaded,C=E.props.context.loadData,x=E.hasChildren();return h===!1?!1:h||!C&&!x||C&&f&&!x},E.isDisabled=function(){var b=E.props.disabled,h=E.props.context.disabled;return!!(h||b)},E.isCheckable=function(){var b=E.props.checkable,h=E.props.context.checkable;return!h||b===!1?!1:h},E.syncLoadData=function(b){var h=b.expanded,f=b.loading,C=b.loaded,x=E.props.context,_=x.loadData,j=x.onNodeLoad;if(f)return;_&&h&&!E.isLeaf()&&(!E.hasChildren()&&!C&&j(Object(s.b)(E.props)))},E.renderSwitcher=function(){var b=E.props,h=b.expanded,f=b.switcherIcon,C=E.props.context,x=C.prefixCls,_=C.switcherIcon,j=f||_;if(E.isLeaf())return r.createElement("span",{className:p()("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof j=="function"?j(Object(B.a)(Object(B.a)({},E.props),{},{isLeaf:!0})):j);var W=p()("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(h?i:t));return r.createElement("span",{onClick:E.onExpand,className:W},typeof j=="function"?j(Object(B.a)(Object(B.a)({},E.props),{},{isLeaf:!1})):j)},E.renderCheckbox=function(){var b=E.props,h=b.checked,f=b.halfChecked,C=b.disableCheckbox,x=E.props.context.prefixCls,_=E.isDisabled(),j=E.isCheckable();if(!j)return null;var W=typeof j!="boolean"?j:null;return r.createElement("span",{className:p()("".concat(x,"-checkbox"),h&&"".concat(x,"-checkbox-checked"),!h&&f&&"".concat(x,"-checkbox-indeterminate"),(_||C)&&"".concat(x,"-checkbox-disabled")),onClick:E.onCheck},W)},E.renderIcon=function(){var b=E.props.loading,h=E.props.context.prefixCls;return r.createElement("span",{className:p()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(E.getNodeState()||"docu"),b&&"".concat(h,"-icon_loading"))})},E.renderSelector=function(){var b=E.state.dragNodeHighlight,h=E.props,f=h.title,C=h.selected,x=h.icon,_=h.loading,j=h.data,W=E.props.context,w=W.prefixCls,F=W.showIcon,I=W.icon,v=W.draggable,H=W.loadData,Y=W.titleRender,ie=E.isDisabled(),le="".concat(w,"-node-content-wrapper"),he;if(F){var we=x||I;he=we?r.createElement("span",{className:p()("".concat(w,"-iconEle"),"".concat(w,"-icon__customize"))},typeof we=="function"?we(E.props):we):E.renderIcon()}else H&&_&&(he=E.renderIcon());var Pe;typeof f=="function"?Pe=f(j):Y?Pe=Y(j):Pe=f;var xe=r.createElement("span",{className:"".concat(w,"-title")},Pe);return r.createElement("span",{ref:E.setSelectHandle,title:typeof f=="string"?f:"",className:p()("".concat(le),"".concat(le,"-").concat(E.getNodeState()||"normal"),!ie&&(C||b)&&"".concat(w,"-node-selected"),!ie&&v&&"draggable"),draggable:!ie&&v||void 0,"aria-grabbed":!ie&&v||void 0,onMouseEnter:E.onMouseEnter,onMouseLeave:E.onMouseLeave,onContextMenu:E.onContextMenu,onClick:E.onSelectorClick,onDoubleClick:E.onSelectorDoubleClick,onDragStart:v?E.onDragStart:void 0},he,xe)},E}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 b=this.props.selectable,h=this.props.context.selectable;return typeof b=="boolean"?b:h}},{key:"render",value:function(){var b,h=this.props,f=h.eventKey,C=h.className,x=h.style,_=h.dragOver,j=h.dragOverGapTop,W=h.dragOverGapBottom,w=h.isLeaf,F=h.isStart,I=h.isEnd,v=h.expanded,H=h.selected,Y=h.checked,ie=h.halfChecked,le=h.loading,he=h.domRef,we=h.active,Pe=h.onMouseMove,xe=Object(Q.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Oe=this.props.context,pe=Oe.prefixCls,be=Oe.filterTreeNode,ne=Oe.draggable,fe=Oe.keyEntities,_e=this.isDisabled(),ke=Object(m.f)(xe),qe=fe[f]||{},je=qe.level,st=I[I.length-1];return r.createElement("div",Object.assign({ref:he,className:p()(C,"".concat(pe,"-treenode"),(b={},Object(te.a)(b,"".concat(pe,"-treenode-disabled"),_e),Object(te.a)(b,"".concat(pe,"-treenode-switcher-").concat(v?"open":"close"),!w),Object(te.a)(b,"".concat(pe,"-treenode-checkbox-checked"),Y),Object(te.a)(b,"".concat(pe,"-treenode-checkbox-indeterminate"),ie),Object(te.a)(b,"".concat(pe,"-treenode-selected"),H),Object(te.a)(b,"".concat(pe,"-treenode-loading"),le),Object(te.a)(b,"".concat(pe,"-treenode-active"),we),Object(te.a)(b,"".concat(pe,"-treenode-leaf-last"),st),Object(te.a)(b,"drag-over",!_e&&_),Object(te.a)(b,"drag-over-gap-top",!_e&&j),Object(te.a)(b,"drag-over-gap-bottom",!_e&&W),Object(te.a)(b,"filter-node",be&&be(Object(s.b)(this.props))),b)),style:x,onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0,onMouseMove:Pe},ke),r.createElement(d,{prefixCls:pe,level:je,isStart:F,isEnd:I}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),P}(r.Component),R=function(A){return r.createElement(g.a.Consumer,null,function(P){return r.createElement(o,Object.assign({},A,{context:P}))})};R.displayName="TreeNode",R.defaultProps={title:u},R.isTreeNode=1;var T=Ae.a=R},XIdC:function(kt,Ae,U){"use strict";var te=U("rePB"),Q=U("ODXe"),B=U("Ff2n"),J=U("q1tI"),K=U.n(J),N=U("TSYQ"),$=U.n(N),z=U("6cGi"),r=U("4IlW"),D=J.forwardRef(function(p,g){var m,a=p.prefixCls,d=a===void 0?"rc-switch":a,s=p.className,i=p.checked,t=p.defaultChecked,u=p.disabled,o=p.loadingIcon,R=p.checkedChildren,T=p.unCheckedChildren,S=p.onClick,A=p.onChange,P=p.onKeyDown,E=Object(B.a)(p,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(z.a)(!1,{value:i,defaultValue:t}),h=Object(Q.a)(b,2),f=h[0],C=h[1];function x(w,F){var I=f;return u||(I=w,C(I),A==null||A(I,F)),I}function _(w){w.which===r.a.LEFT?x(!1,w):w.which===r.a.RIGHT&&x(!0,w),P==null||P(w)}function j(w){var F=x(!f,w);S==null||S(F,w)}var W=$()(d,s,(m={},Object(te.a)(m,"".concat(d,"-checked"),f),Object(te.a)(m,"".concat(d,"-disabled"),u),m));return J.createElement("button",Object.assign({},E,{type:"button",role:"switch","aria-checked":f,disabled:u,className:W,ref:g,onKeyDown:_,onClick:j}),o,J.createElement("span",{className:"".concat(d,"-inner")},f?R:T))});D.displayName="Switch",Ae.a=D},Y1PL:function(kt,Ae,U){"use strict";U.r(Ae),U.d(Ae,"ResizableTextArea",function(){return ie});var te=U("wx14"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("LK+K"),N=U("q1tI"),$=U("VTBJ"),z=U("rePB"),r=U("Zm9Q"),D=U("Kwbf"),p=U("c+Xe"),g=U("m+aA"),m=U("bdgK"),a=new Map;function d(we){we.forEach(function(Pe){var xe,Oe=Pe.target;(xe=a.get(Oe))===null||xe===void 0||xe.forEach(function(pe){return pe(Oe)})})}var s=new m.default(d),i=null,t=null;function u(we,Pe){a.has(we)||(a.set(we,new Set),s.observe(we)),a.get(we).add(Pe)}function o(we,Pe){a.has(we)&&(a.get(we).delete(Pe),a.get(we).size||(s.unobserve(we),a.delete(we)))}var R=function(we){Object(J.a)(xe,we);var Pe=Object(K.a)(xe);function xe(){return Object(Q.a)(this,xe),Pe.apply(this,arguments)}return Object(B.a)(xe,[{key:"render",value:function(){return this.props.children}}]),xe}(N.Component),T=N.createContext(null);function S(we){var Pe=we.children,xe=we.onBatchResize,Oe=N.useRef(0),pe=N.useRef([]),be=N.useContext(T),ne=N.useCallback(function(fe,_e,ke){Oe.current+=1;var qe=Oe.current;pe.current.push({size:fe,element:_e,data:ke}),Promise.resolve().then(function(){qe===Oe.current&&(xe==null||xe(pe.current),pe.current=[])}),be==null||be(fe,_e,ke)},[xe,be]);return N.createElement(T.Provider,{value:ne},Pe)}function A(we){var Pe=we.children,xe=we.disabled,Oe=N.useRef(null),pe=N.useRef(null),be=N.useContext(T),ne=N.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=N.isValidElement(Pe)&&Object(p.c)(Pe),_e=fe?Pe.ref:null,ke=N.useMemo(function(){return Object(p.a)(_e,Oe)},[_e,Oe]),qe=N.useRef(we);qe.current=we;var je=N.useCallback(function(st){var vt=qe.current,Re=vt.onResize,Be=vt.data,Ye=st.getBoundingClientRect(),Ke=Ye.width,yt=Ye.height,Pt=st.offsetWidth,Ht=st.offsetHeight,Xt=Math.floor(Ke),an=Math.floor(yt);if(ne.current.width!==Xt||ne.current.height!==an||ne.current.offsetWidth!==Pt||ne.current.offsetHeight!==Ht){var tn={width:Xt,height:an,offsetWidth:Pt,offsetHeight:Ht};ne.current=tn;var et=Pt===Math.round(Ke)?Ke:Pt,Ze=Ht===Math.round(yt)?yt:Ht,Ct=Object($.a)(Object($.a)({},tn),{},{offsetWidth:et,offsetHeight:Ze});be==null||be(Ct,st,Be),Re&&Promise.resolve().then(function(){Re(Ct,st)})}},[]);return N.useEffect(function(){var st=Object(g.a)(Oe.current)||Object(g.a)(pe.current);return st&&!xe&&u(st,je),function(){return o(st,je)}},[Oe.current,xe]),N.createElement(R,{ref:pe},fe?N.cloneElement(Pe,{ref:ke}):Pe)}var P="rc-observer-key";function E(we){var Pe=we.children,xe=Object(r.a)(Pe);return xe.map(function(Oe,pe){var be=(Oe==null?void 0:Oe.key)||"".concat(P,"-").concat(pe);return N.createElement(A,Object(te.a)({},we,{key:be}),Oe)})}E.Collection=S;var b=E,h=U("bT9E"),f=U("TSYQ"),C=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 w(we){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=we.getAttribute("id")||we.getAttribute("data-reactid")||we.getAttribute("name");if(Pe&&j[xe])return j[xe];var Oe=window.getComputedStyle(we),pe=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),be=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),ne=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),fe=_.map(function(ke){return"".concat(ke,":").concat(Oe.getPropertyValue(ke))}).join(";"),_e={sizingStyle:fe,paddingSize:be,borderSize:ne,boxSizing:pe};return Pe&&xe&&(j[xe]=_e),_e}function F(we){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=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)),we.getAttribute("wrap")?W.setAttribute("wrap",we.getAttribute("wrap")):W.removeAttribute("wrap");var pe=w(we,Pe),be=pe.paddingSize,ne=pe.borderSize,fe=pe.boxSizing,_e=pe.sizingStyle;W.setAttribute("style","".concat(_e,";").concat(x)),W.value=we.value||we.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,qe=Number.MAX_SAFE_INTEGER,je=W.scrollHeight,st;if(fe==="border-box"?je+=ne:fe==="content-box"&&(je-=be),xe!==null||Oe!==null){W.value=" ";var vt=W.scrollHeight-be;xe!==null&&(ke=vt*xe,fe==="border-box"&&(ke=ke+be+ne),je=Math.max(ke,je)),Oe!==null&&(qe=vt*Oe,fe==="border-box"&&(qe=qe+be+ne),st=je>qe?"":"hidden",je=Math.min(qe,je))}return{height:je,minHeight:ke,maxHeight:qe,overflowY:st,resize:"none"}}var I=U("Gytx"),v=U.n(I),H;(function(we){we[we.NONE=0]="NONE",we[we.RESIZING=1]="RESIZING",we[we.RESIZED=2]="RESIZED"})(H||(H={}));var Y=function(we){Object(J.a)(xe,we);var Pe=Object(K.a)(xe);function xe(Oe){var pe;return Object(Q.a)(this,xe),pe=Pe.call(this,Oe),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(be){pe.textArea=be},pe.handleResize=function(be){var ne=pe.state.resizeStatus,fe=pe.props,_e=fe.autoSize,ke=fe.onResize;if(ne!==H.NONE)return;typeof ke=="function"&&ke(be),_e&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var be=pe.props.autoSize;if(!be||!pe.textArea)return;var ne=be.minRows,fe=be.maxRows,_e=F(pe.textArea,!1,ne,fe);pe.setState({textareaStyles:_e,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:H.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:H.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var be=pe.props,ne=be.prefixCls,fe=ne===void 0?"rc-textarea":ne,_e=be.autoSize,ke=be.onResize,qe=be.className,je=be.disabled,st=pe.state,vt=st.textareaStyles,Re=st.resizeStatus,Be=Object(h.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ye=C()(fe,qe,Object(z.a)({},"".concat(fe,"-disabled"),je));"value"in Be&&(Be.value=Be.value||"");var Ke=Object($.a)(Object($.a)(Object($.a)({},pe.props.style),vt),Re===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return N.createElement(b,{onResize:pe.handleResize,disabled:!(_e||ke)},N.createElement("textarea",Object(te.a)({},Be,{className:Ye,style:Ke,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:H.NONE},pe}return Object(B.a)(xe,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!v()(pe.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var pe=this.textArea.selectionStart,be=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,be)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),xe}(N.Component),ie=Y,le=function(we){Object(J.a)(xe,we);var Pe=Object(K.a)(xe);function xe(Oe){var pe;Object(Q.a)(this,xe),pe=Pe.call(this,Oe),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ne){pe.resizableTextArea=ne},pe.handleChange=function(ne){var fe=pe.props.onChange;pe.setValue(ne.target.value,function(){pe.resizableTextArea.resizeTextarea()}),fe&&fe(ne)},pe.handleKeyDown=function(ne){var fe=pe.props,_e=fe.onPressEnter,ke=fe.onKeyDown;ne.keyCode===13&&_e&&_e(ne),ke&&ke(ne)};var be=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return pe.state={value:be},pe}return Object(B.a)(xe,[{key:"setValue",value:function(pe,be){"value"in this.props||this.setState({value:pe},be)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return N.createElement(ie,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),xe}(N.Component),he=Ae.default=le},YIbm:function(kt,Ae,U){kt.exports={content:"content___24s9X"}},"YJx+":function(kt,Ae,U){kt.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(kt,Ae,U){"use strict";var te=U("+BJd"),Q=U("mr32"),B=U("14J3"),J=U("BMrR"),K=U("5NDa"),N=U("5rEg"),$=U("oBTY"),z=U("5Dmo"),r=U("3S7+"),D=U("miYZ"),p=U("tsqr"),g=U("tJVT"),m=U("q1tI"),a=U.n(m),d=function(i){var t,u,o=i.value,R=o===void 0?[[],[]]:o,T=i.onChange,S=Object(m.useState)(""),A=Object(g.a)(S,2),P=A[0],E=A[1],b=Object(m.useState)(""),h=Object(g.a)(b,2),f=h[0],C=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)?(p.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):j==="|"?(p.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0};return a.a.createElement("div",null,a.a.createElement("p",{className:"font14"},"\u5173\u952E\u8BCD",a.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5173\u952E\u8BCD\u53EF\u7528\u4E8E\u81EA\u52A8\u5224\u5206\uFF09"),a.a.createElement(r.a,{overlayStyle:{maxWidth:350},title:a.a.createElement("div",null,a.a.createElement("div",null,"\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD\u7684\u5206\u6570\u662F\u666E\u901A\u5173\u952E\u8BCD\u5206\u6570\u7684\u4E24\u500D"),a.a.createElement("div",null,"\u4F8B\u5982\uFF1A"),a.a.createElement("div",null,"\u672C\u989810\u5206\uFF0C\u666E\u901A\u5173\u952E\u8BCD1\u4E2A\uFF0C\u6838\u5FC3\u5173\u952E\u8BCD2\u4E2A\uFF0C\u5219\u6BCF\u4E2A"),a.a.createElement("div",null,"\u666E\u901A\u5173\u952E\u8BCD2\u5206\uFF0C\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD4\u5206"))},a.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2 font14"}))),a.a.createElement(J.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",a.a.createElement(N.a,{value:P,onChange:function(j){E(j.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(j){var W,w=(W=j.target)===null||W===void 0?void 0:W.value;if(x(w)){var F,I;(F=R[0])===null||F===void 0||F.push(w==null||((I=w.split("|"))===null||I===void 0)?void 0:I.filter(function(v){return!!v})),T(Object($.a)(R)),E("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((t=R[0])===null||t===void 0)?void 0:t.map(function(_,j){return a.a.createElement(Q.a,{className:"mb10",key:j,closable:!0,onClose:function(w){var F;w.preventDefault(),R[0]=(F=R[0])===null||F===void 0?void 0:F.filter(function(I,v){return v!==j}),T(Object($.a)(R))}},_==null?void 0:_.join(" \u6216 "))})),a.a.createElement(J.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",a.a.createElement(N.a,{value:f,onChange:function(j){C(j.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(j){var W,w=(W=j.target)===null||W===void 0?void 0:W.value;if(x(w)){var F,I;(F=R[1])===null||F===void 0||F.push(w==null||((I=w.split("|"))===null||I===void 0)?void 0:I.filter(function(v){return!!v})),T(Object($.a)(R)),C("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((u=R[1])===null||u===void 0)?void 0:u.map(function(_,j){return a.a.createElement(Q.a,{className:"mb10",key:j,closable:!0,onClose:function(w){var F;w.preventDefault(),R[1]=(F=R[1])===null||F===void 0?void 0:F.filter(function(I,v){return v!==j}),T(Object($.a)(R))}},_==null?void 0:_.join(" \u6216 "))})))};Ae.a=d},ZW9T:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return I});var te=U("k1fw"),Q=U("oBTY"),B=U("miYZ"),J=U("tsqr"),K=U("rAM+"),N=U("tJVT"),$=U("PpiC"),z=U("q1tI"),r=U.n(z),D=U("bdgK"),p=U("9og8"),g=U("WmNS"),m=U.n(g),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},d={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},t=U("5VLF"),u=U.n(t),o={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(H,Y){return Y.map(function(ie){return{label:ie,kind:H.languages.CompletionItemKind.Keyword,insertText:ie}})},T=function(H){return Object.keys(o.tables).map(function(Y){return{label:Y,kind:H.languages.CompletionItemKind.Variable,insertText:Y}})},S=function(H,Y){var ie=o.tables[H];return ie?ie.map(function(le){return{label:le,kind:Y.languages.CompletionItemKind.Field,insertText:le}}):[]};function A(v,H,Y,ie,le){var he=H.getWordUntilPosition(Y),we={startLineNumber:Y.lineNumber,endLineNumber:Y.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Pe=ie.map(function(xe){return{label:xe,kind:v.languages.CompletionItemKind.Keyword,insertText:xe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}});return le.map(function(xe){Pe.push(Object(te.a)(Object(te.a)({},xe),{},{range:we}))}),Pe}var P=function(v){o.languages.map(function(le){return v.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(we,Pe,xe){return Object(p.a)(m.a.mark(function Oe(){var pe;return m.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return pe=u()(we.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:we.getFullModelRange(),text:pe}]);case 2:case"end":return ne.stop()}},Oe)}))()}}),le});var H=s.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=i.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=d.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}});v.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(he,we){var Pe=he.getWordUntilPosition(we),xe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Oe=he.getLineContent(we.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(Q.a)(s.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(Q.a)(s.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),v.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(he,we){var Pe=he.getWordUntilPosition(we),xe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn};return{suggestions:Object(Q.a)(a.keywords.map(function(Oe){return{label:Oe,kind:v.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}}))}}}),v.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(he,we){var Pe=he.getWordUntilPosition(we),xe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Oe=he.getLineContent(we.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(Q.a)(d.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(Q.a)(d.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),v.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(he,we){var Pe=he.getWordUntilPosition(we),xe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Oe=he.getLineContent(we.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(Q.a)(i.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(Q.a)(i.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=U("fjLI"),h=U("LvDl"),f=U("+ua5");function C(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function 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 v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=v;if(Array.isArray(v)){for(var Y=0;Y<v.length;Y++){var ie=j[v[Y]];if(ie)return ie}return H[0]}return j[H]||H}var w=null,F=Ae.b=function(v){var H=v.width,Y=H===void 0?"100%":H,ie=v.height,le=ie===void 0?"100%":ie,he=v.value,we=v.language,Pe=we===void 0?"javascript":we,xe=v.style,Oe=xe===void 0?{}:xe,pe=v.options,be=pe===void 0?{}:pe,ne=v.overrideServices,fe=ne===void 0?{}:ne,_e=v.theme,ke=_e===void 0?"vs-dark":_e,qe=v.onEditBlur,je=v.onSave,st=v.autoHeight,vt=st===void 0?!1:st,Re=v.forbidCopy,Be=Re===void 0?!1:Re,Ye=v.onChange,Ke=Ye===void 0?x:Ye,yt=v.editorDidMount,Pt=yt===void 0?x:yt,Ht=v.onFocus,Xt=Ht===void 0?x:Ht,an=v.filename,tn=an===void 0?"educoder.txt":an,et=v.errorLine,Ze=v.errorContent,Ct=Ze===void 0?"":Ze,At=Object($.a)(v,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),dt=Object(z.useRef)(),ft=Object(z.useRef)({}),He=Object(z.useRef)(),Ne=Object(z.useRef)(),Ue=Object(z.useRef)(!1),ge=Object(z.useRef)(),Ee=Object(z.useState)(!1),De=Object(N.a)(Ee,2),ue=De[0],Fe=De[1];function at(){var Nn;return dt.current&&(Nn=new D.default(function(Tn){var pr=Object(K.a)(Tn),_r;try{for(pr.s();!(_r=pr.n()).done;){var Pr=_r.value;(Pr.target.offsetHeight>0||Pr.target.offsetWidth>0)&&ft.current.instance.layout()}}catch(yr){pr.e(yr)}finally{pr.f()}}),Nn.observe(dt.current)),Nn}function xt(){J.b.warn(decodeURIComponent(E))}var Gt=function(){var Tn=ft.current.instance;if(he!=null&&Tn&&ue){var pr=Tn.getModel();pr&&he!==pr.getValue()&&(_=!0,pr.setValue(he),Tn.layout(),_=!1)}};Object(z.useEffect)(function(){Ne.current&&clearTimeout(Ne.current),Ne.current=setTimeout(function(){Gt()},500)},[he,ue,ft.current]),Object(z.useEffect)(function(){if(et&&ft.current&&ft.current.instance){var Nn=ft.current.instance;Nn.changeViewZones(function(pr){var _r=document.createElement("div");_r.style.padding="10px 20px",_r.style.width="calc(100% - 20px)",_r.className="my-error-line-wrp",_r.innerHTML=Ct,pr.addZone({afterLineNumber:et||11,heightInLines:3,domNode:_r})});var Tn={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Nn.addOverlayWidget(Tn),Nn.revealPositionInCenter({lineNumber:20,column:1})}},[et,ft.current,ue]);function $t(){var Nn=ft.current.instance;if(Nn){var Tn=Nn.getSelection(),pr=ft.current.pastePos||{},_r=new w.Range(pr.startLineNumber||Tn.endLineNumber,pr.startColumn||Tn.endColumn,pr.endLineNumber||Tn.endLineNumber,pr.endColumn||Tn.endColumn);setTimeout(function(){Nn.executeEdits("",[{range:_r,text:""}])},300)}}function Yt(Nn){(window.navigator.platform.match("Mac")?Nn.metaKey:Nn.ctrlKey)&&Nn.keyCode==83&&(Nn.preventDefault(),je())}var $n=function(){if(vt&&ft.current.instance){var Tn=ft.current.instance.getContentHeight();Jt(Tn<le?le:Tn)}else Jt(le)};function vn(Nn){var Tn=document.createEvent("MouseEvents");Tn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Nn.dispatchEvent(Tn)}function ln(Nn,Tn){var pr=window.URL||window.webkitURL||window,_r=new Blob([Tn]),Pr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pr.href=pr.createObjectURL(_r),Pr.download=Nn,vn(Pr)}Object(z.useEffect)(function(){$n()},[$n]),Object(z.useEffect)(function(){dt.current&&!ue&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(Nn){try{w=Nn,ft.current.instance=w.editor.create(dt.current,{value:he,language:W(Pe),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},fe);var Tn=ft.current.instance,pr=b.d._menuItems,_r=Object(Q.a)(pr).find(function(Ot){return Ot[0]._debugName=="EditorContext"}),Pr=_r[1],yr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],mt=function(Me,ye){var ve=Me._first;do{var or,en,Ie=ye.includes((or=ve.element)===null||or===void 0||((en=or.command)===null||en===void 0)?void 0:en.id);Ie&&Me._remove(ve)}while(ve=ve.next)};if(Pt(Tn,w),setTimeout(function(){$n(),ft.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ln(tn||"educoder.txt",Tn.getValue())}}),Tn.getDomNode().addEventListener("input",function(){He.current.autoFormat&&Tn.getAction("editor.action.formatDocument").run()})},500),ft.current.subscription=Tn.onDidChangeModelContent(function(Ot){Ue.current?clearTimeout(ge.current):($n(),Ke(Tn.getValue(),Ot)),ge.current=setTimeout(function(){Ue.current=!1},500)}),window.Monaco||P(w,W(Pe)),Be&&(mt(Pr,yr),dt.current.classList.add("noCopyPaste"),Tn.onKeyDown(function(Ot){var Me=Ot.keyCode,ye=Ot.ctrlKey,ve=Ot.metaKey;(Me===33||Me===52)&&(ve||ye)&&(xt(),Ot.preventDefault())})),window.Monaco=w,qe&&Tn.onDidBlurEditorWidget(function(){qe(Tn.getValue())}),Xt&&Tn.onDidFocusEditorText(function(){Xt(Tn.getValue())}),Be){Tn.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return xt(),null}),Tn.onDidPaste(function(Ot){ft.current.pastePos=Ot});try{window.addEventListener("paste",$t)}catch(Ot){}}var Ge=at();return Fe(!0),function(){var Ot=ft.current.instance;Ot.dispose();var Me=Ot.getModel();Me&&Me.dispose(),ft.current.subscription&&ft.current.subscription.dispose(),Be&&window.removeEventListener("paste",$t),Ge.unobserve(dt.current)}}catch(Ot){}})},[]),Object(z.useEffect)(function(){var Nn=ft.current.instance;if(Nn&&ue)return document.addEventListener("keydown",Yt,!1),function(){document.removeEventListener("keydown",Yt)}},[je,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;if(Nn&&ue){var Tn=W(Pe);w.editor.setModelLanguage(Nn.getModel(),Tn),console.log("language:",Pe,Nn.getModel(),Tn)}},[Pe,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;Nn&&ue&&w.editor.setTheme(ke)},[ke,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;He.current=be,Nn&&ue&&(Nn.updateOptions(Object(te.a)({},be)),setTimeout(function(){Nn.getModel().updateOptions(Object(te.a)({},be))},200))},[JSON.stringify(be),ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;Nn&&ue&&Nn.layout()},[Y,le,ue]);var hn=Object(z.useState)(C(Y)),Gn=Object(N.a)(hn,2),fr=Gn[0],vr=Gn[1],ir=Object(z.useState)(C(le)),br=Object(N.a)(ir,2),Rr=br[0],Jt=br[1],Ar=Object(te.a)(Object(te.a)({},Oe),{},{width:fr,height:Rr});return r.a.createElement("div",{className:"my-monaco-editor",ref:dt,style:Ar})};function I(v){var H=v.width,Y=H===void 0?"100%":H,ie=v.height,le=ie===void 0?"100%":ie,he=v.original,we=v.modified,Pe=v.language,xe=v.options,Oe=xe===void 0?{}:xe,pe=Object(z.useRef)(),be=Object(z.useState)(null),ne=Object(N.a)(be,2),fe=ne[0],_e=ne[1];function ke(vt){var Re;return pe.current&&(Re=new D.default(function(Be){var Ye=Object(K.a)(Be),Ke;try{for(Ye.s();!(Ke=Ye.n()).done;){var yt=Ke.value;(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&vt.layout()}}catch(Pt){Ye.e(Pt)}finally{Ye.f()}}),Re.observe(pe.current)),Re}Object(z.useEffect)(function(){pe.current&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(vt){w=vt;var Re=w.editor.createDiffEditor(pe.current,Object(te.a)(Object(te.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));_e(Re);var Be=ke(Re);return function(){Re.dispose();var Ye=Re.getModel();Ye&&Ye.dispose(),Be.unobserve(pe.current)}})},[]),Object(z.useEffect)(function(){fe&&fe.setModel({original:w.editor.createModel(he,Pe),modified:w.editor.createModel(we,Pe)})},[he,we,Pe,fe]);var qe=C(Y),je=C(le),st={width:qe,height:je};return r.a.createElement("div",{className:"my-diff-editor",ref:pe,style:st})}},ZWs3:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return p});var te=U("+L6B"),Q=U("2/Rp"),B=U("0Owb"),J=U("9og8"),K=U("tJVT"),N=U("PpiC"),$=U("WmNS"),z=U.n($),r=U("q1tI"),D=U.n(r),p=function(m){var a=m.children,d=Object(N.a)(m,["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)({},d,{loading:t,onClick:function(){var o=Object(J.a)(z.a.mark(function R(T){return z.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,u(!0),A.next=4,d.onClick(T);case 4:u(!1),A.next=10;break;case 7:A.prev=7,A.t0=A.catch(0),u(!1);case 10:case"end":return A.stop()}},R,null,[[0,7]])}));return function(R){return o.apply(this,arguments)}}()}),a)}},ZpRC:function(kt,Ae,U){"use strict";function te(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function Q(p,g){return(!g||p!=="hidden")&&p!=="visible"&&p!=="clip"}function B(p,g){if(p.clientHeight<p.scrollHeight||p.clientWidth<p.scrollWidth){var m=getComputedStyle(p,null);return Q(m.overflowY,g)||Q(m.overflowX,g)||function(a){var d=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(i){return null}}(a);return!!d&&(d.clientHeight<a.scrollHeight||d.clientWidth<a.scrollWidth)}(p)}return!1}function J(p,g,m,a,d,s,i,t){return s<p&&i>g||s>p&&i<g?0:s<=p&&t<=m||i>=g&&t>=m?s-p-a:i>g&&t<m||s<p&&t>m?i-g+d:0}var K=function(p,g){var m=window,a=g.scrollMode,d=g.block,s=g.inline,i=g.boundary,t=g.skipOverflowHiddenElements,u=typeof i=="function"?i:function(vt){return vt!==i};if(!te(p))throw new TypeError("Invalid target");for(var o=document.scrollingElement||document.documentElement,R=[],T=p;te(T)&&u(T);){if((T=T.parentElement)===o){R.push(T);break}T!=null&&T===document.body&&B(T)&&!B(document.documentElement)||T!=null&&B(T,t)&&R.push(T)}for(var S=m.visualViewport?m.visualViewport.width:innerWidth,A=m.visualViewport?m.visualViewport.height:innerHeight,P=window.scrollX||pageXOffset,E=window.scrollY||pageYOffset,b=p.getBoundingClientRect(),h=b.height,f=b.width,C=b.top,x=b.right,_=b.bottom,j=b.left,W=d==="start"||d==="nearest"?C:d==="end"?_:C+h/2,w=s==="center"?j+f/2:s==="end"?x:j,F=[],I=0;I<R.length;I++){var v=R[I],H=v.getBoundingClientRect(),Y=H.height,ie=H.width,le=H.top,he=H.right,we=H.bottom,Pe=H.left;if(a==="if-needed"&&C>=0&&j>=0&&_<=A&&x<=S&&C>=le&&_<=we&&j>=Pe&&x<=he)return F;var xe=getComputedStyle(v),Oe=parseInt(xe.borderLeftWidth,10),pe=parseInt(xe.borderTopWidth,10),be=parseInt(xe.borderRightWidth,10),ne=parseInt(xe.borderBottomWidth,10),fe=0,_e=0,ke="offsetWidth"in v?v.offsetWidth-v.clientWidth-Oe-be:0,qe="offsetHeight"in v?v.offsetHeight-v.clientHeight-pe-ne:0;if(o===v)fe=d==="start"?W:d==="end"?W-A:d==="nearest"?J(E,E+A,A,pe,ne,E+W,E+W+h,h):W-A/2,_e=s==="start"?w:s==="center"?w-S/2:s==="end"?w-S:J(P,P+S,S,Oe,be,P+w,P+w+f,f),fe=Math.max(0,fe+E),_e=Math.max(0,_e+P);else{fe=d==="start"?W-le-pe:d==="end"?W-we+ne+qe:d==="nearest"?J(le,we,Y,pe,ne+qe,W,W+h,h):W-(le+Y/2)+qe/2,_e=s==="start"?w-Pe-Oe:s==="center"?w-(Pe+ie/2)+ke/2:s==="end"?w-he+be+ke:J(Pe,he,ie,Oe,be+ke,w,w+f,f);var je=v.scrollLeft,st=v.scrollTop;W+=st-(fe=Math.max(0,Math.min(st+fe,v.scrollHeight-Y+qe))),w+=je-(_e=Math.max(0,Math.min(je+_e,v.scrollWidth-ie+ke)))}F.push({el:v,top:fe,left:_e})}return F};function N(p){return p===Object(p)&&Object.keys(p).length!==0}function $(p,g){g===void 0&&(g="auto");var m="scrollBehavior"in document.body.style;p.forEach(function(a){var d=a.el,s=a.top,i=a.left;d.scroll&&m?d.scroll({top:s,left:i,behavior:g}):(d.scrollTop=s,d.scrollLeft=i)})}function z(p){return p===!1?{block:"end",inline:"nearest"}:N(p)?p:{block:"start",inline:"nearest"}}function r(p,g){var m=!p.ownerDocument.documentElement.contains(p);if(N(g)&&typeof g.behavior=="function")return g.behavior(m?[]:K(p,g));if(m)return;var a=z(g);return $(K(p,a),a.behavior)}var D=Ae.a=r},Zss7:function(kt,Ae,U){var te;(function(Q){var B=/^\s+/,J=/\s+$/,K=0,N=Q.round,$=Q.min,z=Q.max,r=Q.random;function D(ne,fe){if(ne=ne||"",fe=fe||{},ne instanceof D)return ne;if(!(this instanceof D))return new D(ne,fe);var _e=p(ne);this._originalInput=ne,this._r=_e.r,this._g=_e.g,this._b=_e.b,this._a=_e.a,this._roundA=N(100*this._a)/100,this._format=fe.format||_e.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=N(this._r)),this._g<1&&(this._g=N(this._g)),this._b<1&&(this._b=N(this._b)),this._ok=_e.ok,this._tc_id=K++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),fe,_e,ke,qe,je,st;return fe=ne.r/255,_e=ne.g/255,ke=ne.b/255,fe<=.03928?qe=fe/12.92:qe=Q.pow((fe+.055)/1.055,2.4),_e<=.03928?je=_e/12.92:je=Q.pow((_e+.055)/1.055,2.4),ke<=.03928?st=ke/12.92:st=Q.pow((ke+.055)/1.055,2.4),.2126*qe+.7152*je+.0722*st},setAlpha:function(ne){return this._a=F(ne),this._roundA=N(100*this._a)/100,this},toHsv:function(){var ne=d(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=d(this._r,this._g,this._b),fe=N(ne.h*360),_e=N(ne.s*100),ke=N(ne.v*100);return this._a==1?"hsv("+fe+", "+_e+"%, "+ke+"%)":"hsva("+fe+", "+_e+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var ne=m(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=m(this._r,this._g,this._b),fe=N(ne.h*360),_e=N(ne.s*100),ke=N(ne.l*100);return this._a==1?"hsl("+fe+", "+_e+"%, "+ke+"%)":"hsla("+fe+", "+_e+"%, "+ke+"%, "+this._roundA+")"},toHex:function(ne){return i(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return t(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:N(this._r),g:N(this._g),b:N(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+N(this._r)+", "+N(this._g)+", "+N(this._b)+")":"rgba("+N(this._r)+", "+N(this._g)+", "+N(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:N(I(this._r,255)*100)+"%",g:N(I(this._g,255)*100)+"%",b:N(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+N(I(this._r,255)*100)+"%, "+N(I(this._g,255)*100)+"%, "+N(I(this._b,255)*100)+"%)":"rgba("+N(I(this._r,255)*100)+"%, "+N(I(this._g,255)*100)+"%, "+N(I(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(ne){var fe="#"+u(this._r,this._g,this._b,this._a),_e=fe,ke=this._gradientType?"GradientType = 1, ":"";if(ne){var qe=D(ne);_e="#"+u(qe._r,qe._g,qe._b,qe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+_e+")"},toString:function(ne){var fe=!!ne;ne=ne||this._format;var _e=!1,ke=this._a<1&&this._a>=0,qe=!fe&&ke&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return qe?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(_e=this.toRgbString()),ne==="prgb"&&(_e=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(_e=this.toHexString()),ne==="hex3"&&(_e=this.toHexString(!0)),ne==="hex4"&&(_e=this.toHex8String(!0)),ne==="hex8"&&(_e=this.toHex8String()),ne==="name"&&(_e=this.toName()),ne==="hsl"&&(_e=this.toHslString()),ne==="hsv"&&(_e=this.toHsvString()),_e||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(ne,fe){var _e=ne.apply(null,[this].concat([].slice.call(fe)));return this._r=_e._r,this._g=_e._g,this._b=_e._b,this.setAlpha(_e._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(P,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(T,arguments)},spin:function(){return this._applyModification(E,arguments)},_applyCombination:function(ne,fe){return ne.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(h,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},D.fromRatio=function(ne,fe){if(typeof ne=="object"){var _e={};for(var ke in ne)ne.hasOwnProperty(ke)&&(ke==="a"?_e[ke]=ne[ke]:_e[ke]=he(ne[ke]));ne=_e}return D(ne,fe)};function p(ne){var fe={r:0,g:0,b:0},_e=1,ke=null,qe=null,je=null,st=!1,vt=!1;return typeof ne=="string"&&(ne=pe(ne)),typeof ne=="object"&&(Oe(ne.r)&&Oe(ne.g)&&Oe(ne.b)?(fe=g(ne.r,ne.g,ne.b),st=!0,vt=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Oe(ne.h)&&Oe(ne.s)&&Oe(ne.v)?(ke=he(ne.s),qe=he(ne.v),fe=s(ne.h,ke,qe),st=!0,vt="hsv"):Oe(ne.h)&&Oe(ne.s)&&Oe(ne.l)&&(ke=he(ne.s),je=he(ne.l),fe=a(ne.h,ke,je),st=!0,vt="hsl"),ne.hasOwnProperty("a")&&(_e=ne.a)),_e=F(_e),{ok:st,format:ne.format||vt,r:$(255,z(fe.r,0)),g:$(255,z(fe.g,0)),b:$(255,z(fe.b,0)),a:_e}}function g(ne,fe,_e){return{r:I(ne,255)*255,g:I(fe,255)*255,b:I(_e,255)*255}}function m(ne,fe,_e){ne=I(ne,255),fe=I(fe,255),_e=I(_e,255);var ke=z(ne,fe,_e),qe=$(ne,fe,_e),je,st,vt=(ke+qe)/2;if(ke==qe)je=st=0;else{var Re=ke-qe;st=vt>.5?Re/(2-ke-qe):Re/(ke+qe);switch(ke){case ne:je=(fe-_e)/Re+(fe<_e?6:0);break;case fe:je=(_e-ne)/Re+2;break;case _e:je=(ne-fe)/Re+4;break}je/=6}return{h:je,s:st,l:vt}}function a(ne,fe,_e){var ke,qe,je;ne=I(ne,360),fe=I(fe,100),_e=I(_e,100);function st(Be,Ye,Ke){return Ke<0&&(Ke+=1),Ke>1&&(Ke-=1),Ke<1/6?Be+(Ye-Be)*6*Ke:Ke<1/2?Ye:Ke<2/3?Be+(Ye-Be)*(2/3-Ke)*6:Be}if(fe===0)ke=qe=je=_e;else{var vt=_e<.5?_e*(1+fe):_e+fe-_e*fe,Re=2*_e-vt;ke=st(Re,vt,ne+1/3),qe=st(Re,vt,ne),je=st(Re,vt,ne-1/3)}return{r:ke*255,g:qe*255,b:je*255}}function d(ne,fe,_e){ne=I(ne,255),fe=I(fe,255),_e=I(_e,255);var ke=z(ne,fe,_e),qe=$(ne,fe,_e),je,st,vt=ke,Re=ke-qe;if(st=ke===0?0:Re/ke,ke==qe)je=0;else{switch(ke){case ne:je=(fe-_e)/Re+(fe<_e?6:0);break;case fe:je=(_e-ne)/Re+2;break;case _e:je=(ne-fe)/Re+4;break}je/=6}return{h:je,s:st,v:vt}}function s(ne,fe,_e){ne=I(ne,360)*6,fe=I(fe,100),_e=I(_e,100);var ke=Q.floor(ne),qe=ne-ke,je=_e*(1-fe),st=_e*(1-qe*fe),vt=_e*(1-(1-qe)*fe),Re=ke%6,Be=[_e,st,je,je,vt,_e][Re],Ye=[vt,_e,_e,st,je,je][Re],Ke=[je,je,vt,_e,_e,st][Re];return{r:Be*255,g:Ye*255,b:Ke*255}}function i(ne,fe,_e,ke){var qe=[le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16))];return ke&&qe[0].charAt(0)==qe[0].charAt(1)&&qe[1].charAt(0)==qe[1].charAt(1)&&qe[2].charAt(0)==qe[2].charAt(1)?qe[0].charAt(0)+qe[1].charAt(0)+qe[2].charAt(0):qe.join("")}function t(ne,fe,_e,ke,qe){var je=[le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16)),le(we(ke))];return qe&&je[0].charAt(0)==je[0].charAt(1)&&je[1].charAt(0)==je[1].charAt(1)&&je[2].charAt(0)==je[2].charAt(1)&&je[3].charAt(0)==je[3].charAt(1)?je[0].charAt(0)+je[1].charAt(0)+je[2].charAt(0)+je[3].charAt(0):je.join("")}function u(ne,fe,_e,ke){var qe=[le(we(ke)),le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16))];return qe.join("")}D.equals=function(ne,fe){return!ne||!fe?!1:D(ne).toRgbString()==D(fe).toRgbString()},D.random=function(){return D.fromRatio({r:r(),g:r(),b:r()})};function o(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.s-=fe/100,_e.s=v(_e.s),D(_e)}function R(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.s+=fe/100,_e.s=v(_e.s),D(_e)}function T(ne){return D(ne).desaturate(100)}function S(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.l+=fe/100,_e.l=v(_e.l),D(_e)}function A(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toRgb();return _e.r=z(0,$(255,_e.r-N(255*-(fe/100)))),_e.g=z(0,$(255,_e.g-N(255*-(fe/100)))),_e.b=z(0,$(255,_e.b-N(255*-(fe/100)))),D(_e)}function P(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.l-=fe/100,_e.l=v(_e.l),D(_e)}function E(ne,fe){var _e=D(ne).toHsl(),ke=(_e.h+fe)%360;return _e.h=ke<0?360+ke:ke,D(_e)}function b(ne){var fe=D(ne).toHsl();return fe.h=(fe.h+180)%360,D(fe)}function h(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+120)%360,s:fe.s,l:fe.l}),D({h:(_e+240)%360,s:fe.s,l:fe.l})]}function f(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+90)%360,s:fe.s,l:fe.l}),D({h:(_e+180)%360,s:fe.s,l:fe.l}),D({h:(_e+270)%360,s:fe.s,l:fe.l})]}function C(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+72)%360,s:fe.s,l:fe.l}),D({h:(_e+216)%360,s:fe.s,l:fe.l})]}function x(ne,fe,_e){fe=fe||6,_e=_e||30;var ke=D(ne).toHsl(),qe=360/_e,je=[D(ne)];for(ke.h=(ke.h-(qe*fe>>1)+720)%360;--fe;)ke.h=(ke.h+qe)%360,je.push(D(ke));return je}function _(ne,fe){fe=fe||6;for(var _e=D(ne).toHsv(),ke=_e.h,qe=_e.s,je=_e.v,st=[],vt=1/fe;fe--;)st.push(D({h:ke,s:qe,v:je})),je=(je+vt)%1;return st}D.mix=function(ne,fe,_e){_e=_e===0?0:_e||50;var ke=D(ne).toRgb(),qe=D(fe).toRgb(),je=_e/100,st={r:(qe.r-ke.r)*je+ke.r,g:(qe.g-ke.g)*je+ke.g,b:(qe.b-ke.b)*je+ke.b,a:(qe.a-ke.a)*je+ke.a};return D(st)},D.readability=function(ne,fe){var _e=D(ne),ke=D(fe);return(Q.max(_e.getLuminance(),ke.getLuminance())+.05)/(Q.min(_e.getLuminance(),ke.getLuminance())+.05)},D.isReadable=function(ne,fe,_e){var ke=D.readability(ne,fe),qe,je;je=!1,qe=be(_e);switch(qe.level+qe.size){case"AAsmall":case"AAAlarge":je=ke>=4.5;break;case"AAlarge":je=ke>=3;break;case"AAAsmall":je=ke>=7;break}return je},D.mostReadable=function(ne,fe,_e){var ke=null,qe=0,je,st,vt,Re;_e=_e||{},st=_e.includeFallbackColors,vt=_e.level,Re=_e.size;for(var Be=0;Be<fe.length;Be++)je=D.readability(ne,fe[Be]),je>qe&&(qe=je,ke=D(fe[Be]));return D.isReadable(ne,ke,{level:vt,size:Re})||!st?ke:(_e.includeFallbackColors=!1,D.mostReadable(ne,["#fff","#000"],_e))};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=w(j);function w(ne){var fe={};for(var _e in ne)ne.hasOwnProperty(_e)&&(fe[ne[_e]]=_e);return fe}function F(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function I(ne,fe){Y(ne)&&(ne="100%");var _e=ie(ne);return ne=$(fe,z(0,parseFloat(ne))),_e&&(ne=parseInt(ne*fe,10)/100),Q.abs(ne-fe)<1e-6?1:ne%fe/parseFloat(fe)}function v(ne){return $(1,z(0,ne))}function H(ne){return parseInt(ne,16)}function Y(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function ie(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function le(ne){return ne.length==1?"0"+ne:""+ne}function he(ne){return ne<=1&&(ne=ne*100+"%"),ne}function we(ne){return Q.round(parseFloat(ne)*255).toString(16)}function Pe(ne){return H(ne)/255}var xe=function(){var ne="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",_e="(?:"+fe+")|(?:"+ne+")",ke="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?",qe="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?";return{CSS_UNIT:new RegExp(_e),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+qe),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+qe),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Oe(ne){return!!xe.CSS_UNIT.exec(ne)}function pe(ne){ne=ne.replace(B,"").replace(J,"").toLowerCase();var fe=!1;if(j[ne])ne=j[ne],fe=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var _e;return(_e=xe.rgb.exec(ne))?{r:_e[1],g:_e[2],b:_e[3]}:(_e=xe.rgba.exec(ne))?{r:_e[1],g:_e[2],b:_e[3],a:_e[4]}:(_e=xe.hsl.exec(ne))?{h:_e[1],s:_e[2],l:_e[3]}:(_e=xe.hsla.exec(ne))?{h:_e[1],s:_e[2],l:_e[3],a:_e[4]}:(_e=xe.hsv.exec(ne))?{h:_e[1],s:_e[2],v:_e[3]}:(_e=xe.hsva.exec(ne))?{h:_e[1],s:_e[2],v:_e[3],a:_e[4]}:(_e=xe.hex8.exec(ne))?{r:H(_e[1]),g:H(_e[2]),b:H(_e[3]),a:Pe(_e[4]),format:fe?"name":"hex8"}:(_e=xe.hex6.exec(ne))?{r:H(_e[1]),g:H(_e[2]),b:H(_e[3]),format:fe?"name":"hex"}:(_e=xe.hex4.exec(ne))?{r:H(_e[1]+""+_e[1]),g:H(_e[2]+""+_e[2]),b:H(_e[3]+""+_e[3]),a:Pe(_e[4]+""+_e[4]),format:fe?"name":"hex8"}:(_e=xe.hex3.exec(ne))?{r:H(_e[1]+""+_e[1]),g:H(_e[2]+""+_e[2]),b:H(_e[3]+""+_e[3]),format:fe?"name":"hex"}:!1}function be(ne){var fe,_e;return ne=ne||{level:"AA",size:"small"},fe=(ne.level||"AA").toUpperCase(),_e=(ne.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),_e!=="small"&&_e!=="large"&&(_e="small"),{level:fe,size:_e}}kt.exports?kt.exports=D:!(te=function(){return D}.call(Ae,U,Ae,kt),te!==void 0&&(kt.exports=te))})(Math)},a99f:function(kt,Ae,U){"use strict";U.r(Ae);var te=U("T2oS"),Q=U("W9HT"),B=U("14J3"),J=U("BMrR"),K=U("jCWc"),N=U("kPKH"),$=U("sPJy"),z=U("bE4q"),r=U("k1fw"),D=U("oBTY"),p=U("miYZ"),g=U("tsqr"),m=U("9og8"),a=U("tJVT"),d=U("WmNS"),s=U.n(d),i=U("q1tI"),t=U.n(i),u=U("Ty5D"),o=U("9kvl"),R=U("55Ip"),T=U("LvDl"),S=U("bbsP"),A=U("/wGt"),P=U("DjyN"),E=U("NUBc"),b=U("/zsF"),h=U("PArb"),f=U("5Dmo"),C=U("3S7+"),x=U("sRBo"),_=U("kaz8"),j=U("+L6B"),W=U("2/Rp"),w=U("5NDa"),F=U("5rEg"),I=U("xKgJ"),v=U("kCvp"),H=U.n(v),Y=U("NLgs"),ie=U("9z17"),le=F.a.Search,he=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],we=[{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Pe=function(ue){var Fe,at=ue.classroomList,xt=ue.shixunsList,Gt=ue.dispatch,$t=ue.callback,Yt=ue.inNewPaperLibrary,$n=Object(i.useState)(Object(r.a)({},Object(u.i)())),vn=Object(a.a)($n,2),ln=vn[0],hn=vn[1],Gn=at.shixunLists,fr=Object(i.useState)([]),vr=Object(a.a)(fr,2),ir=vr[0],br=vr[1],Rr=Object(i.useState)(""),Jt=Object(a.a)(Rr,2),Ar=Jt[0],Nn=Jt[1],Tn=Object(i.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),pr=Object(a.a)(Tn,2),_r=pr[0],Pr=pr[1];Object(i.useEffect)(function(){return at.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?document.body.setAttribute("data-custom","height"):document.body.removeAttribute("data-custom"),function(){document.body.removeAttribute("data-custom")}},[at.actionTabs.key]);var yr=at.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(i.useEffect)(function(){yr&&Gt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})},[ln.categoryId,yr,_r]),Object(i.useEffect)(function(){Gt({type:"shixunsList/getMenus",payload:{}})},[]),Object(i.useEffect)(function(){br([])},[at.actionTabs.key]);var mt=Object(ie.b)(),Ge=Object(a.a)(mt,4),Ot=Ge[0],Me=Ge[1],ye=Ge[2],ve=Ge[3],or=function(gt,Ce,cn){_r.tag_level=gt,_r.sub_discipline_id=Ce,_r.discipline_id=cn,Pr(Object(r.a)({},_r))},en=function(){var Ie=Object(m.a)(s.a.mark(function gt(Ce){var cn,hr;return s.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:$t&&$t(Gn==null||((cn=Gn.shixun_list)===null||cn===void 0)?void 0:cn.filter(function(O){return O.identifier===ir[0]})[0],(hr=at.actionTabs)===null||hr===void 0?void 0:hr.editData,Ce),Gt({type:"classroomList/setActionTabs",payload:{}}),Me();case 3:case"end":return q.stop()}},gt)}));return function(Ce){return Ie.apply(this,arguments)}}();return at.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:t.a.createElement(A.a,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!0,onClose:function(){Gt({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!yr,key:"bottom",className:H.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(W.a,{size:"large",onClick:function(){Gt({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(W.a,{size:"large",onClick:Object(m.a)(s.a.mark(function Ie(){var gt;return s.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(!(ir.length>1)){cn.next=4;break}g.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),cn.next=16;break;case 4:if(!(ir.length===0)){cn.next=8;break}g.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),cn.next=16;break;case 8:if(!Yt){cn.next=12;break}en(0),cn.next=16;break;case 12:return cn.next=14,ve({id:ir[0],course_id:ln.coursesId,type:"shixun"});case 14:gt=cn.sent,gt||en(0);case 16:case"end":return cn.stop()}},Ie)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(le,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Ar,onChange:function(gt){return Nn(gt.target.value)},className:H.a.search,onSearch:function(gt){_r.keyword=gt,_r.page=1,Pr(Object(r.a)({},_r))}})),t.a.createElement("section",{className:"edu-container"},he.map(function(Ie,gt){var Ce;return t.a.createElement("ul",{className:H.a.menu,key:gt},t.a.createElement("li",null,Ie.name),Ie==null||((Ce=Ie.children)===null||Ce===void 0)?void 0:Ce.map(function(cn,hr){return t.a.createElement("li",{key:hr,className:_r[Ie.id]==cn.id?H.a.actived:"",onClick:function(){_r[Ie.id]=cn.id,Pr(Object(r.a)({},_r)),Gt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})}},t.a.createElement("strong",null,cn.name))}))}),t.a.createElement("ul",{className:H.a.menut},t.a.createElement("span",{style:{padding:"18px",fontWeight:"600"}},"\u65B9\u5411\uFF1A"),t.a.createElement("li",{className:_r.discipline_id?"":H.a.actived3,onClick:function(){or(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),xt.menus&&xt.menus.map(function(Ie,gt){return t.a.createElement("li",{key:gt,className:_r.discipline_id==Ie.id?H.a.actived3:""},t.a.createElement("strong",{onClick:function(){or(1,null,Ie.id)}},Ie.name),t.a.createElement("div",null,Ie.sub_repertoires.map(function(Ce,cn){return t.a.createElement("div",{key:cn,className:"mt5"},t.a.createElement("div",{className:_r.sub_discipline_id==Ce.id?"".concat(H.a.actived4," ").concat(H.a.subTag):H.a.subTag,onClick:function(){or(2,Ce.id,Ie.id)}},Ce.name),t.a.createElement("ul",{className:"mt5"},Ce.tags&&Ce.tags.map(function(hr,mr){return t.a.createElement("li",{key:mr,className:_r.sub_discipline_id==hr.id?H.a.actived4:"",onClick:function(){or(3,hr.id,Ie.id)}},hr.name)})))})))})),we.map(function(Ie,gt){var Ce;return t.a.createElement("ul",{className:H.a.menu,key:gt},t.a.createElement("li",null,Ie.name),Ie==null||((Ce=Ie.children)===null||Ce===void 0)?void 0:Ce.map(function(cn,hr){return t.a.createElement("li",{key:hr,className:_r[Ie.id]==cn.id?H.a.actived:"",onClick:function(){_r[Ie.id]=cn.id,Pr(Object(r.a)({},_r)),Gt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})}},t.a.createElement("strong",null,cn.name))}))}),t.a.createElement("div",{className:H.a.menuCourse,style:{margin:"0px 15px"}},t.a.createElement("ul",null,t.a.createElement("li",null,"\u5DF2\u9009",t.a.createElement("span",{className:"c-blue"},ir.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},Gn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){_r.order=_r.order==="asc"?"desc":"asc",Pr(Object(r.a)({},_r))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(_r.order)},_r.order==="asc"?t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))),t.a.createElement(_.a.Group,{style:{display:"block"},value:ir,onChange:function(gt){br(gt)}},Gn==null||((Fe=Gn.shixun_list)===null||Fe===void 0)?void 0:Fe.map(function(Ie,gt){return t.a.createElement("div",{className:H.a.listItem,key:Ie.identifier},t.a.createElement(_.a,{value:Ie.identifier,disabled:Ie==null?void 0:Ie.need_authorize}),t.a.createElement("div",{className:H.a.info},t.a.createElement("div",{className:H.a.title},t.a.createElement("div",{className:H.a.titleLeft},t.a.createElement(R.a,{to:"/shixuns/".concat(Ie.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Ie.title}})),(Ie==null?void 0:Ie.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(Y.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(I.v)()&&(Ie==null?void 0:Ie.mark_status)===1&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(I.v)()&&(Ie==null?void 0:Ie.mark_status)===2&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(I.v)()&&(Ie==null?void 0:Ie.mark_status)===3&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),t.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},t.a.createElement("span",{className:H.a.description,dangerouslySetInnerHTML:{__html:Ie.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},Ie.challenge_names.map(function(Ce,cn){return t.a.createElement("span",{key:cn,className:"mr30"},"\u7B2C",cn+1,"\u5173 ",Ce," ")})),t.a.createElement(h.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,Ie.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,Ie.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Ie.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,Ie.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(E.a,{defaultCurrent:1,current:_r.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:Gn==null?void 0:Gn.shixuns_count,onChange:function(gt){_r.page=gt,Pr(Object(r.a)({},_r)),br([])}})),t.a.createElement(ie.a,{visible:Ot,onCancel:Me,onOk:en,renderData:ye,inPaper:!0,modalType:"single",type:"shixun"}))},xe=Object(o.a)(function(De){var ue=De.classroomList,Fe=De.shixunsList,at=De.user;return{classroomList:ue,shixunsList:Fe,user:at}})(Pe),Oe=U("sZF6"),pe=U("2aBv"),be=U("zWo0"),ne=U.n(be),fe=U("LYsE"),_e=U("1vsH"),ke=U("vCeJ"),qe=U("7Kak"),je=U("9yH6"),st=U("giR+"),vt=U("fyUT"),Re=U("6UJt"),Be=U("DFOY"),Ye=U("rAM+"),Ke=U("y8nQ"),yt=U("Vl3Y"),Pt=U("ZWs3"),Ht=function(ue){var Fe=ue.initValue,at=ue.courseOptions,xt=ue.setIsEdit,Gt=ue.setEditKey,$t=ue.reload,Yt=yt.a.useForm(),$n=Object(a.a)(Yt,1),vn=$n[0],ln=Object(u.i)(),hn=Object(i.useMemo)(function(){var Gn=Fe==null?void 0:Fe.sub_discipline_id,fr=[],vr=Object(Ye.a)(at),ir;try{for(vr.s();!(ir=vr.n()).done;){var br=ir.value,Rr=Object(Ye.a)(br.children),Jt;try{for(Rr.s();!(Jt=Rr.n()).done;){var Ar=Jt.value;Ar.value===Gn&&(fr=[br.value,Ar.value])}}catch(Tn){Rr.e(Tn)}finally{Rr.f()}}}catch(Tn){vr.e(Tn)}finally{vr.f()}var Nn=Fe.time;return Object(r.a)(Object(r.a)({},Fe),{},{sub_discipline_id:fr,time:Nn===-1?null:Nn})},[Fe,at]);return t.a.createElement(yt.a,{initialValues:hn,layout:"vertical",form:vn,className:ne.a.formWrap},t.a.createElement(yt.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},t.a.createElement(Be.a,{placeholder:"\u8BF7\u9009\u62E9...",options:at})),t.a.createElement(yt.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(yt.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(vt.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(yt.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(je.a.Group,null,t.a.createElement(je.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(je.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(je.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(yt.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(yt.a.Item,{className:"tr"},t.a.createElement(Pt.a,{type:"primary",onClick:Object(m.a)(s.a.mark(function Gn(){var fr,vr;return s.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,vn.validateFields();case 2:return fr=vn.getFieldsValue(),fr.sub_discipline_id=fr.sub_discipline_id[1],br.next=6,Object(ke.z)(Object(r.a)({id:ln.id},fr));case 6:vr=br.sent,vr.status===0&&(xt(!1),Gt(-1),$t());case 8:case"end":return br.stop()}},Gn)}))},"\u4FDD\u5B58"),t.a.createElement(W.a,{style:{marginLeft:10},onClick:function(){vn.resetFields(),xt(!1)}},"\u53D6\u6D88")))},Xt=Ht,an=U("g9YV"),tn=U("wCAj"),et=U("+BqJ"),Ze=U.n(et),Ct=U("9Bee"),At=function(ue){var Fe=ue.isPreview,at=Fe===void 0?!1:Fe,xt=ue.isExportBlank,Gt=xt===void 0?!1:xt,$t=ue.newExercisePaper,Yt=ue.setIsEdit,$n=Object(u.i)(),vn=Object(i.useState)(),ln=Object(a.a)(vn,2),hn=ln[0],Gn=ln[1],fr=Object(i.useState)(),vr=Object(a.a)(fr,2),ir=vr[0],br=vr[1],Rr=Object(i.useRef)(null),Jt=Object(i.useState)(21),Ar=Object(a.a)(Jt,2),Nn=Ar[0],Tn=Ar[1];Object(i.useEffect)(function(){pr()},[]),Object(i.useEffect)(function(){Rr.current&&Tn(Rr.current.clientHeight)},[Rr.current]),Object(i.useEffect)(function(){var mt;if((mt=$t.exerciseExportHeadData)!==null&&mt!==void 0&&mt.title){var Ge=$t.exerciseExportHeadData;Gn(Object(r.a)({},Ge||{}));var Ot=Ge||{},Me=Ot.table,ye,ve;(Me!=null&&Me.total_singles_scores||Me!=null&&Me.total_doubles_scores||Me!=null&&Me.total_nulls_scores||Me!=null&&Me.total_judges_scores||Me!=null&&Me.total_pros_scores||Me!=null&&Me.total_shixuns_scores||Me!=null&&Me.total_mains_scores||Me!=null&&Me.total_combination_scores)&&(ye=Number(Me==null?void 0:Me.total_singles_scores)+Number(Me==null?void 0:Me.total_doubles_scores)+Number(Me==null?void 0:Me.total_nulls_scores)+Number(Me==null?void 0:Me.total_judges_scores)+Number(Me==null?void 0:Me.total_pros_scores)+Number(Me==null?void 0:Me.total_shixuns_scores)+Number(Me==null?void 0:Me.total_mains_scores)+Number(Me==null?void 0:Me.total_combination_scores)),(Me!=null&&Me.singles_scores||Me!=null&&Me.doubles_scores||Me!=null&&Me.nulls_scores||Me!=null&&Me.judges_scores||Me!=null&&Me.pros_scores||Me!=null&&Me.shixuns_scores||Me!=null&&Me.mains_scores||Me!=null&&Me.combination_scores)&&(ve=Number(Me==null?void 0:Me.singles_scores)+Number(Me==null?void 0:Me.doubles_scores)+Number(Me==null?void 0:Me.nulls_scores)+Number(Me==null?void 0:Me.judges_scores)+Number(Me==null?void 0:Me.pros_scores)+Number(Me==null?void 0:Me.shixuns_scores)+Number(Me==null?void 0:Me.mains_scores)+Number(Me==null?void 0:Me.combination_scores));var or=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Me==null?void 0:Me.total_singles_scores,doubles_score:Me==null?void 0:Me.total_doubles_scores,nulls_score:Me==null?void 0:Me.total_nulls_scores,judges_score:Me==null?void 0:Me.total_judges_scores,pros_score:Me==null?void 0:Me.total_pros_scores,shixuns_score:Me==null?void 0:Me.total_shixuns_scores,mains_score:Me==null?void 0:Me.total_mains_scores,combinations_score:Me==null?void 0:Me.total_combination_scores,total_score:ye},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Me==null?void 0:Me.singles_scores,doubles_score:Me==null?void 0:Me.doubles_scores,nulls_score:Me==null?void 0:Me.nulls_scores,judges_score:Me==null?void 0:Me.judges_scores,pros_score:Me==null?void 0:Me.pros_scores,shixuns_score:Me==null?void 0:Me.shixuns_scores,mains_score:Me==null?void 0:Me.mains_scores,combinations_score:Me==null?void 0:Me.combination_scores,total_score:ve},{key:"3",name:"\u8BC4\u5377\u4EBA"}],en=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Me==null?void 0:Me.total_singles_scores,doubles_score:Me==null?void 0:Me.total_doubles_scores,nulls_score:Me==null?void 0:Me.total_nulls_scores,judges_score:Me==null?void 0:Me.total_judges_scores,pros_score:Me==null?void 0:Me.total_pros_scores,shixuns_score:Me==null?void 0:Me.total_shixuns_scores,mains_score:Me==null?void 0:Me.total_mains_scores,combinations_score:Me==null?void 0:Me.combination_scores,total_score:ye},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];br(Object(D.a)(Gt?en:or))}},[$t.exerciseExportHeadData]);var pr=function(){var mt=Object(m.a)(s.a.mark(function Ge(){var Ot,Me,ye,ve,or,en,Ie;return s.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(ke.m)($n.id);case 2:Ot=Ce.sent,Gn(Ot||{}),Me=Ot||{},ye=Me.table,(ye!=null&&ye.total_singles_scores||ye!=null&&ye.total_doubles_scores||ye!=null&&ye.total_nulls_scores||ye!=null&&ye.total_judges_scores||ye!=null&&ye.total_pros_scores||ye!=null&&ye.total_shixuns_scores||ye!=null&&ye.total_mains_scores||ye!=null&&ye.total_combination_scores)&&(ve=Number(ye==null?void 0:ye.total_singles_scores)+Number(ye==null?void 0:ye.total_doubles_scores)+Number(ye==null?void 0:ye.total_nulls_scores)+Number(ye==null?void 0:ye.total_judges_scores)+Number(ye==null?void 0:ye.total_pros_scores)+Number(ye==null?void 0:ye.total_shixuns_scores)+Number(ye==null?void 0:ye.total_mains_scores)+Number(ye==null?void 0:ye.total_combination_scores)),(ye!=null&&ye.singles_scores||ye!=null&&ye.doubles_scores||ye!=null&&ye.nulls_scores||ye!=null&&ye.judges_scores||ye!=null&&ye.pros_scores||ye!=null&&ye.shixuns_scores||ye!=null&&ye.mains_scores||ye!=null&&ye.combinations_score)&&(or=Number(ye==null?void 0:ye.singles_scores)+Number(ye==null?void 0:ye.doubles_scores)+Number(ye==null?void 0:ye.nulls_scores)+Number(ye==null?void 0:ye.judges_scores)+Number(ye==null?void 0:ye.pros_scores)+Number(ye==null?void 0:ye.shixuns_scores)+Number(ye==null?void 0:ye.mains_scores)+Number(ye==null?void 0:ye.combinations_score)),en=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:ye==null?void 0:ye.total_singles_scores,doubles_score:ye==null?void 0:ye.total_doubles_scores,nulls_score:ye==null?void 0:ye.total_nulls_scores,judges_score:ye==null?void 0:ye.total_judges_scores,pros_score:ye==null?void 0:ye.total_pros_scores,shixuns_score:ye==null?void 0:ye.total_shixuns_scores,combinations_score:ye==null?void 0:ye.total_combination_scores,mains_score:ye==null?void 0:ye.total_mains_scores,total_score:ve},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:ye==null?void 0:ye.singles_scores,doubles_score:ye==null?void 0:ye.doubles_scores,nulls_score:ye==null?void 0:ye.nulls_scores,judges_score:ye==null?void 0:ye.judges_scores,pros_score:ye==null?void 0:ye.pros_scores,shixuns_score:ye==null?void 0:ye.shixuns_scores,mains_score:ye==null?void 0:ye.mains_scores,combinations_score:ye==null?void 0:ye.combination_scores,total_score:or},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Ie=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],br(Gt?Ie:en);case 10:case"end":return Ce.stop()}},Ge)}));return function(){return mt.apply(this,arguments)}}(),_r=[{width:"10%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:function(Ge){return t.a.createElement("a",null,Ge)}},{width:"10%",title:"\u5355\u9009\u9898",align:"center",dataIndex:"singles_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u591A\u9009\u9898",align:"center",dataIndex:"doubles_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u586B\u7A7A\u9898",align:"center",dataIndex:"nulls_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u5224\u65AD\u9898",align:"center",dataIndex:"judges_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u7F16\u7A0B\u9898",align:"center",dataIndex:"pros_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u5B9E\u8BAD\u9898",align:"center",dataIndex:"shixuns_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u7B80\u7B54\u9898",align:"center",dataIndex:"mains_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u7EC4\u5408\u9898",align:"center",dataIndex:"combinations_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}},{width:"10%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:function(Ge){return t.a.createElement("a",null,Ge==="0.0"?0:Ge)}}],Pr=hn||{},yr=Pr.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(Ze.a.wrap," ").concat(at?"pl20":""," ")},(hn==null?void 0:hn.photo_url)&&t.a.createElement("img",{className:Ze.a.img,src:hn==null?void 0:hn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(W.a,{onClick:function(){return Yt(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(yr==null?void 0:yr.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,hn==null?void 0:hn.title)),(hn==null?void 0:hn.exercise_description)&&t.a.createElement("span",{ref:Rr,style:{justifyContent:Nn===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(hn==null?void 0:hn.exercise_description)),(yr==null?void 0:yr.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",hn==null?void 0:hn.large_counts,"\u5927\u9898\u3011\u3010",hn==null?void 0:hn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",hn==null?void 0:hn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(hn==null?void 0:hn.time)>-1?"".concat(hn==null?void 0:hn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(yr==null?void 0:yr.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(Ct.a,{value:hn==null?void 0:hn.description})),(yr==null?void 0:yr.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(tn.a,{className:Ze.a.table,columns:_r,dataSource:Object(D.a)(ir||[]),bordered:!0,pagination:!1}))))},dt=Object(o.a)(function(De){var ue=De.newExercisePaper;return{newExercisePaper:ue}})(At),ft=U("VYcG"),He=function(ue){var Fe=ue.onImport,at=ue.questionType,xt=ue.onAdd,Gt=ue.onSort,$t=ue.user,Yt=Object(u.i)(),$n=function(){var vn=Object(m.a)(s.a.mark(function ln(){var hn,Gn;return s.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(ke.h)(Yt.id);case 2:hn=vr.sent,hn.status===0&&o.d.push("/classrooms/coursesId/exercise/".concat(hn.exercise_id,"/").concat((Gn=$t.userInfo)===null||Gn===void 0?void 0:Gn.login,"/initate_answer"));case 4:case"end":return vr.stop()}},ln)}));return function(){return vn.apply(this,arguments)}}();return t.a.createElement("section",{style:{display:"flex",width:"100%",position:"fixed",bottom:0,height:70,boxShadow:"rgb(0 0 0 / 5%) 0px -4px 4px 0px",zIndex:666},className:[ne.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},t.a.createElement("div",{style:{width:"1200px",margin:"0px auto",display:"flex",alignItems:"center"}},t.a.createElement(W.a,{style:{height:30,marginRight:10,width:104},type:"primary",onClick:function(){o.d.push("/paperlibrary/edit_select/".concat(Yt.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(W.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Fe},"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898"),t.a.createElement("div",{style:{marginRight:"27px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement("div",{style:{display:"flex",marginRight:27}},at.map(function(vn){return t.a.createElement("span",{key:vn.id,className:ne.a.button,onClick:function(){return xt(vn.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),vn.name)})),t.a.createElement("div",{style:{marginRight:"25px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement(W.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8",onClick:Gt},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(R.a,{to:"/paperlibrary/see/".concat(Yt.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(T.throttle)($n,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},Ne=Object(o.a)(function(De){var ue=De.user;return{user:ue}})(He),Ue=U("hQp1"),ge=function(ue){var Fe,at,xt,Gt=ue.exercise,$t=ue.newExercisePaper,Yt=ue.user,$n=ue.dispatch,vn=Object(u.i)(),ln=Object(i.useState)(!1),hn=Object(a.a)(ln,2),Gn=hn[0],fr=hn[1],vr=Object(i.useState)(!1),ir=Object(a.a)(vr,2),br=ir[0],Rr=ir[1],Jt=Object(i.useState)(-1),Ar=Object(a.a)(Jt,2),Nn=Ar[0],Tn=Ar[1],pr=Object(i.useRef)(),_r=[{name:"\u5355\u9009\u9898",id:0,count:"q_singles",score:"q_singles_scores"},{name:"\u591A\u9009\u9898",id:1,count:"q_doubles",score:"q_doubles_scores"},{name:"\u5224\u65AD\u9898",id:2,count:"q_judges",score:"q_judges_scores"},{name:"\u586B\u7A7A\u9898",id:3,count:"q_nulls",score:"q_nulls_scores"},{name:"\u7B80\u7B54\u9898",id:4,count:"q_mains",score:"q_mains_scores"},{name:"\u5B9E\u8BAD\u9898",id:5,count:"q_shixuns",score:"q_shixuns_scores"},{name:"\u7F16\u7A0B\u9898",id:6,count:"q_pros",score:"q_pros_scores"},{name:"\u7EC4\u5408\u9898",id:7,count:"q_combinations",score:"q_combinations_scores"}],Pr=Object(_e.I)();Object(i.useEffect)(function(){return $n({type:"globalSetting/footerToggle",payload:!1}),function(){$n({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(i.useEffect)(function(){or()},[]);var yr=Object(ft.useCourseOptions)();Object(i.useEffect)(function(){var Z,Le,ot;if($t!=null&&(Z=$t.editData)!==null&&Z!==void 0&&Z.exercise_question_types){var wt,Lt;ye(Object(T.cloneDeep)($t==null||((wt=$t.editData)===null||wt===void 0)?void 0:wt.exercise_question_types)),ve.current=Object(T.cloneDeep)($t==null||((Lt=$t.editData)===null||Lt===void 0)?void 0:Lt.exercise_question_types)}var ct=(Le=$t.editData)===null||Le===void 0||((ot=Le.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id;ct&&mt(ct)},[$t.editData]);var mt=function(){var Z=Object(m.a)(s.a.mark(function Le(ot){return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Lt.next=2,$n({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:ot}});case 2:case"end":return Lt.stop()}},Le)}));return function(ot){return Z.apply(this,arguments)}}(),Ge=Object(i.useState)(),Ot=Object(a.a)(Ge,2),Me=Ot[0],ye=Ot[1],ve=Object(i.useRef)(Me),or=function(){var Z=Object(m.a)(s.a.mark(function Le(){var ot;return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:ot=$n({type:"newExercisePaper/editExercise",payload:{id:vn.id}}),ot.status===0&&ye(ot.exercise_question_types);case 2:case"end":return Lt.stop()}},Le)}));return function(){return Z.apply(this,arguments)}}(),en=function(){var Z=Object(m.a)(s.a.mark(function Le(ot){var wt,Lt,ct,Et,Mt,Cn,Yn;return s.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(!(Nn!==-1)){fn.next=3;break}return g.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),fn.abrupt("return");case 3:if(!(ot===Ue.a.Shixun)){fn.next=7;break}$n({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),fn.next=21;break;case 7:if(!(ot===Ue.a.Program)){fn.next=11;break}o.d.push("/problems/new?difficult=".concat((wt=$t.editData)===null||wt===void 0||((Lt=wt.exercise)===null||Lt===void 0)?void 0:Lt.difficulty,"&sub_discipline_id=").concat((ct=$t.editData)===null||ct===void 0||((Et=ct.exercise)===null||Et===void 0)?void 0:Et.sub_discipline_id,"&express_id=").concat(vn.id,"&callback_url=").concat(location.pathname)),fn.next=21;break;case 11:if(Cn=Me.find(function(Wt){return Wt.question_type===ot}),Cn){fn.next=18;break}return ve.current=Object(T.cloneDeep)(Me),Me.push({name:_r.find(function(Wt){return Wt.id===ot}).name,question_type:ot,count:0,score:0,items:[{key:1,insert_id:1,question_type:ot}]}),ye(Object(D.a)(Me)),Tn("".concat(ot,"-",1)),fn.abrupt("return");case 18:setTimeout(function(){var Wt;(Wt=document.getElementById("".concat(ot,"-").concat(Cn.count-1)))===null||Wt===void 0||Wt.scrollIntoView()},400),Yn={key:Cn.count,insert_id:(Mt=Cn.items[Cn.count])===null||Mt===void 0?void 0:Mt.question_id,question_type:ot},gt(Yn);case 21:case"end":return fn.stop()}},Le)}));return function(ot){return Z.apply(this,arguments)}}(),Ie=function(){Tn(-1),ye(ve.current)},gt=function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ve.current=Object(T.cloneDeep)(Me),Le.question_type===Ue.a.Program){var ot,wt,Lt,ct;return o.d.push("/problems/new?difficult=".concat((ot=$t.editData)===null||ot===void 0||((wt=ot.exercise)===null||wt===void 0)?void 0:wt.difficulty,"&sub_discipline_id=").concat((Lt=$t.editData)===null||Lt===void 0||((ct=Lt.exercise)===null||ct===void 0)?void 0:ct.sub_discipline_id,"&express_id=").concat(vn.id,"&callback_url=").concat(location.pathname)),!1}Me.map(function(Et){if(Et.question_type===Le.question_type){var Mt=Object(T.cloneDeep)(Et.items);Mt.splice(Le==null?void 0:Le.key,0,Object(r.a)({insert_id:Le==null?void 0:Le.insert_id},Le)),Et.items=Mt}return Et}),ye(Object(D.a)(Me)),Tn("".concat(Le.question_type,"-").concat(Le.key+1))},Ce={ref:pr,editKey:Nn,hideAction:!1,cancelAdd:function(){return Ie()},setEditKey:function(Le){return Tn(Le)},addCallback:function(Le){return gt(Le)}},cn=Object(i.useState)(!1),hr=Object(a.a)(cn,2),mr=hr[0],q=hr[1],O=function(){var Z=Object(m.a)(s.a.mark(function Le(ot,wt){var Lt,ct;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(!(ot.length===0)){Mt.next=4;break}return g.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),wt(),Mt.abrupt("return");case 4:return Mt.next=6,Object(ke.s)(vn.id,(Lt=ot[0])===null||Lt===void 0?void 0:Lt.file);case 6:ct=Mt.sent,ct.status===0&&(g.b.success("\u6210\u529F\u5BFC\u5165".concat(ct==null?void 0:ct.success,"\u6761")),q(!1),or());case 8:case"end":return Mt.stop()}},Le)}));return function(ot,wt){return Z.apply(this,arguments)}}(),M=function(){var Z=Object(m.a)(s.a.mark(function Le(ot,wt){var Lt;return s.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(ke.y)(vn.id,{question_type:ot});case 2:Lt=Et.sent,(Lt==null?void 0:Lt.status)===0&&(g.b.success(Lt==null?void 0:Lt.message),Rr(!1),or()),wt();case 5:case"end":return Et.stop()}},Le)}));return function(ot,wt){return Z.apply(this,arguments)}}(),X=function(){if(Nn!==-1){g.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}q(!0)},se=function(){var Z=Object(m.a)(s.a.mark(function Le(ot,wt,Lt){var ct,Et,Mt;return s.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return ve.current=Object(T.cloneDeep)(Me),ct=Me.findIndex(function(Hn){return Hn.question_type===Lt}),Et=Me,Et[ct].items=wt,ye(Object(D.a)(Et)),Yn.next=7,Object(ke.a)({id:vn.id,itemId:parseInt(ot.draggableId),position:ot.destination.index+1});case 7:Mt=Yn.sent;case 8:case"end":return Yn.stop()}},Le)}));return function(ot,wt,Lt){return Z.apply(this,arguments)}}();return t.a.createElement("div",null,t.a.createElement("section",{className:"edu-container minH500"},t.a.createElement(Q.a,{spinning:!1,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},t.a.createElement("section",{className:"animated fadeIn"},t.a.createElement("aside",{className:"mt10"},t.a.createElement(z.a,{separator:">"},t.a.createElement(z.a.Item,null,t.a.createElement(R.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(z.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(ne.a.title," mt20")},t.a.createElement(J.a,{style:{width:"100%"}},t.a.createElement(N.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(N.a,null,t.a.createElement(R.a,{className:"font16 c-light-black",to:(Pr==null?void 0:Pr.fromadd)==="1"?"/paperlibrary/add/".concat(vn.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[ne.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!Gn&&t.a.createElement(dt,{setIsEdit:fr,isExportBlank:!1}),Gn&&t.a.createElement(Xt,{initValue:(Fe=$t.editData)===null||Fe===void 0?void 0:Fe.exercise,setIsEdit:fr,courseOptions:yr,reload:or,setEditKey:Tn})),Me&&t.a.createElement("section",{className:[ne.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(fe.a,{inNewPaperLibrary:!0,data:Me,editorProps:Ce,isDragDisabled:Nn!==-1,onDragEnd:se,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:or})),t.a.createElement(xe,{inNewPaperLibrary:!0,callback:function(Le,ot,wt){var Lt;ve.current=Object(T.cloneDeep)(Me);var ct={shixun:Le.challenge_names.map(function(Cn){return{challenge_name:Cn,challenge_score:5}}),shixun_name:Le==null||((Lt=Le.title)===null||Lt===void 0)?void 0:Lt.replace(/<.*?>/gi,""),shixun_id:Le.id,question_type:5,edit:!0,is_copy:wt};if(ot&&(Me.map(function(Cn){if(Cn.question_type===5){var Yn=Object(T.cloneDeep)(Cn.items);Yn.splice(ot==null?void 0:ot.key,0,ct),Cn.items=Yn}return Cn}),Tn("5-".concat(Me.key+1)),ye(Object(D.a)(Me))),!ot){var Et,Mt=Me.find(function(Cn){return Cn.question_type===5});if(!Mt){Me.push({name:_r.find(function(Cn){return Cn.id===5}).name,question_type:5,count:0,score:0,items:[ct]}),ye(Object(D.a)(Me)),Tn("".concat(5,"-",1));return}(Et=document.getElementById("".concat(5,"-",Mt.count-1)))===null||Et===void 0||Et.scrollIntoView({block:"center",inline:"nearest"}),Mt.items.push(ct),ye(Object(D.a)(Me)),Tn("".concat(5,"-",Mt.count))}}})),t.a.createElement(Oe.a,{visible:mr,onCancel:function(){return q(!1)},onOk:O}),t.a.createElement(pe.a,{visible:br,onCancel:function(){return Rr(!1)},onOk:M,data:(at=$t.editData)===null||at===void 0||((xt=at.exercise)===null||xt===void 0)?void 0:xt.sort_by_qustion_type})),t.a.createElement(Ne,{questionType:_r,onAdd:en,onImport:X,onSort:function(){return Rr(!0)}}))},Ee=Ae.default=Object(o.a)(function(De){var ue=De.exercise,Fe=De.newExercisePaper,at=De.user;return{exercise:ue,user:at,newExercisePaper:Fe}})(ge)},bT9E:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});var te=U("VTBJ");function Q(B,J){var K=Object(te.a)({},B);return Array.isArray(J)&&J.forEach(function(N){delete K[N]}),K}},biw7:function(kt,Ae,U){"use strict";var te=U("q1tI"),Q=U.n(te),B=te.createContext(null);Ae.a=B},c5Ni:function(kt,Ae,U){},dejd:function(kt,Ae,U){},dmUQ:function(kt,Ae,U){"use strict";var te=U("Ff2n"),Q=U("rePB"),B=U("1OyB"),J=U("vuIU"),K=U("Ji7U"),N=U("md7G"),$=U("foSv"),z=U("q1tI"),r=U.n(z),D=U("TSYQ"),p=U.n(D),g=U("4IlW");function m(h,f){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);f&&(x=x.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),C.push.apply(C,x)}return C}function a(h){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?m(Object(C),!0).forEach(function(x){Object(Q.a)(h,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):m(Object(C)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(C,x))})}return h}function d(h){var f=s();return function(){var x=Object($.a)(h),_;if(f){var j=Object($.a)(this).constructor;_=Reflect.construct(x,arguments,j)}else _=x.apply(this,arguments);return Object(N.a)(this,_)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function i(){}function t(h){h.preventDefault()}var u=function(f){return f.replace(/[^\w.-]+/g,"")},o=200,R=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(f){return f!=null},A=function(f,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},P=function(h){Object(K.a)(C,h);var f=d(C);function C(x){var _;Object(B.a)(this,C),_=f.call(this,x),_.onKeyDown=function(w){var F=_.props,I=F.onKeyDown,v=F.onPressEnter;if(w.keyCode===g.a.UP){var H=_.getRatio(w);_.up(w,H,null),_.stop()}else if(w.keyCode===g.a.DOWN){var Y=_.getRatio(w);_.down(w,Y,null),_.stop()}else w.keyCode===g.a.ENTER&&v&&v(w);if(_.recordCursorPosition(),_.lastKeyCode=w.keyCode,I){for(var ie=arguments.length,le=new Array(ie>1?ie-1:0),he=1;he<ie;he++)le[he-1]=arguments[he];I.apply(void 0,[w].concat(le))}},_.onKeyUp=function(w){var F=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),F){for(var I=arguments.length,v=new Array(I>1?I-1:0),H=1;H<I;H++)v[H-1]=arguments[H];F.apply(void 0,[w].concat(v))}},_.onChange=function(w){var F=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(w)),_.setState({inputValue:_.rawInput}),F(_.toNumber(_.rawInput))},_.onMouseUp=function(){var w=_.props.onMouseUp;_.recordCursorPosition(),w&&w.apply(void 0,arguments)},_.onFocus=function(){var w;_.setState({focused:!0}),(w=_.props).onFocus.apply(w,arguments)},_.onBlur=function(){var w=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var F=_.getCurrentValidValue(_.state.inputValue),I=_.setValue(F,i);if(w){var v=_.input.value,H=_.getInputDisplayValue({focus:!1,value:I});_.input.value=H&&Number(H),w.apply(void 0,arguments),_.input.value=v}},_.getRatio=function(w){var F=1;return w.metaKey||w.ctrlKey?F=.1:w.shiftKey&&(F=10),F},_.getFullNum=function(w){return isNaN(w)?w:/e/i.test(String(w))?Number(w).toFixed(18).replace(/\.?0+$/,""):w},_.getPrecision=function(w){if(S(_.props.precision))return _.props.precision;var F=String(w);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var I=0;return F.indexOf(".")>=0&&(I=F.length-F.indexOf(".")-1),I},_.getInputDisplayValue=function(w){var F=w||_.state,I=F.focused,v=F.inputValue,H=F.value,Y;I?Y=v:Y=_.toPrecisionAsStep(H),Y==null&&(Y="");var ie=_.formatWrapper(Y);return S(_.props.decimalSeparator)&&(ie=ie.toString().replace(".",_.props.decimalSeparator)),ie},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(w){}},_.restoreByAfter=function(w){if(w===void 0)return!1;var F=_.input.value,I=F.lastIndexOf(w);if(I===-1)return!1;var v=_.cursorBefore.length;return _.lastKeyCode===g.a.DELETE&&_.cursorBefore.charAt(v-1)===w[0]?(_.fixCaret(v,v),!0):I+w.length===F.length?(_.fixCaret(I,I),!0):!1},_.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(F,I){var v=w.substring(I);return _.restoreByAfter(v)})},_.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(w,F,I){_.pressingUpOrDown=!0,_.step("down",w,F,I)},_.up=function(w,F,I){_.pressingUpOrDown=!0,_.step("up",w,F,I)},_.saveInput=function(w){_.input=w};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(J.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var j=this.props,W=j.value,w=j.onChange,F=j.max,I=j.min,v=this.state.focused;if(_){if(!A(_.value,W)||!A(_.max,F)||!A(_.min,I)){var H=v?W:this.getValidValue(W),Y;this.pressingUpOrDown?Y=H:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:Y})}var ie="value"in this.props?W:this.state.value;"max"in this.props&&_.max!==F&&typeof ie=="number"&&ie>F&&w&&w(F),"min"in this.props&&_.min!==I&&typeof ie=="number"&&ie<I&&w&&w(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var le=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?le=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(le=this.cursorStart):le=this.input.value.length,this.fixCaret(le,le)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(he){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var 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 S(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,w=parseFloat(_);return isNaN(w)?_:(w<j&&(w=j),w>W&&(w=W),w)}},{key:"setValue",value:function(_,j){var W=this.props.precision,w=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),F=this.state.value,I=F===void 0?null:F,v=this.state.inputValue,H=v===void 0?null:v,Y=typeof w=="number"?w.toFixed(W):"".concat(w),ie=w!==I||Y!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},j)):this.setState({value:w,inputValue:this.toPrecisionAsStep(_)},j),ie&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,w=W.precision,F=W.step;if(S(w))return w;var I=this.getPrecision(j),v=this.getPrecision(F),H=this.getPrecision(_);return _?Math.max(H,I+v):I+v}},{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,w=_&&_.length>16&&W;return this.isNotCompleteNumber(_)||w?_:S(j)?Math.round(_*Math.pow(10,j))/Math.pow(10,j):Number(_)}},{key:"upStep",value:function(_,j){var W=this.props.step,w=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),I=((w*_+w*W*j)/w).toFixed(F);return this.toNumber(I)}},{key:"downStep",value:function(_,j){var W=this.props.step,w=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),I=((w*_-w*W*j)/w).toFixed(F);return this.toNumber(I)}},{key:"step",value:function(_,j){var W=this,w=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 I=this.props;if(I.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var H=this["".concat(_,"Step")](v,w),Y=H>I.max||H<I.min;if(H>I.max?H=I.max:H<I.min&&(H=I.min),this.setValue(H,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){W[_](j,w,!0)},F?o:R)}},{key:"fixCaret",value:function(_,j){if(_===void 0||j===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,w=this.input.selectionEnd;(_!==W||j!==w)&&this.input.setSelectionRange(_,j)}catch(F){}}},{key:"render",value:function(){var _,j=this.props,W=j.prefixCls,w=j.disabled,F=j.readOnly,I=j.useTouch,v=j.autoComplete,H=j.upHandler,Y=j.downHandler,ie=j.className,le=j.max,he=j.min,we=j.style,Pe=j.title,xe=j.onMouseEnter,Oe=j.onMouseLeave,pe=j.onMouseOver,be=j.onMouseOut,ne=j.required,fe=j.onClick,_e=j.tabIndex,ke=j.type,qe=j.placeholder,je=j.id,st=j.inputMode,vt=j.pattern,Re=j.step,Be=j.maxLength,Ye=j.autoFocus,Ke=j.name,yt=j.onPaste,Pt=j.onInput,Ht=Object(te.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"]),Xt=this.state,an=Xt.value,tn=Xt.focused,et=p()(W,(_={},Object(Q.a)(_,ie,!!ie),Object(Q.a)(_,"".concat(W,"-disabled"),w),Object(Q.a)(_,"".concat(W,"-focused"),tn),_)),Ze={};Object.keys(Ht).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Ze[ue]=Ht[ue])});var Ct=!F&&!w,At=this.getInputDisplayValue(null),dt=(an||an===0)&&(isNaN(an)||Number(an)>=le),ft=(an||an===0)&&(isNaN(an)||Number(an)<=he),He=dt||w||F,Ne=ft||w||F,Ue=p()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Q.a)({},"".concat(W,"-handler-up-disabled"),He)),ge=p()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Q.a)({},"".concat(W,"-handler-down-disabled"),Ne)),Ee=I?{onTouchStart:He?i:this.up,onTouchEnd:this.stop}:{onMouseDown:He?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},De=I?{onTouchStart:Ne?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Ne?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:et,style:we,title:Pe,onMouseEnter:xe,onMouseLeave:Oe,onMouseOver:pe,onMouseOut:be,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"},Ee,{role:"button","aria-label":"Increase Value","aria-disabled":He,className:Ue}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:t})),r.a.createElement("span",Object.assign({unselectable:"on"},De,{role:"button","aria-label":"Decrease Value","aria-disabled":Ne,className:ge}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(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":he,"aria-valuemax":le,"aria-valuenow":an,required:ne,type:ke,placeholder:qe,onPaste:yt,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:_e,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ct?this.onKeyDown:i,onKeyUp:Ct?this.onKeyUp:i,autoFocus:Ye,maxLength:Be,readOnly:F,disabled:w,max:le,min:he,step:Re,name:Ke,title:Pe,id:je,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:vt,inputMode:st,onInput:Pt},Ze))))}}]),C}(r.a.Component);P.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:u,required:!1,autoComplete:"off"};var E=P,b=Ae.a=E},fcSX:function(kt,Ae,U){"use strict";var te=U("Ff2n"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("md7G"),N=U("foSv"),$=U("1W/9"),z=U("q1tI"),r=U("rePB"),D=U("JX7q"),p=U("TSYQ"),g=U.n(p),m=U("qx4F"),a=U("4IlW");function d(w){return Array.isArray(w)?w:[w]}var s={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(s).filter(function(w){if(typeof document=="undefined")return!1;var F=document.getElementsByTagName("html")[0];return w in(F?F.style:{})})[0],t=s[i];function u(w,F,I,v){w.addEventListener?w.addEventListener(F,I,v):w.attachEvent&&w.attachEvent("on".concat(F),I)}function o(w,F,I,v){w.removeEventListener?w.removeEventListener(F,I,v):w.attachEvent&&w.detachEvent("on".concat(F),I)}function R(w,F){var I=typeof w=="function"?w(F):w;return Array.isArray(I)?I.length===2?I:[I[0],I[1]]:[I]}var T=function(F){return!isNaN(parseFloat(F))&&isFinite(F)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function w(F,I,v,H){if(!I||I===document||I instanceof Document)return!1;if(I===F.parentNode)return!0;var Y=Math.max(Math.abs(v),Math.abs(H))===Math.abs(H),ie=Math.max(Math.abs(v),Math.abs(H))===Math.abs(v),le=I.scrollHeight-I.clientHeight,he=I.scrollWidth-I.clientWidth,we=document.defaultView.getComputedStyle(I),Pe=we.overflowY==="auto"||we.overflowY==="scroll",xe=we.overflowX==="auto"||we.overflowX==="scroll",Oe=le&&Pe,pe=he&&xe;return Y&&(!Oe||Oe&&(I.scrollTop>=le&&H<0||I.scrollTop<=0&&H>0))||ie&&(!pe||pe&&(I.scrollLeft>=he&&v<0||I.scrollLeft<=0&&v>0))?w(F,I.parentNode,v,H):!1};function P(w){var F=E();return function(){var v=Object(N.a)(w),H;if(F){var Y=Object(N.a)(this).constructor;H=Reflect.construct(v,arguments,Y)}else H=v.apply(this,arguments);return Object(K.a)(this,H)}}function E(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(w){return!1}}var b={},h=function(w){Object(J.a)(I,w);var F=P(I);function I(v){var H;return Object(Q.a)(this,I),H=F.call(this,v),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(Y){if(Y.touches.length>1)return;H.startPos={x:Y.touches[0].clientX,y:Y.touches[0].clientY}},H.removeMoveHandler=function(Y){if(Y.changedTouches.length>1)return;var ie=Y.currentTarget,le=Y.changedTouches[0].clientX-H.startPos.x,he=Y.changedTouches[0].clientY-H.startPos.y;(ie===H.maskDom||ie===H.handlerDom||ie===H.contentDom&&A(ie,Y.target,le,he))&&Y.cancelable&&Y.preventDefault()},H.transitionEnd=function(Y){var ie=Y.target;o(ie,t,H.transitionEnd),ie.style.transition=""},H.onKeyDown=function(Y){if(Y.keyCode===a.a.ESC){var ie=H.props.onClose;Y.stopPropagation(),ie&&ie(Y)}},H.onWrapperTransitionEnd=function(Y){var ie=H.props,le=ie.open,he=ie.afterVisibleChange;Y.target===H.contentWrapper&&Y.propertyName.match(/transform$/)&&(H.dom.style.transition="",!le&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),he&&he(!!le))},H.openLevelTransition=function(){var Y=H.props,ie=Y.open,le=Y.width,he=Y.height,we=H.getHorizontalBoolAndPlacementName(),Pe=we.isHorizontal,xe=we.placementName,Oe=H.contentDom?H.contentDom.getBoundingClientRect()[Pe?"width":"height"]:0,pe=(Pe?le:he)||Oe;H.setLevelAndScrolling(ie,xe,pe)},H.setLevelTransform=function(Y,ie,le,he){var we=H.props,Pe=we.placement,xe=we.levelMove,Oe=we.duration,pe=we.ease,be=we.showMask;H.levelDom.forEach(function(ne){ne.style.transition="transform ".concat(Oe," ").concat(pe),u(ne,t,H.transitionEnd);var fe=Y?le:0;if(xe){var _e=R(xe,{target:ne,open:Y});fe=Y?_e[0]:_e[1]||0}var ke=typeof fe=="number"?"".concat(fe,"px"):fe,qe=Pe==="left"||Pe==="top"?ke:"-".concat(ke);qe=be&&Pe==="right"&&he?"calc(".concat(qe," + ").concat(he,"px)"):qe,ne.style.transform=fe?"".concat(ie,"(").concat(qe,")"):""})},H.setLevelAndScrolling=function(Y,ie,le){var he=H.props.onChange;if(!S){var we=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(m.a)(!0):0;H.setLevelTransform(Y,ie,le,we),H.toggleScrollingToDrawerAndBody(we)}he&&he(Y)},H.toggleScrollingToDrawerAndBody=function(Y){var ie=H.props,le=ie.getOpenCount,he=ie.getContainer,we=ie.showMask,Pe=ie.open,xe=he&&he(),Oe=le&&le();if(xe&&xe.parentNode===document.body&&we){var pe=["touchstart"],be=[document.body,H.maskDom,H.handlerDom,H.contentDom];Pe&&document.body.style.overflow!=="hidden"?(Y&&H.addScrollingEffect(Y),Oe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",be.forEach(function(ne,fe){if(!ne)return;u(ne,pe[fe]||"touchmove",fe?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Oe||(document.body.style.overflow=""),document.body.style.touchAction="",Y&&H.remScrollingEffect(Y),be.forEach(function(ne,fe){if(!ne)return;o(ne,pe[fe]||"touchmove",fe?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(Y){var ie=H.props,le=ie.placement,he=ie.duration,we=ie.ease,Pe=ie.getOpenCount,xe=ie.switchScrollingEffect,Oe=Pe&&Pe();Oe===1&&xe();var pe="width ".concat(he," ").concat(we),be="transform ".concat(he," ").concat(we);H.dom.style.transition="none";switch(le){case"right":H.dom.style.transform="translateX(-".concat(Y,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(Y,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(be,",").concat(pe),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(Y){var ie=H.props,le=ie.placement,he=ie.duration,we=ie.ease,Pe=ie.getOpenCount,xe=ie.switchScrollingEffect,Oe=Pe&&Pe();Oe||xe(!0),i&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var pe,be="width ".concat(he," ").concat(we),ne="transform ".concat(he," ").concat(we);switch(le){case"left":{H.dom.style.width="100%",be="width 0s ".concat(we," ").concat(he);break}case"right":{H.dom.style.transform="translateX(".concat(Y,"px)"),H.dom.style.width="100%",be="width 0s ".concat(we," ").concat(he),H.maskDom&&(H.maskDom.style.left="-".concat(Y,"px"),H.maskDom.style.width="calc(100% + ".concat(Y,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(Y,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",pe="height 0s ".concat(we," ").concat(he);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ne,",").concat(pe?"".concat(pe,","):"").concat(be),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(Y){return b[Y]})},H.getLevelDom=function(Y){var ie=Y.level,le=Y.getContainer;if(S)return;var he=le&&le(),we=he?he.parentNode:null;if(H.levelDom=[],ie==="all"){var Pe=we?Array.prototype.slice.call(we.children):[];Pe.forEach(function(xe){xe.nodeName!=="SCRIPT"&&xe.nodeName!=="STYLE"&&xe.nodeName!=="LINK"&&xe!==he&&H.levelDom.push(xe)})}else ie&&d(ie).forEach(function(xe){document.querySelectorAll(xe).forEach(function(Oe){H.levelDom.push(Oe)})})},H.getHorizontalBoolAndPlacementName=function(){var Y=H.props.placement,ie=Y==="left"||Y==="right",le="translate".concat(ie?"X":"Y");return{isHorizontal:ie,placementName:le}},H.state={_self:Object(D.a)(H)},H}return Object(B.a)(I,[{key:"componentDidMount",value:function(){var H=this;if(!S){var Y=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Y=!0,null}}))}catch(Pe){}this.passive=Y?{passive:!1}:!1}var ie=this.props,le=ie.open,he=ie.getContainer,we=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),le&&(we&&we.parentNode===document.body&&(b[this.drawerId]=le),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var Y=this.props,ie=Y.open,le=Y.getContainer,he=le&&le();ie!==H.open&&(ie&&this.domFocus(),he&&he.parentNode===document.body&&(b[this.drawerId]=!!ie),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,Y=H.getOpenCount,ie=H.open,le=H.switchScrollingEffect,he=typeof Y=="function"&&Y();delete b[this.drawerId],ie&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",le(!0))}},{key:"render",value:function(){var H,Y=this,ie=this.props,le=ie.className,he=ie.children,we=ie.style,Pe=ie.width,xe=ie.height,Oe=ie.defaultOpen,pe=ie.open,be=ie.prefixCls,ne=ie.placement,fe=ie.level,_e=ie.levelMove,ke=ie.ease,qe=ie.duration,je=ie.getContainer,st=ie.handler,vt=ie.onChange,Re=ie.afterVisibleChange,Be=ie.showMask,Ye=ie.maskClosable,Ke=ie.maskStyle,yt=ie.onClose,Pt=ie.onHandleClick,Ht=ie.keyboard,Xt=ie.getOpenCount,an=ie.switchScrollingEffect,tn=Object(te.a)(ie,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),et=this.dom?pe:!1,Ze=g()(be,(H={},Object(r.a)(H,"".concat(be,"-").concat(ne),!0),Object(r.a)(H,"".concat(be,"-open"),et),Object(r.a)(H,le||"",!!le),Object(r.a)(H,"no-mask",!Be),H)),Ct=this.getHorizontalBoolAndPlacementName(),At=Ct.placementName,dt=ne==="left"||ne==="top"?"-100%":"100%",ft=et?"":"".concat(At,"(").concat(dt,")"),He=st&&z.cloneElement(st,{onClick:function(Ue){st.props.onClick&&st.props.onClick(),Pt&&Pt(Ue)},ref:function(Ue){Y.handlerDom=Ue}});return z.createElement("div",Object.assign({},tn,{tabIndex:-1,className:Ze,style:we,ref:function(Ue){Y.dom=Ue},onKeyDown:et&&Ht?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Be&&z.createElement("div",{className:"".concat(be,"-mask"),onClick:Ye?yt:void 0,style:Ke,ref:function(Ue){Y.maskDom=Ue}}),z.createElement("div",{className:"".concat(be,"-content-wrapper"),style:{transform:ft,msTransform:ft,width:T(Pe)?"".concat(Pe,"px"):Pe,height:T(xe)?"".concat(xe,"px"):xe},ref:function(Ue){Y.contentWrapper=Ue}},z.createElement("div",{className:"".concat(be,"-content"),ref:function(Ue){Y.contentDom=Ue},onTouchStart:et&&Be?this.removeStartHandler:void 0,onTouchMove:et&&Be?this.removeMoveHandler:void 0},he),He))}}],[{key:"getDerivedStateFromProps",value:function(H,Y){var ie=Y.prevProps,le=Y._self,he={prevProps:H};if(ie!==void 0){var we=H.placement,Pe=H.level;we!==ie.placement&&(le.contentDom=null),Pe!==ie.level&&le.getLevelDom(H)}return he}}]),I}(z.Component);h.defaultProps={switchScrollingEffect:function(){}};var f=h;function C(w){var F=x();return function(){var v=Object(N.a)(w),H;if(F){var Y=Object(N.a)(this).constructor;H=Reflect.construct(v,arguments,Y)}else H=v.apply(this,arguments);return Object(K.a)(this,H)}}function x(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(w){return!1}}var _=function(w){Object(J.a)(I,w);var F=C(I);function I(v){var H;Object(Q.a)(this,I),H=F.call(this,v),H.onHandleClick=function(ie){var le=H.props,he=le.onHandleClick,we=le.open;if(he&&he(ie),typeof we=="undefined"){var Pe=H.state.open;H.setState({open:!Pe})}},H.onClose=function(ie){var le=H.props,he=le.onClose,we=le.open;he&&he(ie),typeof we=="undefined"&&H.setState({open:!1})};var Y=typeof v.open!="undefined"?v.open:!!v.defaultOpen;return H.state={open:Y},"onMaskClick"in v&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(B.a)(I,[{key:"render",value:function(){var H=this,Y=this.props,ie=Y.defaultOpen,le=Y.getContainer,he=Y.wrapperClassName,we=Y.forceRender,Pe=Y.handler,xe=Object(te.a)(Y,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Oe=this.state.open;if(!le)return z.createElement("div",{className:he,ref:function(ne){H.dom=ne}},z.createElement(f,Object.assign({},xe,{open:Oe,handler:Pe,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var pe=!!Pe||we;return z.createElement($.a,{visible:Oe,forceRender:pe,getContainer:le,wrapperClassName:he},function(be){var ne=be.visible,fe=be.afterClose,_e=Object(te.a)(be,["visible","afterClose"]);return z.createElement(f,Object.assign({},xe,_e,{open:ne!==void 0?ne:Oe,afterVisibleChange:fe!==void 0?fe:xe.afterVisibleChange,handler:Pe,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,Y){var ie=Y.prevProps,le={prevProps:H};return typeof ie!="undefined"&&H.open!==ie.open&&(le.open=H.open),le}}]),I}(z.Component);_.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:z.createElement("div",{className:"drawer-handle"},z.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var j=_,W=Ae.a=j},fjLI:function(kt,Ae,U){"use strict";U.d(Ae,"f",function(){return m}),U.d(Ae,"b",function(){return a}),U.d(Ae,"a",function(){return d}),U.d(Ae,"d",function(){return s}),U.d(Ae,"e",function(){return i}),U.d(Ae,"c",function(){return t});var te=U("8HAY"),Q=U("Vhoy"),B=U("MI8n"),J=U("JYp7"),K=U("pmY6"),N=U("24hK"),$=U("nnTU"),z=U("T8No"),r=U("Cg/j"),D=U("t9D7"),p=function(u,o,R,T){var S=arguments.length,A=S<3?o:T===null?T=Object.getOwnPropertyDescriptor(o,R):T,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,o,R,T);else for(var E=u.length-1;E>=0;E--)(P=u[E])&&(A=(S<3?P(A):S>3?P(o,R,A):P(o,R))||A);return S>3&&A&&Object.defineProperty(o,R,A),A},g=function(u,o){return function(R,T){o(R,T,u)}};function m(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 d=Object(r.c)("menuService"),s=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new B.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:u=>u===a.CommandPalette}}addCommand(u){return this.addCommands(J.a.single(u))}addCommands(u){for(const o of u)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(K.i)(()=>{let o=!1;for(const R of u)o=this._commands.delete(R.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(u){return this._commands.get(u)}getCommands(){const u=new Map;return this._commands.forEach((o,R)=>u.set(R,o)),u}appendMenuItem(u,o){return this.appendMenuItems(J.a.single({id:u,item:o}))}appendMenuItems(u){const o=new Set,R=new N.a;for(const{id:T,item:S}of u){let A=this._menuItems.get(T);A||(A=new N.a,this._menuItems.set(T,A)),R.push(A.push(S)),o.add(T)}return this._onDidChangeMenu.fire(o),Object(K.i)(()=>{if(R.size>0){for(let T of R)T();this._onDidChangeMenu.fire(o),R.clear()}})}getMenuItems(u){let o;return this._menuItems.has(u)?o=[...this._menuItems.get(u)]:o=[],u===a.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(u){const o=new Set;for(const R of u)m(R)&&(o.add(R.command.id),R.alt&&o.add(R.alt.id));this._commands.forEach((R,T)=>{o.has(T)||u.push({command:R})})}};class i extends te.e{constructor(u,o,R,T){super(`submenuitem.${u.submenu.id}`,typeof u.title=="string"?u.title:u.title.value,[],"submenu");this.item=u,this._menuService=o,this._contextKeyService=R,this._options=T}get actions(){const u=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=o.getActions(this._options);o.dispose();for(const[,T]of R)T.length>0&&(u.push(...T),u.push(new te.d));return u.length&&u.pop(),u}}let t=class u{constructor(o,R,T,S,A){var P,E;if(this._commandService=A,this.id=o.id,this.label=(T==null?void 0:T.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(E=typeof o.tooltip=="string"?o.tooltip:(P=o.tooltip)===null||P===void 0?void 0:P.value)!==null&&E!==void 0?E:"",this.enabled=!o.precondition||S.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const b=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=S.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=o,this.alt=R?new u(R,void 0,T,S,A):void 0,this._options=T,D.d.isThemeIcon(o.icon)&&(this.class=Q.a.asClassName(o.icon))}dispose(){}run(...o){var R,T;let S=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(S=[...S,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(S=[...S,...o]),this._commandService.executeCommand(this.id,...S)}};t=p([g(3,z.b),g(4,$.b)],t)},fyJ8:function(kt,Ae,U){"use strict";var te=U("rePB"),Q=U("VTBJ"),B=U("Ff2n"),J=U("U8pU"),K=U("q1tI"),N=U.n(K),$=U("TSYQ"),z=U.n($),r=U("c+Xe"),D=U("sR1s");function p(s){return s&&Object(J.a)(s)==="object"&&!Array.isArray(s)&&!K.isValidElement(s)}function g(s){return typeof s=="string"?!0:Object(r.c)(s)}function m(s,i){var t,u=s.prefixCls,o=s.className,R=s.record,T=s.index,S=s.dataIndex,A=s.render,P=s.children,E=s.component,b=E===void 0?"td":E,h=s.colSpan,f=s.rowSpan,C=s.fixLeft,x=s.fixRight,_=s.firstFixLeft,j=s.lastFixLeft,W=s.firstFixRight,w=s.lastFixRight,F=s.appendNode,I=s.additionalProps,v=I===void 0?{}:I,H=s.ellipsis,Y=s.align,ie=s.rowType,le=s.isSticky,he="".concat(u,"-cell"),we,Pe;if(P)Pe=P;else{var xe=Object(D.b)(R,S);if(Pe=xe,A){var Oe=A(xe,R,T);p(Oe)?(Pe=Oe.children,we=Oe.props):Pe=Oe}}Object(J.a)(Pe)==="object"&&!Array.isArray(Pe)&&!K.isValidElement(Pe)&&(Pe=null),H&&(j||W)&&(Pe=K.createElement("span",{className:"".concat(he,"-content")},Pe));var pe=we||{},be=pe.colSpan,ne=pe.rowSpan,fe=pe.style,_e=pe.className,ke=Object(B.a)(pe,["colSpan","rowSpan","style","className"]),qe=be!==void 0?be:h,je=ne!==void 0?ne:f;if(qe===0||je===0)return null;var st={},vt=typeof C=="number",Re=typeof x=="number";vt&&(st.position="sticky",st.left=C),Re&&(st.position="sticky",st.right=x);var Be={};Y&&(Be.textAlign=Y);var Ye,Ke=H===!0?{showTitle:!0}:H;Ke&&(Ke.showTitle||ie==="header")&&(typeof Pe=="string"||typeof Pe=="number"?Ye=Pe.toString():K.isValidElement(Pe)&&typeof Pe.props.children=="string"&&(Ye=Pe.props.children));var yt=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:Ye},ke),v),{},{colSpan:qe&&qe!==1?qe:null,rowSpan:je&&je!==1?je:null,className:z()(he,o,(t={},Object(te.a)(t,"".concat(he,"-fix-left"),vt),Object(te.a)(t,"".concat(he,"-fix-left-first"),_),Object(te.a)(t,"".concat(he,"-fix-left-last"),j),Object(te.a)(t,"".concat(he,"-fix-right"),Re),Object(te.a)(t,"".concat(he,"-fix-right-first"),W),Object(te.a)(t,"".concat(he,"-fix-right-last"),w),Object(te.a)(t,"".concat(he,"-ellipsis"),H),Object(te.a)(t,"".concat(he,"-with-append"),F),Object(te.a)(t,"".concat(he,"-fix-sticky"),(vt||Re)&&le),t),v.className,_e),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},v.style),Be),st),fe),ref:g(b)?i:null});return K.createElement(b,Object.assign({},yt),F,Pe)}var a=K.forwardRef(m);a.displayName="Cell";var d=K.memo(a,function(s,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,s.record):!1});Ae.a=d},h78n:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return _});var te=U("q1tI"),Q=U.n(te),B=U("TSYQ"),J=U.n(B),K={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},N=function(w){var F=w.map(function(){return Object(te.useRef)()}),I=Object(te.useRef)();return Object(te.useEffect)(function(){var v=Date.now(),H=!1;Object.keys(F).forEach(function(Y){var ie=F[Y].current;if(!ie)return;H=!0;var le=ie.style;le.transitionDuration=".3s, .3s, .3s, .06s",I.current&&v-I.current<100&&(le.transitionDuration="0s, 0s")}),H&&(I.current=Date.now())}),[F]};function $(){return $=Object.assign||function(W){for(var w=1;w<arguments.length;w++){var F=arguments[w];for(var I in F)Object.prototype.hasOwnProperty.call(F,I)&&(W[I]=F[I])}return W},$.apply(this,arguments)}function z(W,w){return m(W)||g(W,w)||D(W,w)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(W,w){if(!W)return;if(typeof W=="string")return p(W,w);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 p(W,w)}function p(W,w){(w==null||w>W.length)&&(w=W.length);for(var F=0,I=new Array(w);F<w;F++)I[F]=W[F];return I}function g(W,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(W)))return;var F=[],I=!0,v=!1,H=void 0;try{for(var Y=W[Symbol.iterator](),ie;!(I=(ie=Y.next()).done)&&!(F.push(ie.value),w&&F.length===w);I=!0);}catch(le){v=!0,H=le}finally{try{!I&&Y.return!=null&&Y.return()}finally{if(v)throw H}}return F}function m(W){if(Array.isArray(W))return W}function a(W,w){if(W==null)return{};var F=d(W,w),I,v;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(W);for(v=0;v<H.length;v++){if(I=H[v],w.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,I))continue;F[I]=W[I]}}return F}function d(W,w){if(W==null)return{};var F={},I=Object.keys(W),v,H;for(H=0;H<I.length;H++){if(v=I[H],w.indexOf(v)>=0)continue;F[v]=W[v]}return F}var s=function(w){var F=w.className,I=w.percent,v=w.prefixCls,H=w.strokeColor,Y=w.strokeLinecap,ie=w.strokeWidth,le=w.style,he=w.trailColor,we=w.trailWidth,Pe=w.transition,xe=a(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete xe.gapPosition;var Oe=Array.isArray(I)?I:[I],pe=Array.isArray(H)?H:[H],be=N(Oe),ne=z(be,1),fe=ne[0],_e=ie/2,ke=100-ie/2,qe="M ".concat(Y==="round"?_e:0,",").concat(_e,`
|
|
L `).concat(Y==="round"?ke:100,",").concat(_e),je="0 0 100 ".concat(ie),st=0;return Q.a.createElement("svg",$({className:J()("".concat(v,"-line"),F),viewBox:je,preserveAspectRatio:"none",style:le},xe),Q.a.createElement("path",{className:"".concat(v,"-line-trail"),d:qe,strokeLinecap:Y,stroke:he,strokeWidth:we||ie,fillOpacity:"0"}),Oe.map(function(vt,Re){var Be={strokeDasharray:"".concat(vt,"px, 100px"),strokeDashoffset:"-".concat(st,"px"),transition:Pe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ye=pe[Re]||pe[pe.length-1];return st+=vt,Q.a.createElement("path",{key:Re,className:"".concat(v,"-line-path"),d:qe,strokeLinecap:Y,stroke:Ye,strokeWidth:ie,fillOpacity:"0",ref:fe[Re],style:Be})}))};s.defaultProps=K;var i=s;function t(){return t=Object.assign||function(W){for(var w=1;w<arguments.length;w++){var F=arguments[w];for(var I in F)Object.prototype.hasOwnProperty.call(F,I)&&(W[I]=F[I])}return W},t.apply(this,arguments)}function u(W,w){return A(W)||S(W,w)||R(W,w)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(W,w){if(!W)return;if(typeof W=="string")return T(W,w);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 T(W,w)}function T(W,w){(w==null||w>W.length)&&(w=W.length);for(var F=0,I=new Array(w);F<w;F++)I[F]=W[F];return I}function S(W,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(W)))return;var F=[],I=!0,v=!1,H=void 0;try{for(var Y=W[Symbol.iterator](),ie;!(I=(ie=Y.next()).done)&&!(F.push(ie.value),w&&F.length===w);I=!0);}catch(le){v=!0,H=le}finally{try{!I&&Y.return!=null&&Y.return()}finally{if(v)throw H}}return F}function A(W){if(Array.isArray(W))return W}function P(W,w){if(W==null)return{};var F=E(W,w),I,v;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(W);for(v=0;v<H.length;v++){if(I=H[v],w.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(W,I))continue;F[I]=W[I]}}return F}function E(W,w){if(W==null)return{};var F={},I=Object.keys(W),v,H;for(H=0;H<I.length;H++){if(v=I[H],w.indexOf(v)>=0)continue;F[v]=W[v]}return F}var b=0;function h(W){return+W.replace("%","")}function f(W){return Array.isArray(W)?W:[W]}function C(W,w,F,I){var v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,Y=50-I/2,ie=0,le=-Y,he=0,we=-2*Y;switch(H){case"left":ie=-Y,le=0,he=2*Y,we=0;break;case"right":ie=Y,le=0,he=-2*Y,we=0;break;case"bottom":le=Y,we=2*Y;break;default:}var Pe="M 50,50 m ".concat(ie,",").concat(le,`
|
|
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(he,",").concat(-we,`
|
|
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(-he,",").concat(we),xe=Math.PI*2*Y,Oe={stroke:F,strokeDasharray:"".concat(w/100*(xe-v),"px ").concat(xe,"px"),strokeDashoffset:"-".concat(v/2+W/100*(xe-v),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Pe,pathStyle:Oe}}var x=function(w){var F=w.prefixCls,I=w.strokeWidth,v=w.trailWidth,H=w.gapDegree,Y=w.gapPosition,ie=w.trailColor,le=w.strokeLinecap,he=w.style,we=w.className,Pe=w.strokeColor,xe=w.percent,Oe=P(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),pe=Object(te.useMemo)(function(){return b+=1,b},[]),be=C(0,100,ie,I,H,Y),ne=be.pathString,fe=be.pathStyle,_e=f(xe),ke=f(Pe),qe=ke.find(function(Be){return Object.prototype.toString.call(Be)==="[object Object]"}),je=N(_e),st=u(je,1),vt=st[0],Re=function(){var Ye=0;return _e.map(function(Ke,yt){var Pt=ke[yt]||ke[ke.length-1],Ht=Object.prototype.toString.call(Pt)==="[object Object]"?"url(#".concat(F,"-gradient-").concat(pe,")"):"",Xt=C(Ye,Ke,Pt,I,H,Y);return Ye+=Ke,Q.a.createElement("path",{key:yt,className:"".concat(F,"-circle-path"),d:Xt.pathString,stroke:Ht,strokeLinecap:le,strokeWidth:I,opacity:Ke===0?0:1,fillOpacity:"0",style:Xt.pathStyle,ref:vt[yt]})})};return Q.a.createElement("svg",t({className:J()("".concat(F,"-circle"),we),viewBox:"0 0 100 100",style:he},Oe),qe&&Q.a.createElement("defs",null,Q.a.createElement("linearGradient",{id:"".concat(F,"-gradient-").concat(pe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(qe).sort(function(Be,Ye){return h(Be)-h(Ye)}).map(function(Be,Ye){return Q.a.createElement("stop",{key:Ye,offset:Be,stopColor:qe[Be]})}))),Q.a.createElement("path",{className:"".concat(F,"-circle-trail"),d:ne,stroke:ie,strokeLinecap:le,strokeWidth:v||I,fillOpacity:"0",style:fe}),Re().reverse())};x.defaultProps=K;var _=x,j={Line:i,Circle:_}},hQp1:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});var te;(function(B){B.FirstPage="firstPage",B.PrevPage="prevPage",B.NextPage="nextPage"})(te||(te={}));var Q;(function(B){B[B.Single=0]="Single",B[B.Multiple=1]="Multiple",B[B.Judge=2]="Judge",B[B.Fill=3]="Fill",B[B.Subjective=4]="Subjective",B[B.Shixun=5]="Shixun",B[B.Program=6]="Program",B[B.Combine=7]="Combine"})(Q||(Q={}))},hW8S:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return J}),U.d(Ae,"c",function(){return K}),U.d(Ae,"b",function(){return N});var te=U("VTBJ"),Q=U("Ff2n"),B=U("Kwbf"),J="RC_TABLE_INTERNAL_COL_DEFINE";function K($){var z=$.expandable,r=Object(Q.a)($,["expandable"]);return"expandable"in $?Object(te.a)(Object(te.a)({},r),z):r}function N($){return Object.keys($).reduce(function(z,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(z[r]=$[r]),z},{})}},i58Z:function(kt,Ae,U){kt.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ic2d:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return J});var te=U("FWmy"),Q=U("746U");class B{constructor(){this.data=new Map}add(K,N){te.a(Q.l(K)),te.a(Q.k(N)),te.a(!this.data.has(K),"There is already an extension with this id"),this.data.set(K,N)}as(K){return this.data.get(K)||null}}const J=new B},ie49:function(kt,Ae,U){kt.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(kt,Ae,U){kt.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(kt,Ae,U){},kqOp:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return D});var te=U("0Owb"),Q=U("fWQN"),B=U("mtLc"),J=U("yKVA"),K=U("879j"),N=U("q1tI"),$=U.n(N),z=U("Ot1p"),r="\u2581",D=function(p){Object(J.a)(m,p);var g=Object(K.a)(m);function m(){var a;Object(Q.a)(this,m);for(var d=arguments.length,s=new Array(d),i=0;i<d;i++)s[i]=arguments[i];return a=g.call.apply(g,[this].concat(s)),a.getChCountBeforeCursor=function(t,u){for(var o=u.line,R=0,T=0;T<o;T++)R+=t.getLine(T).split(r).length-1;var S=t.getLine(o).substring(0,u.ch);return R+=S.split(r).length-1,R},a.onCMBeforeChange=function(t,u){var o=t.getRange(u.from,u.to),R=0;if(u.text.forEach(function(P){R+=P.split(r).length-1}),o&&o.indexOf(r)!=-1){var T=o.split(r).length-1,S=a.getChCountBeforeCursor(t,u.from);console.log("\u5220\u9664".concat(T,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(S,"\u4E2A\uFF0C\u65B0\u589E").concat(R,"\u4E2A")),a.props.deleteEmptyDisabled?u.cancel():a.props.onPlaceholderChange&&a.props.onPlaceholderChange(S,T,R)}else if(R){var A=a.getChCountBeforeCursor(t,u.from);console.log("\u65B0\u589E".concat(R,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(A,"\u4E2A")),a.props.onPlaceholderChange&&a.props.onPlaceholderChange(A,0,R)}},a}return Object(B.a)(m,[{key:"render",value:function(){return $.a.createElement(z.a,Object(te.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),m}(N.Component)},lZu9:function(kt,Ae,U){(function(te){te(U("VrN/"),U("1eCo"),U("8EBN"))})(function(te){"use strict";te.defineMode("markdown",function(Q,B){var J=te.getMode(Q,"text/html"),K=J.name=="null";function N(I){if(te.findModeByName){var v=te.findModeByName(I);v&&(I=v.mime||v.mimes[0])}var H=te.getMode(Q,I);return H.name=="null"?null:H}B.highlightFormatting===void 0&&(B.highlightFormatting=!1),B.maxBlockquoteDepth===void 0&&(B.maxBlockquoteDepth=0),B.taskLists===void 0&&(B.taskLists=!1),B.strikethrough===void 0&&(B.strikethrough=!1),B.emoji===void 0&&(B.emoji=!1),B.fencedCodeBlockHighlighting===void 0&&(B.fencedCodeBlockHighlighting=!0),B.fencedCodeBlockDefaultMode===void 0&&(B.fencedCodeBlockDefaultMode="text/plain"),B.xml===void 0&&(B.xml=!0),B.tokenTypeOverrides===void 0&&(B.tokenTypeOverrides={});var $={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var z in $)$.hasOwnProperty(z)&&B.tokenTypeOverrides[z]&&($[z]=B.tokenTypeOverrides[z]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,g=B.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,a=/^[^#!\[\]*_\\<>` "'(~:]+/,d=/^(~~~+|```+)[ \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(I,v,H){return v.f=v.inline=H,H(I,v)}function o(I,v,H){return v.f=v.block=H,H(I,v)}function R(I){return!I||!/\S/.test(I.string)}function T(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==A){var v=K;if(!v){var H=te.innerMode(J,I.htmlState);v=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}v&&(I.f=h,I.block=S,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function S(I,v){var H=I.column()===v.indentation,Y=R(v.prevLine.stream),ie=v.indentedCode,le=v.prevLine.hr,he=v.list!==!1,we=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var Pe=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,he)){for(v.list=null;Pe<v.listStack[v.listStack.length-1];)v.listStack.pop(),v.listStack.length?v.indentation=v.listStack[v.listStack.length-1]:v.list=!1;v.list!==!1&&(v.indentationDiff=Pe-v.listStack[v.listStack.length-1])}var xe=!Y&&!le&&!v.prevLine.header&&(!he||!ie)&&!v.prevLine.fencedCodeEnd,Oe=(v.list===!1||le||Y)&&v.indentation<=we&&I.match(r),pe=null;if(v.indentationDiff>=4&&(ie||v.prevLine.fencedCodeEnd||v.prevLine.header||Y))return I.skipToEnd(),v.indentedCode=!0,$.code;if(I.eatSpace())return null;if(H&&v.indentation<=we&&(pe=I.match(g))&&pe[1].length<=6)return v.quote=0,v.header=pe[1].length,v.thisLine.header=!0,B.highlightFormatting&&(v.formatting="header"),v.f=v.inline,E(v);if(v.indentation<=we&&I.eat(">"))return v.quote=H?1:v.quote+1,B.highlightFormatting&&(v.formatting="quote"),I.eatSpace(),E(v);if(!Oe&&!v.setext&&H&&v.indentation<=we&&(pe=I.match(D))){var be=pe[1]?"ol":"ul";return v.indentation=Pe+I.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,B.taskLists&&I.match(p,!1)&&(v.taskList=!0),v.f=v.inline,B.highlightFormatting&&(v.formatting=["list","list-"+be]),E(v)}else{if(H&&v.indentation<=we&&(pe=I.match(d,!0)))return v.quote=0,v.fencedEndRE=new RegExp(pe[1]+"+ *$"),v.localMode=B.fencedCodeBlockHighlighting&&N(pe[2]||B.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=te.startState(v.localMode)),v.f=v.block=P,B.highlightFormatting&&(v.formatting="code-block"),v.code=-1,E(v);if(v.setext||(!xe||!he)&&!v.quote&&v.list===!1&&!v.code&&!Oe&&!s.test(I.string)&&(pe=I.lookAhead(1))&&(pe=pe.match(m)))return v.setext?(v.header=v.setext,v.setext=0,I.skipToEnd(),B.highlightFormatting&&(v.formatting="header")):(v.header=pe[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,E(v);if(Oe)return I.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,$.hr;if(I.peek()==="[")return u(I,v,j)}return u(I,v,v.inline)}function A(I,v){var H=J.token(I,v.htmlState);if(!K){var Y=te.innerMode(J,v.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||v.md_inside&&I.current().indexOf(">")>-1)&&(v.f=h,v.block=S,v.htmlState=null)}return H}function P(I,v){var H=v.listStack[v.listStack.length-1]||0,Y=v.indentation<H,ie=H+3;if(v.fencedEndRE&&v.indentation<=ie&&(Y||I.match(v.fencedEndRE))){B.highlightFormatting&&(v.formatting="code-block");var le;return Y||(le=E(v)),v.localMode=v.localState=null,v.block=S,v.f=h,v.fencedEndRE=null,v.code=0,v.thisLine.fencedCodeEnd=!0,Y?o(I,v,v.block):le}else return v.localMode?v.localMode.token(I,v.localState):(I.skipToEnd(),$.code)}function E(I){var v=[];if(I.formatting){v.push($.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var H=0;H<I.formatting.length;H++)v.push($.formatting+"-"+I.formatting[H]),I.formatting[H]==="header"&&v.push($.formatting+"-"+I.formatting[H]+"-"+I.header),I.formatting[H]==="quote"&&(!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=I.quote?v.push($.formatting+"-"+I.formatting[H]+"-"+I.quote):v.push("error"))}if(I.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(I.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(I.linkHref?v.push($.linkHref,"url"):(I.strong&&v.push($.strong),I.em&&v.push($.em),I.strikethrough&&v.push($.strikethrough),I.emoji&&v.push($.emoji),I.linkText&&v.push($.linkText),I.code&&v.push($.code),I.image&&v.push($.image),I.imageAltText&&v.push($.imageAltText,"link"),I.imageMarker&&v.push($.imageMarker)),I.header&&v.push($.header,$.header+"-"+I.header),I.quote&&(v.push($.quote),!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=I.quote?v.push($.quote+"-"+I.quote):v.push($.quote+"-"+B.maxBlockquoteDepth)),I.list!==!1){var Y=(I.listStack.length-1)%3;Y?Y===1?v.push($.list2):v.push($.list3):v.push($.list1)}return I.trailingSpaceNewLine?v.push("trailing-space-new-line"):I.trailingSpace&&v.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function b(I,v){return I.match(a,!0)?E(v):void 0}function h(I,v){var H=v.text(I,v);if(typeof H!="undefined")return H;if(v.list)return v.list=null,E(v);if(v.taskList){var Y=I.match(p,!0)[1]===" ";return Y?v.taskOpen=!0:v.taskClosed=!0,B.highlightFormatting&&(v.formatting="task"),v.taskList=!1,E(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&I.match(/^#+$/,!0))return B.highlightFormatting&&(v.formatting="header"),E(v);var ie=I.next();if(v.linkTitle){v.linkTitle=!1;var le=ie;ie==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(I.match(new RegExp(he),!0))return $.linkHref}if(ie==="`"){var we=v.formatting;B.highlightFormatting&&(v.formatting="code"),I.eatWhile("`");var Pe=I.current().length;if(v.code==0&&(!v.quote||Pe==1))return v.code=Pe,E(v);if(Pe==v.code){var xe=E(v);return v.code=0,xe}else return v.formatting=we,E(v)}else if(v.code)return E(v);if(ie==="\\"&&(I.next(),B.highlightFormatting)){var Oe=E(v),pe=$.formatting+"-escape";return Oe?Oe+" "+pe:pe}if(ie==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,B.highlightFormatting&&(v.formatting="image"),E(v);if(ie==="["&&v.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,B.highlightFormatting&&(v.formatting="image"),E(v);if(ie==="]"&&v.imageAltText){B.highlightFormatting&&(v.formatting="image");var Oe=E(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=C,Oe}if(ie==="["&&!v.image)return v.linkText&&I.match(/^.*?\]/)||(v.linkText=!0,B.highlightFormatting&&(v.formatting="link")),E(v);if(ie==="]"&&v.linkText){B.highlightFormatting&&(v.formatting="link");var Oe=E(v);return v.linkText=!1,v.inline=v.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?C:h,Oe}if(ie==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=f,B.highlightFormatting&&(v.formatting="link");var Oe=E(v);return Oe?Oe+=" ":Oe="",Oe+$.linkInline}if(ie==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=f,B.highlightFormatting&&(v.formatting="link");var Oe=E(v);return Oe?Oe+=" ":Oe="",Oe+$.linkEmail}if(B.xml&&ie==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var be=I.string.indexOf(">",I.pos);if(be!=-1){var ne=I.string.substring(I.start,be);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(v.md_inside=!0)}return I.backUp(1),v.htmlState=te.startState(J),o(I,v,A)}if(B.xml&&ie==="<"&&I.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var fe=1,_e=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ie);)fe++;var ke=I.peek()||" ",qe=!/\s/.test(ke)&&(!i.test(ke)||/\s/.test(_e)||i.test(_e)),je=!/\s/.test(_e)&&(!i.test(_e)||/\s/.test(ke)||i.test(ke)),st=null,vt=null;if(fe%2&&(!v.em&&qe&&(ie==="*"||!je||i.test(_e))?st=!0:v.em==ie&&je&&(ie==="*"||!qe||i.test(ke))&&(st=!1)),fe>1&&(!v.strong&&qe&&(ie==="*"||!je||i.test(_e))?vt=!0:v.strong==ie&&je&&(ie==="*"||!qe||i.test(ke))&&(vt=!1)),vt!=null||st!=null){B.highlightFormatting&&(v.formatting=st==null?"strong":vt==null?"em":"strong em"),st===!0&&(v.em=ie),vt===!0&&(v.strong=ie);var xe=E(v);return st===!1&&(v.em=!1),vt===!1&&(v.strong=!1),xe}}else if(ie===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return E(v);I.backUp(1)}if(B.strikethrough){if(ie==="~"&&I.eatWhile(ie)){if(v.strikethrough){B.highlightFormatting&&(v.formatting="strikethrough");var xe=E(v);return v.strikethrough=!1,xe}else if(I.match(/^[^\s]/,!1))return v.strikethrough=!0,B.highlightFormatting&&(v.formatting="strikethrough"),E(v)}else if(ie===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return E(v);I.backUp(2)}}if(B.emoji&&ie===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,B.highlightFormatting&&(v.formatting="emoji");var Re=E(v);return v.emoji=!1,Re}return ie===" "&&(I.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),E(v)}function f(I,v){var H=I.next();if(H===">"){v.f=v.inline=h,B.highlightFormatting&&(v.formatting="link");var Y=E(v);return Y?Y+=" ":Y="",Y+$.linkInline}return I.match(/^[^>]+/,!0),$.linkInline}function C(I,v){if(I.eatSpace())return null;var H=I.next();return H==="("||H==="["?(v.f=v.inline=_(H==="("?")":"]"),B.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,E(v)):"error"}var x={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(I){return function(v,H){var Y=v.next();if(Y===I){H.f=H.inline=h,B.highlightFormatting&&(H.formatting="link-string");var ie=E(H);return H.linkHref=!1,ie}return v.match(x[I]),H.linkHref=!0,E(H)}}function j(I,v){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=W,I.next(),B.highlightFormatting&&(v.formatting="link"),v.linkText=!0,E(v)):u(I,v,h)}function W(I,v){if(I.match(/^\]:/,!0)){v.f=v.inline=w,B.highlightFormatting&&(v.formatting="link");var H=E(v);return v.linkText=!1,H}return I.match(/^([^\]\\]|\\.)+/,!0),$.linkText}function w(I,v){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?v.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=h,$.linkHref+" url")}var F={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:h,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&te.copyState(J,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?te.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,v){if(v.formatting=!1,I!=v.thisLine.stream){if(v.header=0,v.hr=!1,I.match(/^\s*$/,!0))return T(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:I},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=A)){var H=I.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(v.indentation=H,v.indentationDiff=null,H>0)return null}}return v.f(I,v)},innerMode:function(I){return I.block==A?{state:I.htmlState,mode:J}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:F}},indent:function(I,v,H){return I.block==A&&J.indent?J.indent(I.htmlState,v,H):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,v,H):te.Pass},blankLine:T,getType:E,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},loLm:function(kt,Ae,U){kt.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(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return z});var te=U("q1tI"),Q=U("biw7"),B=U("fyJ8");function J(r){var D=r.className,p=r.index,g=r.children,m=r.colSpan,a=r.rowSpan,d=te.useContext(Q.a),s=d.prefixCls,i=d.fixedInfoList,t=i[p];return te.createElement(B.a,Object.assign({className:D,index:p,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:m,rowSpan:a}}}},t))}function K(r){return te.createElement("tr",Object.assign({},r))}function N(r){var D=r.children,p=te.useContext(Q.a),g=p.prefixCls;return te.createElement("tfoot",{className:"".concat(g,"-summary")},D)}var $=Ae.b=N,z={Cell:J,Row:K}},nEHx:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return te});var te;(function(Q){Q.DARK="dark",Q.LIGHT="light",Q.HIGH_CONTRAST="hc"})(te||(te={}))},ngQI:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Ul}),U.d(Ae,"b",function(){return yl}),U.d(Ae,"c",function(){return bl});var te=U("q1tI"),Q=U.n(te),B=U("dI71"),J=U("wx14"),K=U("ANjH"),N=U("/MKj");function $(L,k){if(L.length!==k.length)return!1;for(var V=0;V<L.length;V++)if(L[V]!==k[V])return!1;return!0}function z(L,k){var V=Object(te.useState)(function(){return{inputs:k,result:L()}})[0],re=Object(te.useRef)(!0),de=Object(te.useRef)(V),ce=re.current||Boolean(k&&de.current.inputs&&$(k,de.current.inputs)),Te=ce?de.current:{inputs:k,result:L()};return Object(te.useEffect)(function(){re.current=!1,de.current=Te},[Te]),Te.result}function r(L,k){return z(function(){return L},k)}var D=z,p=r,g=U("9R94"),m=function(k){var V=k.top,re=k.right,de=k.bottom,ce=k.left,Te=re-ce,Se=de-V,Ve={top:V,right:re,bottom:de,left:ce,width:Te,height:Se,x:ce,y:V,center:{x:(re+ce)/2,y:(de+V)/2}};return Ve},a=function(k,V){return{top:k.top-V.top,left:k.left-V.left,bottom:k.bottom+V.bottom,right:k.right+V.right}},d=function(k,V){return{top:k.top+V.top,left:k.left+V.left,bottom:k.bottom-V.bottom,right:k.right-V.right}},s=function(k,V){return{top:k.top+V.y,left:k.left+V.x,bottom:k.bottom+V.y,right:k.right+V.x}},i={top:0,right:0,bottom:0,left:0},t=function(k){var V=k.borderBox,re=k.margin,de=re===void 0?i:re,ce=k.border,Te=ce===void 0?i:ce,Se=k.padding,Ve=Se===void 0?i:Se,it=m(a(V,de)),ut=m(d(V,Te)),$e=m(d(ut,Ve));return{marginBox:it,borderBox:m(V),paddingBox:ut,contentBox:$e,margin:de,border:Te,padding:Ve}},u=function(k){var V=k.slice(0,-2),re=k.slice(-2);if(re!=="px")return 0;var de=Number(V);return isNaN(de)&&Object(g.a)(!1),de},o=function(){return{x:window.pageXOffset,y:window.pageYOffset}},R=function(k,V){var re=k.borderBox,de=k.border,ce=k.margin,Te=k.padding,Se=s(re,V);return t({borderBox:Se,border:de,margin:ce,padding:Te})},T=function(k,V){return V===void 0&&(V=o()),R(k,V)},S=function(k,V){var re={top:u(V.marginTop),right:u(V.marginRight),bottom:u(V.marginBottom),left:u(V.marginLeft)},de={top:u(V.paddingTop),right:u(V.paddingRight),bottom:u(V.paddingBottom),left:u(V.paddingLeft)},ce={top:u(V.borderTopWidth),right:u(V.borderRightWidth),bottom:u(V.borderBottomWidth),left:u(V.borderLeftWidth)};return t({borderBox:k,margin:re,padding:de,border:ce})},A=function(k){var V=k.getBoundingClientRect(),re=window.getComputedStyle(k);return S(V,re)},P=Number.isNaN||function(k){return typeof k=="number"&&k!==k};function E(L,k){return L===k?!0:!!(P(L)&&P(k))}function b(L,k){if(L.length!==k.length)return!1;for(var V=0;V<L.length;V++)if(!E(L[V],k[V]))return!1;return!0}function h(L,k){k===void 0&&(k=b);var V,re=[],de,ce=!1;function Te(){for(var Se=[],Ve=0;Ve<arguments.length;Ve++)Se[Ve]=arguments[Ve];return ce&&V===this&&k(Se,re)||(de=L.apply(this,Se),ce=!0,V=this,re=Se),de}return Te}var f=h,C=function(k){var V=[],re=null,de=function(){for(var Te=arguments.length,Se=new Array(Te),Ve=0;Ve<Te;Ve++)Se[Ve]=arguments[Ve];if(V=Se,re)return;re=requestAnimationFrame(function(){re=null,k.apply(void 0,V)})};return de.cancel=function(){if(!re)return;cancelAnimationFrame(re),re=null},de},x=C,_=U("i8i4"),j=U.n(_),W=!0,w=/[ \t]{2,}/g,F=/^[ \t]*/gm,I=function(k){return k.replace(w," ").replace(F,"").trim()},v=function(k){return I(`
|
|
%creact-beautiful-dnd
|
|
|
|
%c`+I(k)+`
|
|
|
|
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
|
|
`)},H=function(k){return[v(k),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Y="__react-beautiful-dnd-disable-dev-warnings";function ie(L,k){var V;if(W)return;if(typeof window!="undefined"&&window[Y])return;(V=console)[L].apply(V,H(k))}var le=ie.bind(null,"warn"),he=ie.bind(null,"error");function we(){}function Pe(L,k){return Object(J.a)({},L,{},k)}function xe(L,k,V){var re=k.map(function(de){var ce=Pe(V,de.options);return L.addEventListener(de.eventName,de.fn,ce),function(){L.removeEventListener(de.eventName,de.fn,ce)}});return function(){re.forEach(function(ce){ce()})}}var Oe=!0,pe="Invariant failed";function be(L){this.message=L}be.prototype.toString=function(){return this.message};function ne(L,k){if(L)return;throw Oe?new be(pe):new be(pe+": "+(k||""))}var fe=function(L){Object(B.a)(k,L);function k(){for(var re,de=arguments.length,ce=new Array(de),Te=0;Te<de;Te++)ce[Te]=arguments[Te];return re=L.call.apply(L,[this].concat(ce))||this,re.callbacks=null,re.unbind=we,re.onWindowError=function(Se){var Ve=re.getCallbacks();Ve.isDragging()&&Ve.tryAbort();var it=Se.error;it instanceof be&&Se.preventDefault()},re.getCallbacks=function(){if(!re.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return re.callbacks},re.setCallbacks=function(Se){re.callbacks=Se},re}var V=k.prototype;return V.componentDidMount=function(){this.unbind=xe(window,[{eventName:"error",fn:this.onWindowError}])},V.componentWillUnmount=function(){this.unbind()},V.componentDidCatch=function(de){if(de instanceof be){this.setState({});return}throw de},V.render=function(){return this.props.children(this.setCallbacks)},k}(Q.a.Component),_e=`
|
|
Press space bar to start a drag.
|
|
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
|
Some screen readers may require you to be in focus mode or to use your pass through key
|
|
`,ke=function(k){return k+1},qe=function(k){return`
|
|
You have lifted an item in position `+ke(k.source.index)+`
|
|
`},je=function(k,V){var re=k.droppableId===V.droppableId,de=ke(k.index),ce=ke(V.index);return re?`
|
|
You have moved the item from position `+de+`
|
|
to position `+ce+`
|
|
`:`
|
|
You have moved the item from position `+de+`
|
|
in list `+k.droppableId+`
|
|
to list `+V.droppableId+`
|
|
in position `+ce+`
|
|
`},st=function(k,V,re){var de=V.droppableId===re.droppableId;return de?`
|
|
The item `+k+`
|
|
has been combined with `+re.draggableId:`
|
|
The item `+k+`
|
|
in list `+V.droppableId+`
|
|
has been combined with `+re.draggableId+`
|
|
in list `+re.droppableId+`
|
|
`},vt=function(k){var V=k.destination;if(V)return je(k.source,V);var re=k.combine;return re?st(k.draggableId,k.source,re):"You are over an area that cannot be dropped on"},Re=function(k){return`
|
|
The item has returned to its starting position
|
|
of `+ke(k.index)+`
|
|
`},Be=function(k){if(k.reason==="CANCEL")return`
|
|
Movement cancelled.
|
|
`+Re(k.source)+`
|
|
`;var V=k.destination,re=k.combine;return V?`
|
|
You have dropped the item.
|
|
`+je(k.source,V)+`
|
|
`:re?`
|
|
You have dropped the item.
|
|
`+st(k.draggableId,k.source,re)+`
|
|
`:`
|
|
The item has been dropped while not over a drop area.
|
|
`+Re(k.source)+`
|
|
`},Ye={dragHandleUsageInstructions:_e,onDragStart:qe,onDragUpdate:vt,onDragEnd:Be},Ke={x:0,y:0},yt=function(k,V){return{x:k.x+V.x,y:k.y+V.y}},Pt=function(k,V){return{x:k.x-V.x,y:k.y-V.y}},Ht=function(k,V){return k.x===V.x&&k.y===V.y},Xt=function(k){return{x:k.x!==0?-k.x:0,y:k.y!==0?-k.y:0}},an=function(k,V,re){var de;return re===void 0&&(re=0),de={},de[k]=V,de[k==="x"?"y":"x"]=re,de},tn=function(k,V){return Math.sqrt(Math.pow(V.x-k.x,2)+Math.pow(V.y-k.y,2))},et=function(k,V){return Math.min.apply(Math,V.map(function(re){return tn(k,re)}))},Ze=function(k){return function(V){return{x:k(V.x),y:k(V.y)}}},Ct=function(L,k){var V=m({top:Math.max(k.top,L.top),right:Math.min(k.right,L.right),bottom:Math.min(k.bottom,L.bottom),left:Math.max(k.left,L.left)});return V.width<=0||V.height<=0?null:V},At=function(k,V){return{top:k.top+V.y,left:k.left+V.x,bottom:k.bottom+V.y,right:k.right+V.x}},dt=function(k){return[{x:k.left,y:k.top},{x:k.right,y:k.top},{x:k.left,y:k.bottom},{x:k.right,y:k.bottom}]},ft={top:0,right:0,bottom:0,left:0},He=function(k,V){return V?At(k,V.scroll.diff.displacement):k},Ne=function(k,V,re){if(re&&re.increasedBy){var de;return Object(J.a)({},k,(de={},de[V.end]=k[V.end]+re.increasedBy[V.line],de))}return k},Ue=function(k,V){return V&&V.shouldClipSubject?Ct(V.pageMarginBox,k):m(k)},ge=function(L){var k=L.page,V=L.withPlaceholder,re=L.axis,de=L.frame,ce=He(k.marginBox,de),Te=Ne(ce,re,V),Se=Ue(Te,de);return{page:k,withPlaceholder:V,active:Se}},Ee=function(L,k){L.frame||ne(!1);var V=L.frame,re=Pt(k,V.scroll.initial),de=Xt(re),ce=Object(J.a)({},V,{scroll:{initial:V.scroll.initial,current:k,diff:{value:re,displacement:de},max:V.scroll.max}}),Te=ge({page:L.subject.page,withPlaceholder:L.subject.withPlaceholder,axis:L.axis,frame:ce}),Se=Object(J.a)({},L,{frame:ce,subject:Te});return Se};function De(L){return Number.isInteger?Number.isInteger(L):typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function ue(L){return Object.values?Object.values(L):Object.keys(L).map(function(k){return L[k]})}function Fe(L,k){if(L.findIndex)return L.findIndex(k);for(var V=0;V<L.length;V++)if(k(L[V]))return V;return-1}function at(L,k){if(L.find)return L.find(k);var V=Fe(L,k);return V!==-1?L[V]:void 0}function xt(L){return Array.prototype.slice.call(L)}var Gt=f(function(L){return L.reduce(function(k,V){return k[V.descriptor.id]=V,k},{})}),$t=f(function(L){return L.reduce(function(k,V){return k[V.descriptor.id]=V,k},{})}),Yt=f(function(L){return ue(L)}),$n=f(function(L){return ue(L)}),vn=f(function(L,k){var V=$n(k).filter(function(re){return L===re.descriptor.droppableId}).sort(function(re,de){return re.descriptor.index-de.descriptor.index});return V});function ln(L){return L.at&&L.at.type==="REORDER"?L.at.destination:null}function hn(L){return L.at&&L.at.type==="COMBINE"?L.at.combine:null}var Gn=f(function(L,k){return k.filter(function(V){return V.descriptor.id!==L.descriptor.id})}),fr=function(L){var k=L.isMovingForward,V=L.draggable,re=L.destination,de=L.insideDestination,ce=L.previousImpact;if(!re.isCombineEnabled)return null;var Te=ln(ce);if(!Te)return null;function Se(An){var Fn={type:"COMBINE",combine:{draggableId:An,droppableId:re.descriptor.id}};return Object(J.a)({},ce,{at:Fn})}var Ve=ce.displaced.all,it=Ve.length?Ve[0]:null;if(k)return it?Se(it):null;var ut=Gn(V,de);if(!it){if(!ut.length)return null;var $e=ut[ut.length-1];return Se($e.descriptor.id)}var Xe=Fe(ut,function(An){return An.descriptor.id===it});Xe!==-1||ne(!1);var tt=Xe-1;if(tt<0)return null;var Dt=ut[tt];return Se(Dt.descriptor.id)},vr=function(L,k){return L.descriptor.droppableId===k.descriptor.id},ir={point:Ke,value:0},br={invisible:{},visible:{},all:[]},Rr={displaced:br,displacedBy:ir,at:null},Jt=function(L,k){return function(V){return L<=V&&V<=k}},Ar=function(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(re){var de=k(re.top)&&k(re.bottom)&&V(re.left)&&V(re.right);if(de)return!0;var ce=k(re.top)||k(re.bottom),Te=V(re.left)||V(re.right),Se=ce&&Te;if(Se)return!0;var Ve=re.top<L.top&&re.bottom>L.bottom,it=re.left<L.left&&re.right>L.right,ut=Ve&⁢if(ut)return!0;var $e=Ve&&Te||it&&ce;return $e}},Nn=function(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(re){var de=k(re.top)&&k(re.bottom)&&V(re.left)&&V(re.right);return de}},Tn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},pr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},_r=function(L){return function(k){var V=Jt(k.top,k.bottom),re=Jt(k.left,k.right);return function(de){return L===Tn?V(de.top)&&V(de.bottom):re(de.left)&&re(de.right)}}},Pr=function(k,V){var re=V.frame?V.frame.scroll.diff.displacement:Ke;return At(k,re)},yr=function(k,V,re){return V.subject.active?re(V.subject.active)(k):!1},mt=function(k,V,re){return re(V)(k)},Ge=function(k){var V=k.target,re=k.destination,de=k.viewport,ce=k.withDroppableDisplacement,Te=k.isVisibleThroughFrameFn,Se=ce?Pr(V,re):V;return yr(Se,re,Te)&&mt(Se,de,Te)},Ot=function(k){return Ge(Object(J.a)({},k,{isVisibleThroughFrameFn:Ar}))},Me=function(k){return Ge(Object(J.a)({},k,{isVisibleThroughFrameFn:Nn}))},ye=function(k){return Ge(Object(J.a)({},k,{isVisibleThroughFrameFn:_r(k.destination.axis)}))},ve=function(k,V,re){if(typeof re=="boolean")return re;if(!V)return!0;var de=V.invisible,ce=V.visible;if(de[k])return!1;var Te=ce[k];return Te?Te.shouldAnimate:!0};function or(L,k){var V=L.page.marginBox,re={top:k.point.y,right:0,bottom:0,left:k.point.x};return m(a(V,re))}function en(L){var k=L.afterDragging,V=L.destination,re=L.displacedBy,de=L.viewport,ce=L.forceShouldAnimate,Te=L.last;return k.reduce(function(Ve,it){var ut=or(it,re),$e=it.descriptor.id;Ve.all.push($e);var Xe=Ot({target:ut,destination:V,viewport:de,withDroppableDisplacement:!0});if(!Xe)return Ve.invisible[it.descriptor.id]=!0,Ve;var tt=ve($e,Te,ce),Dt={draggableId:$e,shouldAnimate:tt};return Ve.visible[$e]=Dt,Ve},{all:[],visible:{},invisible:{}})}function Ie(L,k){if(!L.length)return 0;var V=L[L.length-1].descriptor.index;return k.inHomeList?V:V+1}function gt(L){var k=L.insideDestination,V=L.inHomeList,re=L.displacedBy,de=L.destination,ce=Ie(k,{inHomeList:V});return{displaced:br,displacedBy:re,at:{type:"REORDER",destination:{droppableId:de.descriptor.id,index:ce}}}}function Ce(L){var k=L.draggable,V=L.insideDestination,re=L.destination,de=L.viewport,ce=L.displacedBy,Te=L.last,Se=L.index,Ve=L.forceShouldAnimate,it=vr(k,re);if(Se==null)return gt({insideDestination:V,inHomeList:it,displacedBy:ce,destination:re});var ut=at(V,function(An){return An.descriptor.index===Se});if(!ut)return gt({insideDestination:V,inHomeList:it,displacedBy:ce,destination:re});var $e=Gn(k,V),Xe=V.indexOf(ut),tt=$e.slice(Xe),Dt=en({afterDragging:tt,destination:re,displacedBy:ce,last:Te,viewport:de.frame,forceShouldAnimate:Ve});return{displaced:Dt,displacedBy:ce,at:{type:"REORDER",destination:{droppableId:re.descriptor.id,index:Se}}}}function cn(L,k){return Boolean(k.effected[L])}var hr=function(L){var k=L.isMovingForward,V=L.destination,re=L.draggables,de=L.combine,ce=L.afterCritical;if(!V.isCombineEnabled)return null;var Te=de.draggableId,Se=re[Te],Ve=Se.descriptor.index,it=cn(Te,ce);return it?k?Ve:Ve-1:k?Ve+1:Ve},mr=function(L){var k=L.isMovingForward,V=L.isInHomeList,re=L.insideDestination,de=L.location;if(!re.length)return null;var ce=de.index,Te=k?ce+1:ce-1,Se=re[0].descriptor.index,Ve=re[re.length-1].descriptor.index,it=V?Ve:Ve+1;return Te<Se||Te>it?null:Te},q=function(L){var k=L.isMovingForward,V=L.isInHomeList,re=L.draggable,de=L.draggables,ce=L.destination,Te=L.insideDestination,Se=L.previousImpact,Ve=L.viewport,it=L.afterCritical,ut=Se.at;if(ut||ne(!1),ut.type==="REORDER"){var $e=mr({isMovingForward:k,isInHomeList:V,location:ut.destination,insideDestination:Te});return $e==null?null:Ce({draggable:re,insideDestination:Te,destination:ce,viewport:Ve,last:Se.displaced,displacedBy:Se.displacedBy,index:$e})}var Xe=hr({isMovingForward:k,destination:ce,displaced:Se.displaced,draggables:de,combine:ut.combine,afterCritical:it});return Xe==null?null:Ce({draggable:re,insideDestination:Te,destination:ce,viewport:Ve,last:Se.displaced,displacedBy:Se.displacedBy,index:Xe})},O=function(L){var k=L.displaced,V=L.afterCritical,re=L.combineWith,de=L.displacedBy,ce=Boolean(k.visible[re]||k.invisible[re]);return cn(re,V)?ce?Ke:Xt(de.point):ce?de.point:Ke},M=function(L){var k=L.afterCritical,V=L.impact,re=L.draggables,de=hn(V);de||ne(!1);var ce=de.draggableId,Te=re[ce].page.borderBox.center,Se=O({displaced:V.displaced,afterCritical:k,combineWith:ce,displacedBy:V.displacedBy});return yt(Te,Se)},X=function(k,V){return V.margin[k.start]+V.borderBox[k.size]/2},se=function(k,V){return V.margin[k.end]+V.borderBox[k.size]/2},Z=function(k,V,re){return V[k.crossAxisStart]+re.margin[k.crossAxisStart]+re.borderBox[k.crossAxisSize]/2},Le=function(k){var V=k.axis,re=k.moveRelativeTo,de=k.isMoving;return an(V.line,re.marginBox[V.end]+X(V,de),Z(V,re.marginBox,de))},ot=function(k){var V=k.axis,re=k.moveRelativeTo,de=k.isMoving;return an(V.line,re.marginBox[V.start]-se(V,de),Z(V,re.marginBox,de))},wt=function(k){var V=k.axis,re=k.moveInto,de=k.isMoving;return an(V.line,re.contentBox[V.start]+X(V,de),Z(V,re.contentBox,de))},Lt=function(L){var k=L.impact,V=L.draggable,re=L.draggables,de=L.droppable,ce=L.afterCritical,Te=vn(de.descriptor.id,re),Se=V.page,Ve=de.axis;if(!Te.length)return wt({axis:Ve,moveInto:de.page,isMoving:Se});var it=k.displaced,ut=k.displacedBy,$e=it.all[0];if($e){var Xe=re[$e];if(cn($e,ce))return ot({axis:Ve,moveRelativeTo:Xe.page,isMoving:Se});var tt=R(Xe.page,ut.point);return ot({axis:Ve,moveRelativeTo:tt,isMoving:Se})}var Dt=Te[Te.length-1];if(Dt.descriptor.id===V.descriptor.id)return Se.borderBox.center;if(cn(Dt.descriptor.id,ce)){var An=R(Dt.page,Xt(ce.displacedBy.point));return Le({axis:Ve,moveRelativeTo:An,isMoving:Se})}return Le({axis:Ve,moveRelativeTo:Dt.page,isMoving:Se})},ct=function(L,k){var V=L.frame;return V?yt(k,V.scroll.diff.displacement):k},Et=function(k){var V=k.impact,re=k.draggable,de=k.droppable,ce=k.draggables,Te=k.afterCritical,Se=re.page.borderBox.center,Ve=V.at;return de&&Ve?Ve.type==="REORDER"?Lt({impact:V,draggable:re,draggables:ce,droppable:de,afterCritical:Te}):M({impact:V,draggables:ce,afterCritical:Te}):Se},Mt=function(L){var k=Et(L),V=L.droppable,re=V?ct(V,k):k;return re},Cn=function(L,k){var V=Pt(k,L.scroll.initial),re=Xt(V),de=m({top:k.y,bottom:k.y+L.frame.height,left:k.x,right:k.x+L.frame.width}),ce={frame:de,scroll:{initial:L.scroll.initial,max:L.scroll.max,current:k,diff:{value:V,displacement:re}}};return ce};function Yn(L,k){return L.map(function(V){return k[V]})}function Hn(L,k){for(var V=0;V<k.length;V++){var re=k[V].visible[L];if(re)return re}return null}var fn=function(L){var k=L.impact,V=L.viewport,re=L.destination,de=L.draggables,ce=L.maxScrollChange,Te=Cn(V,yt(V.scroll.current,ce)),Se=re.frame?Ee(re,yt(re.frame.scroll.current,ce)):re,Ve=k.displaced,it=en({afterDragging:Yn(Ve.all,de),destination:re,displacedBy:k.displacedBy,viewport:Te.frame,last:Ve,forceShouldAnimate:!1}),ut=en({afterDragging:Yn(Ve.all,de),destination:Se,displacedBy:k.displacedBy,viewport:V.frame,last:Ve,forceShouldAnimate:!1}),$e={},Xe={},tt=[Ve,it,ut];Ve.all.forEach(function(An){var Fn=Hn(An,tt);if(Fn){Xe[An]=Fn;return}$e[An]=!0});var Dt=Object(J.a)({},k,{displaced:{all:Ve.all,invisible:$e,visible:Xe}});return Dt},Wt=function(L,k){return yt(L.scroll.diff.displacement,k)},sn=function(L){var k=L.pageBorderBoxCenter,V=L.draggable,re=L.viewport,de=Wt(re,k),ce=Pt(de,V.page.borderBox.center);return yt(V.client.borderBox.center,ce)},qt=function(L){var k=L.draggable,V=L.destination,re=L.newPageBorderBoxCenter,de=L.viewport,ce=L.withDroppableDisplacement,Te=L.onlyOnMainAxis,Se=Te===void 0?!1:Te,Ve=Pt(re,k.page.borderBox.center),it=At(k.page.borderBox,Ve),ut={target:it,destination:V,withDroppableDisplacement:ce,viewport:de};return Se?ye(ut):Me(ut)},Ft=function(L){var k=L.isMovingForward,V=L.draggable,re=L.destination,de=L.draggables,ce=L.previousImpact,Te=L.viewport,Se=L.previousPageBorderBoxCenter,Ve=L.previousClientSelection,it=L.afterCritical;if(!re.isEnabled)return null;var ut=vn(re.descriptor.id,de),$e=vr(V,re),Xe=fr({isMovingForward:k,draggable:V,destination:re,insideDestination:ut,previousImpact:ce})||q({isMovingForward:k,isInHomeList:$e,draggable:V,draggables:de,destination:re,insideDestination:ut,previousImpact:ce,viewport:Te,afterCritical:it});if(!Xe)return null;var tt=Mt({impact:Xe,draggable:V,droppable:re,draggables:de,afterCritical:it}),Dt=qt({draggable:V,destination:re,newPageBorderBoxCenter:tt,viewport:Te.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Dt){var An=sn({pageBorderBoxCenter:tt,draggable:V,viewport:Te});return{clientSelection:An,impact:Xe,scrollJumpRequest:null}}var Fn=Pt(tt,Se),ar=fn({impact:Xe,viewport:Te,destination:re,draggables:de,maxScrollChange:Fn});return{clientSelection:Ve,impact:ar,scrollJumpRequest:Fn}},Qn=function(k){var V=k.subject.active;return V||ne(!1),V},Bn=function(L){var k=L.isMovingForward,V=L.pageBorderBoxCenter,re=L.source,de=L.droppables,ce=L.viewport,Te=re.subject.active;if(!Te)return null;var Se=re.axis,Ve=Jt(Te[Se.start],Te[Se.end]),it=Yt(de).filter(function($e){return $e!==re}).filter(function($e){return $e.isEnabled}).filter(function($e){return Boolean($e.subject.active)}).filter(function($e){return Ar(ce.frame)(Qn($e))}).filter(function($e){var Xe=Qn($e);return k?Te[Se.crossAxisEnd]<Xe[Se.crossAxisEnd]:Xe[Se.crossAxisStart]<Te[Se.crossAxisStart]}).filter(function($e){var Xe=Qn($e),tt=Jt(Xe[Se.start],Xe[Se.end]);return Ve(Xe[Se.start])||Ve(Xe[Se.end])||tt(Te[Se.start])||tt(Te[Se.end])}).sort(function($e,Xe){var tt=Qn($e)[Se.crossAxisStart],Dt=Qn(Xe)[Se.crossAxisStart];return k?tt-Dt:Dt-tt}).filter(function($e,Xe,tt){return Qn($e)[Se.crossAxisStart]===Qn(tt[0])[Se.crossAxisStart]});if(!it.length)return null;if(it.length===1)return it[0];var ut=it.filter(function($e){var Xe=Jt(Qn($e)[Se.start],Qn($e)[Se.end]);return Xe(V[Se.line])});return ut.length===1?ut[0]:ut.length>1?ut.sort(function($e,Xe){return Qn($e)[Se.start]-Qn(Xe)[Se.start]})[0]:it.sort(function($e,Xe){var tt=et(V,dt(Qn($e))),Dt=et(V,dt(Qn(Xe)));return tt!==Dt?tt-Dt:Qn($e)[Se.start]-Qn(Xe)[Se.start]})[0]},xn=function(k,V){var re=k.page.borderBox.center;return cn(k.descriptor.id,V)?Pt(re,V.displacedBy.point):re},Jn=function(k,V){var re=k.page.borderBox;return cn(k.descriptor.id,V)?At(re,Xt(V.displacedBy.point)):re},pn=function(L){var k=L.pageBorderBoxCenter,V=L.viewport,re=L.destination,de=L.insideDestination,ce=L.afterCritical,Te=de.filter(function(Se){return Me({target:Jn(Se,ce),destination:re,viewport:V.frame,withDroppableDisplacement:!0})}).sort(function(Se,Ve){var it=tn(k,ct(re,xn(Se,ce))),ut=tn(k,ct(re,xn(Ve,ce)));return it<ut?-1:ut<it?1:Se.descriptor.index-Ve.descriptor.index});return Te[0]||null},Sn=f(function(k,V){var re=V[k.line];return{value:re,point:an(k.line,re)}}),un=function(k,V,re){var de=k.axis;if(k.descriptor.mode==="virtual")return an(de.line,V[de.line]);var ce=k.subject.page.contentBox[de.size],Te=vn(k.descriptor.id,re),Se=Te.reduce(function(ut,$e){return ut+$e.client.marginBox[de.size]},0),Ve=Se+V[de.line],it=Ve-ce;return it<=0?null:an(de.line,it)},Un=function(k,V){return Object(J.a)({},k,{scroll:Object(J.a)({},k.scroll,{max:V})})},Xn=function(k,V,re){var de=k.frame;vr(V,k)&&ne(!1),k.subject.withPlaceholder&&ne(!1);var ce=Sn(k.axis,V.displaceBy).point,Te=un(k,ce,re),Se={placeholderSize:ce,increasedBy:Te,oldFrameMaxScroll:k.frame?k.frame.scroll.max:null};if(!de){var Ve=ge({page:k.subject.page,withPlaceholder:Se,axis:k.axis,frame:k.frame});return Object(J.a)({},k,{subject:Ve})}var it=Te?yt(de.scroll.max,Te):de.scroll.max,ut=Un(de,it),$e=ge({page:k.subject.page,withPlaceholder:Se,axis:k.axis,frame:ut});return Object(J.a)({},k,{subject:$e,frame:ut})},nr=function(k){var V=k.subject.withPlaceholder;V||ne(!1);var re=k.frame;if(!re){var de=ge({page:k.subject.page,axis:k.axis,frame:null,withPlaceholder:null});return Object(J.a)({},k,{subject:de})}var ce=V.oldFrameMaxScroll;ce||ne(!1);var Te=Un(re,ce),Se=ge({page:k.subject.page,axis:k.axis,frame:Te,withPlaceholder:null});return Object(J.a)({},k,{subject:Se,frame:Te})},Ln=function(L){var k=L.previousPageBorderBoxCenter,V=L.moveRelativeTo,re=L.insideDestination,de=L.draggable,ce=L.draggables,Te=L.destination,Se=L.viewport,Ve=L.afterCritical;if(!V){if(re.length)return null;var it={displaced:br,displacedBy:ir,at:{type:"REORDER",destination:{droppableId:Te.descriptor.id,index:0}}},ut=Mt({impact:it,draggable:de,droppable:Te,draggables:ce,afterCritical:Ve}),$e=vr(de,Te)?Te:Xn(Te,de,ce),Xe=qt({draggable:de,destination:$e,newPageBorderBoxCenter:ut,viewport:Se.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Xe?it:null}var tt=Boolean(k[Te.axis.line]<=V.page.borderBox.center[Te.axis.line]),Dt=function(){var Fn=V.descriptor.index;return V.descriptor.id===de.descriptor.id||tt?Fn:Fn+1}(),An=Sn(Te.axis,de.displaceBy);return Ce({draggable:de,insideDestination:re,destination:Te,viewport:Se,displacedBy:An,last:br,index:Dt})},Kn=function(L){var k=L.isMovingForward,V=L.previousPageBorderBoxCenter,re=L.draggable,de=L.isOver,ce=L.draggables,Te=L.droppables,Se=L.viewport,Ve=L.afterCritical,it=Bn({isMovingForward:k,pageBorderBoxCenter:V,source:de,droppables:Te,viewport:Se});if(!it)return null;var ut=vn(it.descriptor.id,ce),$e=pn({pageBorderBoxCenter:V,viewport:Se,destination:it,insideDestination:ut,afterCritical:Ve}),Xe=Ln({previousPageBorderBoxCenter:V,destination:it,draggable:re,draggables:ce,moveRelativeTo:$e,insideDestination:ut,viewport:Se,afterCritical:Ve});if(!Xe)return null;var tt=Mt({impact:Xe,draggable:re,droppable:it,draggables:ce,afterCritical:Ve}),Dt=sn({pageBorderBoxCenter:tt,draggable:re,viewport:Se});return{clientSelection:Dt,impact:Xe,scrollJumpRequest:null}},rn=function(L){var k=L.at;return k?k.type==="REORDER"?k.destination.droppableId:k.combine.droppableId:null},_n=function(k,V){var re=rn(k);return re?V[re]:null},In=function(L){var k=L.state,V=L.type,re=_n(k.impact,k.dimensions.droppables),de=Boolean(re),ce=k.dimensions.droppables[k.critical.droppable.id],Te=re||ce,Se=Te.axis.direction,Ve=Se==="vertical"&&(V==="MOVE_UP"||V==="MOVE_DOWN")||Se==="horizontal"&&(V==="MOVE_LEFT"||V==="MOVE_RIGHT");if(Ve&&!de)return null;var it=V==="MOVE_DOWN"||V==="MOVE_RIGHT",ut=k.dimensions.draggables[k.critical.draggable.id],$e=k.current.page.borderBoxCenter,Xe=k.dimensions,tt=Xe.draggables,Dt=Xe.droppables;return Ve?Ft({isMovingForward:it,previousPageBorderBoxCenter:$e,draggable:ut,destination:Te,draggables:tt,viewport:k.viewport,previousClientSelection:k.current.client.selection,previousImpact:k.impact,afterCritical:k.afterCritical}):Kn({isMovingForward:it,previousPageBorderBoxCenter:$e,draggable:ut,isOver:Te,draggables:tt,droppables:Dt,viewport:k.viewport,afterCritical:k.afterCritical})};function wn(L){return L.phase==="DRAGGING"||L.phase==="COLLECTING"}function Zn(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(de){return k(de.y)&&V(de.x)}}function yn(L,k){return L.left<k.right&&L.right>k.left&&L.top<k.bottom&&L.bottom>k.top}function Vn(L){var k=L.pageBorderBox,V=L.draggable,re=L.candidates,de=V.page.borderBox.center,ce=re.map(function(Te){var Se=Te.axis,Ve=an(Te.axis.line,k.center[Se.line],Te.page.borderBox.center[Se.crossAxisLine]);return{id:Te.descriptor.id,distance:tn(de,Ve)}}).sort(function(Te,Se){return Se.distance-Te.distance});return ce[0]?ce[0].id:null}function qn(L){var k=L.pageBorderBox,V=L.draggable,re=L.droppables,de=Yt(re).filter(function(ce){if(!ce.isEnabled)return!1;var Te=ce.subject.active;if(!Te)return!1;if(!yn(k,Te))return!1;if(Zn(Te)(k.center))return!0;var Se=ce.axis,Ve=Te.center[Se.crossAxisLine],it=k[Se.crossAxisStart],ut=k[Se.crossAxisEnd],$e=Jt(Te[Se.crossAxisStart],Te[Se.crossAxisEnd]),Xe=$e(it),tt=$e(ut);return!Xe&&!tt?!0:Xe?it<Ve:ut>Ve});return de.length?de.length===1?de[0].descriptor.id:Vn({pageBorderBox:k,draggable:V,candidates:de}):null}var kn=function(k,V){return m(At(k,V))},Pn=function(L,k){var V=L.frame;return V?kn(k,V.scroll.diff.value):k};function Mn(L){var k=L.displaced,V=L.id;return Boolean(k.visible[V]||k.invisible[V])}function Dn(L){var k=L.draggable,V=L.closest,re=L.inHomeList;return V?re&&V.descriptor.index>k.descriptor.index?V.descriptor.index-1:V.descriptor.index:null}var dn=function(L){var k=L.pageBorderBoxWithDroppableScroll,V=L.draggable,re=L.destination,de=L.insideDestination,ce=L.last,Te=L.viewport,Se=L.afterCritical,Ve=re.axis,it=Sn(re.axis,V.displaceBy),ut=it.value,$e=k[Ve.start],Xe=k[Ve.end],tt=Gn(V,de),Dt=at(tt,function(Fn){var ar=Fn.descriptor.id,dr=Fn.page.borderBox.center[Ve.line],Sr=cn(ar,Se),ur=Mn({displaced:ce,id:ar});return Sr?ur?Xe<=dr:$e<dr-ut:ur?Xe<=dr+ut:$e<dr}),An=Dn({draggable:V,closest:Dt,inHomeList:vr(V,re)});return Ce({draggable:V,insideDestination:de,destination:re,viewport:Te,last:ce,displacedBy:it,index:An})},Ut=4,zt=function(L){var k=L.draggable,V=L.pageBorderBoxWithDroppableScroll,re=L.previousImpact,de=L.destination,ce=L.insideDestination,Te=L.afterCritical;if(!de.isCombineEnabled)return null;var Se=de.axis,Ve=Sn(de.axis,k.displaceBy),it=Ve.value,ut=V[Se.start],$e=V[Se.end],Xe=Gn(k,ce),tt=at(Xe,function(An){var Fn=An.descriptor.id,ar=An.page.borderBox,dr=ar[Se.size],Sr=dr/Ut,ur=cn(Fn,Te),Mr=Mn({displaced:re.displaced,id:Fn});return ur?Mr?$e>ar[Se.start]+Sr&&$e<ar[Se.end]-Sr:ut>ar[Se.start]-it+Sr&&ut<ar[Se.end]-it-Sr:Mr?$e>ar[Se.start]+it+Sr&&$e<ar[Se.end]+it-Sr:ut>ar[Se.start]+Sr&&ut<ar[Se.end]-Sr});if(!tt)return null;var Dt={displacedBy:Ve,displaced:re.displaced,at:{type:"COMBINE",combine:{draggableId:tt.descriptor.id,droppableId:de.descriptor.id}}};return Dt},Vt=function(L){var k=L.pageOffset,V=L.draggable,re=L.draggables,de=L.droppables,ce=L.previousImpact,Te=L.viewport,Se=L.afterCritical,Ve=kn(V.page.borderBox,k),it=qn({pageBorderBox:Ve,draggable:V,droppables:de});if(!it)return Rr;var ut=de[it],$e=vn(ut.descriptor.id,re),Xe=Pn(ut,Ve);return zt({pageBorderBoxWithDroppableScroll:Xe,draggable:V,previousImpact:ce,destination:ut,insideDestination:$e,afterCritical:Se})||dn({pageBorderBoxWithDroppableScroll:Xe,draggable:V,destination:ut,insideDestination:$e,last:ce.displaced,viewport:Te,afterCritical:Se})},jt=function(L,k){var V;return Object(J.a)({},L,(V={},V[k.descriptor.id]=k,V))},nn=function(k){var V=k.previousImpact,re=k.impact,de=k.droppables,ce=rn(V),Te=rn(re);if(!ce)return de;if(ce===Te)return de;var Se=de[ce];if(!Se.subject.withPlaceholder)return de;var Ve=nr(Se);return jt(de,Ve)},bn=function(L){var k=L.draggable,V=L.draggables,re=L.droppables,de=L.previousImpact,ce=L.impact,Te=nn({previousImpact:de,impact:ce,droppables:re}),Se=rn(ce);if(!Se)return Te;var Ve=re[Se];if(vr(k,Ve))return Te;if(Ve.subject.withPlaceholder)return Te;var it=Xn(Ve,k,V);return jt(Te,it)},gn=function(L){var k=L.state,V=L.clientSelection,re=L.dimensions,de=L.viewport,ce=L.impact,Te=L.scrollJumpRequest,Se=de||k.viewport,Ve=re||k.dimensions,it=V||k.current.client.selection,ut=Pt(it,k.initial.client.selection),$e={offset:ut,selection:it,borderBoxCenter:yt(k.initial.client.borderBoxCenter,ut)},Xe={selection:yt($e.selection,Se.scroll.current),borderBoxCenter:yt($e.borderBoxCenter,Se.scroll.current),offset:yt($e.offset,Se.scroll.diff.value)},tt={client:$e,page:Xe};if(k.phase==="COLLECTING")return Object(J.a)({phase:"COLLECTING"},k,{dimensions:Ve,viewport:Se,current:tt});var Dt=Ve.draggables[k.critical.draggable.id],An=ce||Vt({pageOffset:Xe.offset,draggable:Dt,draggables:Ve.draggables,droppables:Ve.droppables,previousImpact:k.impact,viewport:Se,afterCritical:k.afterCritical}),Fn=bn({draggable:Dt,impact:An,previousImpact:k.impact,draggables:Ve.draggables,droppables:Ve.droppables}),ar=Object(J.a)({},k,{current:tt,dimensions:{draggables:Ve.draggables,droppables:Fn},impact:An,viewport:Se,scrollJumpRequest:Te||null,forceShouldAnimate:Te?!1:null});return ar};function bt(L,k){return L.map(function(V){return k[V]})}var lt=function(L){var k=L.impact,V=L.viewport,re=L.draggables,de=L.destination,ce=L.forceShouldAnimate,Te=k.displaced,Se=bt(Te.all,re),Ve=en({afterDragging:Se,destination:de,displacedBy:k.displacedBy,viewport:V.frame,forceShouldAnimate:ce,last:Te});return Object(J.a)({},k,{displaced:Ve})},Je=function(L){var k=L.impact,V=L.draggable,re=L.droppable,de=L.draggables,ce=L.viewport,Te=L.afterCritical,Se=Mt({impact:k,draggable:V,draggables:de,droppable:re,afterCritical:Te});return sn({pageBorderBoxCenter:Se,draggable:V,viewport:ce})},nt=function(L){var k=L.state,V=L.dimensions,re=L.viewport;k.movementMode==="SNAP"||ne(!1);var de=k.impact,ce=re||k.viewport,Te=V||k.dimensions,Se=Te.draggables,Ve=Te.droppables,it=Se[k.critical.draggable.id],ut=rn(de);ut||ne(!1);var $e=Ve[ut],Xe=lt({impact:de,viewport:ce,destination:$e,draggables:Se}),tt=Je({impact:Xe,draggable:it,droppable:$e,draggables:Se,viewport:ce,afterCritical:k.afterCritical});return gn({impact:Xe,clientSelection:tt,state:k,dimensions:Te,viewport:ce})},ze=function(L){return{index:L.index,droppableId:L.droppableId}},pt=function(L){var k=L.draggable,V=L.home,re=L.draggables,de=L.viewport,ce=Sn(V.axis,k.displaceBy),Te=vn(V.descriptor.id,re),Se=Te.indexOf(k);Se!==-1||ne(!1);var Ve=Te.slice(Se+1),it=Ve.reduce(function(tt,Dt){return tt[Dt.descriptor.id]=!0,tt},{}),ut={inVirtualList:V.descriptor.mode==="virtual",displacedBy:ce,effected:it},$e=en({afterDragging:Ve,destination:V,displacedBy:ce,last:null,viewport:de.frame,forceShouldAnimate:!1}),Xe={displaced:$e,displacedBy:ce,at:{type:"REORDER",destination:ze(k.descriptor)}};return{impact:Xe,afterCritical:ut}},rt=function(L,k){return{draggables:L.draggables,droppables:jt(L.droppables,k)}},Tt=function(k){},Nt=function(k){},St=function(L){var k=L.draggable,V=L.offset,re=L.initialWindowScroll,de=R(k.client,V),ce=T(de,re),Te=Object(J.a)({},k,{placeholder:Object(J.a)({},k.placeholder,{client:de}),client:de,page:ce});return Te},Kt=function(L){var k=L.frame;return k||ne(!1),k},Rt=function(L){var k=L.additions,V=L.updatedDroppables,re=L.viewport,de=re.scroll.diff.value;return k.map(function(ce){var Te=ce.descriptor.droppableId,Se=V[Te],Ve=Kt(Se),it=Ve.scroll.diff.value,ut=yt(de,it),$e=St({draggable:ce,offset:ut,initialWindowScroll:re.scroll.initial});return $e})},It=function(L){var k=L.state,V=L.published;Tt();var re=V.modified.map(function(Sr){var ur=k.dimensions.droppables[Sr.droppableId],Mr=Ee(ur,Sr.scroll);return Mr}),de=Object(J.a)({},k.dimensions.droppables,{},Gt(re)),ce=$t(Rt({additions:V.additions,updatedDroppables:de,viewport:k.viewport})),Te=Object(J.a)({},k.dimensions.draggables,{},ce);V.removals.forEach(function(Sr){delete Te[Sr]});var Se={droppables:de,draggables:Te},Ve=rn(k.impact),it=Ve?Se.droppables[Ve]:null,ut=Se.draggables[k.critical.draggable.id],$e=Se.droppables[k.critical.droppable.id],Xe=pt({draggable:ut,home:$e,draggables:Te,viewport:k.viewport}),tt=Xe.impact,Dt=Xe.afterCritical,An=it&&it.isCombineEnabled?k.impact:tt,Fn=Vt({pageOffset:k.current.page.offset,draggable:Se.draggables[k.critical.draggable.id],draggables:Se.draggables,droppables:Se.droppables,previousImpact:An,viewport:k.viewport,afterCritical:Dt});Nt();var ar=Object(J.a)({phase:"DRAGGING"},k,{phase:"DRAGGING",impact:Fn,onLiftImpact:tt,dimensions:Se,afterCritical:Dt,forceShouldAnimate:!1});if(k.phase==="COLLECTING")return ar;var dr=Object(J.a)({phase:"DROP_PENDING"},ar,{phase:"DROP_PENDING",reason:k.reason,isWaiting:!1});return dr},En=function(k){return k.movementMode==="SNAP"},on=function(k,V,re){var de=rt(k.dimensions,V);return!En(k)||re?gn({state:k,dimensions:de}):nt({state:k,dimensions:de})};function gr(L){return L.isDragging&&L.movementMode==="SNAP"?Object(J.a)({phase:"DRAGGING"},L,{scrollJumpRequest:null}):L}var er={phase:"IDLE",completed:null,shouldFlush:!1},tr=function(L,k){if(L===void 0&&(L=er),k.type==="FLUSH")return Object(J.a)({},er,{shouldFlush:!0});if(k.type==="INITIAL_PUBLISH"){L.phase==="IDLE"||ne(!1);var V=k.payload,re=V.critical,de=V.clientSelection,ce=V.viewport,Te=V.dimensions,Se=V.movementMode,Ve=Te.draggables[re.draggable.id],it=Te.droppables[re.droppable.id],ut={selection:de,borderBoxCenter:Ve.client.borderBox.center,offset:Ke},$e={client:ut,page:{selection:yt(ut.selection,ce.scroll.initial),borderBoxCenter:yt(ut.selection,ce.scroll.initial),offset:yt(ut.selection,ce.scroll.diff.value)}},Xe=Yt(Te.droppables).every(function(Tr){return!Tr.isFixedOnPage}),tt=pt({draggable:Ve,home:it,draggables:Te.draggables,viewport:ce}),Dt=tt.impact,An=tt.afterCritical,Fn={phase:"DRAGGING",isDragging:!0,critical:re,movementMode:Se,dimensions:Te,initial:$e,current:$e,isWindowScrollAllowed:Xe,impact:Dt,afterCritical:An,onLiftImpact:Dt,viewport:ce,scrollJumpRequest:null,forceShouldAnimate:null};return Fn}if(k.type==="COLLECTION_STARTING"){if(L.phase==="COLLECTING"||L.phase==="DROP_PENDING")return L;L.phase==="DRAGGING"||ne(!1);var ar=Object(J.a)({phase:"COLLECTING"},L,{phase:"COLLECTING"});return ar}if(k.type==="PUBLISH_WHILE_DRAGGING")return L.phase==="COLLECTING"||L.phase==="DROP_PENDING"||ne(!1),It({state:L,published:k.payload});if(k.type==="MOVE"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var dr=k.payload.client;return Ht(dr,L.current.client.selection)?L:gn({state:L,clientSelection:dr,impact:En(L)?L.impact:null})}if(k.type==="UPDATE_DROPPABLE_SCROLL"){if(L.phase==="DROP_PENDING")return gr(L);if(L.phase==="COLLECTING")return gr(L);wn(L)||ne(!1);var Sr=k.payload,ur=Sr.id,Mr=Sr.newScroll,Lr=L.dimensions.droppables[ur];if(!Lr)return L;var Br=Ee(Lr,Mr);return on(L,Br,!1)}if(k.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var $r=k.payload,e=$r.id,n=$r.isEnabled,c=L.dimensions.droppables[e];c||ne(!1),c.isEnabled!==n||ne(!1);var l=Object(J.a)({},c,{isEnabled:n});return on(L,l,!0)}if(k.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var y=k.payload,G=y.id,ee=y.isCombineEnabled,ae=L.dimensions.droppables[G];ae||ne(!1),ae.isCombineEnabled!==ee||ne(!1);var oe=Object(J.a)({},ae,{isCombineEnabled:ee});return on(L,oe,!0)}if(k.type==="MOVE_BY_WINDOW_SCROLL"){if(L.phase==="DROP_PENDING"||L.phase==="DROP_ANIMATING")return L;wn(L)||ne(!1),L.isWindowScrollAllowed||ne(!1);var me=k.payload.newScroll;if(Ht(L.viewport.scroll.current,me))return gr(L);var We=Cn(L.viewport,me);return En(L)?nt({state:L,viewport:We}):gn({state:L,viewport:We})}if(k.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!wn(L))return L;var Qe=k.payload.maxScroll;if(Ht(Qe,L.viewport.scroll.max))return L;var _t=Object(J.a)({},L.viewport,{scroll:Object(J.a)({},L.viewport.scroll,{max:Qe})});return Object(J.a)({phase:"DRAGGING"},L,{viewport:_t})}if(k.type==="MOVE_UP"||k.type==="MOVE_DOWN"||k.type==="MOVE_LEFT"||k.type==="MOVE_RIGHT"){if(L.phase==="COLLECTING"||L.phase==="DROP_PENDING")return L;L.phase==="DRAGGING"||ne(!1);var ht=In({state:L,type:k.type});return ht?gn({state:L,impact:ht.impact,clientSelection:ht.clientSelection,scrollJumpRequest:ht.scrollJumpRequest}):L}if(k.type==="DROP_PENDING"){var Bt=k.payload.reason;L.phase==="COLLECTING"||ne(!1);var Zt=Object(J.a)({phase:"DROP_PENDING"},L,{phase:"DROP_PENDING",isWaiting:!0,reason:Bt});return Zt}if(k.type==="DROP_ANIMATE"){var mn=k.payload,jn=mn.completed,sr=mn.dropDuration,Wn=mn.newHomeClientOffset;L.phase==="DRAGGING"||L.phase==="DROP_PENDING"||ne(!1);var cr={phase:"DROP_ANIMATING",completed:jn,dropDuration:sr,newHomeClientOffset:Wn,dimensions:L.dimensions};return cr}if(k.type==="DROP_COMPLETE"){var Or=k.payload.completed;return{phase:"IDLE",completed:Or,shouldFlush:!1}}return L},Qt=function(k){return{type:"BEFORE_INITIAL_CAPTURE",payload:k}},Rn=function(k){return{type:"LIFT",payload:k}},zn=function(k){return{type:"INITIAL_PUBLISH",payload:k}},rr=function(k){return{type:"PUBLISH_WHILE_DRAGGING",payload:k}},On=function(){return{type:"COLLECTION_STARTING",payload:null}},Ir=function(k){return{type:"UPDATE_DROPPABLE_SCROLL",payload:k}},jr=function(k){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:k}},xr=function(k){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:k}},lr=function(k){return{type:"MOVE",payload:k}},wr=function(k){return{type:"MOVE_BY_WINDOW_SCROLL",payload:k}},Er=function(k){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:k}},Cr=function(){return{type:"MOVE_UP",payload:null}},Ur=function(){return{type:"MOVE_DOWN",payload:null}},Vr=function(){return{type:"MOVE_RIGHT",payload:null}},Fr=function(){return{type:"MOVE_LEFT",payload:null}},kr=function(){return{type:"FLUSH",payload:null}},Ti=function(k){return{type:"DROP_ANIMATE",payload:k}},Kr=function(k){return{type:"DROP_COMPLETE",payload:k}},Si=function(k){return{type:"DROP",payload:k}},Zr=function(k){return{type:"DROP_PENDING",payload:k}},ei=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function yi(L){if(L.length<=1)return;for(var k=L.map(function(Se){return Se.descriptor.index}),V={},re=1;re<k.length;re++){var de=k[re],ce=k[re-1];de!==ce+1&&(V[de]=!0)}if(!Object.keys(V).length)return;var Te=k.map(function(Se){var Ve=Boolean(V[Se]);return Ve?"[\u{1F525}"+Se+"]":""+Se}).join(", ")}function Ri(L,k){if(!1)var V}var Va=function(L){return function(k){var V=k.getState,re=k.dispatch;return function(de){return function(ce){if(ce.type!=="LIFT"){de(ce);return}var Te=ce.payload,Se=Te.id,Ve=Te.clientSelection,it=Te.movementMode,ut=V();ut.phase==="DROP_ANIMATING"&&re(Kr({completed:ut.completed})),V().phase==="IDLE"||ne(!1),re(kr()),re(Qt({draggableId:Se,movementMode:it}));var $e={shouldPublishImmediately:it==="SNAP"},Xe={draggableId:Se,scrollOptions:$e},tt=L.startPublishing(Xe),Dt=tt.critical,An=tt.dimensions,Fn=tt.viewport;Ri(Dt,An),re(zn({critical:Dt,dimensions:An,clientSelection:Ve,movementMode:it,viewport:Fn}))}}}},fi=function(L){return function(){return function(k){return function(V){V.type==="INITIAL_PUBLISH"&&L.dragging(),V.type==="DROP_ANIMATE"&&L.dropping(V.payload.completed.result.reason),(V.type==="FLUSH"||V.type==="DROP_COMPLETE")&&L.resting(),k(V)}}}},Xa={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ki={opacity:{drop:0,combining:.7},scale:{drop:.75}},ki={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ai=ki.outOfTheWay+"s "+Xa.outOfTheWay,Ji={fluid:"opacity "+ai,snap:"transform "+ai+", opacity "+ai,drop:function(k){var V=k+"s "+Xa.drop;return"transform "+V+", opacity "+V},outOfTheWay:"transform "+ai,placeholder:"height "+ai+", width "+ai+", margin "+ai},ys=function(k){return Ht(k,Ke)?null:"translate("+k.x+"px, "+k.y+"px)"},bs={moveTo:ys,drop:function(k,V){var re=ys(k);return re?V?re+" scale("+Ki.scale.drop+")":re:null}},Es=ki.minDropTime,co=ki.maxDropTime,ho=co-Es,xs=1500,Ca=.6,fo=function(L){var k=L.current,V=L.destination,re=L.reason,de=tn(k,V);if(de<=0)return Es;if(de>=xs)return co;var ce=de/xs,Te=Es+ho*ce,Se=re==="CANCEL"?Te*Ca:Te;return Number(Se.toFixed(2))},po=function(L){var k=L.impact,V=L.draggable,re=L.dimensions,de=L.viewport,ce=L.afterCritical,Te=re.draggables,Se=re.droppables,Ve=rn(k),it=Ve?Se[Ve]:null,ut=Se[V.descriptor.droppableId],$e=Je({impact:k,draggable:V,draggables:Te,afterCritical:ce,droppable:it||ut,viewport:de}),Xe=Pt($e,V.client.borderBox.center);return Xe},ws=function(L){var k=L.draggables,V=L.reason,re=L.lastImpact,de=L.home,ce=L.viewport,Te=L.onLiftImpact;if(!re.at||V!=="DROP"){var Se=lt({draggables:k,impact:Te,destination:de,viewport:ce,forceShouldAnimate:!0});return{impact:Se,didDropInsideDroppable:!1}}if(re.at.type==="REORDER")return{impact:re,didDropInsideDroppable:!0};var Ve=Object(J.a)({},re,{displaced:br});return{impact:Ve,didDropInsideDroppable:!0}},$a=function(L){var k=L.getState,V=L.dispatch;return function(re){return function(de){if(de.type!=="DROP"){re(de);return}var ce=k(),Te=de.payload.reason;if(ce.phase==="COLLECTING"){V(Zr({reason:Te}));return}if(ce.phase==="IDLE")return;var Se=ce.phase==="DROP_PENDING"&&ce.isWaiting;Se&&ne(!1),ce.phase==="DRAGGING"||ce.phase==="DROP_PENDING"||ne(!1);var Ve=ce.critical,it=ce.dimensions,ut=it.draggables[ce.critical.draggable.id],$e=ws({reason:Te,lastImpact:ce.impact,afterCritical:ce.afterCritical,onLiftImpact:ce.onLiftImpact,home:ce.dimensions.droppables[ce.critical.droppable.id],viewport:ce.viewport,draggables:ce.dimensions.draggables}),Xe=$e.impact,tt=$e.didDropInsideDroppable,Dt=tt?ln(Xe):null,An=tt?hn(Xe):null,Fn={index:Ve.draggable.index,droppableId:Ve.droppable.id},ar={draggableId:ut.descriptor.id,type:ut.descriptor.type,source:Fn,reason:Te,mode:ce.movementMode,destination:Dt,combine:An},dr=po({impact:Xe,draggable:ut,dimensions:it,viewport:ce.viewport,afterCritical:ce.afterCritical}),Sr={critical:ce.critical,afterCritical:ce.afterCritical,result:ar,impact:Xe},ur=!Ht(ce.current.client.offset,dr)||Boolean(ar.combine);if(!ur){V(Kr({completed:Sr}));return}var Mr=fo({current:ce.current.client.offset,destination:dr,reason:Te}),Lr={newHomeClientOffset:dr,dropDuration:Mr,completed:Sr};V(Ti(Lr))}}},Cs=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Ts(L){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(V){if(V.target!==window&&V.target!==window.document)return;L()}}}function xi(L){var k=L.onWindowScroll;function V(){k(Cs())}var re=x(V),de=Ts(re),ce=we;function Te(){return ce!==we}function Se(){Te()&&ne(!1),ce=xe(window,[de])}function Ve(){Te()||ne(!1),re.cancel(),ce(),ce=we}return{start:Se,stop:Ve,isActive:Te}}var mo=function(k){return k.type==="DROP_COMPLETE"||k.type==="DROP_ANIMATE"||k.type==="FLUSH"},Ss=function(L){var k=xi({onWindowScroll:function(re){L.dispatch(wr({newScroll:re}))}});return function(V){return function(re){!k.isActive()&&re.type==="INITIAL_PUBLISH"&&k.start(),k.isActive()&&mo(re)&&k.stop(),V(re)}}},Rs=function(L){var k=!1,V=!1,re=setTimeout(function(){V=!0}),de=function(Te){if(k)return;if(V)return;k=!0,L(Te),clearTimeout(re)};return de.wasCalled=function(){return k},de},go=function(){var L=[],k=function(ce){var Te=Fe(L,function(it){return it.timerId===ce});Te!==-1||ne(!1);var Se=L.splice(Te,1),Ve=Se[0];Ve.callback()},V=function(ce){var Te=setTimeout(function(){return k(Te)}),Se={timerId:Te,callback:ce};L.push(Se)},re=function(){if(!L.length)return;var ce=[].concat(L);L.length=0,ce.forEach(function(Te){clearTimeout(Te.timerId),Te.callback()})};return{add:V,flush:re}},vo=function(k,V){return k==null&&V==null?!0:k==null||V==null?!1:k.droppableId===V.droppableId&&k.index===V.index},Os=function(k,V){return k==null&&V==null?!0:k==null||V==null?!1:k.draggableId===V.draggableId&&k.droppableId===V.droppableId},El=function(k,V){if(k===V)return!0;var re=k.draggable.id===V.draggable.id&&k.draggable.droppableId===V.draggable.droppableId&&k.draggable.type===V.draggable.type&&k.draggable.index===V.draggable.index,de=k.droppable.id===V.droppable.id&&k.droppable.type===V.droppable.type;return re&&de},Ta=function(k,V){Tt(),V(),Nt()},Ya=function(k,V){return{draggableId:k.draggable.id,type:k.droppable.type,source:{droppableId:k.droppable.id,index:k.draggable.index},mode:V}},Oi=function(k,V,re,de){if(!k){re(de(V));return}var ce=Rs(re),Te={announce:ce};k(V,Te),ce.wasCalled()||re(de(V))},Zi=function(L,k){var V=go(),re=null,de=function(Xe,tt){re&&ne(!1),Ta("onBeforeCapture",function(){var Dt=L().onBeforeCapture;if(Dt){var An={draggableId:Xe,mode:tt};Dt(An)}})},ce=function(Xe,tt){re&&ne(!1),Ta("onBeforeDragStart",function(){var Dt=L().onBeforeDragStart;Dt&&Dt(Ya(Xe,tt))})},Te=function(Xe,tt){re&&ne(!1);var Dt=Ya(Xe,tt);re={mode:tt,lastCritical:Xe,lastLocation:Dt.source,lastCombine:null},V.add(function(){Ta("onDragStart",function(){return Oi(L().onDragStart,Dt,k,Ye.onDragStart)})})},Se=function(Xe,tt){var Dt=ln(tt),An=hn(tt);re||ne(!1);var Fn=!El(Xe,re.lastCritical);Fn&&(re.lastCritical=Xe);var ar=!vo(re.lastLocation,Dt);ar&&(re.lastLocation=Dt);var dr=!Os(re.lastCombine,An);if(dr&&(re.lastCombine=An),!Fn&&!ar&&!dr)return;var Sr=Object(J.a)({},Ya(Xe,re.mode),{combine:An,destination:Dt});V.add(function(){Ta("onDragUpdate",function(){return Oi(L().onDragUpdate,Sr,k,Ye.onDragUpdate)})})},Ve=function(){re||ne(!1),V.flush()},it=function(Xe){re||ne(!1),re=null,Ta("onDragEnd",function(){return Oi(L().onDragEnd,Xe,k,Ye.onDragEnd)})},ut=function(){if(!re)return;var Xe=Object(J.a)({},Ya(re.lastCritical,re.mode),{combine:null,destination:null,reason:"CANCEL"});it(Xe)};return{beforeCapture:de,beforeStart:ce,start:Te,update:Se,flush:Ve,drop:it,abort:ut}},qi=function(L,k){var V=Zi(L,k);return function(re){return function(de){return function(ce){if(ce.type==="BEFORE_INITIAL_CAPTURE"){V.beforeCapture(ce.payload.draggableId,ce.payload.movementMode);return}if(ce.type==="INITIAL_PUBLISH"){var Te=ce.payload.critical;V.beforeStart(Te,ce.payload.movementMode),de(ce),V.start(Te,ce.payload.movementMode);return}if(ce.type==="DROP_COMPLETE"){var Se=ce.payload.completed.result;V.flush(),de(ce),V.drop(Se);return}if(de(ce),ce.type==="FLUSH"){V.abort();return}var Ve=re.getState();Ve.phase==="DRAGGING"&&V.update(Ve.critical,Ve.impact)}}}},As=function(L){return function(k){return function(V){if(V.type!=="DROP_ANIMATION_FINISHED"){k(V);return}var re=L.getState();re.phase==="DROP_ANIMATING"||ne(!1),L.dispatch(Kr({completed:re.completed}))}}},Ds=function(L){var k=null,V=null;function re(){V&&(cancelAnimationFrame(V),V=null),k&&(k(),k=null)}return function(de){return function(ce){if((ce.type==="FLUSH"||ce.type==="DROP_COMPLETE"||ce.type==="DROP_ANIMATION_FINISHED")&&re(),de(ce),ce.type!=="DROP_ANIMATE")return;var Te={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Ve=L.getState();Ve.phase==="DROP_ANIMATING"&&L.dispatch(ei())}};V=requestAnimationFrame(function(){V=null,k=xe(window,[Te])})}}},_o=function(L){return function(){return function(k){return function(V){(V.type==="DROP_COMPLETE"||V.type==="FLUSH"||V.type==="DROP_ANIMATE")&&L.stopPublishing(),k(V)}}}},Ps=function(L){var k=!1;return function(){return function(V){return function(re){if(re.type==="INITIAL_PUBLISH"){k=!0,L.tryRecordFocus(re.payload.critical.draggable.id),V(re),L.tryRestoreFocusRecorded();return}if(V(re),!k)return;if(re.type==="FLUSH"){k=!1,L.tryRestoreFocusRecorded();return}if(re.type==="DROP_COMPLETE"){k=!1;var de=re.payload.completed.result;de.combine&&L.tryShiftRecord(de.draggableId,de.combine.draggableId),L.tryRestoreFocusRecorded()}}}}},Gi=function(k){return k.type==="DROP_COMPLETE"||k.type==="DROP_ANIMATE"||k.type==="FLUSH"},zi=function(L){return function(k){return function(V){return function(re){if(Gi(re)){L.stop(),V(re);return}if(re.type==="INITIAL_PUBLISH"){V(re);var de=k.getState();de.phase==="DRAGGING"||ne(!1),L.start(de);return}V(re),L.scroll(k.getState())}}}},li=function(L){return function(k){return function(V){if(k(V),V.type!=="PUBLISH_WHILE_DRAGGING")return;var re=L.getState();if(re.phase!=="DROP_PENDING")return;if(re.isWaiting)return;L.dispatch(Si({reason:re.reason}))}}},Mi=K.d,Ni=function(L){var k=L.dimensionMarshal,V=L.focusMarshal,re=L.styleMarshal,de=L.getResponders,ce=L.announce,Te=L.autoScroller;return Object(K.e)(tr,Mi(Object(K.a)(fi(re),_o(k),Va(k),$a,As,Ds,li,zi(Te),Ss,Ps(V),qi(de,ce))))},ea=function(){return{additions:{},removals:{},modified:{}}};function xl(L){var k=L.registry,V=L.callbacks,re=ea(),de=null,ce=function(){if(de)return;V.collectionStarting(),de=requestAnimationFrame(function(){de=null,Tt();var ut=re,$e=ut.additions,Xe=ut.removals,tt=ut.modified,Dt=Object.keys($e).map(function(ar){return k.draggable.getById(ar).getDimension(Ke)}).sort(function(ar,dr){return ar.descriptor.index-dr.descriptor.index}),An=Object.keys(tt).map(function(ar){var dr=k.droppable.getById(ar),Sr=dr.callbacks.getScrollWhileDragging();return{droppableId:ar,scroll:Sr}}),Fn={additions:Dt,removals:Object.keys(Xe),modified:An};re=ea(),Nt(),V.publish(Fn)})},Te=function(ut){var $e=ut.descriptor.id;re.additions[$e]=ut,re.modified[ut.descriptor.droppableId]=!0,re.removals[$e]&&delete re.removals[$e],ce()},Se=function(ut){var $e=ut.descriptor;re.removals[$e.id]=!0,re.modified[$e.droppableId]=!0,re.additions[$e.id]&&delete re.additions[$e.id],ce()},Ve=function(){if(!de)return;cancelAnimationFrame(de),de=null,re=ea()};return{add:Te,remove:Se,stop:Ve}}var Ls=function(L){var k=L.scrollHeight,V=L.scrollWidth,re=L.height,de=L.width,ce=Pt({x:V,y:k},{x:de,y:re}),Te={x:Math.max(0,ce.x),y:Math.max(0,ce.y)};return Te},ta=function(){var L=document.documentElement;return L||ne(!1),L},Is=function(){var L=ta(),k=Ls({scrollHeight:L.scrollHeight,scrollWidth:L.scrollWidth,width:L.clientWidth,height:L.clientHeight});return k},yo=function(){var L=Cs(),k=Is(),V=L.y,re=L.x,de=ta(),ce=de.clientWidth,Te=de.clientHeight,Se=re+ce,Ve=V+Te,it=m({top:V,left:re,right:Se,bottom:Ve}),ut={frame:it,scroll:{initial:L,current:L,max:k,diff:{value:Ke,displacement:Ke}}};return ut},Qa=function(L){var k=L.critical,V=L.scrollOptions,re=L.registry;Tt();var de=yo(),ce=de.scroll.current,Te=k.droppable,Se=re.droppable.getAllByType(Te.type).map(function($e){return $e.callbacks.getDimensionAndWatchScroll(ce,V)}),Ve=re.draggable.getAllByType(k.draggable.type).map(function($e){return $e.getDimension(ce)}),it={draggables:$t(Ve),droppables:Gt(Se)};Nt();var ut={dimensions:it,critical:k,viewport:de};return ut};function bo(L,k,V){if(V.descriptor.id===k.id)return!1;if(V.descriptor.type!==k.type)return!1;var re=L.droppable.getById(V.descriptor.droppableId);return!(re.descriptor.mode!=="virtual")}var ks=function(L,k){var V=null,re=xl({callbacks:{publish:k.publishWhileDragging,collectionStarting:k.collectionStarting},registry:L}),de=function(tt,Dt){if(L.droppable.exists(tt)||ne(!1),!V)return;k.updateDroppableIsEnabled({id:tt,isEnabled:Dt})},ce=function(tt,Dt){if(!V)return;L.droppable.exists(tt)||ne(!1),k.updateDroppableIsCombineEnabled({id:tt,isCombineEnabled:Dt})},Te=function(tt,Dt){if(!V)return;L.droppable.exists(tt)||ne(!1),k.updateDroppableScroll({id:tt,newScroll:Dt})},Se=function(tt,Dt){if(!V)return;L.droppable.getById(tt).callbacks.scroll(Dt)},Ve=function(){if(!V)return;re.stop();var tt=V.critical.droppable;L.droppable.getAllByType(tt.type).forEach(function(Dt){return Dt.callbacks.dragStopped()}),V.unsubscribe(),V=null},it=function(tt){V||ne(!1);var Dt=V.critical.draggable;tt.type==="ADDITION"&&(bo(L,Dt,tt.value)&&re.add(tt.value)),tt.type==="REMOVAL"&&(bo(L,Dt,tt.value)&&re.remove(tt.value))},ut=function(tt){V&&ne(!1);var Dt=L.draggable.getById(tt.draggableId),An=L.droppable.getById(Dt.descriptor.droppableId),Fn={draggable:Dt.descriptor,droppable:An.descriptor},ar=L.subscribe(it);return V={critical:Fn,unsubscribe:ar},Qa({critical:Fn,registry:L,scrollOptions:tt.scrollOptions})},$e={updateDroppableIsEnabled:de,updateDroppableIsCombineEnabled:ce,scrollDroppable:Se,updateDroppableScroll:Te,startPublishing:ut,stopPublishing:Ve};return $e},Ms=function(L,k){return L.phase==="IDLE"?!0:L.phase!=="DROP_ANIMATING"||L.completed.result.draggableId===k?!1:L.completed.result.reason==="DROP"},Eo=function(L){window.scrollBy(L.x,L.y)},Ns=f(function(L){return Yt(L).filter(function(k){return k.isEnabled?!!k.frame:!1})}),na=function(k,V){var re=at(Ns(V),function(de){return de.frame||ne(!1),Zn(de.frame.pageMarginBox)(k)});return re},Ja=function(L){var k=L.center,V=L.destination,re=L.droppables;if(V){var de=re[V];return de.frame?de:null}var ce=na(k,re);return ce},Ai={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(k){return Math.pow(k,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Za=function(L,k){var V=L[k.size]*Ai.startFromPercentage,re=L[k.size]*Ai.maxScrollAtPercentage,de={startScrollingFrom:V,maxScrollValueAt:re};return de},xo=function(L){var k=L.startOfRange,V=L.endOfRange,re=L.current,de=V-k;if(de===0)return 0;var ce=re-k,Te=ce/de;return Te},Us=1,wl=function(L,k){if(L>k.startScrollingFrom)return 0;if(L<=k.maxScrollValueAt)return Ai.maxPixelScroll;if(L===k.startScrollingFrom)return Us;var V=xo({startOfRange:k.maxScrollValueAt,endOfRange:k.startScrollingFrom,current:L}),re=1-V,de=Ai.maxPixelScroll*Ai.ease(re);return Math.ceil(de)},qa=Ai.durationDampening.accelerateAt,es=Ai.durationDampening.stopDampeningAt,ra=function(L,k){var V=k,re=es,de=Date.now(),ce=de-V;if(ce>=es)return L;if(ce<qa)return Us;var Te=xo({startOfRange:qa,endOfRange:re,current:ce}),Se=L*Ai.ease(Te);return Math.ceil(Se)},ia=function(L){var k=L.distanceToEdge,V=L.thresholds,re=L.dragStartTime,de=L.shouldUseTimeDampening,ce=wl(k,V);return ce===0?0:de?Math.max(ra(ce,re),Us):ce},wo=function(L){var k=L.container,V=L.distanceToEdges,re=L.dragStartTime,de=L.axis,ce=L.shouldUseTimeDampening,Te=Za(k,de),Se=V[de.end]<V[de.start];return Se?ia({distanceToEdge:V[de.end],thresholds:Te,dragStartTime:re,shouldUseTimeDampening:ce}):-1*ia({distanceToEdge:V[de.start],thresholds:Te,dragStartTime:re,shouldUseTimeDampening:ce})},ts=function(L){var k=L.container,V=L.subject,re=L.proposedScroll,de=V.height>k.height,ce=V.width>k.width;return!ce&&!de?re:ce&&de?null:{x:ce?0:re.x,y:de?0:re.y}},Co=Ze(function(L){return L===0?0:L}),aa=function(L){var k=L.dragStartTime,V=L.container,re=L.subject,de=L.center,ce=L.shouldUseTimeDampening,Te={top:de.y-V.top,right:V.right-de.x,bottom:V.bottom-de.y,left:de.x-V.left},Se=wo({container:V,distanceToEdges:Te,dragStartTime:k,axis:Tn,shouldUseTimeDampening:ce}),Ve=wo({container:V,distanceToEdges:Te,dragStartTime:k,axis:pr,shouldUseTimeDampening:ce}),it=Co({x:Ve,y:Se});if(Ht(it,Ke))return null;var ut=ts({container:V,subject:re,proposedScroll:it});return ut?Ht(ut,Ke)?null:ut:null},To=Ze(function(L){return L===0?0:L>0?1:-1}),Di=function(){var L=function(V,re){return V<0?V:V>re?V-re:0};return function(k){var V=k.current,re=k.max,de=k.change,ce=yt(V,de),Te={x:L(ce.x,re.x),y:L(ce.y,re.y)};return Ht(Te,Ke)?null:Te}}(),sa=function(k){var V=k.max,re=k.current,de=k.change,ce={x:Math.max(re.x,V.x),y:Math.max(re.y,V.y)},Te=To(de),Se=Di({max:ce,current:re,change:Te});return Se?Te.x!==0&&Se.x===0?!0:Te.y!==0&&Se.y===0:!0},Pi=function(k,V){return sa({current:k.scroll.current,max:k.scroll.max,change:V})},Sa=function(k,V){if(!Pi(k,V))return null;var re=k.scroll.max,de=k.scroll.current;return Di({current:de,max:re,change:V})},Ui=function(k,V){var re=k.frame;return re?sa({current:re.scroll.current,max:re.scroll.max,change:V}):!1},So=function(k,V){var re=k.frame;return re&&Ui(k,V)?Di({current:re.scroll.current,max:re.scroll.max,change:V}):null},Ro=function(L){var k=L.viewport,V=L.subject,re=L.center,de=L.dragStartTime,ce=L.shouldUseTimeDampening,Te=aa({dragStartTime:de,container:k.frame,subject:V,center:re,shouldUseTimeDampening:ce});return Te&&Pi(k,Te)?Te:null},Oo=function(L){var k=L.droppable,V=L.subject,re=L.center,de=L.dragStartTime,ce=L.shouldUseTimeDampening,Te=k.frame;if(!Te)return null;var Se=aa({dragStartTime:de,container:Te.pageMarginBox,subject:V,center:re,shouldUseTimeDampening:ce});return Se&&Ui(k,Se)?Se:null},Ao=function(L){var k=L.state,V=L.dragStartTime,re=L.shouldUseTimeDampening,de=L.scrollWindow,ce=L.scrollDroppable,Te=k.current.page.borderBoxCenter,Se=k.dimensions.draggables[k.critical.draggable.id],Ve=Se.page.marginBox;if(k.isWindowScrollAllowed){var it=k.viewport,ut=Ro({dragStartTime:V,viewport:it,subject:Ve,center:Te,shouldUseTimeDampening:re});if(ut){de(ut);return}}var $e=Ja({center:Te,destination:rn(k.impact),droppables:k.dimensions.droppables});if(!$e)return;var Xe=Oo({dragStartTime:V,droppable:$e,subject:Ve,center:Te,shouldUseTimeDampening:re});Xe&&ce($e.descriptor.id,Xe)},Vi=function(L){var k=L.scrollWindow,V=L.scrollDroppable,re=x(k),de=x(V),ce=null,Te=function(ut){ce||ne(!1);var $e=ce,Xe=$e.shouldUseTimeDampening,tt=$e.dragStartTime;Ao({state:ut,scrollWindow:re,scrollDroppable:de,dragStartTime:tt,shouldUseTimeDampening:Xe})},Se=function(ut){Tt(),ce&&ne(!1);var $e=Date.now(),Xe=!1,tt=function(){Xe=!0};Ao({state:ut,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:tt,scrollDroppable:tt}),ce={dragStartTime:$e,shouldUseTimeDampening:Xe},Nt(),Xe&&Te(ut)},Ve=function(){if(!ce)return;re.cancel(),de.cancel(),ce=null};return{start:Se,stop:Ve,scroll:Te}},Xi=function(L){var k=L.move,V=L.scrollDroppable,re=L.scrollWindow,de=function(it,ut){var $e=yt(it.current.client.selection,ut);k({client:$e})},ce=function(it,ut){if(!Ui(it,ut))return ut;var $e=So(it,ut);if(!$e)return V(it.descriptor.id,ut),null;var Xe=Pt(ut,$e);V(it.descriptor.id,Xe);var tt=Pt(ut,Xe);return tt},Te=function(it,ut,$e){if(!it)return $e;if(!Pi(ut,$e))return $e;var Xe=Sa(ut,$e);if(!Xe)return re($e),null;var tt=Pt($e,Xe);re(tt);var Dt=Pt($e,tt);return Dt},Se=function(it){var ut=it.scrollJumpRequest;if(!ut)return;var $e=rn(it.impact);$e||ne(!1);var Xe=ce(it.dimensions.droppables[$e],ut);if(!Xe)return;var tt=it.viewport,Dt=Te(it.isWindowScrollAllowed,tt,Xe);if(!Dt)return;de(it,Dt)};return Se},Cl=function(L){var k=L.scrollDroppable,V=L.scrollWindow,re=L.move,de=Vi({scrollWindow:V,scrollDroppable:k}),ce=Xi({move:re,scrollWindow:V,scrollDroppable:k}),Te=function(it){if(it.phase!=="DRAGGING")return;if(it.movementMode==="FLUID"){de.scroll(it);return}if(!it.scrollJumpRequest)return;ce(it)},Se={scroll:Te,start:de.start,stop:de.stop};return Se},oa="data-rbd",la=function(){var L=oa+"-drag-handle";return{base:L,draggableId:L+"-draggable-id",contextId:L+"-context-id"}}(),Fs=function(){var L=oa+"-draggable";return{base:L,contextId:L+"-context-id",id:L+"-id"}}(),Tl=function(){var L=oa+"-droppable";return{base:L,contextId:L+"-context-id",id:L+"-id"}}(),Do={contextId:oa+"-scroll-container-context-id"},ci=function(k){return function(V){return"["+V+'="'+k+'"]'}},Gr=function(k,V){return k.map(function(re){var de=re.styles[V];return de?re.selector+" { "+de+" }":""}).join(" ")},si="pointer-events: none;",Yr=function(L){var k=ci(L),V=function(){var Se=`
|
|
cursor: -webkit-grab;
|
|
cursor: grab;
|
|
`;return{selector:k(la.contextId),styles:{always:`
|
|
-webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
touch-action: manipulation;
|
|
`,resting:Se,dragging:si,dropAnimating:Se}}}(),re=function(){var Se=`
|
|
transition: `+Ji.outOfTheWay+`;
|
|
`;return{selector:k(Fs.contextId),styles:{dragging:Se,dropAnimating:Se,userCancel:Se}}}(),de={selector:k(Tl.contextId),styles:{always:"overflow-anchor: none;"}},ce={selector:"body",styles:{dragging:`
|
|
cursor: grabbing;
|
|
cursor: -webkit-grabbing;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
overflow-anchor: none;
|
|
`}},Te=[re,V,de,ce];return{always:Gr(Te,"always"),resting:Gr(Te,"resting"),dragging:Gr(Te,"dragging"),dropAnimating:Gr(Te,"dropAnimating"),userCancel:Gr(Te,"userCancel")}},ti=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?te.useLayoutEffect:te.useEffect,Bs=function(){var k=document.querySelector("head");return k||ne(!1),k},Ra=function(k){var V=document.createElement("style");return k&&V.setAttribute("nonce",k),V.type="text/css",V};function Sl(L,k){var V=D(function(){return Yr(L)},[L]),re=Object(te.useRef)(null),de=Object(te.useRef)(null),ce=p(f(function($e){var Xe=de.current;Xe||ne(!1),Xe.textContent=$e}),[]),Te=p(function($e){var Xe=re.current;Xe||ne(!1),Xe.textContent=$e},[]);ti(function(){!re.current&&!de.current||ne(!1);var $e=Ra(k),Xe=Ra(k);return re.current=$e,de.current=Xe,$e.setAttribute(oa+"-always",L),Xe.setAttribute(oa+"-dynamic",L),Bs().appendChild($e),Bs().appendChild(Xe),Te(V.always),ce(V.resting),function(){var tt=function(An){var Fn=An.current;Fn||ne(!1),Bs().removeChild(Fn),An.current=null};tt(re),tt(de)}},[k,Te,ce,V.always,V.resting,L]);var Se=p(function(){return ce(V.dragging)},[ce,V.dragging]),Ve=p(function($e){if($e==="DROP"){ce(V.dropAnimating);return}ce(V.userCancel)},[ce,V.dropAnimating,V.userCancel]),it=p(function(){if(!de.current)return;ce(V.resting)},[ce,V.resting]),ut=D(function(){return{dragging:Se,dropping:Ve,resting:it}},[Se,Ve,it]);return ut}var Po=function(L){return L&&L.ownerDocument?L.ownerDocument.defaultView:window};function Oa(L){return L instanceof Po(L).HTMLElement}function ns(L,k){var V="["+la.contextId+'="'+L+'"]',re=xt(document.querySelectorAll(V));if(!re.length)return null;var de=at(re,function(ce){return ce.getAttribute(la.draggableId)===k});return de&&Oa(de)?de:null}function Lo(L){var k=Object(te.useRef)({}),V=Object(te.useRef)(null),re=Object(te.useRef)(null),de=Object(te.useRef)(!1),ce=p(function(Xe,tt){var Dt={id:Xe,focus:tt};return k.current[Xe]=Dt,function(){var Fn=k.current,ar=Fn[Xe];ar!==Dt&&delete Fn[Xe]}},[]),Te=p(function(Xe){var tt=ns(L,Xe);tt&&tt!==document.activeElement&&tt.focus()},[L]),Se=p(function(Xe,tt){V.current===Xe&&(V.current=tt)},[]),Ve=p(function(){if(re.current)return;if(!de.current)return;re.current=requestAnimationFrame(function(){re.current=null;var Xe=V.current;Xe&&Te(Xe)})},[Te]),it=p(function(Xe){V.current=null;var tt=document.activeElement;if(!tt)return;if(tt.getAttribute(la.draggableId)!==Xe)return;V.current=Xe},[]);ti(function(){return de.current=!0,function(){de.current=!1;var Xe=re.current;Xe&&cancelAnimationFrame(Xe)}},[]);var ut=D(function(){return{register:ce,tryRecordFocus:it,tryRestoreFocusRecorded:Ve,tryShiftRecord:Se}},[ce,it,Ve,Se]);return ut}function js(){var L={draggables:{},droppables:{}},k=[];function V($e){return k.push($e),function(){var tt=k.indexOf($e);if(tt===-1)return;k.splice(tt,1)}}function re($e){k.length&&k.forEach(function(Xe){return Xe($e)})}function de($e){return L.draggables[$e]||null}function ce($e){var Xe=de($e);return Xe||ne(!1),Xe}var Te={register:function(Xe){L.draggables[Xe.descriptor.id]=Xe,re({type:"ADDITION",value:Xe})},update:function(Xe,tt){var Dt=L.draggables[tt.descriptor.id];if(!Dt)return;if(Dt.uniqueId!==Xe.uniqueId)return;delete L.draggables[tt.descriptor.id],L.draggables[Xe.descriptor.id]=Xe},unregister:function(Xe){var tt=Xe.descriptor.id,Dt=de(tt);if(!Dt)return;if(Xe.uniqueId!==Dt.uniqueId)return;delete L.draggables[tt],re({type:"REMOVAL",value:Xe})},getById:ce,findById:de,exists:function(Xe){return Boolean(de(Xe))},getAllByType:function(Xe){return ue(L.draggables).filter(function(tt){return tt.descriptor.type===Xe})}};function Se($e){return L.droppables[$e]||null}function Ve($e){var Xe=Se($e);return Xe||ne(!1),Xe}var it={register:function(Xe){L.droppables[Xe.descriptor.id]=Xe},unregister:function(Xe){var tt=Se(Xe.descriptor.id);if(!tt)return;if(Xe.uniqueId!==tt.uniqueId)return;delete L.droppables[Xe.descriptor.id]},getById:Ve,findById:Se,exists:function(Xe){return Boolean(Se(Xe))},getAllByType:function(Xe){return ue(L.droppables).filter(function(tt){return tt.descriptor.type===Xe})}};function ut(){L.draggables={},L.droppables={},k.length=0}return{draggable:Te,droppable:it,subscribe:V,clean:ut}}function Rl(){var L=D(js,[]);return Object(te.useEffect)(function(){return function(){requestAnimationFrame(L.clean)}},[L]),L}var Aa=Q.a.createContext(null),$i=function(){var L=document.body;return L||ne(!1),L},Io={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ko=function(k){return"rbd-announcement-"+k};function Ws(L){var k=D(function(){return ko(L)},[L]),V=Object(te.useRef)(null);Object(te.useEffect)(function(){var ce=document.createElement("div");return V.current=ce,ce.id=k,ce.setAttribute("aria-live","assertive"),ce.setAttribute("aria-atomic","true"),Object(J.a)(ce.style,Io),$i().appendChild(ce),function(){setTimeout(function(){var Ve=$i();Ve.contains(ce)&&Ve.removeChild(ce),ce===V.current&&(V.current=null)})}},[k]);var re=p(function(de){var ce=V.current;if(ce){ce.textContent=de;return}},[]);return re}var Hs=0,Da={separator:"::"};function Ol(){Hs=0}function ua(L,k){return k===void 0&&(k=Da),D(function(){return""+L+k.separator+Hs++},[k.separator,L])}function pi(L){var k=L.contextId,V=L.uniqueId;return"rbd-hidden-text-"+k+"-"+V}function Mo(L){var k=L.contextId,V=L.text,re=ua("hidden-text",{separator:"-"}),de=D(function(){return pi({contextId:k,uniqueId:re})},[re,k]);return Object(te.useEffect)(function(){var Te=document.createElement("div");return Te.id=de,Te.textContent=V,Te.style.display="none",$i().appendChild(Te),function(){var Ve=$i();Ve.contains(Te)&&Ve.removeChild(Te)}},[de,V]),de}var rs=Q.a.createContext(null),No={react:"^16.8.5","react-dom":"^16.8.5"},mi=/(\d+)\.(\d+)\.(\d+)/,Nr=function(k){var V=mi.exec(k);V!=null||ne(!1);var re=Number(V[1]),de=Number(V[2]),ce=Number(V[3]);return{major:re,minor:de,patch:ce,raw:k}},wi=function(k,V){return V.major>k.major?!0:V.major<k.major?!1:V.minor>k.minor?!0:V.minor<k.minor?!1:V.patch>=k.patch},Fi=function(L,k){var V=Nr(L),re=Nr(k);if(wi(V,re))return},Yi=`
|
|
We expect a html5 doctype: <!doctype html>
|
|
This is to ensure consistent browser layout and measurement
|
|
|
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
|
|
`,Uo=function(L){var k=L.doctype;if(!k)return;k.name.toLowerCase()!=="html",k.publicId!==""};function Pa(L){}function da(L,k){Pa(function(){Object(te.useEffect)(function(){try{L()}catch(V){he(`
|
|
A setup problem was encountered.
|
|
|
|
> `+V.message+`
|
|
`)}},k)})}function Al(){da(function(){Fi(No.react,Q.a.version),Uo(document)},[])}function La(L){var k=Object(te.useRef)(L);return Object(te.useEffect)(function(){k.current=L}),k}function Ia(){var L=null;function k(){return Boolean(L)}function V(Te){return Te===L}function re(Te){L&&ne(!1);var Se={abandon:Te};return L=Se,Se}function de(){L||ne(!1),L=null}function ce(){L&&(L.abandon(),de())}return{isClaimed:k,isActive:V,claim:re,release:de,tryAbandon:ce}}var Fo=9,Ks=13,Ci=27,Gs=32,Bo=33,Dl=34,is=35,zs=36,jo=37,Pl=38,Wo=39,Ll=40,as,ss=(as={},as[Ks]=!0,as[Fo]=!0,as),Vs=function(L){ss[L.keyCode]&&L.preventDefault()},os=function(){var L="visibilitychange";if(typeof document=="undefined")return L;var k=[L,"ms"+L,"webkit"+L,"moz"+L,"o"+L],V=at(k,function(re){return"on"+re in document});return V||L}(),Ho=0,Xs=5;function ca(L,k){return Math.abs(k.x-L.x)>=Xs||Math.abs(k.y-L.y)>=Xs}var ls={type:"IDLE"};function us(L){var k=L.cancel,V=L.completed,re=L.getPhase,de=L.setPhase;return[{eventName:"mousemove",fn:function(Te){var Se=Te.button,Ve=Te.clientX,it=Te.clientY;if(Se!==Ho)return;var ut={x:Ve,y:it},$e=re();if($e.type==="DRAGGING"){Te.preventDefault(),$e.actions.move(ut);return}$e.type==="PENDING"||ne(!1);var Xe=$e.point;if(!ca(Xe,ut))return;Te.preventDefault();var tt=$e.actions.fluidLift(ut);de({type:"DRAGGING",actions:tt})}},{eventName:"mouseup",fn:function(Te){var Se=re();if(Se.type!=="DRAGGING"){k();return}Te.preventDefault(),Se.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"mousedown",fn:function(Te){re().type==="DRAGGING"&&Te.preventDefault(),k()}},{eventName:"keydown",fn:function(Te){var Se=re();if(Se.type==="PENDING"){k();return}if(Te.keyCode===Ci){Te.preventDefault(),k();return}Vs(Te)}},{eventName:"resize",fn:k},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){re().type==="PENDING"&&k()}},{eventName:"webkitmouseforcedown",fn:function(Te){var Se=re();if(Se.type!=="IDLE"||ne(!1),Se.actions.shouldRespectForcePress()){k();return}Te.preventDefault()}},{eventName:os,fn:k}]}function Ko(L){var k=Object(te.useRef)(ls),V=Object(te.useRef)(we),re=D(function(){return{eventName:"mousedown",fn:function($e){if($e.defaultPrevented)return;if($e.button!==Ho)return;if($e.ctrlKey||$e.metaKey||$e.shiftKey||$e.altKey)return;var Xe=L.findClosestDraggableId($e);if(!Xe)return;var tt=L.tryGetLock(Xe,Te,{sourceEvent:$e});if(!tt)return;$e.preventDefault();var Dt={x:$e.clientX,y:$e.clientY};V.current(),it(tt,Dt)}}},[L]),de=D(function(){return{eventName:"webkitmouseforcewillbegin",fn:function($e){if($e.defaultPrevented)return;var Xe=L.findClosestDraggableId($e);if(!Xe)return;var tt=L.findOptionsForDraggable(Xe);if(!tt)return;if(tt.shouldRespectForcePress)return;if(!L.canGetLock(Xe))return;$e.preventDefault()}}},[L]),ce=p(function(){var $e={passive:!1,capture:!0};V.current=xe(window,[de,re],$e)},[de,re]),Te=p(function(){var ut=k.current;if(ut.type==="IDLE")return;k.current=ls,V.current(),ce()},[ce]),Se=p(function(){var ut=k.current;Te(),ut.type==="DRAGGING"&&ut.actions.cancel({shouldBlockNextClick:!0}),ut.type==="PENDING"&&ut.actions.abort()},[Te]),Ve=p(function(){var $e={capture:!0,passive:!1},Xe=us({cancel:Se,completed:Te,getPhase:function(){return k.current},setPhase:function(Dt){k.current=Dt}});V.current=xe(window,Xe,$e)},[Se,Te]),it=p(function($e,Xe){k.current.type==="IDLE"||ne(!1),k.current={type:"PENDING",point:Xe,actions:$e},Ve()},[Ve]);ti(function(){return ce(),function(){V.current()}},[ce])}var Bi;function Go(){}var Il=(Bi={},Bi[Dl]=!0,Bi[Bo]=!0,Bi[zs]=!0,Bi[is]=!0,Bi);function zo(L,k){function V(){k(),L.cancel()}function re(){k(),L.drop()}return[{eventName:"keydown",fn:function(ce){if(ce.keyCode===Ci){ce.preventDefault(),V();return}if(ce.keyCode===Gs){ce.preventDefault(),re();return}if(ce.keyCode===Ll){ce.preventDefault(),L.moveDown();return}if(ce.keyCode===Pl){ce.preventDefault(),L.moveUp();return}if(ce.keyCode===Wo){ce.preventDefault(),L.moveRight();return}if(ce.keyCode===jo){ce.preventDefault(),L.moveLeft();return}if(Il[ce.keyCode]){ce.preventDefault();return}Vs(ce)}},{eventName:"mousedown",fn:V},{eventName:"mouseup",fn:V},{eventName:"click",fn:V},{eventName:"touchstart",fn:V},{eventName:"resize",fn:V},{eventName:"wheel",fn:V,options:{passive:!0}},{eventName:os,fn:V}]}function ni(L){var k=Object(te.useRef)(Go),V=D(function(){return{eventName:"keydown",fn:function(ce){if(ce.defaultPrevented)return;if(ce.keyCode!==Gs)return;var Te=L.findClosestDraggableId(ce);if(!Te)return;var Se=L.tryGetLock(Te,ut,{sourceEvent:ce});if(!Se)return;ce.preventDefault();var Ve=!0,it=Se.snapLift();k.current();function ut(){Ve||ne(!1),Ve=!1,k.current(),re()}k.current=xe(window,zo(it,ut),{capture:!0,passive:!1})}}},[L]),re=p(function(){var ce={passive:!1,capture:!0};k.current=xe(window,[V],ce)},[V]);ti(function(){return re(),function(){k.current()}},[re])}var ha={type:"IDLE"},Vo=120,Xo=.15;function $o(L){var k=L.cancel,V=L.getPhase;return[{eventName:"orientationchange",fn:k},{eventName:"resize",fn:k},{eventName:"contextmenu",fn:function(de){de.preventDefault()}},{eventName:"keydown",fn:function(de){if(V().type!=="DRAGGING"){k();return}de.keyCode===Ci&&de.preventDefault(),k()}},{eventName:os,fn:k}]}function fa(L){var k=L.cancel,V=L.completed,re=L.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(ce){var Te=re();if(Te.type!=="DRAGGING"){k();return}Te.hasMoved=!0;var Se=ce.touches[0],Ve=Se.clientX,it=Se.clientY,ut={x:Ve,y:it};ce.preventDefault(),Te.actions.move(ut)}},{eventName:"touchend",fn:function(ce){var Te=re();if(Te.type!=="DRAGGING"){k();return}ce.preventDefault(),Te.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"touchcancel",fn:function(ce){if(re().type!=="DRAGGING"){k();return}ce.preventDefault(),k()}},{eventName:"touchforcechange",fn:function(ce){var Te=re();Te.type!=="IDLE"||ne(!1);var Se=ce.touches[0];if(!Se)return;var Ve=Se.force>=Xo;if(!Ve)return;var it=Te.actions.shouldRespectForcePress();if(Te.type==="PENDING"){it&&k();return}if(it){if(Te.hasMoved){ce.preventDefault();return}k();return}ce.preventDefault()}},{eventName:os,fn:k}]}function ds(L){var k=Object(te.useRef)(ha),V=Object(te.useRef)(we),re=p(function(){return k.current},[]),de=p(function(tt){k.current=tt},[]),ce=D(function(){return{eventName:"touchstart",fn:function(tt){if(tt.defaultPrevented)return;var Dt=L.findClosestDraggableId(tt);if(!Dt)return;var An=L.tryGetLock(Dt,Se,{sourceEvent:tt});if(!An)return;var Fn=tt.touches[0],ar=Fn.clientX,dr=Fn.clientY,Sr={x:ar,y:dr};V.current(),$e(An,Sr)}}},[L]),Te=p(function(){var tt={capture:!0,passive:!1};V.current=xe(window,[ce],tt)},[ce]),Se=p(function(){var Xe=k.current;if(Xe.type==="IDLE")return;Xe.type==="PENDING"&&clearTimeout(Xe.longPressTimerId),de(ha),V.current(),Te()},[Te,de]),Ve=p(function(){var Xe=k.current;Se(),Xe.type==="DRAGGING"&&Xe.actions.cancel({shouldBlockNextClick:!0}),Xe.type==="PENDING"&&Xe.actions.abort()},[Se]),it=p(function(){var tt={capture:!0,passive:!1},Dt={cancel:Ve,completed:Se,getPhase:re},An=xe(window,fa(Dt),tt),Fn=xe(window,$o(Dt),tt);V.current=function(){An(),Fn()}},[Ve,re,Se]),ut=p(function(){var tt=re();tt.type==="PENDING"||ne(!1);var Dt=tt.actions.fluidLift(tt.point);de({type:"DRAGGING",actions:Dt,hasMoved:!1})},[re,de]),$e=p(function(tt,Dt){re().type==="IDLE"||ne(!1);var An=setTimeout(ut,Vo);de({type:"PENDING",point:Dt,actions:tt,longPressTimerId:An}),it()},[it,re,de,ut]);ti(function(){return Te(),function(){V.current();var Dt=re();Dt.type==="PENDING"&&(clearTimeout(Dt.longPressTimerId),de(ha))}},[re,Te,de]),ti(function(){var tt=xe(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return tt},[])}function Yo(L){Pa(function(){var k=La(L);da(function(){k.current.length===L.length||ne(!1)})})}var Qo={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function $s(L,k){if(k==null)return!1;var V=Boolean(Qo[k.tagName.toLowerCase()]);if(V)return!0;var re=k.getAttribute("contenteditable");return re==="true"||re===""?!0:k===L?!1:$s(L,k.parentElement)}function pa(L,k){var V=k.target;return Oa(V)?$s(L,V):!1}var Jo=function(L){return m(L.getBoundingClientRect()).center};function cs(L){return L instanceof Po(L).Element}var Zo=function(){var L="matches";if(typeof document=="undefined")return L;var k=[L,"msMatchesSelector","webkitMatchesSelector"],V=at(k,function(re){return re in Element.prototype});return V||L}();function ma(L,k){return L==null?null:L[Zo](k)?L:ma(L.parentElement,k)}function kl(L,k){return L.closest?L.closest(k):ma(L,k)}function ga(L){return"["+la.contextId+'="'+L+'"]'}function qo(L,k){var V=k.target;if(!cs(V))return null;var re=ga(L),de=kl(V,re);return de&&Oa(de)?de:null}function el(L,k){var V=qo(L,k);return V?V.getAttribute(la.draggableId):null}function tl(L,k){var V="["+Fs.contextId+'="'+L+'"]',re=xt(document.querySelectorAll(V)),de=at(re,function(ce){return ce.getAttribute(Fs.id)===k});return de&&Oa(de)?de:null}function ka(L){L.preventDefault()}function ji(L){var k=L.expected,V=L.phase,re=L.isLockActive,de=L.shouldWarn;return re()?!(k!==V):!1}function va(L){var k=L.lockAPI,V=L.store,re=L.registry,de=L.draggableId;if(k.isClaimed())return!1;var ce=re.draggable.findById(de);return ce&&ce.options.isEnabled?!!Ms(V.getState(),de):!1}function Ma(L){var k=L.lockAPI,V=L.contextId,re=L.store,de=L.registry,ce=L.draggableId,Te=L.forceSensorStop,Se=L.sourceEvent,Ve=va({lockAPI:k,store:re,registry:de,draggableId:ce});if(!Ve)return null;var it=de.draggable.getById(ce),ut=tl(V,it.descriptor.id);if(!ut)return null;if(Se&&!it.options.canDragInteractiveElements&&pa(ut,Se))return null;var $e=k.claim(Te||we),Xe="PRE_DRAG";function tt(){return it.options.shouldRespectForcePress}function Dt(){return k.isActive($e)}function An(Lr,Br){ji({expected:Lr,phase:Xe,isLockActive:Dt,shouldWarn:!0})&&re.dispatch(Br())}var Fn=An.bind(null,"DRAGGING");function ar(Lr){function Br(){k.release(),Xe="COMPLETED"}Xe!=="PRE_DRAG"&&(Br(),Xe==="PRE_DRAG"||ne(!1)),re.dispatch(Rn(Lr.liftActionArgs)),Xe="DRAGGING";function $r(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Lr.cleanup(),n.shouldBlockNextClick){var c=xe(window,[{eventName:"click",fn:ka,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(c)}Br(),re.dispatch(Si({reason:e}))}return Object(J.a)({isActive:function(){return ji({expected:"DRAGGING",phase:Xe,isLockActive:Dt,shouldWarn:!1})},shouldRespectForcePress:tt,drop:function(n){return $r("DROP",n)},cancel:function(n){return $r("CANCEL",n)}},Lr.actions)}function dr(Lr){var Br=x(function(e){Fn(function(){return lr({client:e})})}),$r=ar({liftActionArgs:{id:ce,clientSelection:Lr,movementMode:"FLUID"},cleanup:function(){return Br.cancel()},actions:{move:Br}});return Object(J.a)({},$r,{move:Br})}function Sr(){var Lr={moveUp:function(){return Fn(Cr)},moveRight:function(){return Fn(Vr)},moveDown:function(){return Fn(Ur)},moveLeft:function(){return Fn(Fr)}};return ar({liftActionArgs:{id:ce,clientSelection:Jo(ut),movementMode:"SNAP"},cleanup:we,actions:Lr})}function ur(){var Lr=ji({expected:"PRE_DRAG",phase:Xe,isLockActive:Dt,shouldWarn:!0});Lr&&k.release()}var Mr={isActive:function(){return ji({expected:"PRE_DRAG",phase:Xe,isLockActive:Dt,shouldWarn:!1})},shouldRespectForcePress:tt,fluidLift:dr,snapLift:Sr,abort:ur};return Mr}var nl=[Ko,ni,ds];function Ml(L){var k=L.contextId,V=L.store,re=L.registry,de=L.customSensors,ce=L.enableDefaultSensors,Te=[].concat(ce?nl:[],de||[]),Se=Object(te.useState)(function(){return Ia()})[0],Ve=p(function(dr,Sr){dr.isDragging&&!Sr.isDragging&&Se.tryAbandon()},[Se]);ti(function(){var dr=V.getState(),Sr=V.subscribe(function(){var ur=V.getState();Ve(dr,ur),dr=ur});return Sr},[Se,V,Ve]),ti(function(){return Se.tryAbandon},[Se.tryAbandon]);var it=p(function(ar){return va({lockAPI:Se,registry:re,store:V,draggableId:ar})},[Se,re,V]),ut=p(function(ar,dr,Sr){return Ma({lockAPI:Se,registry:re,contextId:k,store:V,draggableId:ar,forceSensorStop:dr,sourceEvent:Sr&&Sr.sourceEvent?Sr.sourceEvent:null})},[k,Se,re,V]),$e=p(function(ar){return el(k,ar)},[k]),Xe=p(function(ar){var dr=re.draggable.findById(ar);return dr?dr.options:null},[re.draggable]),tt=p(function(){if(!Se.isClaimed())return;Se.tryAbandon(),V.getState().phase!=="IDLE"&&V.dispatch(kr())},[Se,V]),Dt=p(Se.isClaimed,[Se]),An=D(function(){return{canGetLock:it,tryGetLock:ut,findClosestDraggableId:$e,findOptionsForDraggable:Xe,tryReleaseLock:tt,isLockClaimed:Dt}},[it,ut,$e,Xe,tt,Dt]);Yo(Te);for(var Fn=0;Fn<Te.length;Fn++)Te[Fn](An)}var rl=function(k){return{onBeforeCapture:k.onBeforeCapture,onBeforeDragStart:k.onBeforeDragStart,onDragStart:k.onDragStart,onDragEnd:k.onDragEnd,onDragUpdate:k.onDragUpdate}};function bi(L){return L.current||ne(!1),L.current}function _a(L){var k=L.contextId,V=L.setCallbacks,re=L.sensors,de=L.nonce,ce=L.dragHandleUsageInstructions,Te=Object(te.useRef)(null);Al();var Se=La(L),Ve=p(function(){return rl(Se.current)},[Se]),it=Ws(k),ut=Mo({contextId:k,text:ce}),$e=Sl(k,de),Xe=p(function(e){bi(Te).dispatch(e)},[]),tt=D(function(){return Object(K.b)({publishWhileDragging:rr,updateDroppableScroll:Ir,updateDroppableIsEnabled:jr,updateDroppableIsCombineEnabled:xr,collectionStarting:On},Xe)},[Xe]),Dt=Rl(),An=D(function(){return ks(Dt,tt)},[Dt,tt]),Fn=D(function(){return Cl(Object(J.a)({scrollWindow:Eo,scrollDroppable:An.scrollDroppable},Object(K.b)({move:lr},Xe)))},[An.scrollDroppable,Xe]),ar=Lo(k),dr=D(function(){return Ni({announce:it,autoScroller:Fn,dimensionMarshal:An,focusMarshal:ar,getResponders:Ve,styleMarshal:$e})},[it,Fn,An,ar,Ve,$e]);Te.current=dr;var Sr=p(function(){var e=bi(Te),n=e.getState();n.phase!=="IDLE"&&e.dispatch(kr())},[]),ur=p(function(){var e=bi(Te).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),Mr=D(function(){return{isDragging:ur,tryAbort:Sr}},[ur,Sr]);V(Mr);var Lr=p(function(e){return Ms(bi(Te).getState(),e)},[]),Br=p(function(){return wn(bi(Te).getState())},[]),$r=D(function(){return{marshal:An,focus:ar,contextId:k,canLift:Lr,isMovementAllowed:Br,dragHandleUsageInstructionsId:ut,registry:Dt}},[k,An,ut,ar,Lr,Br,Dt]);return Ml({contextId:k,store:dr,registry:Dt,customSensors:re,enableDefaultSensors:L.enableDefaultSensors!==!1}),Object(te.useEffect)(function(){return Sr},[Sr]),Q.a.createElement(rs.Provider,{value:$r},Q.a.createElement(N.a,{context:Aa,store:dr},L.children))}var ya=0;function Nl(){ya=0}function il(){return D(function(){return""+ya++},[])}function iu(){Nl(),Ol()}function Ul(L){var k=il(),V=L.dragHandleUsageInstructions||Ye.dragHandleUsageInstructions;return Q.a.createElement(fe,null,function(re){return Q.a.createElement(_a,{nonce:L.nonce,contextId:k,setCallbacks:re,dragHandleUsageInstructions:V,enableDefaultSensors:L.enableDefaultSensors,sensors:L.sensors,onBeforeCapture:L.onBeforeCapture,onBeforeDragStart:L.onBeforeDragStart,onDragStart:L.onDragStart,onDragUpdate:L.onDragUpdate,onDragEnd:L.onDragEnd},L.children)})}var Ys=function(k){return function(V){return k===V}},ui=Ys("scroll"),al=Ys("auto"),Fl=Ys("visible"),sl=function(k,V){return V(k.overflowX)||V(k.overflowY)},Bl=function(k,V){return V(k.overflowX)&&V(k.overflowY)},Qs=function(k){var V=window.getComputedStyle(k),re={overflowX:V.overflowX,overflowY:V.overflowY};return sl(re,ui)||sl(re,al)},ol=function(){return!1;var k,V;if(!Qs(k))return!1;var re,de;if(Bl(de,Fl))return!1},Js=function L(k){return k==null?null:k===document.body?ol()?k:null:k===document.documentElement?null:Qs(k)?k:L(k.parentElement)},au=function(L){if(!L)return;var k=Js(L.parentElement);if(!k)return},Zs=function(L){return{x:L.scrollLeft,y:L.scrollTop}},jl=function L(k){if(!k)return!1;var V=window.getComputedStyle(k);return V.position==="fixed"?!0:L(k.parentElement)},Wi=function(L){var k=Js(L),V=jl(L);return{closestScrollable:k,isFixedOnPage:V}},Na=function(L){var k=L.descriptor,V=L.isEnabled,re=L.isCombineEnabled,de=L.isFixedOnPage,ce=L.direction,Te=L.client,Se=L.page,Ve=L.closest,it=function(){if(!Ve)return null;var tt=Ve.scrollSize,Dt=Ve.client,An=Ls({scrollHeight:tt.scrollHeight,scrollWidth:tt.scrollWidth,height:Dt.paddingBox.height,width:Dt.paddingBox.width});return{pageMarginBox:Ve.page.marginBox,frameClient:Dt,scrollSize:tt,shouldClipSubject:Ve.shouldClipSubject,scroll:{initial:Ve.scroll,current:Ve.scroll,max:An,diff:{value:Ke,displacement:Ke}}}}(),ut=ce==="vertical"?Tn:pr,$e=ge({page:Se,withPlaceholder:null,axis:ut,frame:it}),Xe={descriptor:k,isCombineEnabled:re,isFixedOnPage:de,axis:ut,isEnabled:V,client:Te,page:Se,frame:it,subject:$e};return Xe},hs=function(k,V){var re=A(k);if(!V)return re;if(k!==V)return re;var de=re.paddingBox.top-V.scrollTop,ce=re.paddingBox.left-V.scrollLeft,Te=de+V.scrollHeight,Se=ce+V.scrollWidth,Ve={top:de,right:Se,bottom:Te,left:ce},it=a(Ve,re.border),ut=t({borderBox:it,margin:re.margin,border:re.border,padding:re.padding});return ut},Ua=function(L){var k=L.ref,V=L.descriptor,re=L.env,de=L.windowScroll,ce=L.direction,Te=L.isDropDisabled,Se=L.isCombineEnabled,Ve=L.shouldClipSubject,it=re.closestScrollable,ut=hs(k,it),$e=T(ut,de),Xe=function(){if(!it)return null;var Dt=A(it),An={scrollHeight:it.scrollHeight,scrollWidth:it.scrollWidth};return{client:Dt,page:T(Dt,de),scroll:Zs(it),scrollSize:An,shouldClipSubject:Ve}}(),tt=Na({descriptor:V,isEnabled:!Te,isCombineEnabled:Se,isFixedOnPage:re.isFixedOnPage,direction:ce,client:ut,page:$e,closest:Xe});return tt},Li={passive:!1},Wl={passive:!0},ll=function(L){return L.shouldPublishImmediately?Li:Wl};function Ii(L){var k=Object(te.useContext)(L);return k||ne(!1),k}var Fa=function(k){return k&&k.env.closestScrollable||null};function ul(L){var k=Object(te.useRef)(null),V=Ii(rs),re=ua("droppable"),de=V.registry,ce=V.marshal,Te=La(L),Se=D(function(){return{id:L.droppableId,type:L.type,mode:L.mode}},[L.droppableId,L.mode,L.type]),Ve=Object(te.useRef)(Se),it=D(function(){return f(function(ur,Mr){k.current||ne(!1);var Lr={x:ur,y:Mr};ce.updateDroppableScroll(Se.id,Lr)})},[Se.id,ce]),ut=p(function(){var ur=k.current;return!ur||!ur.env.closestScrollable?Ke:Zs(ur.env.closestScrollable)},[]),$e=p(function(){var ur=ut();it(ur.x,ur.y)},[ut,it]),Xe=D(function(){return x($e)},[$e]),tt=p(function(){var ur=k.current,Mr=Fa(ur);ur&&Mr||ne(!1);var Lr=ur.scrollOptions;if(Lr.shouldPublishImmediately){$e();return}Xe()},[Xe,$e]),Dt=p(function(ur,Mr){k.current&&ne(!1);var Lr=Te.current,Br=Lr.getDroppableRef();Br||ne(!1);var $r=Wi(Br),e={ref:Br,descriptor:Se,env:$r,scrollOptions:Mr};k.current=e;var n=Ua({ref:Br,descriptor:Se,env:$r,windowScroll:ur,direction:Lr.direction,isDropDisabled:Lr.isDropDisabled,isCombineEnabled:Lr.isCombineEnabled,shouldClipSubject:!Lr.ignoreContainerClipping}),c=$r.closestScrollable;return c&&(c.setAttribute(Do.contextId,V.contextId),c.addEventListener("scroll",tt,ll(e.scrollOptions))),n},[V.contextId,Se,tt,Te]),An=p(function(){var ur=k.current,Mr=Fa(ur);return ur&&Mr||ne(!1),Zs(Mr)},[]),Fn=p(function(){var ur=k.current;ur||ne(!1);var Mr=Fa(ur);if(k.current=null,!Mr)return;Xe.cancel(),Mr.removeAttribute(Do.contextId),Mr.removeEventListener("scroll",tt,ll(ur.scrollOptions))},[tt,Xe]),ar=p(function(ur){var Mr=k.current;Mr||ne(!1);var Lr=Fa(Mr);Lr||ne(!1),Lr.scrollTop+=ur.y,Lr.scrollLeft+=ur.x},[]),dr=D(function(){return{getDimensionAndWatchScroll:Dt,getScrollWhileDragging:An,dragStopped:Fn,scroll:ar}},[Fn,Dt,An,ar]),Sr=D(function(){return{uniqueId:re,descriptor:Se,callbacks:dr}},[dr,Se,re]);ti(function(){return Ve.current=Sr.descriptor,de.droppable.register(Sr),function(){k.current&&Fn(),de.droppable.unregister(Sr)}},[dr,Se,Fn,Sr,ce,de.droppable]),ti(function(){if(!k.current)return;ce.updateDroppableIsEnabled(Ve.current.id,!L.isDropDisabled)},[L.isDropDisabled,ce]),ti(function(){if(!k.current)return;ce.updateDroppableIsCombineEnabled(Ve.current.id,L.isCombineEnabled)},[L.isCombineEnabled,ce])}function fs(){}var Ba={width:0,height:0,margin:ft},ba=function(k){var V=k.isAnimatingOpenOnMount,re=k.placeholder,de=k.animate;return V||de==="close"?Ba:{height:re.client.borderBox.height,width:re.client.borderBox.width,margin:re.client.margin}},qs=function(k){var V=k.isAnimatingOpenOnMount,re=k.placeholder,de=k.animate,ce=ba({isAnimatingOpenOnMount:V,placeholder:re,animate:de});return{display:re.display,boxSizing:"border-box",width:ce.width,height:ce.height,marginTop:ce.margin.top,marginRight:ce.margin.right,marginBottom:ce.margin.bottom,marginLeft:ce.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:de!=="none"?Ji.placeholder:null}};function eo(L){var k=Object(te.useRef)(null),V=p(function(){if(!k.current)return;clearTimeout(k.current),k.current=null},[]),re=L.animate,de=L.onTransitionEnd,ce=L.onClose,Te=L.contextId,Se=Object(te.useState)(L.animate==="open"),Ve=Se[0],it=Se[1];Object(te.useEffect)(function(){return Ve?re!=="open"?(V(),it(!1),fs):k.current?fs:(k.current=setTimeout(function(){k.current=null,it(!1)}),V):fs},[re,Ve,V]);var ut=p(function(Xe){if(Xe.propertyName!=="height")return;de(),re==="close"&&ce()},[re,ce,de]),$e=qs({isAnimatingOpenOnMount:Ve,animate:L.animate,placeholder:L.placeholder});return Q.a.createElement(L.placeholder.tagName,{style:$e,"data-rbd-placeholder-context-id":Te,onTransitionEnd:ut,ref:L.innerRef})}var to=Q.a.memo(eo),no=Q.a.createContext(null);function Ea(L){L&&Oa(L)||ne(!1)}function ps(L){return typeof L=="boolean"}function ro(L,k){k.forEach(function(V){return V(L)})}var dl=[function(k){var V=k.props;V.droppableId||ne(!1),typeof V.droppableId=="string"||ne(!1)},function(k){var V=k.props;ps(V.isDropDisabled)||ne(!1),ps(V.isCombineEnabled)||ne(!1),ps(V.ignoreContainerClipping)||ne(!1)},function(k){var V=k.getDroppableRef;Ea(V())}],ms=[function(k){var V=k.props,re=k.getPlaceholderRef;if(!V.placeholder)return;var de=re();if(de)return}],Hl=[function(k){var V=k.props;V.renderClone||ne(!1)},function(k){var V=k.getPlaceholderRef;V()&&ne(!1)}];function Kl(L){da(function(){ro(L,dl),L.props.mode==="standard"&&ro(L,ms),L.props.mode==="virtual"&&ro(L,Hl)})}var ja=function(L){Object(B.a)(k,L);function k(){for(var re,de=arguments.length,ce=new Array(de),Te=0;Te<de;Te++)ce[Te]=arguments[Te];return re=L.call.apply(L,[this].concat(ce))||this,re.state={isVisible:Boolean(re.props.on),data:re.props.on,animate:re.props.shouldAnimate&&re.props.on?"open":"none"},re.onClose=function(){if(re.state.animate!=="close")return;re.setState({isVisible:!1})},re}k.getDerivedStateFromProps=function(de,ce){return de.shouldAnimate?de.on?{isVisible:!0,data:de.on,animate:"open"}:ce.isVisible?{isVisible:!0,data:ce.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(de.on),data:de.on,animate:"none"}};var V=k.prototype;return V.render=function(){if(!this.state.isVisible)return null;var de={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(de)},k}(Q.a.PureComponent),io={dragging:5e3,dropAnimating:4500},cl=function(k,V){return V?Ji.drop(V.duration):k?Ji.snap:Ji.fluid},Gl=function(k,V){return k?V?Ki.opacity.drop:Ki.opacity.combining:null},ao=function(k){return k.forceShouldAnimate!=null?k.forceShouldAnimate:k.mode==="SNAP"};function hl(L){var k=L.dimension,V=k.client,re=L.offset,de=L.combineWith,ce=L.dropping,Te=Boolean(de),Se=ao(L),Ve=Boolean(ce),it=Ve?bs.drop(re,Te):bs.moveTo(re),ut={position:"fixed",top:V.marginBox.top,left:V.marginBox.left,boxSizing:"border-box",width:V.borderBox.width,height:V.borderBox.height,transition:cl(Se,ce),transform:it,opacity:Gl(Te,Ve),zIndex:Ve?io.dropAnimating:io.dragging,pointerEvents:"none"};return ut}function zl(L){return{transform:bs.moveTo(L.offset),transition:L.shouldAnimateDisplacement?null:"none"}}function fl(L){return L.type==="DRAGGING"?hl(L):zl(L)}function pl(L,k,V){V===void 0&&(V=Ke);var re=window.getComputedStyle(k),de=k.getBoundingClientRect(),ce=S(de,re),Te=T(ce,V),Se={client:ce,tagName:k.tagName.toLowerCase(),display:re.display},Ve={x:ce.marginBox.width,y:ce.marginBox.height},it={descriptor:L,placeholder:Se,displaceBy:Ve,client:ce,page:Te};return it}function Vl(L){var k=ua("draggable"),V=L.descriptor,re=L.registry,de=L.getDraggableRef,ce=L.canDragInteractiveElements,Te=L.shouldRespectForcePress,Se=L.isEnabled,Ve=D(function(){return{canDragInteractiveElements:ce,shouldRespectForcePress:Te,isEnabled:Se}},[ce,Se,Te]),it=p(function(tt){var Dt=de();return Dt||ne(!1),pl(V,Dt,tt)},[V,de]),ut=D(function(){return{uniqueId:k,descriptor:V,options:Ve,getDimension:it}},[V,it,Ve,k]),$e=Object(te.useRef)(ut),Xe=Object(te.useRef)(!0);ti(function(){return re.draggable.register($e.current),function(){return re.draggable.unregister($e.current)}},[re.draggable]),ti(function(){if(Xe.current){Xe.current=!1;return}var tt=$e.current;$e.current=ut,re.draggable.update(ut,tt)},[ut,re.draggable])}function so(L,k,V){da(function(){function re(ce){return"Draggable[id: "+ce+"]: "}var de=L.draggableId;if(de||ne(!1),typeof de=="string"||ne(!1),De(L.index)||ne(!1),L.mapped.type==="DRAGGING")return;Ea(V()),L.isEnabled&&(ns(k,de)||ne(!1))})}function Wa(L){Pa(function(){var k=Object(te.useRef)(L);da(function(){L===k.current||ne(!1)},[L])})}function Ha(L){L.preventDefault()}function Xl(L){var k=Object(te.useRef)(null),V=p(function(e){k.current=e},[]),re=p(function(){return k.current},[]),de=Ii(rs),ce=de.contextId,Te=de.dragHandleUsageInstructionsId,Se=de.registry,Ve=Ii(no),it=Ve.type,ut=Ve.droppableId,$e=D(function(){return{id:L.draggableId,index:L.index,type:it,droppableId:ut}},[L.draggableId,L.index,it,ut]),Xe=L.children,tt=L.draggableId,Dt=L.isEnabled,An=L.shouldRespectForcePress,Fn=L.canDragInteractiveElements,ar=L.isClone,dr=L.mapped,Sr=L.dropAnimationFinished;if(so(L,ce,re),Wa(ar),!ar){var ur=D(function(){return{descriptor:$e,registry:Se,getDraggableRef:re,canDragInteractiveElements:Fn,shouldRespectForcePress:An,isEnabled:Dt}},[$e,Se,re,Fn,An,Dt]);Vl(ur)}var Mr=D(function(){return Dt?{tabIndex:0,role:"button","aria-describedby":Te,"data-rbd-drag-handle-draggable-id":tt,"data-rbd-drag-handle-context-id":ce,draggable:!1,onDragStart:Ha}:null},[ce,Te,tt,Dt]),Lr=p(function(e){if(dr.type!=="DRAGGING")return;if(!dr.dropping)return;if(e.propertyName!=="transform")return;Sr()},[Sr,dr]),Br=D(function(){var e=fl(dr),n=dr.type==="DRAGGING"&&dr.dropping?Lr:null,c={innerRef:V,draggableProps:{"data-rbd-draggable-context-id":ce,"data-rbd-draggable-id":tt,style:e,onTransitionEnd:n},dragHandleProps:Mr};return c},[ce,Mr,tt,dr,Lr,V]),$r=D(function(){return{draggableId:$e.id,type:$e.type,source:{index:$e.index,droppableId:$e.droppableId}}},[$e.droppableId,$e.id,$e.index,$e.type]);return Xe(Br,dr.snapshot,$r)}var oo=function(L,k){return L===k},ml=function(L){var k=L.combine,V=L.destination;return V?V.droppableId:k?k.droppableId:null},$l=function(k){return k.combine?k.combine.draggableId:null},Yl=function(k){return k.at&&k.at.type==="COMBINE"?k.at.combine.draggableId:null};function Ql(){var L=f(function(de,ce){return{x:de,y:ce}}),k=f(function(de,ce,Te,Se,Ve){return{isDragging:!0,isClone:ce,isDropAnimating:Boolean(Ve),dropAnimation:Ve,mode:de,draggingOver:Te,combineWith:Se,combineTargetFor:null}}),V=f(function(de,ce,Te,Se,Ve,it,ut){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Ve,combineWith:it,mode:ce,offset:de,dimension:Te,forceShouldAnimate:ut,snapshot:k(ce,Se,Ve,it,null)}}}),re=function(ce,Te){if(ce.isDragging){if(ce.critical.draggable.id!==Te.draggableId)return null;var Se=ce.current.client.offset,Ve=ce.dimensions.draggables[Te.draggableId],it=rn(ce.impact),ut=Yl(ce.impact),$e=ce.forceShouldAnimate;return V(L(Se.x,Se.y),ce.movementMode,Ve,Te.isClone,it,ut,$e)}if(ce.phase==="DROP_ANIMATING"){var Xe=ce.completed;if(Xe.result.draggableId!==Te.draggableId)return null;var tt=Te.isClone,Dt=ce.dimensions.draggables[Te.draggableId],An=Xe.result,Fn=An.mode,ar=ml(An),dr=$l(An),Sr=ce.dropDuration,ur={duration:Sr,curve:Xa.drop,moveTo:ce.newHomeClientOffset,opacity:dr?Ki.opacity.drop:null,scale:dr?Ki.scale.drop:null};return{mapped:{type:"DRAGGING",offset:ce.newHomeClientOffset,dimension:Dt,dropping:ur,draggingOver:ar,combineWith:dr,mode:Fn,forceShouldAnimate:null,snapshot:k(Fn,tt,ar,dr,ur)}}}return null};return re}function lo(L){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:L,combineWith:null}}var Jl={mapped:{type:"SECONDARY",offset:Ke,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:lo(null)}};function Zl(){var L=f(function(Te,Se){return{x:Te,y:Se}}),k=f(lo),V=f(function(Te,Se,Ve){return Se===void 0&&(Se=null),{mapped:{type:"SECONDARY",offset:Te,combineTargetFor:Se,shouldAnimateDisplacement:Ve,snapshot:k(Se)}}}),re=function(Se){return Se?V(Ke,Se,!0):null},de=function(Se,Ve,it,ut){var $e=it.displaced.visible[Se],Xe=Boolean(ut.inVirtualList&&ut.effected[Se]),tt=hn(it),Dt=tt&&tt.draggableId===Se?Ve:null;if(!$e){if(!Xe)return re(Dt);if(it.displaced.invisible[Se])return null;var An=Xt(ut.displacedBy.point),Fn=L(An.x,An.y);return V(Fn,Dt,!0)}if(Xe)return re(Dt);var ar=it.displacedBy.point,dr=L(ar.x,ar.y);return V(dr,Dt,$e.shouldAnimate)},ce=function(Se,Ve){if(Se.isDragging)return Se.critical.draggable.id===Ve.draggableId?null:de(Ve.draggableId,Se.critical.draggable.id,Se.impact,Se.afterCritical);if(Se.phase==="DROP_ANIMATING"){var it=Se.completed;return it.result.draggableId===Ve.draggableId?null:de(Ve.draggableId,it.result.draggableId,it.impact,it.afterCritical)}return null};return ce}var gl=function(){var k=Ql(),V=Zl(),re=function(ce,Te){return k(ce,Te)||V(ce,Te)||Jl};return re},uo={dropAnimationFinished:ei},vl=Object(N.c)(gl,uo,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(Xl);function _l(L){var k=Ii(no),V=k.isUsingCloneFor;return V===L.draggableId&&!L.isClone?null:Q.a.createElement(vl,L)}function yl(L){var k=typeof L.isDragDisabled=="boolean"?!L.isDragDisabled:!0,V=Boolean(L.disableInteractiveElementBlocking),re=Boolean(L.shouldRespectForcePress);return Q.a.createElement(_l,Object(J.a)({},L,{isClone:!1,isEnabled:k,canDragInteractiveElements:V,shouldRespectForcePress:re}))}function xa(L){var k=Object(te.useContext)(rs);k||ne(!1);var V=k.contextId,re=k.isMovementAllowed,de=Object(te.useRef)(null),ce=Object(te.useRef)(null),Te=L.children,Se=L.droppableId,Ve=L.type,it=L.mode,ut=L.direction,$e=L.ignoreContainerClipping,Xe=L.isDropDisabled,tt=L.isCombineEnabled,Dt=L.snapshot,An=L.useClone,Fn=L.updateViewportMaxScroll,ar=L.getContainerForClone,dr=p(function(){return de.current},[]),Sr=p(function(l){de.current=l},[]),ur=p(function(){return ce.current},[]),Mr=p(function(l){ce.current=l},[]);Kl({props:L,getDroppableRef:dr,getPlaceholderRef:ur});var Lr=p(function(){re()&&Fn({maxScroll:Is()})},[re,Fn]);ul({droppableId:Se,type:Ve,mode:it,direction:ut,isDropDisabled:Xe,isCombineEnabled:tt,ignoreContainerClipping:$e,getDroppableRef:dr});var Br=Q.a.createElement(ja,{on:L.placeholder,shouldAnimate:L.shouldAnimatePlaceholder},function(l){var y=l.onClose,G=l.data,ee=l.animate;return Q.a.createElement(to,{placeholder:G,onClose:y,innerRef:Mr,animate:ee,contextId:V,onTransitionEnd:Lr})}),$r=D(function(){return{innerRef:Sr,placeholder:Br,droppableProps:{"data-rbd-droppable-id":Se,"data-rbd-droppable-context-id":V}}},[V,Se,Br,Sr]),e=An?An.dragging.draggableId:null,n=D(function(){return{droppableId:Se,type:Ve,isUsingCloneFor:e}},[Se,e,Ve]);function c(){if(!An)return null;var l=An.dragging,y=An.render,G=Q.a.createElement(_l,{draggableId:l.draggableId,index:l.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(ee,ae){return y(ee,ae,l)});return j.a.createPortal(G,ar())}return Q.a.createElement(no.Provider,{value:n},Te($r,Dt),c())}var gs=function(k,V){return k===V.droppable.type},Ka=function(k,V){return V.draggables[k.draggable.id]},ql=function(){var k={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},V=Object(J.a)({},k,{shouldAnimatePlaceholder:!1}),re=f(function(Te){return{draggableId:Te.id,type:Te.type,source:{index:Te.index,droppableId:Te.droppableId}}}),de=f(function(Te,Se,Ve,it,ut,$e){var Xe=ut.descriptor.id,tt=ut.descriptor.droppableId===Te;if(tt){var Dt=$e?{render:$e,dragging:re(ut.descriptor)}:null,An={isDraggingOver:Ve,draggingOverWith:Ve?Xe:null,draggingFromThisWith:Xe,isUsingPlaceholder:!0};return{placeholder:ut.placeholder,shouldAnimatePlaceholder:!1,snapshot:An,useClone:Dt}}if(!Se)return V;if(!it)return k;var Fn={isDraggingOver:Ve,draggingOverWith:Xe,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:ut.placeholder,shouldAnimatePlaceholder:!0,snapshot:Fn,useClone:null}}),ce=function(Se,Ve){var it=Ve.droppableId,ut=Ve.type,$e=!Ve.isDropDisabled,Xe=Ve.renderClone;if(Se.isDragging){var tt=Se.critical;if(!gs(ut,tt))return V;var Dt=Ka(tt,Se.dimensions),An=rn(Se.impact)===it;return de(it,$e,An,An,Dt,Xe)}if(Se.phase==="DROP_ANIMATING"){var Fn=Se.completed;if(!gs(ut,Fn.critical))return V;var ar=Ka(Fn.critical,Se.dimensions);return de(it,$e,ml(Fn.result)===it,rn(Fn.impact)===it,ar,Xe)}if(Se.phase==="IDLE"&&Se.completed&&!Se.shouldFlush){var dr=Se.completed;if(!gs(ut,dr.critical))return V;var Sr=rn(dr.impact)===it,ur=Boolean(dr.impact.at&&dr.impact.at.type==="COMBINE"),Mr=dr.critical.droppable.id===it;return Sr?ur?k:V:Mr?k:V}return V};return ce},eu={updateViewportMaxScroll:Er};function tu(){return document.body||ne(!1),document.body}var Hr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(N.c)(ql,eu,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(xa);bl.defaultProps=Hr},nnTU:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return $}),U.d(Ae,"a",function(){return z});var te=U("MI8n"),Q=U("JYp7"),B=U("pmY6"),J=U("24hK"),K=U("746U"),N=U("Cg/j");const $=Object(N.c)("commandService"),z=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,D){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:r,handler:D})}if(r.description){const d=[];for(let i of r.description.args)d.push(i.constraint);const s=r.handler;r.handler=function(i,...t){return Object(K.o)(t,d),s(i,...t)}}const{id:p}=r;let g=this._commands.get(p);g||(g=new J.a,this._commands.set(p,g));let m=g.unshift(r),a=Object(B.i)(()=>{m();const d=this._commands.get(p);(d==null?void 0:d.isEmpty())&&this._commands.delete(p)});return this._onDidRegisterCommand.fire(p),a}registerCommandAlias(r,D){return z.registerCommand(r,(p,...g)=>p.get($).executeCommand(D,...g))}getCommand(r){const D=this._commands.get(r);return!D||D.isEmpty()?void 0:Q.a.first(D)}getCommands(){const r=new Map;for(const D of this._commands.keys()){const p=this.getCommand(D);p&&r.set(D,p)}return r}};z.registerCommand("noop",()=>{})},osHv:function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Q=te.Pos;function B(i,t){return i.line-t.line||i.ch-t.ch}var J="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",K=J+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",N=new RegExp("<(/?)(["+J+"]["+K+"]*)","g");function $(i,t,u,o){this.line=t,this.ch=u,this.cm=i,this.text=i.getLine(t),this.min=o?Math.max(o.from,i.firstLine()):i.firstLine(),this.max=o?Math.min(o.to-1,i.lastLine()):i.lastLine()}function z(i,t){var u=i.cm.getTokenTypeAt(Q(i.line,t));return u&&/\btag\b/.test(u)}function r(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function p(i){for(;;){var t=i.text.indexOf(">",i.ch);if(t==-1){if(r(i))continue;return}if(!z(i,t+1)){i.ch=t+1;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function g(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!z(i,t+1)){i.ch=t;continue}N.lastIndex=t,i.ch=t;var u=N.exec(i.text);if(u&&u.index==t)return u}}function m(i){for(;;){N.lastIndex=i.ch;var t=N.exec(i.text);if(!t){if(r(i))continue;return}if(!z(i,t.index+1)){i.ch=t.index+1;continue}return i.ch=t.index+t[0].length,t}}function a(i){for(;;){var t=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!z(i,t+1)){i.ch=t;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function d(i,t){for(var u=[];;){var o=m(i),R,T=i.line,S=i.ch-(o?o[0].length:0);if(!o||!(R=p(i)))return;if(R=="selfClose")continue;if(o[1]){for(var A=u.length-1;A>=0;--A)if(u[A]==o[2]){u.length=A;break}if(A<0&&(!t||t==o[2]))return{tag:o[2],from:Q(T,S),to:Q(i.line,i.ch)}}else u.push(o[2])}}function s(i,t){for(var u=[];;){var o=a(i);if(!o)return;if(o=="selfClose"){g(i);continue}var R=i.line,T=i.ch,S=g(i);if(!S)return;if(S[1])u.push(S[2]);else{for(var A=u.length-1;A>=0;--A)if(u[A]==S[2]){u.length=A;break}if(A<0&&(!t||t==S[2]))return{tag:S[2],from:Q(i.line,i.ch),to:Q(R,T)}}}}te.registerHelper("fold","xml",function(i,t){for(var u=new $(i,t.line,0);;){var o=m(u);if(!o||u.line!=t.line)return;var R=p(u);if(!R)return;if(!o[1]&&R!="selfClose"){var T=Q(u.line,u.ch),S=d(u,o[2]);return S&&B(S.from,T)>0?{from:T,to:S.from}:null}}}),te.findMatchingTag=function(i,t,u){var o=new $(i,t.line,t.ch,u);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var R=p(o),T=R&&Q(o.line,o.ch),S=R&&g(o);if(!R||!S||B(o,t)>0)return;var A={from:Q(o.line,o.ch),to:T,tag:S[2]};return R=="selfClose"?{open:A,close:null,at:"open"}:S[1]?{open:s(o,S[2]),close:A,at:"close"}:(o=new $(i,T.line,T.ch,u),{open:A,close:d(o,S[2]),at:"open"})},te.findEnclosingTag=function(i,t,u,o){for(var R=new $(i,t.line,t.ch,u);;){var T=s(R,o);if(!T)break;var S=new $(i,t.line,t.ch,u),A=d(S,T.tag);if(A)return{open:T,close:A}}},te.scanForClosingTag=function(i,t,u,o){var R=new $(i,t.line,t.ch,o?{from:0,to:o}:null);return d(R,u)}})},p5ED:function(kt,Ae,U){"use strict";var te=U("+L6B"),Q=U("2/Rp"),B=U("5Dmo"),J=U("3S7+"),K=U("k1fw"),N=U("9og8"),$=U("tJVT"),z=U("WmNS"),r=U.n(z),D=U("q1tI"),p=U.n(D),g=U("vHTk"),m=U.n(g),a=U("yEEn"),d=U("ZW9T"),s=U("1vsH"),i=U("V0Rq"),t=U("m3rI");Ae.a=function(u){var o,R,T,S,A,P,E,b=u.editOffice,h=b===void 0?"view":b,f=u.data,C=u.theme,x=u.type,_=u.filename,j=u.monacoEditor,W=u.className,w=u.style,F=u.close,I=u.onClose,v=u.hasMask,H=u.disabledDownload,Y=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ie=Object($.a)(Y,2),le=ie[0],he=ie[1],we=Object(D.useState)(""),Pe=Object($.a)(we,2),xe=Pe[0],Oe=Pe[1],pe=Object(D.useState)(),be=Object($.a)(pe,2),ne=be[0],fe=be[1],_e=window.ENV==="build"?"/react/build":"",ke=t.a.PROXY_SERVER||location.origin,qe,je=1024*1024,st=10*je,vt=Object(D.useRef)();(o=f)!==null&&o!==void 0&&o.startsWith("/api")&&x!=="txt"&&(f=t.a.API_SERVER+f),x==="office"&&(qe=Object(s.T)(f).filesize,qe>st&&(x="other")),_&&j&&(j.filename=_),Object(D.useEffect)(function(){var Ke,yt,Pt=(Ke=document.cookie)===null||Ke===void 0||((yt=Ke.replace(/\s/g,""))===null||yt===void 0)?void 0:yt.split(";");Pt==null||Pt.map(function(Ht){var Xt=Ht.split("=");Xt[0]==="_educoder_session"&&Oe(Xt[1])})},[]),Object(D.useEffect)(function(){x==="office"&&Re()},[x,f]);var Re=function(){var Ke=Object(N.a)(r.a.mark(function yt(){var Pt,Ht,Xt;return r.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return console.log("data:",f),Pt=f,f.startsWith("http")||(Pt=location.origin+Pt),Ht=new URL(Pt).pathname.split("/").pop(),tn.next=6,Object(i.V)({attachment_id:Ht});case 6:Xt=tn.sent,fe(Xt);case 8:case"end":return tn.stop()}},yt)}));return function(){return Ke.apply(this,arguments)}}(),Be=function(){if(f.startsWith("http")||f.startsWith("blob:")){Ye();return}Object(s.z)(_||"educoder",f,_)},Ye=function(){Object(s.x)(_||"educoder",decodeURIComponent(f))};return p.a.createElement("div",{style:Object(K.a)({},w||{}),className:"".concat(v&&m.a.bgBlack," ").concat(x?m.a.wrp:"hide")},F&&p.a.createElement("div",{className:m.a.close,ref:vt},!H&&p.a.createElement(J.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return vt.current}},p.a.createElement("span",{onClick:Ye},p.a.createElement("i",{className:"icon-quxiaozhiding"}))),p.a.createElement(J.a,{title:"\u5173\u95ED",getPopupContainer:function(){return vt.current}},p.a.createElement("span",{className:"",onClick:I},p.a.createElement("i",{className:"icon-guanbi1"})))),p.a.createElement("div",{className:"".concat(m.a[W]," ").concat(W," ").concat(m.a.monaco," ").concat(x==="txt"?"show":"hide")},x==="txt"&&p.a.createElement(d.b,j)),x==="audio"&&p.a.createElement("audio",{src:"".concat(((R=f)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((T=f)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),x==="video"&&p.a.createElement(p.a.Fragment,null,((S=f)===null||S===void 0?void 0:S.indexOf("http"))>-1?p.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):p.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),x==="office"&&ne&&p.a.createElement("iframe",{src:"".concat(_e,"/office.html?key=").concat(ne.key,"&url=").concat(ke+ne.url,"&callbackUrl=").concat(ke+ne.callbackUrl,"&fileType=").concat(ne.fileType,"&title=").concat(ne.title,"&model=").concat(h,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),x==="html"&&p.a.createElement("iframe",{src:f+"&disposition=inline"}),x==="pdf"&&p.a.createElement("iframe",{src:"".concat(_e,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!H)}),x==="image"&&p.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||(E=f)!==null&&E!==void 0&&E.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),x==="other"&&p.a.createElement("div",null,p.a.createElement(Q.a,{type:"primary",size:"large",onClick:Be},p.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),x==="download"&&p.a.createElement(Q.a,{type:"primary",size:"large",onClick:Be},p.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(kt,Ae,U){},pmY6:function(kt,Ae,U){"use strict";U.d(Ae,"h",function(){return D}),U.d(Ae,"g",function(){return g}),U.d(Ae,"f",function(){return m}),U.d(Ae,"e",function(){return a}),U.d(Ae,"i",function(){return d}),U.d(Ae,"b",function(){return s}),U.d(Ae,"a",function(){return i}),U.d(Ae,"d",function(){return t}),U.d(Ae,"c",function(){return u});var te=U("C/vA"),Q=U("JYp7");const B=!1;let J=null;function K(o){J=o}if(B){const o="__is_disposable_tracked__";K(new class{trackDisposable(R){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[o]||console.log(T)},3e3)}setParent(R,T){if(R&&R!==i.None)try{R[o]=!0}catch(S){}}markAsDisposed(R){if(R&&R!==i.None)try{R[o]=!0}catch(T){}}markAsSingleton(R){}})}function N(o){return J==null||J.trackDisposable(o),o}function $(o){J==null||J.markAsDisposed(o)}function z(o,R){J==null||J.setParent(o,R)}function r(o,R){if(!J)return;for(const T of o)J.setParent(T,R)}function D(o){return J==null||J.markAsSingleton(o),o}class p extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function g(o){return typeof o.dispose=="function"&&o.dispose.length===0}function m(o){if(Q.a.is(o)){let R=[];for(const T of o)if(T)try{T.dispose()}catch(S){R.push(S)}if(R.length===1)throw R[0];if(R.length>1)throw new p(R);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function a(...o){const R=d(()=>m(o));return r(o,R),R}function d(o){const R=N({dispose:Object(te.a)(()=>{$(R),o()})});return R}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,N(this)}dispose(){if(this._isDisposed)return;$(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return z(o,this),this._isDisposed?s.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}}s.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new s,N(this),z(this._store,this)}dispose(){$(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}i.None=Object.freeze({dispose(){}});class t{constructor(){this._isDisposed=!1,N(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var R;if(this._isDisposed||o===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),o&&z(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,$(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&z(o,null),o}}class u{constructor(o){this.object=o}dispose(){}}},psGv:function(kt,Ae,U){var te,Q;(function(){var B;(function(){"use strict";var $=[,,function(p){function g(d){this.__parent=d,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}g.prototype.clone_empty=function(){var d=new g(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},g.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},g.prototype.has_match=function(d){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(d))return!0;return!1},g.prototype.set_indent=function(d,s){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},g.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},g.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(d){this.__items.push(d);var s=d.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=d.length-s:this.__character_count+=d.length},g.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function m(d,s){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),s=s||"",d.indent_level>0&&(s=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}m.prototype.get_indent_size=function(d,s){var i=this.__base_string_length;return s=s||0,d<0&&(i=0),i+=d*this.__indent_size,i+=s,i},m.prototype.get_indent_string=function(d,s){var i=this.__base_string;return s=s||0,d<0&&(d=0,i=""),s+=d*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},m.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var d=this.__cache.length,s=0,i="";this.__indent_size&&d>=this.__indent_size&&(s=Math.floor(d/this.__indent_size),d-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),d&&(i+=new Array(d+1).join(" ")),this.__cache.push(i)};function a(d,s){this.__indent_cache=new m(d,s),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new g(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(d,s){return this.__indent_cache.get_indent_string(d,s)},a.prototype.get_indent_size=function(d,s){return this.__indent_cache.get_indent_size(d,s)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(d){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 d!==`
|
|
`&&(i=i.replace(/[\n]/g,d)),i},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(d,s){return d=d||0,s=s||0,this.next_line.set_indent(d,s),this.__lines.length>1?(this.current_line.set_indent(d,s),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(d){for(var s=0;s<d.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),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(d){for(var s=this.__lines.length;d<s;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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(d,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(d)!==0&&t.item(-1)!==s){this.__lines.splice(i+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},p.exports.Output=a},function(p){function g(m,a,d,s){this.type=m,this.text=a,this.comments_before=null,this.newlines=d||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=g},,,function(p){function g(d,s){this.raw_options=m(d,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}g.prototype._get_array=function(d,s){var i=this.raw_options[d],t=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(t=i.concat()):typeof i=="string"&&(t=i.split(/[^a-zA-Z0-9_\/\-]+/)),t},g.prototype._get_boolean=function(d,s){var i=this.raw_options[d],t=i===void 0?!!s:!!i;return t},g.prototype._get_characters=function(d,s){var i=this.raw_options[d],t=s||"";return typeof i=="string"&&(t=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),t},g.prototype._get_number=function(d,s){var i=this.raw_options[d];s=parseInt(s,10),isNaN(s)&&(s=0);var t=parseInt(i,10);return isNaN(t)&&(t=s),t},g.prototype._get_selection=function(d,s,i){var t=this._get_selection_list(d,s,i);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[d]+"'");return t[0]},g.prototype._get_selection_list=function(d,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(d,i);if(!this._is_valid_selection(t,s))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[d]+"'");return t},g.prototype._is_valid_selection=function(d,s){return d.length&&s.length&&!d.some(function(i){return s.indexOf(i)===-1})};function m(d,s){var i={};d=a(d);var t;for(t in d)t!==s&&(i[t]=d[t]);if(s&&d[s])for(t in d[s])i[t]=d[s][t];return i}function a(d){var s={},i;for(i in d){var t=i.replace(/-/g,"_");s[t]=d[i]}return s}p.exports.Options=g,p.exports.normalizeOpts=a,p.exports.mergeOpts=m},,function(p){var g=RegExp.prototype.hasOwnProperty("sticky");function m(a){this.__input=a||"",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 a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},m.prototype.peek=function(a){var d=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(d=this.__input.charAt(a)),d},m.prototype.__match=function(a,d){a.lastIndex=d;var s=a.exec(this.__input);return s&&!(g&&a.sticky)&&(s.index!==d&&(s=null)),s},m.prototype.test=function(a,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(a,d):!1},m.prototype.testChar=function(a,d){var s=this.peek(d);return a.lastIndex=0,s!==null&&a.test(s)},m.prototype.match=function(a){var d=this.__match(a,this.__position);return d?this.__position+=d[0].length:d=null,d},m.prototype.read=function(a,d,s){var i="",t;return a&&(t=this.match(a),t&&(i+=t[0])),d&&(t||!a)&&(i+=this.readUntil(d,s)),i},m.prototype.readUntil=function(a,d){var s="",i=this.__position;a.lastIndex=this.__position;var t=a.exec(this.__input);return t?(i=t.index,d&&(i+=t[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},m.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},m.prototype.get_regexp=function(a,d){var s=null,i="g";return d&&g&&(i="y"),typeof a=="string"&&a!==""?s=new RegExp(a,i):a&&(s=new RegExp(a.source,i)),s},m.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(a){var d=this.__position,s=this.readUntilAfter(a);return this.__position=d,s},m.prototype.lookBack=function(a){var d=this.__position-1;return d>=a.length&&this.__input.substring(d-a.length,d).toLowerCase()===a},p.exports.InputScanner=m},function(p,g,m){var a=m(8).InputScanner,d=m(3).Token,s=m(10).TokenStream,i=m(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,R){this._input=new a(o),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var o,R=new d(t.START,""),T=null,S=[],A=new s;R.type!==t.EOF;){for(o=this._get_next_token(R,T);this._is_comment(o);)A.add(o),o=this._get_next_token(R,T);A.isEmpty()||(o.comments_before=A,A=new s),o.parent=T,this._is_opening(o)?(S.push(T),T=o):T&&this._is_closing(o,T)&&(o.opened=T,T.closed=o,T=S.pop(),o.parent=T),o.previous=R,R.next=o,this.__tokens.add(o),R=o}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(o,R){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(t.RAW,T):this._create_token(t.EOF,"")},u.prototype._is_comment=function(o){return!1},u.prototype._is_opening=function(o){return!1},u.prototype._is_closing=function(o,R){return!1},u.prototype._create_token=function(o,R){var T=new d(o,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=u,p.exports.TOKEN=t},function(p){function g(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},g.prototype.peek=function(m){var a=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(a=this.__tokens[m]),a},g.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},p.exports.TokenStream=g},function(p,g,m){var a=m(12).Pattern;function d(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=""}d.prototype=new a,d.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+"]")},d.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},d.prototype.matching=function(s,i){var t=this._create();return t.__set_whitespace_patterns(s,i),t._update(),t},d.prototype._create=function(){return new d(this._input,this)},d.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},p.exports.WhitespacePattern=d},function(p){function g(m,a){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}g.prototype.read=function(){var 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},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(m){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(m),a._update(),a},g.prototype.until=function(m){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(m),a._update(),a},g.prototype.starting_with=function(m){var a=this._create();return a._starting_pattern=this._input.get_regexp(m,!0),a._update(),a},g.prototype.matching=function(m){var a=this._create();return a._match_pattern=this._input.get_regexp(m,!0),a._update(),a},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},p.exports.Pattern=g},function(p){function g(m,a){m=typeof m=="string"?m:m.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+a,"g")}g.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(m);d;)a[d[1]]=d[2],d=this.__directive_pattern.exec(m);return a},g.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=g},function(p,g,m){var a=m(12).Pattern,d={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({},d),this._excluded=Object.assign({},d),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 d)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},p.exports.TemplatablePattern=s},,,,function(p,g,m){var a=m(19).Beautifier,d=m(20).Options;function s(i,t,u,o){var R=new a(i,t,u,o);return R.beautify()}p.exports=s,p.exports.defaultOptions=function(){return new d}},function(p,g,m){var a=m(20).Options,d=m(2).Output,s=m(21).Tokenizer,i=m(21).TOKEN,t=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,o=function(C,x){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new d(C,x)};o.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},o.prototype.set_space_before_token=function(C,x){this._output.space_before_token=C,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(C){this._output.add_raw_token(C)},o.prototype.print_preserved_newlines=function(C){var x=0;C.type!==i.TEXT&&C.previous.type!==i.TEXT&&(x=C.newlines?1:0),this.preserve_newlines&&(x=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var _=0;_<x;_++)this.print_newline(_>0);return x!==0},o.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(C){this._output.add_new_line(C)},o.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var R=function(C){for(var x=null,_=C.next;_.type!==i.EOF&&C.closed!==_;){if(_.type===i.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===i.EQUALS&&_.next.next&&_.next.next.type===i.VALUE&&(x=_.next.next.text);break}_=_.next}return x},T=function(C,x){var _=null,j=null;return x.closed?(C==="script"?_="text/javascript":C==="style"&&(_="text/css"),_=R(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 S(C,x){return x.indexOf(C)!==-1}function A(C,x,_){this.parent=C||null,this.tag=x?x.tag_name:"",this.indent_level=_||0,this.parser_token=x||null}function P(C){this._printer=C,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(C){var x=new A(this._current_frame,C,this._printer.indent_level);this._current_frame=x},P.prototype._try_pop_frame=function(C){var x=null;return C&&(x=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),x},P.prototype._get_frame=function(C,x){for(var _=this._current_frame;_&&!(C.indexOf(_.tag)!==-1);){if(x&&x.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},P.prototype.try_pop=function(C,x){var _=this._get_frame([C],x);return this._try_pop_frame(_)},P.prototype.indent_to_tag=function(C){var x=this._get_frame(C);x&&(this._printer.indent_level=x.indent_level)};function E(C,x,_,j){this._source_text=C||"",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"}E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,x=this._options.eol;this._options.eol==="auto"&&(x=`
|
|
`,C&&t.test(C)&&(x=C.match(t)[0])),C=C.replace(u,`
|
|
`);var _=C.match(/^[\t ]*/)[0],j={text:"",type:""},W=new b,w=new o(this._options,_),F=new s(C,this._options).tokenize();this._tag_stack=new P(w);for(var I=null,v=F.next();v.type!==i.EOF;)v.type===i.TAG_OPEN||v.type===i.COMMENT?(I=this._handle_tag_open(w,v,W,j),W=I):v.type===i.ATTRIBUTE||v.type===i.EQUALS||v.type===i.VALUE||v.type===i.TEXT&&!W.tag_complete?I=this._handle_inside_tag(w,v,W,F):v.type===i.TAG_CLOSE?I=this._handle_tag_close(w,v,W):v.type===i.TEXT?I=this._handle_text(w,v,W):w.add_raw_token(v),j=I,v=F.next();var H=w._output.get_code(x);return H},E.prototype._handle_tag_close=function(C,x,_){var j={text:x.text,type:x.type};return C.alignment_size=0,_.tag_complete=!0,C.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),_.is_unformatted?C.add_raw_token(x):(_.tag_start_char==="<"&&(C.set_space_before_token(x.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(x)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(C.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&C.set_wrap_point(),j},E.prototype._handle_inside_tag=function(C,x,_,j){var W=_.has_wrapped_attrs,w={text:x.text,type:x.type};if(C.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),_.is_unformatted)C.add_raw_token(x);else if(_.tag_start_char==="{"&&x.type===i.TEXT)C.print_preserved_newlines(x)?(x.newlines=0,C.add_raw_token(x)):C.print_token(x);else{if(x.type===i.ATTRIBUTE?(C.set_space_before_token(!0),_.attr_count+=1):(x.type===i.EQUALS||x.type===i.VALUE&&x.previous.type===i.EQUALS)&&C.set_space_before_token(!1),x.type===i.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.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 I=!0,v=0,H;do{if(H=j.peek(v),H.type===i.ATTRIBUTE){I=!1;break}v+=1}while(v<4&&H.type!==i.EOF&&H.type!==i.TAG_CLOSE);F=!I}F&&(C.print_newline(!1),W=!0)}C.print_token(x),W=W||C.previous_token_wrapped(),_.has_wrapped_attrs=W}return w},E.prototype._handle_text=function(C,x,_){var j={text:x.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(C,x,_):_.is_unformatted||_.is_content_unformatted?C.add_raw_token(x):(C.traverse_whitespace(x),C.print_token(x)),j},E.prototype._print_custom_beatifier_text=function(C,x,_){var j=this;if(x.text!==""){var W=x.text,w,F=1,I="",v="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:_.custom_beautifier_name==="html"&&(w=function(we,Pe){var xe=new E(we,Pe,j._js_beautify,j._css_beautify);return xe.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-C.indent_level);var H=C.get_full_indent(F);if(W=W.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!Y){C.add_raw_token(x);return}I=H+Y[1]+`
|
|
`,W=Y[4],Y[5]&&(v=H+Y[5]),W=W.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
|
|
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(x.whitespace_before=Y[0]))}if(W)if(w){var ie=function(){this.eol=`
|
|
`};ie.prototype=this._options.raw_options;var le=new ie;W=w(H+W,le)}else{var he=x.whitespace_before;he&&(W=W.replace(new RegExp(`
|
|
(`+he+")?","g"),`
|
|
`)),W=H+W.replace(/\n/g,`
|
|
`+H)}I&&(W?W=I+W+`
|
|
`+v:W=I+v),C.print_newline(!1),W&&(x.text=W,x.whitespace_before="",x.newlines=0,C.add_raw_token(x),C.print_newline(!0))}},E.prototype._handle_tag_open=function(C,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?(C.add_raw_token(x),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(x),this._set_tag_position(C,x,W,_,j),W.is_inline_element||C.set_wrap_point(),C.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&&(C.alignment_size=W.alignment_size),W};var b=function(C,x){if(this.parent=C||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!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)))}};E.prototype._get_tag_open_token=function(C){var x=new b(this._tag_stack.get_parser_token(),C);return x.alignment_size=this._options.wrap_attributes_indent_size,x.is_end_tag=x.is_end_tag||S(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&&S(x.tag_check,this._options.unformatted),x.is_content_unformatted=!x.is_empty_element&&S(x.tag_check,this._options.content_unformatted),x.is_inline_element=S(x.tag_name,this._options.inline)||x.tag_name.includes("-")||x.tag_start_char==="{",x},E.prototype._set_tag_position=function(C,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||C.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=T(_.tag_check,x)))),S(_.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var w=C.current_line_has_match(/{{#if/);w||C.print_newline(!1)}_.tag_name==="!--"&&W.type===i.TAG_CLOSE&&j.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,_))}else if(_.is_end_tag){var F=!1;F=_.start_tag_token&&_.start_tag_token.multiline_content,F=F||!_.is_inline_element&&!(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&&C.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(W.type!=="TK_CONTENT"||_.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,_)},E.prototype._calcluate_parent_multiline=function(C,x){x.parent&&C._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"];E.prototype._do_optional_end_element=function(C){var x=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")x=x||this._tag_stack.try_pop("head");else if(C.tag_name==="li")x=x||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")x=x||this._tag_stack.try_pop("dt",["dl"]),x=x||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&h.indexOf(C.tag_name)!==-1){var _=C.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(x=x||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(x=x||this._tag_stack.try_pop("rt",["ruby","rtc"]),x=x||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?x=x||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?x=x||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?x=x||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.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"])):C.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"])):(C.tag_name==="th"||C.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 C.parent=this._tag_stack.get_parser_token(),x},p.exports.Beautifier=E},function(p,g,m){var a=m(6).Options;function d(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"])}d.prototype=new a,p.exports.Options=d},function(p,g,m){var a=m(9).Tokenizer,d=m(9).TOKEN,s=m(13).Directives,i=m(14).TemplatablePattern,t=m(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:d.START,RAW:d.RAW,EOF:d.EOF},o=new s(/<\!--/,/-->/),R=function(T,S){a.call(this,T,S),this._current_tag_name="";var A=new i(this._input).read_options(this._options),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 E=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=P.matching(E).until_after(E)}};R.prototype=new a,R.prototype._is_comment=function(T){return!1},R.prototype._is_opening=function(T){return T.type===u.TAG_OPEN},R.prototype._is_closing=function(T,S){return T.type===u.TAG_CLOSE&&S&&((T.text===">"||T.text==="/>")&&S.text[0]==="<"||T.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(T,S){var A=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(u.EOF,""):(A=A||this._read_open_handlebars(P,S),A=A||this._read_attribute(P,T,S),A=A||this._read_close(P,S),A=A||this._read_raw_content(P,T,S),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,S),A=A||this._create_token(u.UNKNOWN,this._input.next()),A)},R.prototype._read_comment_or_cdata=function(T){var S=null,A=null,P=null;if(T==="<"){var E=this._input.peek(1);E==="!"&&(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&&(S=this._create_token(u.COMMENT,A),S.directives=P)}return S},R.prototype._read_processing=function(T){var S=null,A=null,P=null;if(T==="<"){var E=this._input.peek(1);(E==="!"||E==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(S=this._create_token(u.COMMENT,A),S.directives=P)}return S},R.prototype._read_open=function(T,S){var A=null,P=null;return S||T==="<"&&(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},R.prototype._read_open_handlebars=function(T,S){var A=null,P=null;return S||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),P=this._create_token(u.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),P=this._create_token(u.TAG_OPEN,A))),P},R.prototype._read_close=function(T,S){var A=null,P=null;return S&&(S.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(A=this._input.next(),T==="/"&&(A+=this._input.next()),P=this._create_token(u.TAG_CLOSE,A)):S.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),P=this._create_token(u.TAG_CLOSE,"}}"))),P},R.prototype._read_attribute=function(T,S,A){var P=null,E="";if(A&&A.text[0]==="<")if(T==="=")P=this._create_token(u.EQUALS,this._input.next());else if(T==='"'||T==="'"){var b=this._input.next();T==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),P=this._create_token(u.VALUE,b)}else E=this.__patterns.attribute.read(),E&&(S.type===u.EQUALS?P=this._create_token(u.VALUE,E):P=this._create_token(u.ATTRIBUTE,E));return P},R.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},R.prototype._read_raw_content=function(T,S,A){var P="";if(A&&A.text[0]==="{")P=this.__patterns.handlebars_raw_close.read();else if(S.type===u.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var E=S.opened.text.substr(1).toLowerCase();if(E==="script"||E==="style"){var b=this._read_comment_or_cdata(T);if(b)return b.type=u.TEXT,b;P=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(E)&&(P=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig")))}return P?this._create_token(u.TEXT,P):null},R.prototype._read_content_word=function(T){var S="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(u.TEXT,S)},p.exports.Tokenizer=R,p.exports.TOKEN=u}],z={};function r(p){var g=z[p];if(g!==void 0)return g.exports;var m=z[p]={exports:{}};return $[p](m,m.exports,r),m.exports}var D=r(18);B=D})();var J=B;if(!0)!(te=[U,U("6UM0"),U("TXwP")],Q=function($){var z=U("6UM0"),r=U("TXwP");return{html_beautify:function(D,p){return J(D,p,z.js_beautify,r.css_beautify)}}}.apply(Ae,te),Q!==void 0&&(kt.exports=Q));else var K,N})()},"rAM+":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});var te=U("Qw5x");function Q(B,J){var K;if(typeof Symbol=="undefined"||B[Symbol.iterator]==null){if(Array.isArray(B)||(K=Object(te.a)(B))||J&&B&&typeof B.length=="number"){K&&(B=K);var N=0,$=function(){};return{s:$,n:function(){return N>=B.length?{done:!0}:{done:!1,value:B[N++]}},e:function(g){throw g},f:$}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var z=!0,r=!1,D;return{s:function(){K=B[Symbol.iterator]()},n:function(){var g=K.next();return z=g.done,g},e:function(g){r=!0,D=g},f:function(){try{!z&&K.return!=null&&K.return()}finally{if(r)throw D}}}}},rUJ1:function(kt,Ae){const U=/[&<>"']/,te=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,J={"&":"&","<":"<",">":">",'"':""","'":"'"},K=P=>J[P];function N(P,E){if(E){if(U.test(P))return P.replace(te,K)}else if(Q.test(P))return P.replace(B,K);return P}const $=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function z(P){return P.replace($,(E,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const r=/(^|[^\[])\^/g;function D(P,E){P=P.source||P,E=E||"";const b={replace:(h,f)=>(f=f.source||f,f=f.replace(r,"$1"),P=P.replace(h,f),b),getRegex:()=>new RegExp(P,E)};return b}const p=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(P,E,b){if(P){let h;try{h=decodeURIComponent(z(b)).replace(p,"").toLowerCase()}catch(f){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}E&&!g.test(b)&&(b=t(E,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(h){return null}return b}const a={},d=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(P,E){a[" "+P]||(d.test(P)?a[" "+P]=P+"/":a[" "+P]=T(P,"/",!0)),P=a[" "+P];const b=P.indexOf(":")===-1;return E.substring(0,2)==="//"?b?E:P.replace(s,"$1")+E:E.charAt(0)==="/"?b?E:P.replace(i,"$1")+E:P+E}const u={exec:function(){}};function o(P){let E=1,b,h;for(;E<arguments.length;E++){b=arguments[E];for(h in b)Object.prototype.hasOwnProperty.call(b,h)&&(P[h]=b[h])}return P}function R(P,E){const b=P.replace(/\|/g,(C,x,_)=>{let j=!1,W=x;for(;--W>=0&&_[W]==="\\";)j=!j;return j?"|":" |"}),h=b.split(/ \|/);let f=0;if(h.length>E)h.splice(E);else for(;h.length<E;)h.push("");for(;f<h.length;f++)h[f]=h[f].trim().replace(/\\\|/g,"|");return h}function T(P,E,b){const h=P.length;if(h===0)return"";let f=0;for(;f<h;){const C=P.charAt(h-f-1);if(C===E&&!b)f++;else if(C!==E&&b)f++;else break}return P.substr(0,h-f)}function S(P,E){if(P.indexOf(E[1])===-1)return-1;const b=P.length;let h=0,f=0;for(;f<b;f++)if(P[f]==="\\")f++;else if(P[f]===E[0])h++;else if(P[f]===E[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")}kt.exports={escape:N,unescape:z,edit:D,cleanUrl:m,resolveUrl:t,noopTest:u,merge:o,splitCells:R,rtrim:T,findClosingBracket:S,checkSanitizeDeprecation:A}},sR1s:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return J}),U.d(Ae,"a",function(){return K}),U.d(Ae,"c",function(){return N}),U.d(Ae,"d",function(){return $});var te=U("U8pU"),Q="RC_TABLE_KEY";function B(z){return z==null?[]:Array.isArray(z)?z:[z]}function J(z,r){if(!r&&typeof r!="number")return z;for(var D=B(r),p=z,g=0;g<D.length;g+=1){if(!p)return null;var m=D[g];p=p[m]}return p}function K(z){var r=[],D={};return z.forEach(function(p){for(var g=p||{},m=g.key,a=g.dataIndex,d=m||B(a).join("-")||Q;D[d];)d="".concat(d,"_next");D[d]=!0,r.push(d)}),r}function N(){var z={};function r(m,a){a&&Object.keys(a).forEach(function(d){var s=a[d];s&&Object(te.a)(s)==="object"?(m[d]=m[d]||{},r(m[d],s)):m[d]=s})}for(var D=arguments.length,p=new Array(D),g=0;g<D;g++)p[g]=arguments[g];return p.forEach(function(m){r(z,m)}),z}function $(z){return z!=null}},sZF6:function(kt,Ae,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("DZo9"),J=U("8z0m"),K=U("+L6B"),N=U("2/Rp"),$=U("tJVT"),z=U("q1tI"),r=U.n(z),D=U("xvlK"),p=U("m3rI"),g=U("1vsH"),m=U("Ty5D"),a=U("69hG"),d=U.n(a),s=function(t){var u=t.visible,o=t.onOk,R=t.onCancel,T=Object(z.useState)([]),S=Object($.a)(T,2),A=S[0],P=S[1],E=Object(z.useState)(!1),b=Object($.a)(E,2),h=b[0],f=b[1],C=Object(m.i)();Object(z.useEffect)(function(){u||(P([]),f(!1))},[u]);var x=function(){f(!0),o(A,function(){f(!1)})},_=function(){R()},j=function(){console.log(C,444);var I="".concat(p.a.API_SERVER,"/api/courses/").concat(C.coursesId,"/exercises/down_template");Object(g.x)(null,I)},W=function(I){var v={name:I.name,uid:I.uid,file:I};return P([v]),!1},w=function(){P([])};return r.a.createElement(Q.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:u,onOk:x,centered:!0,wrapClassName:d.a.customModal,onCancel:_,width:"680px",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",confirmLoading:h},r.a.createElement("div",{className:d.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(J.a,{action:"".concat(p.a.API_SERVER,"/api/attachments.json"),beforeUpload:W,onRemove:w,withCredentials:!0,fileList:A,accept:".xls,.xlsx"},r.a.createElement(N.a,{className:d.a.upload,type:"primary",icon:r.a.createElement(D.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};Ae.a=s},sboe:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return B});var te=U("q1tI"),Q=U.n(te),B=te.createContext(null)},t23M:function(kt,Ae,U){"use strict";var te=U("VTBJ"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("LK+K"),N=U("q1tI"),$=U.n(N),z=U("m+aA"),r=U("Zm9Q"),D=U("Kwbf"),p=U("c+Xe"),g=U("bdgK"),m="rc-observer-key",a=function(d){Object(J.a)(i,d);var s=Object(K.a)(i);function i(){var t;return Object(Q.a)(this,i),t=s.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(u){var o=t.props.onResize,R=u[0].target,T=R.getBoundingClientRect(),S=T.width,A=T.height,P=R.offsetWidth,E=R.offsetHeight,b=Math.floor(S),h=Math.floor(A);if(t.state.width!==b||t.state.height!==h||t.state.offsetWidth!==P||t.state.offsetHeight!==E){var f={width:b,height:h,offsetWidth:P,offsetHeight:E};t.setState(f),o&&Promise.resolve().then(function(){o(Object(te.a)(Object(te.a)({},f),{},{offsetWidth:P,offsetHeight:E}))})}},t.setChildNode=function(u){t.childNode=u},t}return Object(B.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var o=Object(z.a)(this.childNode||this),R=o!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,o=Object(r.a)(u);if(o.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=o[0];if(N.isValidElement(R)&&Object(p.c)(R)){var T=R.ref;o[0]=N.cloneElement(R,{ref:Object(p.a)(T,this.setChildNode)})}return o.length===1?o[0]:o.map(function(S,A){return!N.isValidElement(S)||"key"in S&&S.key!==null?S:N.cloneElement(S,{key:"".concat(m,"-").concat(A)})})}}]),i}(N.Component);a.displayName="ResizeObserver",Ae.a=a},t9D7:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return $}),U.d(Ae,"g",function(){return r}),U.d(Ae,"d",function(){return D}),U.d(Ae,"e",function(){return p}),U.d(Ae,"a",function(){return g}),U.d(Ae,"f",function(){return d}),U.d(Ae,"c",function(){return s});var te=U("Vhoy"),Q=U("MI8n"),B=U("pmY6"),J=U("Cg/j"),K=U("ic2d"),N=U("nEHx");const $=Object(J.c)("themeService");var z;(function(i){function t(u){return u&&typeof u=="object"&&typeof u.id=="string"}i.isThemeColor=t})(z||(z={}));function r(i){return{id:i}}var D;(function(i){function t(A){return A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color=="undefined"||z.isThemeColor(A.color))}i.isThemeIcon=t;const u=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function o(A){const P=u.exec(A);if(!P)return;let[,E]=P;return{id:E}}i.fromString=o;function R(A,P){let E=A.id;const b=E.lastIndexOf("~");return b!==-1&&(E=E.substring(0,b)),P&&(E=`${E}~${P}`),{id:E}}i.modify=R;function T(A,P){var E,b;return A.id===P.id&&((E=A.color)===null||E===void 0?void 0:E.id)===((b=P.color)===null||b===void 0?void 0:b.id)}i.isEqual=T;function S(A,P){return{id:A.id,color:P?r(P):void 0}}i.asThemeIcon=S,i.asClassNameArray=te.a.asClassNameArray,i.asClassName=te.a.asClassName,i.asCSSSelector=te.a.asCSSSelector})(D||(D={}));function p(i){switch(i){case N.a.DARK:return"vs-dark";case N.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class m{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 m;K.a.add(g.ThemingContribution,a);function d(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(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return T});var te=U("miYZ"),Q=U("tsqr"),B=U("9og8"),J=U("5NDa"),K=U("5rEg"),N=U("2qtc"),$=U("kLXV"),z=U("oBTY"),r=U("tJVT"),D=U("OaEy"),p=U("2fM7"),g=U("WmNS"),m=U.n(g),a=U("q1tI"),d=U.n(a),s=U("ErOA"),i=U("i58Z"),t=U.n(i),u=U("T1X5"),o=U.n(u),R=p.a.Option,T=function(A){var P=A.subId,E=A.value,b=A.selectvalues,h=A.disabled,f=A.knowledgeOptions,C=f===void 0?[]:f,x=A.onChange,_=x===void 0?function(){}:x,j=A.onAddKnowledgeFinish,W=j===void 0?function(){}:j,w=Object(a.useRef)(),F=Object(a.useState)([]),I=Object(r.a)(F,2),v=I[0],H=I[1];E=E||[];var Y=function(he,we){he?(H([we.key]),_([we.key])):(H([]),_([]))};Object(a.useEffect)(function(){(b==null?void 0:b.length)>0&&(H(Object(z.a)(b)),_(Object(z.a)(b)))},[C]),Object(a.useEffect)(function(){var le;((le=E)===null||le===void 0?void 0:le.length)>0&&_(Object(z.a)(E))},[C]);var ie=function(he){he.preventDefault(),w.current="",$.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:d.a.createElement("div",{className:"font14"},d.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},d.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",d.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",d.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",d.a.createElement("br",null)),d.a.createElement(K.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:w.current,onChange:function(Pe){w.current=Pe.target.value}})),onOk:function(){return new Promise(function(){var Pe=Object(B.a)(m.a.mark(function xe(Oe,pe){var be,ne;return m.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:if(w.current){_e.next=3;break}return Q.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",pe());case 3:if(!(w.current.length>20)){_e.next=6;break}return Q.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",pe());case 6:return _e.next=8,Object(s.a)("/api/tag_disciplines.json",{method:"post",body:{name:w.current,sub_discipline_id:P}});case 8:return be=_e.sent,(be==null?void 0:be.status)===0&&(W({id:be.tag_discipline_id,name:w.current,type:"personal"}),ne=[],ne.push(be.tag_discipline_id),_([].concat(ne)),H([be.tag_discipline_id]),_([].concat(ne))),_e.abrupt("return",Oe());case 11:case"end":return _e.stop()}},xe)}));return function(xe,Oe){return Pe.apply(this,arguments)}}())}})};return d.a.createElement("div",{className:t.a.wrap},d.a.createElement(p.a,{disabled:!P||h,className:"mr5",style:{width:"242px"},onChange:Y,showSearch:!0,allowClear:!0,value:C==null?void 0:C.filter(function(le){return(v==null?void 0:v.includes(le==null?void 0:le.id))||(v==null?void 0:v.includes((le==null?void 0:le.id)+""))}).map(function(le){return le.name})},C==null?void 0:C.map(function(le){return d.a.createElement(R,{key:le.id,value:le.name},d.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},d.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.name),d.a.createElement("span",null,le.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),d.a.createElement("button",{disabled:!P,className:"".concat(t.a.addKnowledge," ").concat(P?"":t.a.disabled),onClick:ie},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(kt,Ae,U){(function(te,Q){kt.exports=Q()})(this,function(){"use strict";function te(Q,B,J){J=J||{},J.childrenKeyName=J.childrenKeyName||"children";var K=Q||[],N=[],$=0;do{var z=K.filter(function(r){return B(r,$)})[0];if(!z)break;N.push(z),K=z[J.childrenKeyName]||[],$+=1}while(K.length>0);return N}return te})},ulZh:function(kt,Ae,U){typeof window!="undefined"&&function(Q,B){kt.exports=B()}(this,function(){return function(te){var Q={};function B(J){if(Q[J])return Q[J].exports;var K=Q[J]={i:J,l:!1,exports:{}};return te[J].call(K.exports,K,K.exports,B),K.l=!0,K.exports}return B.m=te,B.c=Q,B.d=function(J,K,N){B.o(J,K)||Object.defineProperty(J,K,{enumerable:!0,get:N})},B.r=function(J){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})},B.t=function(J,K){if(K&1&&(J=B(J)),K&8)return J;if(K&4&&typeof J=="object"&&J&&J.__esModule)return J;var N=Object.create(null);if(B.r(N),Object.defineProperty(N,"default",{enumerable:!0,value:J}),K&2&&typeof J!="string")for(var $ in J)B.d(N,$,function(z){return J[z]}.bind(null,$));return N},B.n=function(J){var K=J&&J.__esModule?function(){return J.default}:function(){return J};return B.d(K,"a",K),K},B.o=function(J,K){return Object.prototype.hasOwnProperty.call(J,K)},B.p="/dist/",B(B.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Q,B){"use strict";var J=Object.prototype.hasOwnProperty,K="~";function N(){}Object.create&&(N.prototype=Object.create(null),new N().__proto__||(K=!1));function $(p,g,m){this.fn=p,this.context=g,this.once=m||!1}function z(p,g,m,a,d){if(typeof m!="function")throw new TypeError("The listener must be a function");var s=new $(m,a||p,d),i=K?K+g:g;return p._events[i]?p._events[i].fn?p._events[i]=[p._events[i],s]:p._events[i].push(s):(p._events[i]=s,p._eventsCount++),p}function r(p,g){--p._eventsCount===0?p._events=new N:delete p._events[g]}function D(){this._events=new N,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],m,a;if(this._eventsCount===0)return g;for(a in m=this._events)J.call(m,a)&&g.push(K?a.slice(1):a);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(m)):g},D.prototype.listeners=function(g){var m=K?K+g:g,a=this._events[m];if(!a)return[];if(a.fn)return[a.fn];for(var d=0,s=a.length,i=new Array(s);d<s;d++)i[d]=a[d].fn;return i},D.prototype.listenerCount=function(g){var m=K?K+g:g,a=this._events[m];return a?a.fn?1:a.length:0},D.prototype.emit=function(g,m,a,d,s,i){var t=K?K+g:g;if(!this._events[t])return!1;var u=this._events[t],o=arguments.length,R,T;if(u.fn){u.once&&this.removeListener(g,u.fn,void 0,!0);switch(o){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,m),!0;case 3:return u.fn.call(u.context,m,a),!0;case 4:return u.fn.call(u.context,m,a,d),!0;case 5:return u.fn.call(u.context,m,a,d,s),!0;case 6:return u.fn.call(u.context,m,a,d,s,i),!0}for(T=1,R=new Array(o-1);T<o;T++)R[T-1]=arguments[T];u.fn.apply(u.context,R)}else{var S=u.length,A;for(T=0;T<S;T++){u[T].once&&this.removeListener(g,u[T].fn,void 0,!0);switch(o){case 1:u[T].fn.call(u[T].context);break;case 2:u[T].fn.call(u[T].context,m);break;case 3:u[T].fn.call(u[T].context,m,a);break;case 4:u[T].fn.call(u[T].context,m,a,d);break;default:if(!R)for(A=1,R=new Array(o-1);A<o;A++)R[A-1]=arguments[A];u[T].fn.apply(u[T].context,R)}}}return!0},D.prototype.on=function(g,m,a){return z(this,g,m,a,!1)},D.prototype.once=function(g,m,a){return z(this,g,m,a,!0)},D.prototype.removeListener=function(g,m,a,d){var s=K?K+g:g;if(!this._events[s])return this;if(!m)return r(this,s),this;var i=this._events[s];if(i.fn)i.fn===m&&(!d||i.once)&&(!a||i.context===a)&&r(this,s);else{for(var t=0,u=[],o=i.length;t<o;t++)(i[t].fn!==m||d&&!i[t].once||a&&i[t].context!==a)&&u.push(i[t]);u.length?this._events[s]=u.length===1?u[0]:u:r(this,s)}return this},D.prototype.removeAllListeners=function(g){var m;return g?(m=K?K+g:g,this._events[m]&&r(this,m)):(this._events=new N,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=K,D.EventEmitter=D,te.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,Q,B){(function(J){var K=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,N=/^([^\/?#]*)([^]*)$/,$=/(?:\/|^)\.(?=\/)/g,z=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(D,p,g){if(g=g||{},D=D.trim(),p=p.trim(),!p){if(!g.alwaysNormalize)return D;var m=r.parseURL(D);if(!m)throw new Error("Error trying to parse base URL.");return m.path=r.normalizePath(m.path),r.buildURLFromParts(m)}var a=r.parseURL(p);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return g.alwaysNormalize?(a.path=r.normalizePath(a.path),r.buildURLFromParts(a)):p;var d=r.parseURL(D);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var s=N.exec(d.path);d.netLoc=s[1],d.path=s[2]}d.netLoc&&!d.path&&(d.path="/");var i={scheme:d.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(i.netLoc=d.netLoc,a.path[0]!=="/"))if(!a.path)i.path=d.path,a.params||(i.params=d.params,a.query||(i.query=d.query));else{var t=d.path,u=t.substring(0,t.lastIndexOf("/")+1)+a.path;i.path=r.normalizePath(u)}return i.path===null&&(i.path=g.alwaysNormalize?r.normalizePath(a.path):a.path),r.buildURLFromParts(i)},parseURL:function(D){var p=K.exec(D);return p?{scheme:p[1]||"",netLoc:p[2]||"",path:p[3]||"",params:p[4]||"",query:p[5]||"",fragment:p[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace($,"");D.length!==(D=D.replace(z,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};te.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(te,Q,B){function J(g){var m={};function a(s){if(m[s])return m[s].exports;var i=m[s]={i:s,l:!1,exports:{}};return g[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=g,a.c=m,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 d=a(a.s=ENTRY_MODULE);return d.default||d}var K="[\\.|\\-|\\+|\\w|/|@]+",N="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+K+").*?\\)";function $(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function z(g){return!isNaN(1*g)}function r(g,m,a){var d={};d[a]=[];var s=m.toString(),i=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return d;for(var t=i[1],u=new RegExp("(\\\\n|\\W)"+$(t)+N,"g"),o;o=u.exec(s);){if(o[3]==="dll-reference")continue;d[a].push(o[3])}for(u=new RegExp("\\("+$(t)+'\\("(dll-reference\\s('+K+'))"\\)\\)'+N,"g");o=u.exec(s);)g[o[2]]||(d[a].push(o[1]),g[o[2]]=B(o[1]).m),d[o[2]]=d[o[2]]||[],d[o[2]].push(o[4]);for(var R=Object.keys(d),T=0;T<R.length;T++)for(var S=0;S<d[R[T]].length;S++)z(d[R[T]][S])&&(d[R[T]][S]=1*d[R[T]][S]);return d}function D(g){var m=Object.keys(g);return m.reduce(function(a,d){return a||g[d].length>0},!1)}function p(g,m){for(var a={main:[m]},d={main:[]},s={main:{}};D(a);)for(var i=Object.keys(a),t=0;t<i.length;t++){var u=i[t],o=a[u],R=o.pop();if(s[u]=s[u]||{},s[u][R]||!g[u][R])continue;s[u][R]=!0,d[u]=d[u]||[],d[u].push(R);for(var T=r(g,g[u][R],u),S=Object.keys(T),A=0;A<S.length;A++)a[S[A]]=a[S[A]]||[],a[S[A]]=a[S[A]].concat(T[S[A]])}return d}te.exports=function(g,m){m=m||{};var a={main:B.m},d=m.all?{main:Object.keys(a.main)}:p(a,g),s="";Object.keys(d).filter(function(R){return R!=="main"}).forEach(function(R){for(var T=0;d[R][T];)T++;d[R].push(T),a[R][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+R+" = ("+J.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+d[R].map(function(S){return""+JSON.stringify(S)+": "+a[R][S].toString()}).join(",")+`});
|
|
`}),s=s+"new (("+J.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+d.main.map(function(R){return""+JSON.stringify(R)+": "+a.main[R].toString()}).join(",")+"}))(self);";var i=new window.Blob([s],{type:"text/javascript"});if(m.bare)return i;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,u=t.createObjectURL(i),o=new window.Worker(u);return o.objectURL=u,o}},"./src/config.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"hlsDefaultConfig",function(){return A}),B.d(Q,"mergeConfig",function(){return E}),B.d(Q,"enableStreamingMode",function(){return b});var J=B("./src/controller/abr-controller.ts"),K=B("./src/controller/audio-stream-controller.ts"),N=B("./src/controller/audio-track-controller.ts"),$=B("./src/controller/subtitle-stream-controller.ts"),z=B("./src/controller/subtitle-track-controller.ts"),r=B("./src/controller/buffer-controller.ts"),D=B("./src/controller/timeline-controller.ts"),p=B("./src/controller/cap-level-controller.ts"),g=B("./src/controller/fps-controller.ts"),m=B("./src/controller/eme-controller.ts"),a=B("./src/controller/cmcd-controller.ts"),d=B("./src/utils/xhr-loader.ts"),s=B("./src/utils/fetch-loader.ts"),i=B("./src/utils/cues.ts"),t=B("./src/utils/mediakeys-helper.ts"),u=B("./src/utils/logger.ts");function o(){return o=Object.assign||function(h){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(h[x]=C[x])}return h},o.apply(this,arguments)}function R(h,f){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);f&&(x=x.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),C.push.apply(C,x)}return C}function T(h){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?R(Object(C),!0).forEach(function(x){S(h,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):R(Object(C)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(C,x))})}return h}function S(h,f,C){return f in h?Object.defineProperty(h,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):h[f]=C,h}var A=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:d.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:J.default,bufferController:r.default,capLevelController:p.default,fpsController:g.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},P()),{},{subtitleStreamController:$.SubtitleStreamController,subtitleTrackController:z.default,timelineController:D.TimelineController,audioStreamController:K.default,audioTrackController:N.default,emeController:m.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 E(h,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},h,f)}function b(h){var f=h.loader;if(f!==s.default&&f!==d.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var C=Object(s.fetchSupported)();C&&(h.loader=s.default,h.progressive=!0,h.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/utils/ewma-bandwidth-estimator.ts"),N=B("./src/events.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/errors.ts"),r=B("./src/types/loader.ts"),D=B("./src/utils/logger.ts");function p(a,d){for(var s=0;s<d.length;s++){var i=d[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function g(a,d,s){return d&&p(a.prototype,d),s&&p(a,s),a}var m=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 d=a.prototype;return d.registerListeners=function(){var i=this.hls;i.on(N.Events.FRAG_LOADING,this.onFragLoading,this),i.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(N.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var i=this.hls;i.off(N.Events.FRAG_LOADING,this.onFragLoading,this),i.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(N.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.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)}},d.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)},d._abandonRulesCheck=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.autoLevelEnabled,R=u.config,T=u.media;if(!i||!T)return;var S=t?t.stats:i.stats,A=t?t.duration:i.duration;if(S.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||T.paused||!T.playbackRate||!T.readyState)return;var P=performance.now()-S.loading.start,E=Math.abs(T.playbackRate);if(P<=500*A/E)return;var b=u.levels,h=u.minAutoLevel,f=b[i.level],C=S.total||Math.max(S.loaded,Math.round(A*f.maxBitrate/8)),x=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/P),_=(C-S.loaded)/x,j=T.currentTime,W=($.BufferHelper.bufferInfo(T,j,R.maxBufferHole).end-j)/E;if(W>=2*A/E||_<=W)return;var w=Number.POSITIVE_INFINITY,F;for(F=i.level-1;F>h;F--){var I=b[F].maxBitrate;if(w=A*I/(8*.8*x),w<W)break}if(w>=_)return;var v=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+i.sn+(t?" part "+t.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+`
|
|
Current BW estimate: `+(Object(J.isFiniteNumber)(v)?(v/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+w.toFixed(3)+` s
|
|
Time to underbuffer: `+W.toFixed(3)+" s"),u.nextLoadLevel=F,this.bwEstimator.sample(P,S.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),u.trigger(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:S})},d.onFragLoaded=function(i,t){var u=t.frag,o=t.part;if(u.type===r.PlaylistLevelType.MAIN&&Object(J.isFiniteNumber)(u.sn)){var R=o?o.stats:u.stats,T=o?o.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[u.level],A=(S.loaded?S.loaded.bytes:0)+R.loaded,P=(S.loaded?S.loaded.duration:0)+T;S.loaded={bytes:A,duration:P},S.realBitrate=Math.round(8*A/P)}if(u.bitrateTest){var E={stats:R,frag:u,part:o,id:u.type};this.onFragBuffered(N.Events.FRAG_BUFFERED,E),u.bitrateTest=!1}}},d.onFragBuffered=function(i,t){var u=t.frag,o=t.part,R=o?o.stats:u.stats;if(R.aborted)return;if(u.type!==r.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var T=R.parsing.end-R.loading.start;this.bwEstimator.sample(T,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},d.onError=function(i,t){switch(t.details){case z.ErrorDetails.FRAG_LOAD_ERROR:case z.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.maxAutoLevel,R=u.config,T=u.minAutoLevel,S=u.media,A=t?t.duration:i?i.duration:0,P=S?S.currentTime:0,E=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,h=($.BufferHelper.bufferInfo(S,P,R.maxBufferHole).end-P)/E,f=this.findBestLevel(b,T,o,h,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=A?Math.min(A,R.maxStarvationDelay):R.maxStarvationDelay,x=R.abrBandWidthFactor,_=R.abrBandWidthUpFactor;if(!h){var j=this.bitrateTestDelay;if(j){var W=A?Math.min(A,R.maxLoadingDelay):R.maxLoadingDelay;C=W-j,D.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),x=_=1}}return f=this.findBestLevel(b,T,o,h+C,x,_),Math.max(f,0)},d.findBestLevel=function(i,t,u,o,R,T){for(var S,A=this.fragCurrent,P=this.partCurrent,E=this.lastLoadedFragLevel,b=this.hls.levels,h=b[E],f=!!(h!=null&&(S=h.details)!==null&&S!==void 0&&S.live),C=h==null?void 0:h.codecSet,x=P?P.duration:A?A.duration:0,_=u;_>=t;_--){var j=b[_];if(!j||C&&j.codecSet!==C)continue;var W=j.details,w=(P?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||x,F=void 0;_<=E?F=R*i:F=T*i;var I=b[_].maxBitrate,v=I*w/F;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(F)+"/"+I+"/"+w+"/"+o+"/"+v),F>I&&(!v||f&&!this.bitrateTestDelay||v<o))return _}return-1},g(a,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,t=this.bwEstimator;if(i!==-1&&(!t||!t.canEstimate()))return i;var u=this.getNextABRAutoLevel();return i!==-1&&(u=Math.min(i,u)),u},set:function(i){this._nextAutoLevel=i}}]),a}();Q.default=m},"./src/controller/audio-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),N=B("./src/events.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/controller/fragment-tracker.ts"),r=B("./src/types/level.ts"),D=B("./src/types/loader.ts"),p=B("./src/loader/fragment.ts"),g=B("./src/demux/chunk-cache.ts"),m=B("./src/demux/transmuxer-interface.ts"),a=B("./src/types/transmuxer.ts"),d=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 E=arguments[P];for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(A[b]=E[b])}return A},u.apply(this,arguments)}function o(A,P){A.prototype=Object.create(P.prototype),A.prototype.constructor=A,R(A,P)}function R(A,P){return R=Object.setPrototypeOf||function(b,h){return b.__proto__=h,b},R(A,P)}var T=100,S=function(A){o(P,A);function P(b,h){var f;return f=A.call(this,b,h,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var E=P.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var h=this.hls;h.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(N.Events.ERROR,this.onError,this),h.on(N.Events.BUFFER_RESET,this.onBufferReset,this),h.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var h=this.hls;h.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(N.Events.ERROR,this.onError,this),h.off(N.Events.BUFFER_RESET,this.onBufferReset,this),h.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onInitPtsFound=function(h,f){var C=f.frag,x=f.id,_=f.initPTS;if(x==="main"){var j=C.cc;this.initPTS[C.cc]=_,this.log("InitPTS for cc: "+j+" found from main: "+_),this.videoTrackCC=j,this.state===K.State.WAITING_INIT_PTS&&this.tick()}},E.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=K.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,f>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},E.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var h,f=this.levels,C=this.trackId,x=f==null||((h=f[C])===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 w=this.waitingData;if(w){var F=w.frag,I=w.part,v=w.cache,H=w.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var Y=v.flush(),ie={frag:F,part:I,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(ie),H&&A.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),he=$.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),we=Object(d.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,F);we<0&&(t.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},E.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},E.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:h,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},E.doTickIdle=function(){var h,f,C=this.hls,x=this.levels,_=this.media,j=this.trackId,W=C.config;if(!x||!x[j])return;if(!_&&(this.startFragRequested||!W.startFragPrefetch))return;var w=x[j],F=w.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,p.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(I===null)return;var v=I.len,H=this.getMaxBufferLength(),Y=this.audioSwitch;if(v>=H&&!Y)return;if(!Y&&this._streamEnded(I,F)){C.trigger(N.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var ie=F.fragments,le=ie[0].start,he=I.end;if(Y){var we=this.getLoadPosition();he=we,F.PTSKnown&&we<le&&((I.end>le||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=le+.05))}var Pe=this.getNextFragment(he,F);if(!Pe){this.bufferFlushed=!0;return}((h=Pe.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((f=Pe.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Pe,F):this.loadFragment(Pe,F,he)},E.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)},E.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(h,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(x){return new r.Level(x)})},E.onAudioTrackSwitching=function(h,f){var C=!!f.url;this.trackId=f.id;var x=this.fragCurrent;x!=null&&x.loader&&x.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(T):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(h,f){this.mainDetails=f.details},E.onAudioTrackLoaded=function(h,f){var C,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],w=0;if(_.live||(C=W.details)!==null&&C!==void 0&&C.live){var F=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!F)return;!W.details&&_.hasProgramDateTime&&F.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(_,F),w=_.fragments[0].start):w=this.alignPlaylists(_,W.details)}W.details=_,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(W.details,w),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=K.State.IDLE),this.tick()},E._handleFragmentLoadProgress=function(h){var f,C=h.frag,x=h.part,_=h.payload,j=this.config,W=this.trackId,w=this.levels;if(!w){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var F=w[W];console.assert(F,"Audio track is defined on fragment load progress");var I=F.details;console.assert(I,"Audio track details are defined on fragment load progress");var v=j.defaultAudioCodec||F.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[C.cc],ie=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(Y!==void 0){var le=!1,he=x?x.index:-1,we=he!==-1,Pe=new a.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,_.byteLength,he,we);H.push(_,ie,v,"",C,x,I.totalduration,le,Pe,Y)}else{t.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+W);var xe=this.waitingData=this.waitingData||{frag:C,part:x,cache:new g.default,complete:!1},Oe=xe.cache;Oe.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},E._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,h)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(h,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},E.onFragBuffered=function(h,f){var C=f.frag,x=f.part;if(C.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(x?" p: "+x.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,x)},E.onError=function(h,f){switch(f.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,f);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=f.fatal?K.State.ERROR:K.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var C=!0,x=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);x&&x.len>.5&&(C=!this.reduceMaxBufferLength(x.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},E.onBufferFlushed=function(h,f){var C=f.type;C===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(h){var f,C="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 w=W.frag,F=W.part,I=_.audio,v=_.text,H=_.id3,Y=_.initSegment;if(this.fragContextChanged(w))return;if(this.state=K.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,w,j),x.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:C,tracks:Y.tracks})),I){var ie=I.startPTS,le=I.endPTS,he=I.startDTS,we=I.endDTS;F&&(F.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:le,startDTS:he,endDTS:we}),w.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ie,le,he,we),this.bufferFragmentData(I,w,F,j)}if(H!=null&&(f=H.samples)!==null&&f!==void 0&&f.length){var Pe=u({frag:w,id:C},H);x.trigger(N.Events.FRAG_PARSING_METADATA,Pe)}if(v){var xe=u({frag:w,id:C},v);x.trigger(N.Events.FRAG_PARSING_USERDATA,xe)}},E._bufferInitSegment=function(h,f,C){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(N.Events.BUFFER_CODECS,h);var _=x.initSegment;if(_!=null&&_.byteLength){var j={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:_};this.hls.trigger(N.Events.BUFFER_APPENDING,j)}this.tick()},E.loadFragment=function(h,f,C){var x=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||x===z.FragmentState.NOT_LOADED||x===z.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):f.live&&!Object(J.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,h,f,C)))},E.completeAudioSwitch=function(){var h=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:C})},P}(K.default);Q.default=S},"./src/controller/audio-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/controller/base-playlist-controller.ts"),$=B("./src/types/loader.ts");function z(m,a){for(var d=0;d<a.length;d++){var s=a[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(m,s.key,s)}}function r(m,a,d){return a&&z(m.prototype,a),d&&z(m,d),m}function D(m,a){m.prototype=Object.create(a.prototype),m.prototype.constructor=m,p(m,a)}function p(m,a){return p=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},p(m,a)}var g=function(m){D(a,m);function a(s){var i;return i=m.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 d=a.prototype;return d.registerListeners=function(){var i=this.hls;i.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(J.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var i=this.hls;i.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(J.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(i,t){this.tracks=t.audioTracks||[]},d.onAudioTrackLoaded=function(i,t){var u=t.id,o=t.details,R=this.tracksInGroup[u];if(!R){this.warn("Invalid audio track id "+u);return}var T=R.details;R.details=t.details,this.log("audioTrack "+u+" loaded ["+o.startSN+"-"+o.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,t,T))},d.onLevelLoading=function(i,t){this.switchLevel(t.level)},d.onLevelSwitching=function(i,t){this.switchLevel(t.level)},d.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.audioGroupIds))return;var u=t.audioGroupIds[t.urlId];if(this.groupId!==u){this.groupId=u;var o=this.tracks.filter(function(T){return!u||T.groupId===u});this.selectDefaultTrack&&!o.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var R={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(J.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},d.onError=function(i,t){if(m.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===$.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},d.setAudioTrack=function(i){var t=this.tracksInGroup;if(i<0||i>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=t[this.trackId];this.log("Now switching to audio-track index "+i);var o=t[i],R=o.id,T=o.groupId,S=T===void 0?"":T,A=o.name,P=o.type,E=o.url;if(this.trackId=i,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(J.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:S,name:A,type:P,url:E}),o.details&&!o.details.live)return;var b=this.switchParams(o.url,u==null?void 0:u.details);this.loadPlaylist(b)},d.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,u=this.findTrackId(t)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.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},d.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var u=t.id,o=t.groupId,R=t.url;if(i)try{R=i.addDirectives(R)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(J.Events.AUDIO_TRACK_LOADING,{url:R,id:u,groupId:o,deliveryDirectives:i||null})}},r(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),a}(N.default);Q.default=g},"./src/controller/base-playlist-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/polyfills/number.ts"),K=B("./src/types/level.ts"),N=B("./src/controller/level-helper.ts"),$=B("./src/utils/logger.ts"),z=B("./src/errors.ts"),r=function(){function D(g,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=$.logger.log.bind($.logger,m+":"),this.warn=$.logger.warn.bind($.logger,m+":"),this.hls=g}var p=D.prototype;return p.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},p.onError=function(m,a){a.fatal&&a.type===z.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},p.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},p.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},p.stopLoad=function(){this.canLoad=!1,this.clearTimer()},p.switchParams=function(m,a){var d=a==null?void 0:a.renditionReports;if(d)for(var s=0;s<d.length;s++){var i=d[s],t=""+i.URI;if(t===m.substr(-t.length)){var u=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var R=Math.min(a.age-a.partTarget,a.targetduration);o!==void 0&&R>a.partTarget&&(o+=1)}if(Object(J.isFiniteNumber)(u))return new K.HlsUrlParameters(u,Object(J.isFiniteNumber)(o)?o:void 0,K.HlsSkip.No)}}},p.loadPlaylist=function(m){},p.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},p.playlistLoaded=function(m,a,d){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||d!=null&&d.live){if(i.reloaded(d),d&&this.log("live playlist "+m+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),d&&i.fragments.length>0&&Object(N.mergeDetails)(d,i),!this.canLoad||!i.live)return;var o,R=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var S=this.hls.config.lowLatencyMode,A=i.lastPartSn,P=i.endSN,E=i.lastPartIndex,b=E!==-1,h=A===P,f=S?0:E;b?(R=h?P+1:A,T=h?f:E+1):R=P+1;var C=i.age,x=C+i.ageHeader,_=Math.min(x-i.partTarget,i.targetduration*1.5);if(_>0){if(d&&_>d.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+d.tuneInGoal+" to: "+_+" with playlist age: "+i.age),_=0;else{var j=Math.floor(_/i.targetduration);if(R+=j,T!==void 0){var W=Math.round(_%i.targetduration/i.partTarget);T+=W}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+_+" skip sn "+j+" to part "+T)}i.tuneInGoal=_}if(o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T),S||!h){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T);var w=Object(N.computeReloadInterval)(i,t);R!==void 0&&i.canBlockReload&&(w-=i.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(w)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(o)},w)}else this.clearTimer()},p.getDeliveryDirectives=function(m,a,d,s){var i=Object(K.getSkipValue)(m,d);return a!=null&&a.skip&&m.deltaUpdateFailed&&(d=a.msn,s=a.part,i=K.HlsSkip.No),new K.HlsUrlParameters(d,s,i)},p.retryLoadingOrFail=function(m){var a=this,d=this.hls.config,s=this.retryCount<d.levelLoadingMaxRetry;if(s){var i;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(i=m.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*d.levelLoadingRetryDelay,d.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return s},D}()},"./src/controller/base-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"State",function(){return P}),B.d(Q,"default",function(){return E});var J=B("./src/polyfills/number.ts"),K=B("./src/task-loop.ts"),N=B("./src/controller/fragment-tracker.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/utils/logger.ts"),r=B("./src/events.ts"),D=B("./src/errors.ts"),p=B("./src/types/transmuxer.ts"),g=B("./src/utils/mp4-tools.ts"),m=B("./src/utils/discontinuities.ts"),a=B("./src/controller/fragment-finders.ts"),d=B("./src/controller/level-helper.ts"),s=B("./src/loader/fragment-loader.ts"),i=B("./src/crypt/decrypter.ts"),t=B("./src/utils/time-ranges.ts"),u=B("./src/types/loader.ts");function o(b,h){for(var f=0;f<h.length;f++){var C=h[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function R(b,h,f){return h&&o(b.prototype,h),f&&o(b,f),b}function T(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function S(b,h){b.prototype=Object.create(h.prototype),b.prototype.constructor=b,A(b,h)}function A(b,h){return A=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},A(b,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"},E=function(b){S(h,b);function h(C,x,_){var j;return j=b.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=z.logger.log.bind(z.logger,_+":"),j.warn=z.logger.warn.bind(z.logger,_+":"),j.hls=C,j.fragmentLoader=new s.default(C.config),j.fragmentTracker=x,j.config=C.config,j.decrypter=new i.default(C,C.config),C.on(r.Events.KEY_LOADED,j.onKeyLoaded,T(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 w=W.getState(j);return w===N.FragmentState.PARTIAL||w===N.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,w=this.state,F=j?j.currentTime:0,I=$.BufferHelper.bufferInfo(W||j,F,x.maxBufferHole);if(this.log("media seeking to "+(Object(J.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+w),w===P.ENDED)this.resetLoadingState();else if(_&&!I.len){var v=x.maxFragLookUpTolerance,H=_.start-v,Y=_.start+_.duration+v,ie=F>Y;(F<H||ie)&&(ie&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=F),!this.loadedmetadata&&!I.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(),b.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,b.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,w=function(I){if(W.fragContextChanged(x)){W.warn("Fragment "+x.sn+(I.part?" p: "+I.part.index:"")+" of level "+x.level+" was dropped during download."),W.fragmentTracker.removeFragment(x);return}x.stats.chunkCount++,W._handleFragmentLoadProgress(I)};this._doFragLoad(x,_,j,w).then(function(F){if(!F)return;W.fragLoadError=0;var I=W.state;if(W.fragContextChanged(x)){(I===P.FRAG_LOADING||I===P.BACKTRACKING||!W.fragCurrent&&I===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,w=j.payload,F=x.decryptdata;if(w&&w.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var I=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(w),F.key.buffer,F.iv.buffer).then(function(v){var H=self.performance.now();return W.trigger(r.Events.FRAG_DECRYPTED,{frag:x,payload:v,stats:{tstart:I,tdecrypt:H}}),j.payload=v,j})}return j}).then(function(j){var W=_.fragCurrent,w=_.hls,F=_.levels;if(!F)throw new Error("init load aborted, missing levels");var I=F[x.level].details;console.assert(I,"Level details are defined when init segment is loaded");var v=x.stats;_.state=P.IDLE,_.fragLoadError=0,x.data=new Uint8Array(j.payload),v.parsing.start=v.buffering.start=self.performance.now(),v.parsing.end=v.buffering.end=self.performance.now(),j.frag===W&&w.trigger(r.Events.FRAG_BUFFERED,{stats:v,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($.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,w=x.partsLoaded,F=!w||w.length===0||w.some(function(v){return!v}),I=new p.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,W?W.index:-1,!F);_.flush(I)},f._handleFragmentLoadProgress=function(x){},f._doFragLoad=function(x,_,j,W){var w=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 I=this.getNextPart(F,x,j);if(I>-1){var v=F[I];return this.log("Loading part sn: "+x.sn+" p: "+v.index+" cc: "+x.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+I+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=P.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:x,part:F[I],targetBufferTime:j}),this.doFragPartsLoad(x,F,I,W).catch(function(H){return w.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(J.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 w.handleFragLoadError(H)})},f.doFragPartsLoad=function(x,_,j,W){var w=this;return new Promise(function(F,I){var v=[],H=function Y(ie){var le=_[ie];w.fragmentLoader.loadPart(x,le,W).then(function(he){v[le.index]=he;var we=he.part;w.hls.trigger(r.Events.FRAG_LOADED,he);var Pe=_[ie+1];if(Pe&&Pe.fragment===x)Y(ie+1);else return F({frag:x,part:we,partsLoaded:v})}).catch(I)};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,w=_.level,F=self.performance.now();j.stats.parsing.end=F,W&&(W.stats.parsing.end=F),this.updateLevelTiming(j,W,w,x.partial)},f.getCurrentContext=function(x){var _=this.levels,j=x.level,W=x.sn,w=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],I=w>-1?Object(d.getPartWith)(F,W,w):null,v=I?I.fragment:Object(d.getFragmentWithSN)(F,W,this.fragCurrent);return v?{frag:v,part:I,level:F}:null},f.bufferFragmentData=function(x,_,j,W){if(!x||this.state!==P.PARSING)return;var w=x.data1,F=x.data2,I=w;if(w&&F&&(I=Object(g.appendUint8Array)(w,F)),!I||!I.length)return;var v={type:x.type,frag:_,part:j,chunkMeta:W,parent:_.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,v),x.dropped&&x.independent&&!j&&this.flushBufferGap(_)},f.flushBufferGap=function(x){var _=this.media;if(!_)return;if(!$.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,x.start);return}var j=_.currentTime,W=$.BufferHelper.bufferInfo(_,j,0),w=x.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,w*.25),I=Math.max(Math.min(x.start-F,W.end-F),j+F);x.start-I>F&&this.flushMainBuffer(I,x.start)},f.getFwdBufferInfo=function(x,_){var j=this.config,W=this.getLoadPosition();if(!Object(J.isFiniteNumber)(W))return null;var w=$.BufferHelper.bufferInfo(x,W,j.maxBufferHole);if(w.len===0&&w.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(W,_);if(F&&w.nextStart<F.end)return $.BufferHelper.bufferInfo(x,W,Math.max(w.nextStart,j.maxBufferHole))}return w},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,w=_.fragments,F=w.length;if(!F)return null;var I=this.config,v=w[0].start,H;if(_.live){var Y=I.initialLiveManifestSize;if(F<Y)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+Y+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(_,w),this.startPosition=H?this.hls.liveSyncPosition||H.start:x)}else x<=v&&(H=w[0]);if(!H){var ie=I.lowLatencyMode?_.partEnd:_.fragmentEnd;H=this.getFragmentAtPosition(x,ie,_)}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,w=!1,F=!0,I=0,v=x.length;I<v;I++){var H=x[I];if(F=F&&!H.independent,W>-1&&j<H.start)break;var Y=H.loaded;!Y&&(w||H.independent||F)&&H.fragment===_&&(W=I),w=Y}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 w=j.sn+1;if(w>=x.startSN&&w<=x.endSN){var F=_[w-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 I=this.hls.liveSyncPosition;I!==null&&(W=this.getFragmentAtPosition(I,this.bitrateTest?x.fragmentEnd:x.edge,x))}return W},f.getFragmentAtPosition=function(x,_,j){var W=this.config,w=this.fragPrevious,F=j.fragments,I=j.endSN,v=j.fragmentHint,H=W.maxFragLookUpTolerance,Y=!!(W.lowLatencyMode&&j.partList&&v);Y&&v&&!this.bitrateTest&&(F=F.concat(v),I=v.sn);var ie;if(x<_){var le=x>_-H?0:H;ie=Object(a.findFragmentByPTS)(w,F,x,le)}else ie=F[F.length-1];if(ie){var he=ie.sn-j.startSN,we=w&&ie.level===w.level,Pe=F[he+1],xe=this.fragmentTracker.getState(ie);if(xe===N.FragmentState.BACKTRACKED){ie=null;for(var Oe=he;F[Oe]&&this.fragmentTracker.getState(F[Oe])===N.FragmentState.BACKTRACKED;)w?ie=F[Oe--]:ie=F[--Oe];ie||(ie=Pe)}else w&&ie.sn===w.sn&&!Y&&(we&&(ie.sn<I&&this.fragmentTracker.getState(Pe)!==N.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+Pe.sn),ie=Pe):ie=null))}return ie},f.synchronizeToLiveEdge=function(x){var _=this.config,j=this.media;if(!j)return;var W=this.hls.liveSyncPosition,w=j.currentTime,F=x.fragments[0].start,I=x.edge,v=w>=F-_.maxFragLookUpTolerance&&w<=I;if(W!==null&&j.duration>W&&(w<W||!v)){var H=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*x.targetduration;(!v&&j.readyState<4||w<I-H)&&(this.loadedmetadata||(this.nextLoadPosition=W),j.readyState&&(this.warn("Playback: "+w.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+W.toFixed(3)),j.currentTime=W))}},f.alignPlaylists=function(x,_){var j=this.levels,W=this.levelLastLoaded,w=this.fragPrevious,F=W!==null?j[W]:null,I=x.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var v=x.fragments[0].start,H=!_,Y=x.alignedSliding&&Object(J.isFiniteNumber)(v);if(H||!Y&&!v){Object(m.alignStream)(w,F,x);var ie=x.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+x.startSN+" prev-sn: "+(w?w.sn:"na")+" fragments: "+I),ie}return v},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(J.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 w=this.config;if(this.fragLoadError+1<=w.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*w.fragLoadingRetryDelay,w.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):(z.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=$.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 w=this,F=j.details;console.assert(!!F,"level.details must be defined");var I=Object.keys(x.elementaryStreams).reduce(function(v,H){var Y=x.elementaryStreams[H];if(Y){var ie=Y.endPTS-Y.startPTS;if(ie<=0)return w.warn("Could not parse fragment "+x.sn+" "+H+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),w.resetTransmuxer(),v||!1;var le=W?0:Object(d.updateFragPTSDTS)(F,x,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return w.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:F,level:j,drift:le,type:H,frag:x,start:Y.startPTS,end:Y.endPTS}),!0}return v},!1);I?(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)},R(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(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts"),$=B("./src/errors.ts"),z=B("./src/utils/buffer-helper.ts"),r=B("./src/utils/mediasource-helper.ts"),D=B("./src/loader/fragment.ts"),p=B("./src/controller/buffer-operation-queue.ts"),g=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function d(i){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=t.hls,o=t.media,R=t.mediaSource;N.logger.log("[buffer-controller]: Media source opened"),o&&(t.updateMediaElementDuration(),u.trigger(K.Events.MEDIA_ATTACHED,{media:o})),R&&R.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){N.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){N.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var s=d.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 p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(t,u){var o=2;(u.audio&&!u.video||!u.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,N.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(t,u){var o=this.media=u.media;if(o&&g){var R=this.mediaSource=new g;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(R),this._objectUrl=o.src}},s.onMediaDetaching=function(){var t=this.media,u=this.mediaSource,o=this._objectUrl;if(u){if(N.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){N.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(o&&self.URL.revokeObjectURL(o),t.src===o?(t.removeAttribute("src"),t.load()):N.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(K.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(u){var o=t.sourceBuffer[u];try{o&&(t.removeBufferListeners(u),t.mediaSource&&t.mediaSource.removeSourceBuffer(o),t.sourceBuffer[u]=void 0)}catch(R){N.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},s.onBufferCodecs=function(t,u){var o=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(T){if(R){var S=o.tracks[T];if(S&&typeof S.buffer.changeType=="function"){var A=u[T],P=A.codec,E=A.levelCodec,b=A.container,h=(S.levelCodec||S.codec).replace(m,"$1"),f=(E||P).replace(m,"$1");if(h!==f){var C=b+";codecs="+(E||P);o.appendChangeType(T,C)}}}else o.pendingTracks[T]=u[T]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(t,u){var o=this,R=this.operationQueue,T={execute:function(){var A=o.sourceBuffer[t];A&&(N.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+u),A.changeType(u)),R.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(A){N.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",A)}};R.append(T,t)},s.onBufferAppending=function(t,u){var o=this,R=this.hls,T=this.operationQueue,S=this.tracks,A=u.data,P=u.type,E=u.frag,b=u.part,h=u.chunkMeta,f=h.buffering[P],C=self.performance.now();f.start=C;var x=E.stats.buffering,_=b?b.stats.buffering:null;x.start===0&&(x.start=C),_&&_.start===0&&(_.start=C);var j=S.audio,W=P==="audio"&&h.id===1&&(j==null?void 0:j.container)==="audio/mpeg",w={execute:function(){if(f.executeStart=self.performance.now(),W){var I=o.sourceBuffer[P];if(I){var v=E.start-I.timestampOffset;Math.abs(v)>=.1&&(N.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+E.start+" (delta: "+v+") sn: "+E.sn+")"),I.timestampOffset=E.start)}}o.appendExecutor(A,P)},onStart:function(){},onComplete:function(){var I=self.performance.now();f.executeEnd=f.end=I,x.first===0&&(x.first=I),_&&_.first===0&&(_.first=I);var v=o.sourceBuffer,H={};for(var Y in v)H[Y]=z.BufferHelper.getBuffered(v[Y]);o.appendError=0,o.hls.trigger(K.Events.BUFFER_APPENDED,{type:P,frag:E,part:b,chunkMeta:h,parent:E.type,timeRanges:H})},onError:function(I){N.logger.error("[buffer-controller]: Error encountered while trying to append to the "+P+" SourceBuffer",I);var v={type:$.ErrorTypes.MEDIA_ERROR,parent:E.type,details:$.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?v.details=$.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,v.details=$.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>R.config.appendErrorMaxRetry&&(N.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0)),R.trigger(K.Events.ERROR,v)}};T.append(w,P)},s.onBufferFlushing=function(t,u){var o=this,R=this.operationQueue,T=function(A){return{execute:o.removeExecutor.bind(o,A,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(K.Events.BUFFER_FLUSHED,{type:A})},onError:function(E){N.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",E)}}};u.type?R.append(T(u.type),u.type):this.getSourceBufferTypes().forEach(function(S){R.append(T(S),S)})},s.onFragParsed=function(t,u){var o=this,R=u.frag,T=u.part,S=[],A=T?T.elementaryStreams:R.elementaryStreams;A[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(A[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),A[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var P=function(){var b=self.performance.now();R.stats.buffering.end=b,T&&(T.stats.buffering.end=b);var h=T?T.stats:R.stats;o.hls.trigger(K.Events.FRAG_BUFFERED,{frag:R,part:T,stats:h,id:R.type})};S.length===0&&N.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(P,S)},s.onFragChanged=function(t,u){this.flushBackBuffer()},s.onBufferEos=function(t,u){var o=this,R=this.getSourceBufferTypes().reduce(function(T,S){var A=o.sourceBuffer[S];return(!u.type||u.type===S)&&(A&&!A.ended&&(A.ended=!0,N.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),T&&!!(!A||A.ended)},!0);R&&this.blockBuffers(function(){var T=o.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},s.onLevelUpdated=function(t,u){var o=u.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var t=this.hls,u=this.details,o=this.media,R=this.sourceBuffer;if(!o||u===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var S=u.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(J.isFiniteNumber)(S)||S<0)return;var A=o.currentTime,P=u.levelTargetDuration,E=Math.max(S,P),b=Math.floor(A/P)*P-E;T.forEach(function(h){var f=R[h];if(f){var C=z.BufferHelper.getBuffered(f);C.length>0&&b>C.start(0)&&(t.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),u.live&&t.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),t.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:h}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,u=this.hls,o=this.media,R=this.mediaSource,T=t.fragments[0].start+t.totalduration,S=o.duration,A=Object(J.isFiniteNumber)(R.duration)?R.duration:0;t.live&&u.config.liveDurationInfinity?(N.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(t)):(T>A&&T>S||!Object(J.isFiniteNumber)(S))&&(N.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),R.duration=T)},s.updateSeekableRange=function(t){var u=this.mediaSource,o=t.fragments,R=o.length;if(R&&t.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var T=Math.max(0,o[0].start),S=Math.max(T,T+t.totalduration);u.setLiveSeekableRange(T,S)}},s.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,u=this.operationQueue,o=this.pendingTracks,R=Object.keys(o).length;if(R&&!t||R===2){this.createSourceBuffers(o),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(S){u.executeNext(S)})}},s.createSourceBuffers=function(t){var u=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var T in t)if(!u[T]){var S=t[T];if(!S)throw Error("source buffer exists for track "+T+", however track does not");var A=S.levelCodec||S.codec,P=S.container+";codecs="+A;N.logger.log("[buffer-controller]: creating sourceBuffer("+P+")");try{var E=u[T]=o.addSourceBuffer(P),b=T;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[T]={buffer:E,codec:A,container:S.container,levelCodec:S.levelCodec,id:S.id},R++}catch(h){N.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:P})}}R&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(t){var u=this.operationQueue,o=u.current(t);o.onStart()},s._onSBUpdateEnd=function(t){var u=this.operationQueue,o=u.current(t);o.onComplete(),u.shiftAndExecuteNext(t)},s._onSBUpdateError=function(t,u){N.logger.error("[buffer-controller]: "+t+" SourceBuffer error",u),this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(t);o&&o.onError(u)},s.removeExecutor=function(t,u,o){var R=this.media,T=this.mediaSource,S=this.operationQueue,A=this.sourceBuffer,P=A[t];if(!R||!T||!P){N.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(t);return}var E=Object(J.isFiniteNumber)(R.duration)?R.duration:Infinity,b=Object(J.isFiniteNumber)(T.duration)?T.duration:Infinity,h=Math.max(0,u),f=Math.min(o,E,b);f>h?(N.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)):S.shiftAndExecuteNext(t)},s.appendExecutor=function(t,u){var o=this.operationQueue,R=this.sourceBuffer,T=R[u];if(!T){N.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(u);return}T.ended=!1,console.assert(!T.updating,u+" sourceBuffer must not be updating"),T.appendBuffer(t)},s.blockBuffers=function(t,u){var o=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){N.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var R=this.operationQueue,T=u.map(function(S){return R.appendBlocker(S)});Promise.all(T).then(function(){t(),u.forEach(function(S){var A=o.sourceBuffer[S];(!A||!A.updating)&&R.shiftAndExecuteNext(S)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(t,u,o){var R=this.sourceBuffer[t];if(!R)return;var T=o.bind(this,t);this.listeners[t].push({event:u,listener:T}),R.addEventListener(u,T)},s.removeBufferListeners=function(t){var u=this.sourceBuffer[t];if(!u)return;this.listeners[t].forEach(function(o){u.removeEventListener(o.event,o.listener)})},d}()},"./src/controller/buffer-operation-queue.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return K});var J=B("./src/utils/logger.ts"),K=function(){function N(z){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=z}var $=N.prototype;return $.append=function(r,D){var p=this.queues[D];p.push(r),p.length===1&&this.buffers[D]&&this.executeNext(D)},$.insertAbort=function(r,D){var p=this.queues[D];p.unshift(r),this.executeNext(D)},$.appendBlocker=function(r){var D,p=new Promise(function(m){D=m}),g={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,r),p},$.executeNext=function(r){var D=this.buffers,p=this.queues,g=D[r],m=p[r];if(m.length){var a=m[0];try{a.execute()}catch(d){J.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(d),(!g||!g.updating)&&(m.shift(),this.executeNext(r))}}},$.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},$.current=function(r){return this.queues[r][0]},N}()},"./src/controller/cap-level-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts");function K(z,r){for(var D=0;D<r.length;D++){var p=r[D];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(z,p.key,p)}}function N(z,r,D){return r&&K(z.prototype,r),D&&K(z,D),z}var $=function(){function z(D){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=z.prototype;return r.setStreamController=function(p){this.streamController=p},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 p=this.hls;p.on(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var p=this.hls;p.off(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(p,g){z.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},r.onMediaAttaching=function(p,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},r.onManifestParsed=function(p,g){var m=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,m.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onBufferCodecs=function(p,g){var m=this.hls;m.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(p.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},r.getMaxLevel=function(p){var g=this,m=this.hls.levels;if(!m.length)return-1;var a=m.filter(function(d,s){return z.isLevelAllowed(s,g.restrictedLevels)&&s<=p});return this.clientRect=null,z.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,g={width:0,height:0};if(p){var m=p.getBoundingClientRect();g.width=m.width,g.height=m.height,!g.width&&!g.height&&(g.width=m.right-m.left||p.width||0,g.height=m.bottom-m.top||p.height||0)}return this.clientRect=g,g},z.isLevelAllowed=function(p,g){return g===void 0&&(g=[]),g.indexOf(p)===-1},z.getMaxLevelByMediaSize=function(p,g,m){if(!p||!p.length)return-1;for(var a=function(u,o){return o?u.width!==o.width||u.height!==o.height:!0},d=p.length-1,s=0;s<p.length;s+=1){var i=p[s];if((i.width>=g||i.height>=m)&&a(i,p[s+1])){d=s;break}}return d},N(z,[{key:"mediaWidth",get:function(){return this.getDimensions().width*z.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*z.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(g){}return p}}]),z}();Q.default=$},"./src/controller/cmcd-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./src/events.ts"),K=B("./src/types/cmcd.ts"),N=B("./src/utils/buffer-helper.ts"),$=B("./src/utils/logger.ts");function z(d,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(d,t.key,t)}}function r(d,s,i){return s&&z(d.prototype,s),i&&z(d,i),d}function D(d,s){var i=typeof Symbol!="undefined"&&d[Symbol.iterator]||d["@@iterator"];if(i)return(i=i.call(d)).next.bind(i);if(Array.isArray(d)||(i=p(d))||s&&d&&typeof d.length=="number"){i&&(d=i);var t=0;return function(){return t>=d.length?{done:!0}:{done:!1,value:d[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 p(d,s){if(!d)return;if(typeof d=="string")return g(d,s);var i=Object.prototype.toString.call(d).slice(8,-1);if(i==="Object"&&d.constructor&&(i=d.constructor.name),i==="Map"||i==="Set")return Array.from(d);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(d,s)}function g(d,s){(s==null||s>d.length)&&(s=d.length);for(var i=0,t=new Array(s);i<s;i++)t[i]=d[i];return t}function m(){return m=Object.assign||function(d){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(d[t]=i[t])}return d},m.apply(this,arguments)}var a=function(){function d(i){var t=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(R){try{t.apply(R,{ot:K.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(T){$.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(R){try{var T=R.frag,S=t.hls.levels[T.level],A=t.getObjectType(T),P={d:T.duration*1e3,ot:A};(A===K.CMCDObjectType.VIDEO||A===K.CMCDObjectType.AUDIO||A==K.CMCDObjectType.MUXED)&&(P.br=S.bitrate/1e3,P.tb=t.getTopBandwidth(A),P.bl=t.getBufferLength(A)),t.apply(R,P)}catch(E){$.logger.warn("Could not generate segment CMCD data.",E)}},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||d.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var s=d.prototype;return s.registerListeners=function(){var t=this.hls;t.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(J.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var t=this.hls;t.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(J.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(t,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(t,u){var o,R;this.audioBuffer=(o=u.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(R=u.tracks.video)===null||R===void 0?void 0:R.buffer},s.createData=function(){var t;return{v:K.CMCDVersion,sf:K.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(t,u){u===void 0&&(u={}),m(u,this.createData());var o=u.ot===K.CMCDObjectType.INIT||u.ot===K.CMCDObjectType.VIDEO||u.ot===K.CMCDObjectType.MUXED;if(this.starved&&o&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var R=d.toHeaders(u);if(!Object.keys(R).length)return;t.headers||(t.headers={}),m(t.headers,R)}else{var T=d.toQuery(u);if(!T)return;t.url=d.appendQueryToUri(t.url,T)}},s.getObjectType=function(t){var u=t.type;return u==="subtitle"?K.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?K.CMCDObjectType.INIT:u==="audio"?K.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?K.CMCDObjectType.VIDEO:K.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(t){for(var u=0,o=t===K.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=D(o),T;!(T=R()).done;){var S=T.value;S.bitrate>u&&(u=S.bitrate)}return u>0?u:NaN},s.getBufferLength=function(t){var u=this.hls.media,o=t===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!u)return NaN;var R=N.BufferHelper.bufferInfo(o,u.currentTime,this.config.maxBufferHole);return R.len*1e3},s.createPlaylistLoader=function(){var t=this.config.pLoader,u=this.applyPlaylistData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(A,P,E){u(A),this.loader.load(A,P,E)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},s.createFragmentLoader=function(){var t=this.config.fLoader,u=this.applyFragmentData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(A,P,E){u(A),this.loader.load(A,P,E)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.uuid=function(){var t=URL.createObjectURL(new Blob),u=t.toString();return URL.revokeObjectURL(t),u.substr(u.lastIndexOf("/")+1)},d.serialize=function(t){for(var u=[],o=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},R=function(W){return Math.round(W)},T=function(W){return R(W/100)*100},S=function(W){return encodeURIComponent(W)},A={br:R,d:R,bl:T,dl:T,mtp:T,nor:S,rtp:T,tb:R},P=Object.keys(t||{}).sort(),E=D(P),b;!(b=E()).done;){var h=b.value,f=t[h];if(!o(f))continue;if(h==="v"&&f===1)continue;if(h=="pr"&&f===1)continue;var C=A[h];C&&(f=C(f));var 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(",")},d.toHeaders=function(t){for(var u=Object.keys(t),o={},R=["Object","Request","Session","Status"],T=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,P=u;A<P.length;A++){var E=P[A],b=S[E]!=null?S[E]:1;T[b][E]=t[E]}for(var h=0;h<T.length;h++){var f=d.serialize(T[h]);f&&(o["CMCD-"+R[h]]=f)}return o},d.toQuery=function(t){return"CMCD="+encodeURIComponent(d.serialize(t))},d.appendQueryToUri=function(t,u){if(!u)return t;var o=t.includes("?")?"&":"?";return""+t+o+u},d}()},"./src/controller/eme-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/utils/logger.ts"),$=B("./src/utils/mediakeys-helper.ts");function z(a,d){for(var s=0;s<d.length;s++){var i=d[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,d,s){return d&&z(a.prototype,d),s&&z(a,s),a}var D=3,p=function(d,s,i){var t={audioCapabilities:[],videoCapabilities:[]};return d.forEach(function(u){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:i.audioRobustness||""})}),s.forEach(function(u){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:i.videoRobustness||""})}),[t]},g=function(d,s,i,t){switch(d){case $.KeySystems.WIDEVINE:return p(s,i,t);default:throw new Error("Unknown key-system: "+d)}},m=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 d=a.prototype;return d.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},d._registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},d._unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},d.getLicenseServerUrl=function(i){switch(i){case $.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},d._attemptKeySystemAccess=function(i,t,u){var o=this,R=g(i,t,u,this._drmSystemOptions);N.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(i,R);this.mediaKeysPromise=T.then(function(S){return o._onMediaKeySystemAccessObtained(i,S)}),T.catch(function(S){N.logger.error('Failed to obtain key-system "'+i+'" access:',S)})},d._onMediaKeySystemAccessObtained=function(i,t){var u=this;N.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var R=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(T){return o.mediaKeys=T,N.logger.log('Media-keys created for key-system "'+i+'"'),u._onMediaKeysCreated(),T});return R.catch(function(T){N.logger.error("Failed to create media-keys:",T)}),R},d._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),i._onNewMediaKeySession(t.mediaKeysSession))})},d._onNewMediaKeySession=function(i){var t=this;N.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(u){t._onKeySessionMessage(i,u.message)},!1)},d._onKeySessionMessage=function(i,t){N.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(u){N.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),i.update(u)})},d.onMediaEncrypted=function(i){var t=this;if(N.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(R){if(!t._media)return;t._attemptSetMediaKeys(R),t._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(u).catch(u)},d._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}N.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},d._generateRequestWithPreferredKeySession=function(i,t){var u=this,o=this._mediaKeysList[0];if(!o){N.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){N.logger.warn("Key-Session already initialized but requested again");return}var R=o.mediaKeysSession;if(!R){N.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){N.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}N.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,R.generateRequest(i,t).then(function(){N.logger.debug("Key-session generation succeeded")}).catch(function(T){N.logger.error("Error generating key-session request:",T),u.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},d._createLicenseXhr=function(i,t,u){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,i,t,u);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,o,i),R=void 0}catch(T){N.logger.error(T)}try{o.readyState||o.open("POST",i,!0),R&&R.call(this.hls,o,i)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return o},d._onLicenseRequestReadyStageChange=function(i,t,u,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,N.logger.log("License request succeeded");var R=i.response,T=this._licenseResponseCallback;if(T)try{R=T.call(this.hls,i,t)}catch(A){N.logger.error(A)}o(R)}else{if(N.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;N.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(u,o)}break}},d._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case $.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},d._requestLicense=function(i,t){N.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){N.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(o,i,t);N.logger.log("Sending license request to URL: "+o);var T=this._generateLicenseRequestChallenge(u,i);R.send(T)}catch(S){N.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},d.onMediaAttached=function(i,t){if(!this._emeEnabled)return;var u=t.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},d.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(){})},d.onManifestParsed=function(i,t){if(!this._emeEnabled)return;var u=t.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),o=t.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess($.KeySystems.WIDEVINE,u,o)},r(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();Q.default=m},"./src/controller/fps-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/logger.ts"),N=function(){function $(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var z=$.prototype;return z.setStreamController=function(D){this.streamController=D},z.registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},z.unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching)},z.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},z.onMediaAttaching=function(D,p){var g=this.hls.config;if(g.capLevelOnFPSDrop){var m=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},z.checkFPS=function(D,p,g){var m=performance.now();if(p){if(this.lastTime){var a=m-this.lastTime,d=g-this.lastDroppedFrames,s=p-this.lastDecodedFrames,i=1e3*d/a,t=this.hls;if(t.trigger(J.Events.FPS_DROP,{currentDropped:d,currentDecoded:s,totalDroppedFrames:g}),i>0&&d>t.config.fpsDroppedMonitoringThreshold*s){var u=t.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=u)&&(u=u-1,t.trigger(J.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:t.currentLevel}),t.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=g,this.lastDecodedFrames=p}},z.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var p=D.getVideoPlaybackQuality();this.checkFPS(D,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},$}();Q.default=N},"./src/controller/fragment-finders.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"findFragmentByPDT",function(){return N}),B.d(Q,"findFragmentByPTS",function(){return $}),B.d(Q,"fragmentWithinToleranceTest",function(){return z}),B.d(Q,"pdtWithinToleranceTest",function(){return r}),B.d(Q,"findFragWithCC",function(){return D});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/binary-search.ts");function N(p,g,m){if(g===null||!Array.isArray(p)||!p.length||!Object(J.isFiniteNumber)(g))return null;var a=p[0].programDateTime;if(g<(a||0))return null;var d=p[p.length-1].endProgramDateTime;if(g>=(d||0))return null;m=m||0;for(var s=0;s<p.length;++s){var i=p[s];if(r(g,m,i))return i}return null}function $(p,g,m,a){m===void 0&&(m=0),a===void 0&&(a=0);var d=null;if(p?d=g[p.sn-g[0].sn+1]||null:m===0&&g[0].start===0&&(d=g[0]),d&&z(m,a,d)===0)return d;var s=K.default.search(g,z.bind(null,m,a));return s||d}function z(p,g,m){p===void 0&&(p=0),g===void 0&&(g=0);var a=Math.min(g,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-a<=p?1:m.start-a>p&&m.start?-1:0}function r(p,g,m){var a=Math.min(g,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,d=m.endProgramDateTime||0;return d-a>p}function D(p,g){return K.default.search(p,function(m){return m.cc<g?1:m.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"FragmentState",function(){return N}),B.d(Q,"FragmentTracker",function(){return $});var J=B("./src/events.ts"),K=B("./src/types/loader.ts"),N;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(N||(N={}));var $=function(){function D(g){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=g,this._registerListeners()}var p=D.prototype;return p._registerListeners=function(){var m=this.hls;m.on(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(J.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var m=this.hls;m.off(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(J.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(m,a){if(a===K.PlaylistLevelType.MAIN){var d=this.activeFragment,s=this.activeParts;if(!d)return null;if(s)for(var i=s.length;i--;){var t=s[i],u=t?t.end:d.appendedPTS;if(t.start<=m&&u!==void 0&&m<=u)return i>9&&(this.activeParts=s.slice(i-9)),t}else if(d.start<=m&&d.appendedPTS!==void 0&&m<=d.appendedPTS)return d}return this.getBufferedFrag(m,a)},p.getBufferedFrag=function(m,a){for(var d=this.fragments,s=Object.keys(d),i=s.length;i--;){var t=d[s[i]];if((t==null?void 0:t.body.type)===a&&t.buffered){var u=t.body;if(u.start<=m&&m<=u.end)return u}}return null},p.detectEvictedFragments=function(m,a,d){var s=this;Object.keys(this.fragments).forEach(function(i){var t=s.fragments[i];if(!t)return;if(!t.buffered){t.body.type===d&&s.removeFragment(t.body);return}var u=t.range[m];if(!u)return;u.time.some(function(o){var R=!s.isTimeBuffered(o.startPTS,o.endPTS,a);return R&&s.removeFragment(t.body),R})})},p.detectPartialFragments=function(m){var a=this,d=this.timeRanges,s=m.frag,i=m.part;if(!d||s.sn==="initSegment")return;var t=r(s),u=this.fragments[t];if(!u)return;Object.keys(d).forEach(function(o){var R=s.elementaryStreams[o];if(!R)return;var T=d[o],S=i!==null||R.partial===!0;u.range[o]=a.getBufferedTimes(s,i,S,T)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},p.fragBuffered=function(m){var a=r(m),d=this.fragments[a];d&&(d.backtrack=d.loaded=null,d.buffered=!0)},p.getBufferedTimes=function(m,a,d,s){for(var i={time:[],partial:d},t=a?a.start:m.start,u=a?a.end:m.end,o=m.minEndPTS||u,R=m.maxStartPTS||t,T=0;T<s.length;T++){var S=s.start(T)-this.bufferPadding,A=s.end(T)+this.bufferPadding;if(R>=S&&o<=A){i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});break}else if(t<A&&u>S)i.partial=!0,i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});else if(u<=S)break}return i},p.getPartialFragment=function(m){var a=null,d,s,i,t=0,u=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(R){var T=o[R];if(!T)return;z(T)&&(s=T.body.start-u,i=T.body.end+u,m>=s&&m<=i&&(d=Math.min(m-s,i-m),t<=d&&(a=T.body,t=d)))}),a},p.getState=function(m){var a=r(m),d=this.fragments[a];return d?d.buffered?z(d)?N.PARTIAL:N.OK:d.backtrack?N.BACKTRACKED:N.APPENDING:N.NOT_LOADED},p.backtrack=function(m,a){var d=r(m),s=this.fragments[d];if(!s||s.backtrack)return null;var i=s.backtrack=a||s.loaded;return s.loaded=null,i},p.getBacktrackData=function(m){var a=r(m),d=this.fragments[a];if(d){var s,i=d.backtrack;if(i!=null&&(s=i.payload)!==null&&s!==void 0&&s.byteLength)return i;this.removeFragment(m)}return null},p.isTimeBuffered=function(m,a,d){for(var s,i,t=0;t<d.length;t++){if(s=d.start(t)-this.bufferPadding,i=d.end(t)+this.bufferPadding,m>=s&&a<=i)return!0;if(a<=s)return!1}return!1},p.onFragLoaded=function(m,a){var d=a.frag,s=a.part;if(d.sn==="initSegment"||d.bitrateTest||s)return;var i=r(d);this.fragments[i]={body:d,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(m,a){var d=this,s=a.frag,i=a.part,t=a.timeRanges;if(s.type===K.PlaylistLevelType.MAIN)if(this.activeFragment=s,i){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(i)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(o){var R=t[o];if(d.detectEvictedFragments(o,R),!i)for(var T=0;T<R.length;T++)s.appendedPTS=Math.max(R.end(T),s.appendedPTS||0)})},p.onFragBuffered=function(m,a){this.detectPartialFragments(a)},p.hasFragment=function(m){var a=r(m);return!!this.fragments[a]},p.removeFragmentsInRange=function(m,a,d){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===d&&u.start<a&&u.end>m&&s.removeFragment(u)}})},p.removeFragment=function(m){var a=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[a]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function z(D){var p,g;return D.buffered&&(((p=D.range.video)===null||p===void 0?void 0:p.partial)||((g=D.range.audio)===null||g===void 0?void 0:g.partial))}function r(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return z}),B.d(Q,"MAX_START_GAP_JUMP",function(){return r}),B.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),B.d(Q,"SKIP_BUFFER_RANGE_START",function(){return p}),B.d(Q,"default",function(){return g});var J=B("./src/utils/buffer-helper.ts"),K=B("./src/errors.ts"),N=B("./src/events.ts"),$=B("./src/utils/logger.ts"),z=250,r=2,D=.1,p=.05,g=function(){function m(d,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=d,this.media=s,this.fragmentTracker=i,this.hls=t}var a=m.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(s){var i=this.config,t=this.media,u=this.stalled,o=t.currentTime,R=t.seeking,T=this.seeking&&!R,S=!this.seeking&&R;if(this.seeking=R,o!==s){if(this.moved=!0,u!==null){if(this.stallReported){var A=self.performance.now()-u;$.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||T)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!J.BufferHelper.getBuffered(t).length)return;var P=J.BufferHelper.bufferInfo(t,o,0),E=P.len>0,b=P.nextStart||0;if(!E&&!b)return;if(R){var h=P.len>r,f=!b||b-o>r&&!this.fragmentTracker.getPartialFragment(o);if(h||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,x=Math.max(b,P.start||0)-o,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=_==null||((C=_.details)===null||C===void 0)?void 0:C.live,W=j?_.details.targetduration*2:r;if(x>0&&x<=W){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(u===null){this.stalled=w;return}var F=w-u;!R&&F>=z&&this._reportStall(P.len);var I=J.BufferHelper.bufferInfo(t,o,i.maxBufferHole);this._tryFixBufferStall(I,F)},a._tryFixBufferStall=function(s,i){var t=this.config,u=this.fragmentTracker,o=this.media,R=o.currentTime,T=u.getPartialFragment(R);if(T){var S=this._trySkipBufferHole(T);if(S)return}s.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&($.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(s){var i=this.hls,t=this.media,u=this.stallReported;u||(this.stallReported=!0,$.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+s+")"),i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},a._trySkipBufferHole=function(s){for(var i=this.config,t=this.hls,u=this.media,o=u.currentTime,R=0,T=J.BufferHelper.getBuffered(u),S=0;S<T.length;S++){var A=T.start(S);if(o+i.maxBufferHole>=R&&o<A){var P=Math.max(A+p,u.currentTime+D);return $.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+P),this.moved=!0,this.stalled=null,u.currentTime=P,s&&t.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+P,frag:s}),P}R=T.end(S)}return 0},a._tryNudgeBuffer=function(){var s=this.config,i=this.hls,t=this.media,u=t.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<s.nudgeMaxRetry){var R=u+o*s.nudgeOffset;$.logger.warn("Nudging 'currentTime' from "+u+" to "+R),t.currentTime=R,i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else $.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+s.nudgeMaxRetry+" nudges"),i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),N=B("./src/demux/id3.ts"),$=.25,z=function(){function r(p){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=p,this._registerListeners()}var D=r.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var g=this.hls;g.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(K.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(g){if(!this.media)return;for(var m=0;m<g.length;m++){var a=g[m];if(a.kind==="metadata"&&a.label==="id3")return Object(K.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,m){if(!this.media)return;var a=m.frag,d=m.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<d.length;i++){var t=N.getID3Frames(d[i].data);if(t){var u=d[i].pts,o=i<d.length-1?d[i+1].pts:a.end,R=o-u;R<=0&&(o=u+$);for(var T=0;T<t.length;T++){var S=t[T];if(!N.isTimeStampFrame(S)){var A=new s(u,o,"");A.value=S,this.id3Track.addCue(A)}}}}},D.onBufferFlushing=function(g,m){var a=m.startOffset,d=m.endOffset,s=m.type;if(!s||s==="audio"){var i=this.id3Track;i&&Object(K.removeCuesInRange)(i,a,d)}},r}();Q.default=z},"./src/controller/latency-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/errors.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts");function $(D,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function z(D,p,g){return p&&$(D.prototype,p),g&&$(D,g),D}var r=function(){function D(g){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=g,this.config=g.config,this.registerListeners()}var p=D.prototype;return p.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},p.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)},p.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)},p.onMediaAttached=function(m,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},p.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},p.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},p.onLevelUpdated=function(m,a){var d=a.details;this.levelDetails=d,d.advanced&&this.timeupdate(),!d.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},p.onError=function(m,a){if(a.details!==J.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,N.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},p.timeupdate=function(){var m=this.media,a=this.levelDetails;if(!m||!a)return;this.currentTime=m.currentTime;var d=this.computeLatency();if(d===null)return;this._latency=d;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=d-u,R=Math.min(this.maxLatency,u+a.targetduration),T=o<R;if(a.live&&T&&o>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,t)),A=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;m.playbackRate=Math.min(S,Math.max(1,A))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},p.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},p.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},z(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,a=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:a?m.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var a=m.holdBack,d=m.partHoldBack,s=m.targetduration,i=this.config,t=i.liveSyncDuration,u=i.liveSyncDurationCount,o=i.lowLatencyMode,R=this.hls.userConfig,T=o&&d||a;(R.liveSyncDuration||R.liveSyncDurationCount||T===0)&&(T=t!==void 0?t:u*s);var S=s,A=1;return T+Math.min(this.stallCount*A,S)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),a=this.targetLatency,d=this.levelDetails;if(m===null||a===null||d===null)return null;var s=d.edge,i=m-a-this.edgeStalled,t=s-d.totalduration,u=s-(this.config.lowLatencyMode&&d.partTarget||d.targetduration);return Math.min(Math.max(t,i),u)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var a=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-a,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,a=this.levelDetails;if(!m||!a)return 0;var d=m.buffered.length;return d?m.buffered.end(d-1):a.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return i});var J=B("./src/types/level.ts"),K=B("./src/events.ts"),N=B("./src/errors.ts"),$=B("./src/utils/codecs.ts"),z=B("./src/controller/level-helper.ts"),r=B("./src/controller/base-playlist-controller.ts"),D=B("./src/types/loader.ts");function p(){return p=Object.assign||function(t){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var R in o)Object.prototype.hasOwnProperty.call(o,R)&&(t[R]=o[R])}return t},p.apply(this,arguments)}function g(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function m(t,u,o){return u&&g(t.prototype,u),o&&g(t,o),t}function a(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,d(t,u)}function d(t,u){return d=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},d(t,u)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){a(u,t);function u(R){var T;return T=t.call(this,R,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var o=u.prototype;return o._registerListeners=function(){var T=this.hls;T.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(K.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var T=this.hls;T.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(K.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},o.startLoad=function(){var T=this._levels;T.forEach(function(S){S.loadError=0}),t.prototype.startLoad.call(this)},o.onManifestLoaded=function(T,S){var A=[],P=[],E=[],b,h={},f,C=!1,x=!1,_=!1;if(S.levels.forEach(function(F){var I=F.attrs;C=C||!!(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 v=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;f=h[v],f?f.url.push(F.url):(f=new J.Level(F),h[v]=f,A.push(f)),I&&(I.AUDIO&&Object(z.addGroupId)(f,"audio",I.AUDIO),I.SUBTITLES&&Object(z.addGroupId)(f,"text",I.SUBTITLES))}),(C||x)&&_&&(A=A.filter(function(F){var I=F.videoCodec,v=F.width,H=F.height;return!!I||!!(v&&H)})),A=A.filter(function(F){var I=F.audioCodec,v=F.videoCodec;return(!I||Object($.isCodecSupportedInMp4)(I,"audio"))&&(!v||Object($.isCodecSupportedInMp4)(v,"video"))}),S.audioTracks&&(P=S.audioTracks.filter(function(F){return!F.audioCodec||Object($.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(z.assignTrackIdsByGroup)(P)),S.subtitles&&(E=S.subtitles,Object(z.assignTrackIdsByGroup)(E)),A.length>0){b=A[0].bitrate,A.sort(function(F,I){return F.bitrate-I.bitrate}),this._levels=A;for(var j=0;j<A.length;j++)if(A[j].bitrate===b){this._firstLevel=j,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+b);break}var W=_&&!x,w={levels:A,audioTracks:P,subtitleTracks:E,firstLevel:this._firstLevel,stats:S.stats,audio:_,video:x,altAudio:!W&&P.some(function(F){return!!F.url})};this.hls.trigger(K.Events.MANIFEST_PARSED,w),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(T,S){if(t.prototype.onError.call(this,T,S),S.fatal)return;var A=S.context,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 E=!1,b=!0,h;switch(S.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:case N.ErrorDetails.KEY_LOAD_ERROR:case N.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var f=this._levels[S.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=S.frag.level)):h=S.frag.level}break;case N.ErrorDetails.LEVEL_LOAD_ERROR:case N.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(b=!1),h=A.level),E=!0;break;case N.ErrorDetails.REMUX_ALLOC_ERROR:h=S.level,E=!0;break}h!==void 0&&this.recoverLevel(S,h,E,b)},o.recoverLevel=function(T,S,A,P){var E=T.details,b=this._levels[S];if(b.loadError++,A){var h=this.retryLoadingOrFail(T);if(h)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(P){var f=b.url.length;if(f>1&&b.loadError<f)T.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var C=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(E+": switch to "+C),T.levelRetry=!0,this.hls.nextAutoLevel=C)}}},o.redundantFailover=function(T){var S=this._levels[T],A=S.url.length;if(A>1){var P=(S.urlId+1)%A;this.warn("Switching to redundant URL-id "+P),this._levels.forEach(function(E){E.urlId=P}),this.level=T}},o.onFragLoaded=function(T,S){var A=S.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(T,S){var A,P=S.level,E=S.details,b=this._levels[P];if(!b){var h;this.warn("Invalid level index "+P),(h=S.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(E.deltaUpdateFailed=!0);return}P===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(P,S,b.details)):(A=S.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(E.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(T,S){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var P=-1,E=this.hls.audioTracks[S.id].groupId,b=0;b<A.audioGroupIds.length;b++)if(A.audioGroupIds[b]===E){P=b;break}P!==A.urlId&&(A.urlId=P,this.startLoad())}},o.loadPlaylist=function(T){var S=this.currentLevelIndex,A=this._levels[S];if(this.canLoad&&A&&A.url.length>0){var P=A.urlId,E=A.url[P];if(T)try{E=T.addDirectives(E)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+S+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+P+" "+E),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:E,level:S,id:P,deliveryDirectives:T||null})}},o.removeLevel=function(T,S){var A=function(b,h){return h!==S},P=this._levels.filter(function(E,b){return b!==T?!0:E.url.length>1&&S!==void 0?(E.url=E.url.filter(A),E.audioGroupIds&&(E.audioGroupIds=E.audioGroupIds.filter(A)),E.textGroupIds&&(E.textGroupIds=E.textGroupIds.filter(A)),E.urlId=0,!0):!1}).map(function(E,b){var h=E.details;return h!=null&&h.fragments&&h.fragments.forEach(function(f){f.level=b}),E});this._levels=P,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:P})},m(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var S,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===T&&(S=A[T])!==null&&S!==void 0&&S.details)return;if(T<0||T>=A.length){var P=T<0;if(this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.OTHER_ERROR,details:N.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:P,reason:"invalid level idx"}),P)return;T=Math.min(T,A.length-1)}this.clearTimer();var E=this.currentLevelIndex,b=A[E],h=A[T];this.log("switching to level "+T+" from "+E),this.currentLevelIndex=T;var f=p({},h,{level:T,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete f._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,f);var C=h.details;if(!C||C.live){var x=this.switchParams(h.uri,b==null?void 0:b.details);this.loadPlaylist(x)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),u}(r.default)},"./src/controller/level-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"addGroupId",function(){return N}),B.d(Q,"assignTrackIdsByGroup",function(){return $}),B.d(Q,"updatePTS",function(){return z}),B.d(Q,"updateFragPTSDTS",function(){return D}),B.d(Q,"mergeDetails",function(){return p}),B.d(Q,"mapPartIntersection",function(){return g}),B.d(Q,"mapFragmentIntersection",function(){return m}),B.d(Q,"adjustSliding",function(){return a}),B.d(Q,"addSliding",function(){return d}),B.d(Q,"computeReloadInterval",function(){return s}),B.d(Q,"getFragmentWithSN",function(){return i}),B.d(Q,"getPartWith",function(){return t});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts");function N(u,o,R){switch(o){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function $(u){var o={};u.forEach(function(R){var T=R.groupId||"";R.id=o[T]=o[T]||0,o[T]++})}function z(u,o,R){var T=u[o],S=u[R];r(T,S)}function r(u,o){var R=o.startPTS;if(Object(J.isFiniteNumber)(R)){var T=0,S;o.sn>u.sn?(T=R-u.start,S=u):(T=u.start-R,S=o),S.duration!==T&&(S.duration=T)}else if(o.sn>u.sn){var A=u.cc===o.cc;A&&u.minEndPTS?o.start=u.start+(u.minEndPTS-u.start):o.start=u.start+u.duration}else o.start=Math.max(u.start-o.duration,0)}function D(u,o,R,T,S,A){var P=T-R;P<=0&&(K.logger.warn("Fragment should have a positive duration",o),T=R+o.duration,A=S+o.duration);var E=R,b=T,h=o.startPTS,f=o.endPTS;if(Object(J.isFiniteNumber)(h)){var C=Math.abs(h-R);Object(J.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(C,o.deltaPTS):o.deltaPTS=C,E=Math.max(R,h),R=Math.min(R,h),S=Math.min(S,o.startDTS),b=Math.min(T,f),T=Math.max(T,f),A=Math.max(A,o.endDTS)}o.duration=T-R;var x=R-o.start;o.appendedPTS=T,o.start=o.startPTS=R,o.maxStartPTS=E,o.startDTS=S,o.endPTS=T,o.minEndPTS=b,o.endDTS=A;var _=o.sn;if(!u||_<u.startSN||_>u.endSN)return 0;var j,W=_-u.startSN,w=u.fragments;for(w[W]=o,j=W;j>0;j--)r(w[j],w[j-1]);for(j=W;j<w.length-1;j++)r(w[j],w[j+1]);return u.fragmentHint&&r(w[w.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,x}function p(u,o){for(var R=null,T=u.fragments,S=T.length-1;S>=0;S--){var A=T[S].initSegment;if(A){R=A;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var P=0,E;if(m(u,o,function(j,W){j.relurl&&(P=j.cc-W.cc),Object(J.isFiniteNumber)(j.startPTS)&&Object(J.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&&(E=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,R=j.initSegment)}),R){var b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;b.forEach(function(j){var W;(!j.initSegment||j.initSegment.relurl===((W=R)===null||W===void 0?void 0:W.relurl))&&(j.initSegment=R)})}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 C=0;C<f.length;C++)f[C].cc+=P}o.skippedSegments&&(o.startCC=o.fragments[0].cc),g(u.partList,o.partList,function(j,W){W.elementaryStreams=j.elementaryStreams,W.stats=j.stats}),E?D(o,E,E.startPTS,E.endPTS,E.startDTS,E.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 g(u,o,R){if(u&&o)for(var T=0,S=0,A=u.length;S<=A;S++){var P=u[S],E=o[S+T];P&&E&&P.index===E.index&&P.fragment.sn===E.fragment.sn?R(P,E):T--}}function m(u,o,R){for(var T=o.skippedSegments,S=Math.max(u.startSN,o.startSN)-o.startSN,A=(u.fragmentHint?1:0)+(T?o.endSN:Math.min(u.endSN,o.endSN))-o.startSN,P=o.startSN-u.startSN,E=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,b=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,h=S;h<=A;h++){var f=b[P+h],C=E[h];T&&!C&&h<T&&(C=o.fragments[h]=f),f&&C&&R(f,C)}}function a(u,o){var R=o.startSN+o.skippedSegments-u.startSN,T=u.fragments;if(R<0||R>=T.length)return;d(o,T[R].start)}function d(u,o){if(o){for(var R=u.fragments,T=u.skippedSegments;T<R.length;T++)R[T].start+=o;u.fragmentHint&&(u.fragmentHint.start+=o)}}function s(u,o){var R=1e3*u.levelTargetDuration,T=R/2,S=u.age,A=S>0&&S<R*3,P=o.loading.end-o.loading.start,E,b=u.availabilityDelay;if(u.updated===!1)if(A){var h=333*u.misses;E=Math.max(Math.min(T,P*2),h),u.availabilityDelay=(u.availabilityDelay||0)+E}else E=T;else A?(b=Math.min(b||R/2,S),u.availabilityDelay=b,E=b+R-S):E=R-P;return Math.round(E)}function i(u,o,R){if(!u||!u.details)return null;var T=u.details,S=T.fragments[o-T.startSN];return S||(S=T.fragmentHint,S&&S.sn===o?S:o<T.startSN&&R&&R.sn===o?R:null)}function t(u,o,R){if(!u||!u.details)return null;var T=u.details.partList;if(T)for(var S=T.length;S--;){var A=T[S];if(A.index===R&&A.fragment.sn===o)return A}return null}},"./src/controller/stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return T});var J=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),N=B("./src/is-supported.ts"),$=B("./src/events.ts"),z=B("./src/utils/buffer-helper.ts"),r=B("./src/controller/fragment-tracker.ts"),D=B("./src/types/loader.ts"),p=B("./src/loader/fragment.ts"),g=B("./src/demux/transmuxer-interface.ts"),m=B("./src/types/transmuxer.ts"),a=B("./src/controller/gap-controller.ts"),d=B("./src/errors.ts"),s=B("./src/utils/logger.ts");function i(S,A){for(var P=0;P<A.length;P++){var E=A[P];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function t(S,A,P){return A&&i(S.prototype,A),P&&i(S,P),S}function u(S,A){S.prototype=Object.create(A.prototype),S.prototype.constructor=S,o(S,A)}function o(S,A){return o=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},o(S,A)}var R=100,T=function(S){u(A,S);function A(E,b){var h;return h=S.call(this,E,b,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var P=A.prototype;return P._registerListeners=function(){var b=this.hls;b.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on($.Events.ERROR,this.onError,this),b.on($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on($.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P._unregisterListeners=function(){var b=this.hls;b.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off($.Events.ERROR,this.onError,this),b.off($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},P.startLoad=function(b){if(this.levels){var h=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}h>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),b=h),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},P.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},P.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var b,h=this.levels,f=this.level,C=h==null||((b=h[f])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var 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(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},P.doTickIdle=function(){var b,h,f=this.hls,C=this.levelLastLoaded,x=this.levels,_=this.media,j=f.config,W=f.nextLoadLevel;if(C===null||!_&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!x||!x[W])return;var w=x[W];this.level=f.nextLoadLevel=W;var F=w.details;if(!F||this.state===K.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==W){this.state=K.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,D.PlaylistLevelType.MAIN);if(I===null)return;var v=I.len,H=this.getMaxBufferLength(w.maxBitrate);if(v>=H)return;if(this._streamEnded(I,F)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger($.Events.BUFFER_EOS,Y),this.state=K.State.ENDED;return}var ie=I.end,le=this.getNextFragment(ie,F);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var he=le.sn-F.startSN;he>1&&(le=F.fragments[he-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===r.FragmentState.OK&&this.nextLoadPosition>ie){var we=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,we,D.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,F)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((b=le.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((h=le.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(le,F):this.loadFragment(le,F,ie)},P.loadFragment=function(b,h,f){var C,x=this.fragmentTracker.getState(b);if(this.fragCurrent=b,x===r.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(b);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else x=r.FragmentState.NOT_LOADED}x===r.FragmentState.NOT_LOADED||x===r.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,b,h,f)):x===r.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},P.getAppendedFrag=function(b){var h=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},P.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},P.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},P.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},P.nextLevelSwitch=function(){var b=this.levels,h=this.media;if(h!=null&&h.readyState){var f,C=this.getAppendedFrag(h.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!h.paused&&b){var x=this.hls.nextLoadLevel,_=b[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 w=this.followingBufferedFrag(W);if(w){this.abortCurrentFrag();var F=w.maxStartPTS?w.maxStartPTS:w.start,I=w.duration,v=Math.max(W.end,F+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(v,Number.POSITIVE_INFINITY)}}}},P.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},P.flushMainBuffer=function(b,h){S.prototype.flushMainBuffer.call(this,b,h,this.altAudio?"video":null)},P.onMediaAttached=function(b,h){S.prototype.onMediaAttached.call(this,b,h);var f=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,f,this.fragmentTracker,this.hls)},P.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},P.onMediaPlaying=function(){this.tick()},P.onMediaSeeked=function(){var b=this.media,h=b?b.currentTime:null;Object(J.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},P.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger($.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},P.onManifestParsed=function(b,h){var f=!1,C=!1,x;h.levels.forEach(function(_){x=_.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(f=!0),x.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(N.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},P.onLevelLoading=function(b,h){var f=this.levels;if(!f||this.state!==K.State.IDLE)return;var C=f[h.level];(!C.details||C.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(C.details))&&(this.state=K.State.WAITING_LEVEL)},P.onLevelLoaded=function(b,h){var f,C=this.levels,x=h.level,_=h.details,j=_.totalduration;if(!C){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 w=C[x],F=0;if(_.live||(f=w.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;F=this.alignPlaylists(_,w.details)}if(w.details=_,this.levelLastLoaded=x,this.hls.trigger($.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(b){var h,f=b.frag,C=b.part,x=b.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var 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 w=j.videoCodec,F=W.PTSKnown||!W.live,I=(h=f.initSegment)===null||h===void 0?void 0:h.data,v=this._getAudioCodec(j),H=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=C?C.index:-1,ie=Y!==-1,le=new m.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,x.byteLength,Y,ie),he=this.initPTS[f.cc];H.push(x,I,v,w,f,C,W.totalduration,F,le,he)},P.onAudioTrackSwitching=function(b,h){var f=this.altAudio,C=!!h.url,x=h.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;f&&j.trigger($.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger($.Events.AUDIO_TRACK_SWITCHED,{id:x})}},P.onAudioTrackSwitched=function(b,h){var f=h.id,C=!!this.hls.audioTracks[f].url;if(C){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=C,this.tick()},P.onBufferCreated=function(b,h){var f=h.tracks,C,x,_=!1;for(var j in f){var W=f[j];if(W.id==="main"){if(x=j,C=W,j==="video"){var w=f[j];w&&(this.videoBuffer=w.buffer)}}else _=!0}_&&C?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},P.onFragBuffered=function(b,h){var f=h.frag,C=h.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var x=C?C.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,C)},P.onError=function(b,h){switch(h.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,h);break;case d.ErrorDetails.LEVEL_LOAD_ERROR:case d.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 d.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},P.checkBuffer=function(){var b=this.media,h=this.gapController;if(!b||!h||!b.readyState)return;var f=z.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},P.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},P.onBufferFlushed=function(b,h){var f=h.type;if(f!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,D.PlaylistLevelType.MAIN)}},P.onLevelsUpdated=function(b,h){this.levels=h.levels},P.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},P.seekToStartPos=function(){var b=this.media,h=b.currentTime,f=this.startPosition;if(f>=0&&h<f){if(b.seeking){s.logger.log("could not seek to "+f+", already seeking at "+h);return}var C=z.BufferHelper.getBuffered(b),x=C.length?C.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),b.currentTime=f}},P._getAudioCodec=function(b){var h=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},P._loadBitrateTestFrag=function(b){var h=this;this._doFragLoad(b).then(function(f){var C=h.hls;if(!f||C.nextLoadLevel||h.fragContextChanged(b))return;h.fragLoadError=0,h.state=K.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var x=b.stats;x.parsing.start=x.parsing.end=x.buffering.start=x.buffering.end=self.performance.now(),C.trigger($.Events.FRAG_LOADED,f)})},P._handleTransmuxComplete=function(b){var h,f="main",C=this.hls,x=b.remuxResult,_=b.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,w=j.part,F=j.level,I=x.video,v=x.text,H=x.id3,Y=x.initSegment,ie=this.altAudio?void 0:x.audio;if(this.fragContextChanged(W))return;if(this.state=K.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(F,Y.tracks,W,_),C.trigger($.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:f,tracks:Y.tracks}));var le=Y.initPTS,he=Y.timescale;Object(J.isFiniteNumber)(le)&&(this.initPTS[W.cc]=le,C.trigger($.Events.INIT_PTS_FOUND,{frag:W,id:f,initPTS:le,timescale:he}))}if(I&&x.independent!==!1){if(F.details){var we=I.startPTS,Pe=I.endPTS,xe=I.startDTS,Oe=I.endDTS;if(w)w.elementaryStreams[I.type]={startPTS:we,endPTS:Pe,startDTS:xe,endDTS:Oe};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<we){this.backtrack(W);return}W.setElementaryStreamInfo(I.type,W.start,Pe,W.start,Oe,!0)}W.setElementaryStreamInfo(I.type,we,Pe,xe,Oe),this.bufferFragmentData(I,W,w,_)}}else if(x.independent===!1){this.backtrack(W);return}if(ie){var be=ie.startPTS,ne=ie.endPTS,fe=ie.startDTS,_e=ie.endDTS;w&&(w.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:be,endPTS:ne,startDTS:fe,endDTS:_e}),W.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,be,ne,fe,_e),this.bufferFragmentData(ie,W,w,_)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var ke={frag:W,id:f,samples:H.samples};C.trigger($.Events.FRAG_PARSING_METADATA,ke)}if(v){var qe={frag:W,id:f,samples:v.samples};C.trigger($.Events.FRAG_PARSING_USERDATA,qe)}},P._bufferInitSegment=function(b,h,f,C){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 w=b.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(w&&(w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),_.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(w="mp4a.40.5")),F.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(w="mp4a.40.2",this.log("Android: force audio codec to "+w)),b.audioCodec&&b.audioCodec!==w&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+w+'"'),_.levelCodec=w,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(w||"")+"/"+(b.audioCodec||"")+"/"+_.codec+"]")}j&&(j.levelCodec=b.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+j.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger($.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(I){var v=h[I],H=v.initSegment;H!=null&&H.byteLength&&x.hls.trigger($.Events.BUFFER_APPENDING,{type:I,data:H,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},P.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var h=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,h?this.resetFragmentLoading(b):this.state=K.State.BACKTRACKING},P.checkFragmentChanged=function(){var b=this.media,h=null;if(b&&b.readyState>1&&b.seeking===!1){var f=b.currentTime;if(z.BufferHelper.isBuffered(b,f)?h=this.getAppendedFrag(f):z.BufferHelper.isBuffered(b,f+.1)&&(h=this.getAppendedFrag(f+.1)),h){var C=this.fragPlaying,x=h.level;(!C||h.sn!==C.sn||C.level!==x||h.urlId!==C.urlId)&&(this.hls.trigger($.Events.FRAG_CHANGED,{frag:h}),(!C||C.level!==x)&&this.hls.trigger($.Events.LEVEL_SWITCHED,{level:x}),this.fragPlaying=h)}}},t(A,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(K.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"SubtitleStreamController",function(){return u});var J=B("./src/events.ts"),K=B("./src/utils/logger.ts"),N=B("./src/utils/buffer-helper.ts"),$=B("./src/controller/fragment-finders.ts"),z=B("./src/utils/discontinuities.ts"),r=B("./src/controller/level-helper.ts"),D=B("./src/controller/fragment-tracker.ts"),p=B("./src/controller/base-stream-controller.ts"),g=B("./src/types/loader.ts"),m=B("./src/types/level.ts");function a(o,R){for(var T=0;T<R.length;T++){var S=R[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(o,S.key,S)}}function d(o,R,T){return R&&a(o.prototype,R),T&&a(o,T),o}function s(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,i(o,R)}function i(o,R){return i=Object.setPrototypeOf||function(S,A){return S.__proto__=A,S},i(o,R)}var t=500,u=function(o){s(R,o);function R(S,A){var P;return P=o.call(this,S,A,"[subtitle-stream-controller]")||this,P.levels=[],P.currentTrackId=-1,P.tracksBuffered=[],P.mainDetails=null,P._registerListeners(),P}var T=R.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var A=this.hls;A.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(J.Events.ERROR,this.onError,this),A.on(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var A=this.hls;A.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(J.Events.ERROR,this.onError,this),A.off(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=p.State.IDLE,this.setInterval(t),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(A,P){this.mainDetails=P.details},T.onSubtitleFragProcessed=function(A,P){var E=P.frag,b=P.success;if(this.fragPrevious=E,this.state=p.State.IDLE,!b)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var f,C=E.start,x=0;x<h.length;x++)if(C>=h[x].start&&C<=h[x].end){f=h[x];break}var _=E.start+E.duration;f?f.end=_:(f={start:C,end:_},h.push(f)),this.fragmentTracker.fragBuffered(E)},T.onBufferFlushing=function(A,P){var E=P.startOffset,b=P.endOffset;if(E===0&&b!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,f=this.levels;if(!f.length||!f[h]||!f[h].details)return;var C=f[h].details,x=C.targetduration,_=b-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(E,_,g.PlaylistLevelType.SUBTITLE)}},T.onError=function(A,P){var E,b=P.frag;if(!b||b.type!==g.PlaylistLevelType.SUBTITLE)return;(E=this.fragCurrent)!==null&&E!==void 0&&E.loader&&this.fragCurrent.loader.abort(),this.state=p.State.IDLE},T.onSubtitleTracksUpdated=function(A,P){var E=this,b=P.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(h){return new m.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){E.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(A,P){if(this.currentTrackId=P.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var E=this.levels[this.currentTrackId];E!=null&&E.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,E&&this.setInterval(t)},T.onSubtitleTrackLoaded=function(A,P){var E,b=P.details,h=P.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var x=C[f];if(h>=C.length||h!==f||!x)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(E=x.details)!==null&&E!==void 0&&E.live){var _=this.mainDetails;if(b.deltaUpdateFailed||!_)return;var j=_.fragments[0];if(!x.details)b.hasProgramDateTime&&_.hasProgramDateTime?Object(z.alignMediaPlaylistByPDT)(b,_):j&&Object(r.addSliding)(b,j.start);else{var W=this.alignPlaylists(b,x.details);W===0&&j&&Object(r.addSliding)(b,j.start)}}if(x.details=b,this.levelLastLoaded=h,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var w=Object($.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);w||(this.warn("Subtitle playlist not aligned with playback"),x.details=void 0)}},T._handleFragmentLoadComplete=function(A){var P=A.frag,E=A.payload,b=P.decryptdata,h=this.hls;if(this.fragContextChanged(P))return;if(E&&E.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(E),b.key.buffer,b.iv.buffer).then(function(C){var x=performance.now();h.trigger(J.Events.FRAG_DECRYPTED,{frag:P,payload:C,stats:{tstart:f,tdecrypt:x}})})}},T.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var A,P=this.currentTrackId,E=this.levels;if(!E.length||!E[P]||!E[P].details)return;var b=E[P].details,h=b.targetduration,f=this.config,C=this.media,x=N.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-h,f.maxBufferHole),_=x.end,j=x.len,W=this.getMaxBufferLength()+h;if(j>W)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var w=b.fragments,F=w.length,I=b.edge,v,H=this.fragPrevious;if(_<I){var Y=f.maxFragLookUpTolerance;H&&b.hasProgramDateTime&&(v=Object($.findFragmentByPDT)(w,H.endProgramDateTime,Y)),v||(v=Object($.findFragmentByPTS)(H,w,_,Y),!v&&H&&H.start<w[0].start&&(v=w[0]))}else v=w[F-1];(A=v)!==null&&A!==void 0&&A.encrypted?(K.logger.log("Loading key for "+v.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(J.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===D.FragmentState.NOT_LOADED&&this.loadFragment(v,b,_)}},T.loadFragment=function(A,P,E){this.fragCurrent=A,o.prototype.loadFragment.call(this,A,P,E)},d(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(p.default)},"./src/controller/subtitle-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),N=B("./src/controller/base-playlist-controller.ts"),$=B("./src/types/loader.ts");function z(a,d){for(var s=0;s<d.length;s++){var i=d[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,d,s){return d&&z(a.prototype,d),s&&z(a,s),a}function D(a,d){a.prototype=Object.create(d.prototype),a.prototype.constructor=a,p(a,d)}function p(a,d){return p=Object.setPrototypeOf||function(i,t){return i.__proto__=t,i},p(a,d)}var g=function(a){D(d,a);function d(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=d.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},s.registerListeners=function(){var t=this.hls;t.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(J.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var t=this.hls;t.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(J.Events.ERROR,this.onError,this)},s.onMediaAttached=function(t,u){if(this.media=u.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},s.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},s.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=m(this.media.textTracks);t.forEach(function(u){Object(K.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(t,u){this.tracks=u.subtitleTracks},s.onSubtitleTrackLoaded=function(t,u){var o=u.id,R=u.details,T=this.trackId,S=this.tracksInGroup[T];if(!S){this.warn("Invalid subtitle track id "+o);return}var A=S.details;S.details=u.details,this.log("subtitle track "+o+" loaded ["+R.startSN+"-"+R.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,u,A))},s.onLevelLoading=function(t,u){this.switchLevel(u.level)},s.onLevelSwitching=function(t,u){this.switchLevel(u.level)},s.switchLevel=function(t){var u=this.hls.levels[t];if(!(u!=null&&u.textGroupIds))return;var o=u.textGroupIds[u.urlId];if(this.groupId!==o){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(P){return!o||P.groupId===o});this.tracksInGroup=T;var S=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=o;var A={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(J.Events.SUBTITLE_TRACKS_UPDATED,A),S!==-1&&this.setSubtitleTrack(S,R)}},s.findTrackId=function(t){for(var u=this.tracksInGroup,o=0;o<u.length;o++){var R=u[o];if((!this.selectDefaultTrack||R.default)&&(!t||t===R.name))return R.id}return-1},s.onError=function(t,u){if(a.prototype.onError.call(this,t,u),u.fatal||!u.context)return;u.context.type===$.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},s.loadPlaylist=function(t){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var o=u.id,R=u.groupId,T=u.url;if(t)try{T=t.addDirectives(T)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(J.Events.SUBTITLE_TRACK_LOADING,{url:T,id:o,groupId:R,deliveryDirectives:t||null})}},s.toggleTrackModes=function(t){var u=this,o=this.media,R=this.subtitleDisplay,T=this.trackId;if(!o)return;var S=m(o.textTracks),A=S.filter(function(b){return b.groupId===u.groupId});if(t===-1)[].slice.call(S).forEach(function(b){b.mode="disabled"});else{var P=A[T];P&&(P.mode="disabled")}var E=A[t];E&&(E.mode=R?"showing":"hidden")},s.setSubtitleTrack=function(t,u){var o,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(o=R[t])!==null&&o!==void 0&&o.details)||t<-1||t>=R.length)return;this.clearTimer();var T=R[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,T){var S=T.id,A=T.groupId,P=A===void 0?"":A,E=T.name,b=T.type,h=T.url;this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:P,name:E,type:b,url:h});var f=this.switchParams(T.url,u==null?void 0:u.details);this.loadPlaylist(f)}else this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:t})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,u=m(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(d,[{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)}}]),d}(N.default);function m(a){for(var d=[],s=0;s<a.length;s++){var i=a[s];i.kind==="subtitles"&&i.label&&d.push(a[s])}return d}Q.default=g},"./src/controller/timeline-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"TimelineController",function(){return m});var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/utils/cea-608-parser.ts"),$=B("./src/utils/output-filter.ts"),z=B("./src/utils/webvtt-parser.ts"),r=B("./src/utils/texttrack-utils.ts"),D=B("./src/utils/imsc1-ttml-parser.ts"),p=B("./src/types/loader.ts"),g=B("./src/utils/logger.ts"),m=function(){function i(u){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var o=new $.default(this,"textTrack1"),R=new $.default(this,"textTrack2"),T=new $.default(this,"textTrack3"),S=new $.default(this,"textTrack4");this.cea608Parser1=new N.default(1,o,R),this.cea608Parser2=new N.default(3,T,S)}u.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(K.Events.FRAG_LOADING,this.onFragLoading,this),u.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=i.prototype;return t.destroy=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(K.Events.FRAG_LOADING,this.onFragLoading,this),o.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(o,R,T,S,A){for(var P=!1,E=A.length;E--;){var b=A[E],h=d(b[0],b[1],R,T);if(h>=0&&(b[0]=Math.min(b[0],R),b[1]=Math.max(b[1],T),P=!0,h/(T-R)>.5))return}if(P||A.push([R,T]),this.config.renderTextTracksNatively){var f=this.captionsTracks[o];this.Cues.newCue(f,R,T,S)}else{var C=this.Cues.newCue(null,R,T,S);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:C,track:o})}},t.onInitPtsFound=function(o,R){var T=this,S=R.frag,A=R.id,P=R.initPTS,E=R.timescale,b=this.unparsedVttFrags;A==="main"&&(this.initPTS[S.cc]=P,this.timescale[S.cc]=E),b.length&&(this.unparsedVttFrags=[],b.forEach(function(h){T.onFragLoaded(K.Events.FRAG_LOADED,h)}))},t.getExistingTrack=function(o){var R=this.media;if(R)for(var T=0;T<R.textTracks.length;T++){var S=R.textTracks[T];if(S[o])return S}return null},t.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},t.createNativeTrack=function(o){if(this.captionsTracks[o])return;var R=this.captionsProperties,T=this.captionsTracks,S=this.media,A=R[o],P=A.label,E=A.languageCode,b=this.getExistingTrack(o);if(b)T[o]=b,Object(r.clearCurrentCues)(T[o]),Object(r.sendAddTrackEvent)(T[o],S);else{var h=this.createTextTrack("captions",P,E);h&&(h[o]=!0,T[o]=h)}},t.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var R=this.captionsProperties[o];if(!R)return;var T=R.label,S={_id:o,label:T,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[o]=S,this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},t.createTextTrack=function(o,R,T){var S=this.media;return S?S.addTextTrack(o,R,T):void 0},t.onMediaAttaching=function(o,R){this.media=R.media,this._cleanTracks()},t.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(R){Object(r.clearCurrentCues)(o[R]),delete o[R]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var o=this.media;if(!o)return;var R=o.textTracks;if(R)for(var T=0;T<R.length;T++)Object(r.clearCurrentCues)(R[T])},t.onSubtitleTracksUpdated=function(o,R){var T=this;this.textTracks=[];var S=R.subtitleTracks||[],A=S.some(function(h){return h.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var P=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var E=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,f){var C;if(f<E.length){for(var x=null,_=0;_<E.length;_++)if(a(E[_],h)){x=E[_];break}x&&(C=x)}C?Object(r.clearCurrentCues)(C):(C=T.createTextTrack("subtitles",h.name,h.lang),C&&(C.mode="disabled")),C&&(C.groupId=h.groupId,T.textTracks.push(C))})}else if(!P&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},t.onManifestLoaded=function(o,R){var T=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(S){var A=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!A)return;var P="textTrack"+A[1],E=T.captionsProperties[P];if(!E)return;E.label=S.name,S.lang&&(E.languageCode=S.lang),E.media=S})},t.onFragLoading=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2,A=this.lastSn,P=this.lastPartIndex;if(!this.enabled||!(T&&S))return;if(R.frag.type===p.PlaylistLevelType.MAIN){var E,b,h=R.frag.sn,f=(E=R==null||((b=R.part)===null||b===void 0)?void 0:b.index)!=null?E:-1;h===A+1||h===A&&f===P+1||(T.reset(),S.reset()),this.lastSn=h,this.lastPartIndex=f}},t.onFragLoaded=function(o,R){var T=R.frag,S=R.payload,A=this.initPTS,P=this.unparsedVttFrags;if(T.type===p.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(J.isFiniteNumber)(A[T.cc])){P.push(R),A.length&&this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var E=T.decryptdata;if(E==null||E.key==null||E.method!=="AES-128"){var b=this.tracks[T.level],h=this.vttCCs;h[T.cc]||(h[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(T,S):this._parseVTTs(T,S,h)}}else this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(o,R){var T=this,S=this.hls;Object(D.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(A){T._appendCues(A,o.level),S.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){g.logger.log("Failed to parse IMSC1: "+A),S.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},t._parseVTTs=function(o,R,T){var S=this,A=this.hls;Object(z.parseWebVTT)(R,this.initPTS[o.cc],this.timescale[o.cc],T,o.cc,o.start,function(P){S._appendCues(P,o.level),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(P){S._fallbackToIMSC1(o,R),g.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,R){var T=this,S=this.tracks[o.level];S.textCodec||Object(D.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(){S.textCodec=D.IMSC1_CODEC,T._parseIMSC1(o,R)},function(){S.textCodec="wvtt"})},t._appendCues=function(o,R){var T=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[R];if(S.mode==="disabled")return;o.forEach(function(E){return Object(r.addCueToTrack)(S,E)})}else{var A=this.tracks[R],P=A.default?"default":"subtitles"+R;T.trigger(K.Events.CUES_PARSED,{type:"subtitles",cues:o,track:P})}},t.onFragDecrypted=function(o,R){var T=R.frag;if(T.type===p.PlaylistLevelType.SUBTITLE){if(!Object(J.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(K.Events.FRAG_LOADED,R)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(T&&S))return;for(var A=0;A<R.samples.length;A++){var P=R.samples[A].bytes;if(P){var E=this.extractCea608Data(P);T.addData(R.samples[A].pts,E[0]),S.addData(R.samples[A].pts,E[1])}}},t.onBufferFlushing=function(o,R){var T=R.startOffset,S=R.endOffset,A=R.endOffsetSubtitles,P=R.type,E=this.media;if(!E||E.currentTime<S)return;if(!P||P==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(f){return Object(r.removeCuesInRange)(b[f],T,S)})}if(this.config.renderTextTracksNatively&&(T===0&&A!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(f){return Object(r.removeCuesInRange)(h[f],T,A)})}},t.extractCea608Data=function(o){for(var R=o[0]&31,T=2,S=[[],[]],A=0;A<R;A++){var P=o[T++],E=127&o[T++],b=127&o[T++],h=(4&P)!==0,f=3&P;if(E===0&&b===0)continue;h&&((f===0||f===1)&&(S[f].push(E),S[f].push(b)))}return S},i}();function a(i,t){return i&&i.label===t.name&&!(i.textTrack1||i.textTrack2)}function d(i,t,u,o){return Math.min(t,o)-Math.max(i,u)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.subtle=void 0,this.aesIV=void 0,this.subtle=$,this.aesIV=z}var N=K.prototype;return N.decrypt=function(z,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,z)},K}()},"./src/crypt/aes-decryptor.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"removePadding",function(){return K}),B.d(Q,"default",function(){return N});var J=B("./src/utils/typed-array.ts");function K($){var z=$.byteLength,r=z&&new DataView($.buffer).getUint8(z-1);return r?Object(J.sliceUint8)($,0,z-r):$}var N=function(){function $(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var z=$.prototype;return z.uint8ArrayToUint32Array_=function(D){for(var p=new DataView(D),g=new Uint32Array(4),m=0;m<4;m++)g[m]=p.getUint32(m*4);return g},z.initTable=function(){var D=this.sBox,p=this.invSBox,g=this.subMix,m=g[0],a=g[1],d=g[2],s=g[3],i=this.invSubMix,t=i[0],u=i[1],o=i[2],R=i[3],T=new Uint32Array(256),S=0,A=0,P=0;for(P=0;P<256;P++)P<128?T[P]=P<<1:T[P]=P<<1^283;for(P=0;P<256;P++){var E=A^A<<1^A<<2^A<<3^A<<4;E=E>>>8^E&255^99,D[S]=E,p[E]=S;var b=T[S],h=T[b],f=T[h],C=T[E]*257^E*16843008;m[S]=C<<24|C>>>8,a[S]=C<<16|C>>>16,d[S]=C<<8|C>>>24,s[S]=C,C=f*16843009^h*65537^b*257^S*16843008,t[E]=C<<24|C>>>8,u[E]=C<<16|C>>>16,o[E]=C<<8|C>>>24,R[E]=C,S?(S=b^T[T[T[f^b]]],A^=T[T[A]]):S=A=1}},z.expandKey=function(D){for(var p=this.uint8ArrayToUint32Array_(D),g=!0,m=0;m<p.length&&g;)g=p[m]===this.key[m],m++;if(g)return;this.key=p;var a=this.keySize=p.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var d=this.ksRows=(a+6+1)*4,s,i,t=this.keySchedule=new Uint32Array(d),u=this.invKeySchedule=new Uint32Array(d),o=this.sBox,R=this.rcon,T=this.invSubMix,S=T[0],A=T[1],P=T[2],E=T[3],b,h;for(s=0;s<d;s++){if(s<a){b=t[s]=p[s];continue}h=b,s%a===0?(h=h<<8|h>>>24,h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[h&255],h^=R[s/a|0]<<24):a>6&&s%a===4&&(h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[h&255]),t[s]=b=(t[s-a]^h)>>>0}for(i=0;i<d;i++)s=d-i,i&3?h=t[s]:h=t[s-4],i<4||s<=4?u[i]=h:u[i]=S[o[h>>>24]]^A[o[h>>>16&255]]^P[o[h>>>8&255]]^E[o[h&255]],u[i]=u[i]>>>0},z.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},z.decrypt=function(D,p,g){for(var m=this.keySize+6,a=this.invKeySchedule,d=this.invSBox,s=this.invSubMix,i=s[0],t=s[1],u=s[2],o=s[3],R=this.uint8ArrayToUint32Array_(g),T=R[0],S=R[1],A=R[2],P=R[3],E=new Int32Array(D),b=new Int32Array(E.length),h,f,C,x,_,j,W,w,F,I,v,H,Y,ie,le=this.networkToHostOrderSwap;p<E.length;){for(F=le(E[p]),I=le(E[p+1]),v=le(E[p+2]),H=le(E[p+3]),_=F^a[0],j=H^a[1],W=v^a[2],w=I^a[3],Y=4,ie=1;ie<m;ie++)h=i[_>>>24]^t[j>>16&255]^u[W>>8&255]^o[w&255]^a[Y],f=i[j>>>24]^t[W>>16&255]^u[w>>8&255]^o[_&255]^a[Y+1],C=i[W>>>24]^t[w>>16&255]^u[_>>8&255]^o[j&255]^a[Y+2],x=i[w>>>24]^t[_>>16&255]^u[j>>8&255]^o[W&255]^a[Y+3],_=h,j=f,W=C,w=x,Y=Y+4;h=d[_>>>24]<<24^d[j>>16&255]<<16^d[W>>8&255]<<8^d[w&255]^a[Y],f=d[j>>>24]<<24^d[W>>16&255]<<16^d[w>>8&255]<<8^d[_&255]^a[Y+1],C=d[W>>>24]<<24^d[w>>16&255]<<16^d[_>>8&255]<<8^d[j&255]^a[Y+2],x=d[w>>>24]<<24^d[_>>16&255]<<16^d[j>>8&255]<<8^d[W&255]^a[Y+3],b[p]=le(h^T),b[p+1]=le(x^S),b[p+2]=le(C^A),b[p+3]=le(f^P),T=F,S=I,A=v,P=H,p=p+4}return b.buffer},$}()},"./src/crypt/decrypter.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return p});var J=B("./src/crypt/aes-crypto.ts"),K=B("./src/crypt/fast-aes-key.ts"),N=B("./src/crypt/aes-decryptor.ts"),$=B("./src/utils/logger.ts"),z=B("./src/utils/mp4-tools.ts"),r=B("./src/utils/typed-array.ts"),D=16,p=function(){function g(a,d,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=d,this.removePKCS7Padding=u,u)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=g.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var d=this.currentResult;if(!d){this.reset();return}var s=new Uint8Array(d);return this.reset(),this.removePKCS7Padding?Object(N.removePadding)(s):s},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(d,s,i,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(d),s,i);var u=this.flush();u&&t(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(d),s,i).then(t)},m.softwareDecrypt=function(d,s,i){var t=this.currentIV,u=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(d=Object(z.appendUint8Array)(o,d),this.remainderData=null);var R=this.getValidChunk(d);if(!R.length)return null;t&&(i=t);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new N.default),T.expandKey(s);var S=u;return this.currentResult=T.decrypt(R.buffer,0,i),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,S||null},m.webCryptoDecrypt=function(d,s,i){var t=this,u=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new K.default(u,s)),this.fastAesKey.expandKey().then(function(o){if(!u)return Promise.reject(new Error("web crypto not initialized"));var R=new J.default(u,i);return R.decrypt(d.buffer,o)}).catch(function(o){return t.onWebCryptoError(o,d,s,i)})},m.onWebCryptoError=function(d,s,i,t){return $.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",d),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,i,t)},m.getValidChunk=function(d){var s=d,i=d.length-d.length%D;return i!==d.length&&(s=Object(r.sliceUint8)(d,0,i),this.remainderData=Object(r.sliceUint8)(d,i)),s},m.logOnce=function(d){if(!this.logEnabled)return;$.logger.log("[decrypter.ts]: "+d),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.subtle=void 0,this.key=void 0,this.subtle=$,this.key=z}var N=K.prototype;return N.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},K}()},"./src/demux/aacdemuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/adts.ts"),N=B("./src/utils/logger.ts"),$=B("./src/demux/id3.ts");function z(p,g){p.prototype=Object.create(g.prototype),p.prototype.constructor=p,r(p,g)}function r(p,g){return r=Object.setPrototypeOf||function(a,d){return a.__proto__=d,a},r(p,g)}var D=function(p){z(g,p);function g(a,d){var s;return s=p.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=a,s.config=d,s}var m=g.prototype;return m.resetInitSegment=function(d,s,i){p.prototype.resetInitSegment.call(this,d,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:d,duration:i,inputTimeScale:9e4,dropped:0}},g.probe=function(d){if(!d)return!1;for(var s=$.getID3Data(d,0)||[],i=s.length,t=d.length;i<t;i++)if(K.probe(d,i))return N.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(d,s){return K.canParse(d,s)},m.appendFrame=function(d,s,i){K.initTrackConfig(d,this.observer,s,i,d.manifestCodec);var t=K.appendFrame(d,s,i,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},g}(J.default);D.minProbeByteLength=9,Q.default=D},"./src/demux/adts.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"getAudioConfig",function(){return $}),B.d(Q,"isHeaderPattern",function(){return z}),B.d(Q,"getHeaderLength",function(){return r}),B.d(Q,"getFullFrameLength",function(){return D}),B.d(Q,"canGetFrameLength",function(){return p}),B.d(Q,"isHeader",function(){return g}),B.d(Q,"canParse",function(){return m}),B.d(Q,"probe",function(){return a}),B.d(Q,"initTrackConfig",function(){return d}),B.d(Q,"getFrameDuration",function(){return s}),B.d(Q,"parseFrameHeader",function(){return i}),B.d(Q,"appendFrame",function(){return t});var J=B("./src/utils/logger.ts"),K=B("./src/errors.ts"),N=B("./src/events.ts");function $(u,o,R,T){var S,A,P,E,b=navigator.userAgent.toLowerCase(),h=T,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((o[R+2]&192)>>>6)+1;var C=(o[R+2]&60)>>>2;if(C>f.length-1){u.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return P=(o[R+2]&1)<<2,P|=(o[R+3]&192)>>>6,J.logger.log("manifest codec:"+T+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(S=5,E=new Array(4),A=C-3):(S=2,E=new Array(2),A=C):b.indexOf("android")!==-1?(S=2,E=new Array(2),A=C):(S=5,E=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&C>=6?A=C-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(C>=6&&P===1||/vivaldi/i.test(b))||!T&&P===1)&&(S=2,E=new Array(2)),A=C)),E[0]=S<<3,E[0]|=(C&14)>>1,E[1]|=(C&1)<<7,E[1]|=P<<3,S===5&&(E[1]|=(A&14)>>1,E[2]=(A&1)<<7,E[2]|=2<<2,E[3]=0),{config:E,samplerate:f[C],channelCount:P,codec:"mp4a.40."+S,manifestCodec:h}}function z(u,o){return u[o]===255&&(u[o+1]&246)===240}function r(u,o){return u[o+1]&1?7:9}function D(u,o){return(u[o+3]&3)<<11|u[o+4]<<3|(u[o+5]&224)>>>5}function p(u,o){return o+5<u.length}function g(u,o){return o+1<u.length&&z(u,o)}function m(u,o){return p(u,o)&&z(u,o)&&D(u,o)<=u.length-o}function a(u,o){if(g(u,o)){var R=r(u,o);if(o+R>=u.length)return!1;var T=D(u,o);if(T<=R)return!1;var S=o+T;return S===u.length||g(u,S)}return!1}function d(u,o,R,T,S){if(!u.samplerate){var A=$(o,R,T,S);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,J.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function s(u){return 1024*9e4/u}function i(u,o,R,T,S){var A=r(u,o),P=D(u,o);if(P-=A,P>0){var E=R+T*S;return{headerLength:A,frameLength:P,stamp:E}}}function t(u,o,R,T,S){var A=s(u.samplerate),P=i(o,R,T,S,A);if(P){var E=P.frameLength,b=P.headerLength,h=P.stamp,f=b+E,C=Math.max(0,R+f-o.length),x;C?(x=new Uint8Array(f-b),x.set(o.subarray(R+b,o.length),0)):x=o.subarray(R+b,R+f);var _={unit:x,pts:h};return C||u.samples.push(_),{sample:_,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"initPTSFn",function(){return D});var J=B("./src/polyfills/number.ts"),K=B("./src/demux/id3.ts"),N=B("./src/demux/dummy-demuxed-track.ts"),$=B("./src/utils/mp4-tools.ts"),z=B("./src/utils/typed-array.ts"),r=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=p.prototype;return g.resetInitSegment=function(a,d,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(a,d){return!1},g.appendFrame=function(a,d,s){},g.demux=function(a,d){this.cachedData&&(a=Object($.appendUint8Array)(this.cachedData,a),this.cachedData=null);var s=K.getID3Data(a,0),i=s?s.length:0,t,u,o=this._audioTrack,R=this._id3Track,T=s?K.getTimeStamp(s):void 0,S=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(T,d)),s&&s.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),u=this.initPTS;i<S;){if(this.canParse(a,i)){var A=this.appendFrame(o,a,i);A?(this.frameIndex++,u=A.sample.pts,i+=A.length,t=i):i=S}else K.canParse(a,i)?(s=K.getID3Data(a,i),R.samples.push({pts:u,dts:u,data:s}),i+=s.length,t=i):i++;if(i===S&&t!==S){var P=Object(z.sliceUint8)(a,t);this.cachedData?this.cachedData=Object($.appendUint8Array)(this.cachedData,P):this.cachedData=P}}return{audioTrack:o,avcTrack:Object(N.dummyTrack)(),id3Track:R,textTrack:Object(N.dummyTrack)()}},g.demuxSampleAes=function(a,d,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(a){var d=this.cachedData;return d&&(this.cachedData=null,this.demux(d,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(N.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(N.dummyTrack)()}},g.destroy=function(){},p}(),D=function(g,m){return Object(J.isFiniteNumber)(g)?g*90:m*9e4};Q.default=r},"./src/demux/chunk-cache.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function N(){this.chunks=[],this.dataLength=0}var $=N.prototype;return $.push=function(r){this.chunks.push(r),this.dataLength+=r.length},$.flush=function(){var r=this.chunks,D=this.dataLength,p;if(r.length)r.length===1?p=r[0]:p=K(r,D);else return new Uint8Array(0);return this.reset(),p},$.reset=function(){this.chunks.length=0,this.dataLength=0},N}();function K(N,$){for(var z=new Uint8Array($),r=0,D=0;D<N.length;D++){var p=N[D];z.set(p,r),r+=p.length}return z}},"./src/demux/dummy-demuxed-track.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"dummyTrack",function(){return J});function J(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/logger.ts"),K=function(){function N(z){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=z,this.bytesAvailable=z.byteLength,this.word=0,this.bitsAvailable=0}var $=N.prototype;return $.loadWord=function(){var r=this.data,D=this.bytesAvailable,p=r.byteLength-D,g=new Uint8Array(4),m=Math.min(4,D);if(m===0)throw new Error("no bytes available");g.set(r.subarray(p,p+m)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},$.skipBits=function(r){var D;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,D=r>>3,r-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},$.readBits=function(r){var D=Math.min(this.bitsAvailable,r),p=this.word>>>32-D;return r>32&&J.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=r-D,D>0&&this.bitsAvailable?p<<D|this.readBits(D):p},$.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},$.skipUEG=function(){this.skipBits(1+this.skipLZ())},$.skipEG=function(){this.skipBits(1+this.skipLZ())},$.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},$.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},$.readBoolean=function(){return this.readBits(1)===1},$.readUByte=function(){return this.readBits(8)},$.readUShort=function(){return this.readBits(16)},$.readUInt=function(){return this.readBits(32)},$.skipScalingList=function(r){for(var D=8,p=8,g,m=0;m<r;m++)p!==0&&(g=this.readEG(),p=(D+g+256)%256),D=p===0?D:p},$.readSPS=function(){var r=0,D=0,p=0,g=0,m,a,d,s=this.readUByte.bind(this),i=this.readBits.bind(this),t=this.readUEG.bind(this),u=this.readBoolean.bind(this),o=this.skipBits.bind(this),R=this.skipEG.bind(this),T=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);s();var A=s();if(i(5),o(3),s(),T(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var P=t();if(P===3&&o(1),T(),T(),o(1),u())for(a=P!==3?8:12,d=0;d<a;d++)u()&&(d<6?S(16):S(64))}T();var E=t();if(E===0)t();else if(E===1)for(o(1),R(),R(),m=t(),d=0;d<m;d++)R();T(),o(1);var b=t(),h=t(),f=i(1);f===0&&o(1),o(1),u()&&(r=t(),D=t(),p=t(),g=t());var C=[1,1];if(u()&&u()){var x=s();switch(x){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((b+1)*16-r*2-D*2),height:(2-f)*(h+1)*16-(f?2:4)*(p+g),pixelRatio:C}},$.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},N}();Q.default=K},"./src/demux/id3.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isHeader",function(){return J}),B.d(Q,"isFooter",function(){return K}),B.d(Q,"getID3Data",function(){return N}),B.d(Q,"canParse",function(){return z}),B.d(Q,"getTimeStamp",function(){return r}),B.d(Q,"isTimeStampFrame",function(){return D}),B.d(Q,"getID3Frames",function(){return g}),B.d(Q,"decodeFrame",function(){return m}),B.d(Q,"utf8ArrayToStr",function(){return t}),B.d(Q,"testables",function(){return u});var J=function(S,A){return A+10<=S.length&&(S[A]===73&&S[A+1]===68&&S[A+2]===51&&(S[A+3]<255&&S[A+4]<255&&(S[A+6]<128&&S[A+7]<128&&S[A+8]<128&&S[A+9]<128)))},K=function(S,A){return A+10<=S.length&&(S[A]===51&&S[A+1]===68&&S[A+2]===73&&(S[A+3]<255&&S[A+4]<255&&(S[A+6]<128&&S[A+7]<128&&S[A+8]<128&&S[A+9]<128)))},N=function(S,A){for(var P=A,E=0;J(S,A);){E+=10;var b=$(S,A+6);E+=b,K(S,A+10)&&(E+=10),A+=E}return E>0?S.subarray(P,P+E):void 0},$=function(S,A){var P=0;return P=(S[A]&127)<<21,P|=(S[A+1]&127)<<14,P|=(S[A+2]&127)<<7,P|=S[A+3]&127,P},z=function(S,A){return J(S,A)&&$(S,A+6)+10<=S.length-A},r=function(S){for(var A=g(S),P=0;P<A.length;P++){var E=A[P];if(D(E))return i(E)}return},D=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},p=function(S){var A=String.fromCharCode(S[0],S[1],S[2],S[3]),P=$(S,4),E=10;return{type:A,size:P,data:S.subarray(E,E+P)}},g=function(S){for(var A=0,P=[];J(S,A);){var E=$(S,A+6);A+=10;for(var b=A+E;A+8<b;){var h=p(S.subarray(A)),f=m(h);f&&P.push(f),A+=h.size+10}K(S,A)&&(A+=10)}return P},m=function(S){return S.type==="PRIV"?a(S):S.type[0]==="W"?s(S):d(S)},a=function(S){if(S.size<2)return;var A=t(S.data,!0),P=new Uint8Array(S.data.subarray(A.length+1));return{key:S.type,info:A,data:P.buffer}},d=function(S){if(S.size<2)return;if(S.type==="TXXX"){var A=1,P=t(S.data.subarray(A),!0);A+=P.length+1;var E=t(S.data.subarray(A));return{key:S.type,info:P,data:E}}var b=t(S.data.subarray(1));return{key:S.type,data:b}},s=function(S){if(S.type==="WXXX"){if(S.size<2)return;var A=1,P=t(S.data.subarray(A),!0);A+=P.length+1;var E=t(S.data.subarray(A));return{key:S.type,info:P,data:E}}var b=t(S.data);return{key:S.type,data:b}},i=function(S){if(S.data.byteLength===8){var A=new Uint8Array(S.data),P=A[3]&1,E=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return E/=45,P&&(E+=4772185884e-2),Math.round(E)}return},t=function(S,A){A===void 0&&(A=!1);var P=R();if(P){var E=P.decode(S);if(A){var b=E.indexOf("\0");return b!==-1?E.substring(0,b):E}return E.replace(/\0/g,"")}for(var h=S.length,f,C,x,_="",j=0;j<h;){if(f=S[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:C=S[j++],_+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=S[j++],x=S[j++],_+=String.fromCharCode((f&15)<<12|(C&63)<<6|(x&63)<<0);break;default:}}return _},u={decodeTextFrame:d},o;function R(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/id3.ts"),N=B("./src/utils/logger.ts"),$=B("./src/demux/mpegaudio.ts");function z(p,g){p.prototype=Object.create(g.prototype),p.prototype.constructor=p,r(p,g)}function r(p,g){return r=Object.setPrototypeOf||function(a,d){return a.__proto__=d,a},r(p,g)}var D=function(p){z(g,p);function g(){return p.apply(this,arguments)||this}var m=g.prototype;return m.resetInitSegment=function(d,s,i){p.prototype.resetInitSegment.call(this,d,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:d,duration:i,inputTimeScale:9e4,dropped:0}},g.probe=function(d){if(!d)return!1;for(var s=K.getID3Data(d,0)||[],i=s.length,t=d.length;i<t;i++)if($.probe(d,i))return N.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(d,s){return $.canParse(d,s)},m.appendFrame=function(d,s,i){return this.initPTS===null?void 0:$.appendFrame(d,s,i,this.initPTS,this.frameIndex)},g}(J.default);D.minProbeByteLength=4,Q.default=D},"./src/demux/mp4demuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/mp4-tools.ts"),K=B("./src/demux/dummy-demuxed-track.ts"),N=function(){function $(r,D){this.remainderData=null,this.config=void 0,this.config=D}var z=$.prototype;return z.resetTimeStamp=function(){},z.resetInitSegment=function(){},z.resetContiguity=function(){},$.probe=function(D){return Object(J.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},z.demux=function(D){var p=D,g=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(J.appendUint8Array)(this.remainderData,D));var m=Object(J.segmentValidRange)(p);this.remainderData=m.remainder,g.samples=m.valid||new Uint8Array}else g.samples=p;return{audioTrack:Object(K.dummyTrack)(),avcTrack:g,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},z.flush=function(){var D=Object(K.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(K.dummyTrack)(),avcTrack:D,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},z.demuxSampleAes=function(D,p,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},z.destroy=function(){},$}();N.minProbeByteLength=1024,Q.default=N},"./src/demux/mpegaudio.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"appendFrame",function(){return r}),B.d(Q,"parseHeader",function(){return D}),B.d(Q,"isHeaderPattern",function(){return p}),B.d(Q,"isHeader",function(){return g}),B.d(Q,"canParse",function(){return m}),B.d(Q,"probe",function(){return a});var J=null,K=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],N=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],$=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],z=[0,1,1,4];function r(d,s,i,t,u){if(i+24>s.length)return;var o=D(s,i);if(o&&i+o.frameLength<=s.length){var R=o.samplesPerFrame*9e4/o.sampleRate,T=t+u*R,S={unit:s.subarray(i,i+o.frameLength),pts:T,dts:T};return d.config=[],d.channelCount=o.channelCount,d.samplerate=o.sampleRate,d.samples.push(S),{sample:S,length:o.frameLength,missing:0}}}function D(d,s){var i=d[s+1]>>3&3,t=d[s+1]>>1&3,u=d[s+2]>>4&15,o=d[s+2]>>2&3;if(i!==1&&u!==0&&u!==15&&o!==3){var R=d[s+2]>>1&1,T=d[s+3]>>6,S=i===3?3-t:t===3?3:4,A=K[S*14+u-1]*1e3,P=i===3?0:i===2?1:2,E=N[P*3+o],b=T===3?1:2,h=$[i][t],f=z[t],C=h*8*f,x=Math.floor(h*A/E+R)*f;if(J===null){var _=navigator.userAgent||"",j=_.match(/Chrome\/(\d+)/i);J=j?parseInt(j[1]):0}var W=!!J&&J<=87;return W&&t===2&&A>=224e3&&T===0&&(d[s+3]=d[s+3]|128),{sampleRate:E,channelCount:b,frameLength:x,samplesPerFrame:C}}}function p(d,s){return d[s]===255&&(d[s+1]&224)===224&&(d[s+1]&6)!==0}function g(d,s){return s+1<d.length&&p(d,s)}function m(d,s){var i=4;return p(d,s)&&i<=d.length-s}function a(d,s){if(s+1<d.length&&p(d,s)){var i=4,t=D(d,s),u=i;t!=null&&t.frameLength&&(u=t.frameLength);var o=s+u;return o===d.length||g(d,o)}return!1}},"./src/demux/sample-aes.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/crypt/decrypter.ts"),K=B("./src/demux/tsdemuxer.ts"),N=function(){function $(r,D,p){this.keyData=void 0,this.decrypter=void 0,this.keyData=p,this.decrypter=new J.default(r,D,{removePKCS7Padding:!1})}var z=$.prototype;return z.decryptBuffer=function(D,p){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,p)},z.decryptAacSample=function(D,p,g,m){var a=D[p].unit,d=a.subarray(16,a.length-a.length%16),s=d.buffer.slice(d.byteOffset,d.byteOffset+d.length),i=this;this.decryptBuffer(s,function(t){var u=new Uint8Array(t);a.set(u,16),m||i.decryptAacSamples(D,p+1,g)})},z.decryptAacSamples=function(D,p,g){for(;;p++){if(p>=D.length){g();return}if(D[p].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,p,g,m),!m)return}},z.getAvcEncryptedData=function(D){for(var p=Math.floor((D.length-48)/160)*16+16,g=new Int8Array(p),m=0,a=32;a<=D.length-16;a+=160,m+=16)g.set(D.subarray(a,a+16),m);return g},z.getAvcDecryptedUnit=function(D,p){for(var g=new Uint8Array(p),m=0,a=32;a<=D.length-16;a+=160,m+=16)D.set(g.subarray(m,m+16),a);return D},z.decryptAvcSample=function(D,p,g,m,a,d){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),d||t.decryptAvcSamples(D,p,g+1,m)})},z.decryptAvcSamples=function(D,p,g,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,g=0){if(p>=D.length){m();return}for(var a=D[p].units;!(g>=a.length);g++){var d=a[g];if(d.data.length<=48||d.type!==1&&d.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(D,p,g,m,d,s),!s)return}}},$}();Q.default=N},"./src/demux/transmuxer-interface.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./node_modules/webworkify-webpack/index.js"),K=B.n(J),N=B("./src/events.ts"),$=B("./src/demux/transmuxer.ts"),z=B("./src/utils/logger.ts"),r=B("./src/errors.ts"),D=B("./src/utils/mediasource-helper.ts"),p=B("./node_modules/eventemitter3/index.js"),g=B.n(p),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function d(i,t,u,o){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=t,this.onTransmuxComplete=u,this.onFlush=o;var T=i.config,S=function(h,f){f=f||{},f.frag=R.frag,f.id=R.id,i.trigger(h,f)};this.observer=new p.EventEmitter,this.observer.on(N.Events.FRAG_DECRYPTED,S),this.observer.on(N.Events.ERROR,S);var A={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},P=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){z.logger.log("demuxing in webworker");var E;try{E=this.worker=J("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),E.addEventListener("message",this.onwmsg),E.onerror=function(b){i.trigger(N.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},E.postMessage({cmd:"init",typeSupported:A,vendor:P,id:t,config:JSON.stringify(T)})}catch(b){z.logger.warn("Error in worker:",b),z.logger.error("Error while initializing DemuxerWorker, fallback to inline"),E&&self.URL.revokeObjectURL(E.objectURL),this.transmuxer=new $.default(this.observer,A,T,P,t),this.worker=null}}else this.transmuxer=new $.default(this.observer,A,T,P,t)}var s=d.prototype;return s.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},s.push=function(t,u,o,R,T,S,A,P,E,b){var h=this;E.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,x=S?S.start:T.start,_=T.decryptdata,j=this.frag,W=!(j&&T.cc===j.cc),w=!(j&&E.level===j.level),F=j?E.sn-j.sn:-1,I=this.part?E.part-this.part.index:1,v=!w&&(F===1||F===0&&I===1),H=self.performance.now();(w||F||T.stats.parsing.start===0)&&(T.stats.parsing.start=H),S&&(I||!v)&&(S.stats.parsing.start=H);var Y=new $.TransmuxState(W,v,P,w,x);if(!v||W){z.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+E.sn+" p: "+E.part+" level: "+E.level+" id: "+E.id+`
|
|
discontinuity: `+W+`
|
|
trackSwitch: `+w+`
|
|
contiguous: `+v+`
|
|
accurateTimeOffset: `+P+`
|
|
timeOffset: `+x);var ie=new $.TransmuxConfig(o,R,u,A,b);this.configureTransmuxer(ie)}if(this.frag=T,this.part=S,C)C.postMessage({cmd:"demux",data:t,decryptdata:_,chunkMeta:E,state:Y},t instanceof ArrayBuffer?[t]:[]);else if(f){var le=f.push(t,_,E,Y);Object($.isPromise)(le)?le.then(function(he){h.handleTransmuxComplete(he)}):this.handleTransmuxComplete(le)}},s.flush=function(t){var u=this;t.transmuxing.start=self.performance.now();var o=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:t});else if(o){var T=o.flush(t);Object($.isPromise)(T)?T.then(function(S){u.handleFlushResult(S,t)}):this.handleFlushResult(T,t)}},s.handleFlushResult=function(t,u){var o=this;t.forEach(function(R){o.handleTransmuxComplete(R)}),this.onFlush(u)},s.onWorkerMessage=function(t){var u=t.data,o=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,o.trigger(u.event,u.data);break}}},s.configureTransmuxer=function(t){var u=this.worker,o=this.transmuxer;u?u.postMessage({cmd:"configure",config:t}):o&&o.configure(t)},s.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},d}()},"./src/demux/transmuxer-worker.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/demux/transmuxer.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts"),$=B("./node_modules/eventemitter3/index.js"),z=B.n($);function r(a){var d=new $.EventEmitter,s=function(t,u){a.postMessage({event:t,data:u})};d.on(K.Events.FRAG_DECRYPTED,s),d.on(K.Events.ERROR,s),a.addEventListener("message",function(i){var t=i.data;switch(t.cmd){case"init":{var u=JSON.parse(t.config);a.transmuxer=new J.default(d,t.typeSupported,u,t.vendor,t.id),Object(N.enableLogs)(u.debug),s("init",null);break}case"configure":{a.transmuxer.configure(t.config);break}case"demux":{var o=a.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(J.isPromise)(o)?o.then(function(S){D(a,S)}):D(a,o);break}case"flush":{var R=t.chunkMeta,T=a.transmuxer.flush(R);Object(J.isPromise)(T)?T.then(function(S){g(a,S,R)}):g(a,T,R);break}default:break}})}function D(a,d){if(m(d.remuxResult))return;var s=[],i=d.remuxResult,t=i.audio,u=i.video;t&&p(s,t),u&&p(s,u),a.postMessage({event:"transmuxComplete",data:d},s)}function p(a,d){d.data1&&a.push(d.data1.buffer),d.data2&&a.push(d.data2.buffer)}function g(a,d,s){d.forEach(function(i){D(a,i)}),a.postMessage({event:"flush",data:s})}function m(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"isPromise",function(){return T}),B.d(Q,"TransmuxConfig",function(){return S}),B.d(Q,"TransmuxState",function(){return A});var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/crypt/decrypter.ts"),$=B("./src/demux/aacdemuxer.ts"),z=B("./src/demux/mp4demuxer.ts"),r=B("./src/demux/tsdemuxer.ts"),D=B("./src/demux/mp3demuxer.ts"),p=B("./src/remux/mp4-remuxer.ts"),g=B("./src/remux/passthrough-remuxer.ts"),m=B("./src/demux/chunk-cache.ts"),a=B("./src/utils/mp4-tools.ts"),d=B("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(P){d.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var i=[{demux:r.default,remux:p.default},{demux:z.default,remux:g.default},{demux:$.default,remux:p.default},{demux:D.default,remux:p.default}],t=1024;i.forEach(function(P){var E=P.demux;t=Math.max(t,E.minProbeByteLength)});var u=function(){function P(b,h,f,C,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 m.default,this.observer=b,this.typeSupported=h,this.config=f,this.vendor=C,this.id=x}var E=P.prototype;return E.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},E.push=function(h,f,C,x){var _=this,j=C.transmuxing;j.executeStart=s();var W=new Uint8Array(h),w=this.cache,F=this.config,I=this.currentTransmuxState,v=this.transmuxConfig;x&&(this.currentTransmuxState=x);var H=o(W,f);if(H&&H.method==="AES-128"){var Y=this.getDecrypter();if(F.enableSoftwareAES){var ie=Y.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!ie)return j.executeEnd=s(),R(C);W=new Uint8Array(ie)}else return this.decryptionPromise=Y.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(st){var vt=_.push(st,null,C);return _.decryptionPromise=null,vt}),this.decryptionPromise}var le=x||I,he=le.contiguous,we=le.discontinuity,Pe=le.trackSwitch,xe=le.accurateTimeOffset,Oe=le.timeOffset,pe=v.audioCodec,be=v.videoCodec,ne=v.defaultInitPts,fe=v.duration,_e=v.initSegmentData;if((we||Pe)&&this.resetInitSegment(_e,pe,be,fe),we&&this.resetInitialTimestamp(ne),he||this.resetContiguity(),this.needsProbing(W,we,Pe)){if(w.dataLength){var ke=w.flush();W=Object(a.appendUint8Array)(ke,W)}this.configureTransmuxer(W,v)}var qe=this.transmux(W,H,Oe,xe,C),je=this.currentTransmuxState;return je.contiguous=!0,je.discontinuity=!1,je.trackSwitch=!1,j.executeEnd=s(),qe},E.flush=function(h){var f=this,C=h.transmuxing;C.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 w=[],F=j.timeOffset;if(x){var I=x.flush();I&&w.push(this.push(I,null,h))}var v=_.dataLength;_.reset();var H=this.demuxer,Y=this.remuxer;if(!H||!Y)return v>=t&&this.observer.emit(J.Events.ERROR,J.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=s(),[R(h)];var ie=H.flush(F);return T(ie)?ie.then(function(le){return f.flushRemux(w,le,h),w}):(this.flushRemux(w,ie,h),w)},E.flushRemux=function(h,f,C){var x=f.audioTrack,_=f.avcTrack,j=f.id3Track,W=f.textTrack,w=this.currentTransmuxState,F=w.accurateTimeOffset,I=w.timeOffset;d.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var v=this.remuxer.remux(x,_,j,W,I,F,!0,this.id);h.push({remuxResult:v,chunkMeta:C}),C.transmuxing.executeEnd=s()},E.resetInitialTimestamp=function(h){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(h),C.resetTimeStamp(h)},E.resetContiguity=function(){var h=this.demuxer,f=this.remuxer;if(!h||!f)return;h.resetContiguity(),f.resetNextTimestamp()},E.resetInitSegment=function(h,f,C,x){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetInitSegment(f,C,x),j.resetInitSegment(h,f,C)},E.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},E.transmux=function(h,f,C,x,_){var j;return f&&f.method==="SAMPLE-AES"?j=this.transmuxSampleAes(h,f,C,x,_):j=this.transmuxUnencrypted(h,C,x,_),j},E.transmuxUnencrypted=function(h,f,C,x){var _=this.demuxer.demux(h,f,!1,!this.config.progressive),j=_.audioTrack,W=_.avcTrack,w=_.id3Track,F=_.textTrack,I=this.remuxer.remux(j,W,w,F,f,C,!1,this.id);return{remuxResult:I,chunkMeta:x}},E.transmuxSampleAes=function(h,f,C,x,_){var j=this;return this.demuxer.demuxSampleAes(h,f,C).then(function(W){var w=j.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,x,!1,j.id);return{remuxResult:w,chunkMeta:_}})},E.configureTransmuxer=function(h,f){for(var C=this.config,x=this.observer,_=this.typeSupported,j=this.vendor,W=f.audioCodec,w=f.defaultInitPts,F=f.duration,I=f.initSegmentData,v=f.videoCodec,H,Y=0,ie=i.length;Y<ie;Y++)if(i[Y].demux.probe(h)){H=i[Y];break}H||(d.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:z.default,remux:g.default});var le=this.demuxer,he=this.remuxer,we=H.remux,Pe=H.demux;(!he||!(he instanceof we))&&(this.remuxer=new we(x,C,_,j)),(!le||!(le instanceof Pe))&&(this.demuxer=new Pe(x,C,_),this.probe=Pe.probe),this.resetInitSegment(I,W,v,F),this.resetInitialTimestamp(w)},E.needsProbing=function(h,f,C){return!this.demuxer||!this.remuxer||f||C},E.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new N.default(this.observer,this.config)),h},P}();function o(P,E){var b=null;return P.byteLength>0&&E!=null&&E.key!=null&&E.iv!==null&&E.method!=null&&(b=E),b}var R=function(E){return{remuxResult:{},chunkMeta:E}};function T(P){return"then"in P&&P.then instanceof Function}var S=function(E,b,h,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=E,this.videoCodec=b,this.initSegmentData=h,this.duration=f,this.defaultInitPts=C},A=function(E,b,h,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=E,this.contiguous=b,this.accurateTimeOffset=h,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"discardEPB",function(){return R});var J=B("./src/demux/adts.ts"),K=B("./src/demux/mpegaudio.ts"),N=B("./src/demux/exp-golomb.ts"),$=B("./src/demux/id3.ts"),z=B("./src/demux/sample-aes.ts"),r=B("./src/events.ts"),D=B("./src/utils/mp4-tools.ts"),p=B("./src/utils/logger.ts"),g=B("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},a=function(){function T(A,P,E){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=E}T.probe=function(P){var E=T.syncOffset(P);return E<0?!1:(E&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+E+", junk ahead ?"),!0)},T.syncOffset=function(P){for(var E=Math.min(1e3,P.length-3*188),b=0;b<E;){if(P[b]===71&&P[b+188]===71&&P[b+2*188]===71)return b;b++}return-1},T.createTrack=function(P,E){return{container:P==="video"||P==="audio"?"video/mp2t":void 0,type:P,id:m[P],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:P==="audio"?E:void 0}};var S=T.prototype;return S.resetInitSegment=function(P,E,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",b),this._audioTrack=T.createTrack("audio",b),this._id3Track=T.createTrack("id3",b),this._txtTrack=T.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=P,this.videoCodec=E,this._duration=b},S.resetTimeStamp=function(){},S.resetContiguity=function(){var P=this._audioTrack,E=this._avcTrack,b=this._id3Track;P&&(P.pesData=null),E&&(E.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(P,E,b,h){b===void 0&&(b=!1),h===void 0&&(h=!1),b||(this.sampleAes=null);var f,C=this._avcTrack,x=this._audioTrack,_=this._id3Track,j=C.pid,W=C.pesData,w=x.pid,F=_.pid,I=x.pesData,v=_.pesData,H=!1,Y=this.pmtParsed,ie=this._pmtId,le=P.length;if(this.remainderData&&(P=Object(D.appendUint8Array)(this.remainderData,P),le=P.length,this.remainderData=null),le<188&&!h)return this.remainderData=P,{audioTrack:x,avcTrack:C,id3Track:_,textTrack:this._txtTrack};var he=Math.max(0,T.syncOffset(P));le-=(le+he)%188,le<P.byteLength&&!h&&(this.remainderData=new Uint8Array(P.buffer,le,P.buffer.byteLength-le));for(var we=he;we<le;we+=188)if(P[we]===71){var Pe=!!(P[we+1]&64),xe=((P[we+1]&31)<<8)+P[we+2],Oe=(P[we+3]&48)>>4,pe=void 0;if(Oe>1){if(pe=we+5+P[we+4],pe===we+188)continue}else pe=we+4;switch(xe){case j:Pe&&(W&&(f=t(W))&&this.parseAVCPES(f,!1),W={data:[],size:0}),W&&(W.data.push(P.subarray(pe,we+188)),W.size+=we+188-pe);break;case w:Pe&&(I&&(f=t(I))&&(x.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),I={data:[],size:0}),I&&(I.data.push(P.subarray(pe,we+188)),I.size+=we+188-pe);break;case F:Pe&&(v&&(f=t(v))&&this.parseID3PES(f),v={data:[],size:0}),v&&(v.data.push(P.subarray(pe,we+188)),v.size+=we+188-pe);break;case 0:Pe&&(pe+=P[pe]+1),ie=this._pmtId=s(P,pe);break;case ie:{Pe&&(pe+=P[pe]+1);var be=i(P,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);j=be.avc,j>0&&(C.pid=j),w=be.audio,w>0&&(x.pid=w,x.isAAC=be.isAAC),F=be.id3,F>0&&(_.pid=F),H&&!Y&&(p.logger.log("reparse from beginning"),H=!1,we=he-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=W,x.pesData=I,_.pesData=v;var ne={audioTrack:x,avcTrack:C,id3Track:_,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(ne),ne},S.flush=function(){var P=this.remainderData;this.remainderData=null;var E;return P?E=this.demux(P,-1,!1,!0):E={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(E),this.sampleAes?this.decrypt(E,this.sampleAes):E},S.extractRemainingSamples=function(P){var E=P.audioTrack,b=P.avcTrack,h=P.id3Track,f=b.pesData,C=E.pesData,x=h.pesData,_;f&&(_=t(f))?(this.parseAVCPES(_,!0),b.pesData=null):b.pesData=f,C&&(_=t(C))?(E.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),E.pesData=null):(C!=null&&C.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),E.pesData=C),x&&(_=t(x))?(this.parseID3PES(_),h.pesData=null):h.pesData=x},S.demuxSampleAes=function(P,E,b){var h=this.demux(P,b,!0,!this.config.progressive),f=this.sampleAes=new z.default(this.observer,this.config,E);return this.decrypt(h,f)},S.decrypt=function(P,E){return new Promise(function(b){var h=P.audioTrack,f=P.avcTrack;h.samples&&h.isAAC?E.decryptAacSamples(h.samples,0,function(){f.samples?E.decryptAvcSamples(f.samples,0,0,function(){b(P)}):b(P)}):f.samples&&E.decryptAvcSamples(f.samples,0,0,function(){b(P)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(P,E){var b=this,h=this._avcTrack,f=this.parseAVCNALu(P.data),C=!1,x=this.avcSample,_,j=!1;P.data=null,x&&f.length&&!h.audFound&&(u(x,h),x=this.avcSample=d(!1,P.pts,P.dts,"")),f.forEach(function(W){switch(W.type){case 1:{_=!0,x||(x=b.avcSample=d(!0,P.pts,P.dts,"")),C&&(x.debug+="NDR "),x.frame=!0;var w=W.data;if(j&&w.length>4){var F=new N.default(w).readSliceType();(F===2||F===4||F===7||F===9)&&(x.key=!0)}break}case 5:_=!0,x||(x=b.avcSample=d(!0,P.pts,P.dts,"")),C&&(x.debug+="IDR "),x.key=!0,x.frame=!0;break;case 6:{_=!0,C&&x&&(x.debug+="SEI ");var I=new N.default(R(W.data));I.readUByte();for(var v=0,H=0,Y=!1,ie=0;!Y&&I.bytesAvailable>1;){v=0;do ie=I.readUByte(),v+=ie;while(ie===255);H=0;do ie=I.readUByte(),H+=ie;while(ie===255);if(v===4&&I.bytesAvailable!==0){Y=!0;var le=I.readUByte();if(le===181){var he=I.readUShort();if(he===49){var we=I.readUInt();if(we===1195456820){var Pe=I.readUByte();if(Pe===3){for(var xe=I.readUByte(),Oe=I.readUByte(),pe=31&xe,be=[xe,Oe],ne=0;ne<pe;ne++)be.push(I.readUByte()),be.push(I.readUByte()),be.push(I.readUByte());o(b._txtTrack.samples,{type:3,pts:P.pts,bytes:be})}}}}}else if(v===5&&I.bytesAvailable!==0){if(Y=!0,H>16){for(var fe=[],_e=0;_e<16;_e++)fe.push(I.readUByte().toString(16)),(_e===3||_e===5||_e===7||_e===9)&&fe.push("-");for(var ke=H-16,qe=new Uint8Array(ke),je=0;je<ke;je++)qe[je]=I.readUByte();o(b._txtTrack.samples,{pts:P.pts,payloadType:v,uuid:fe.join(""),userData:Object($.utf8ArrayToStr)(qe),userDataBytes:qe})}}else if(H<I.bytesAvailable)for(var st=0;st<H;st++)I.readUByte()}break}case 7:if(_=!0,j=!0,C&&x&&(x.debug+="SPS "),!h.sps){var vt=new N.default(W.data),Re=vt.readSPS();h.width=Re.width,h.height=Re.height,h.pixelRatio=Re.pixelRatio,h.sps=[W.data],h.duration=b._duration;for(var Be=W.data.subarray(1,4),Ye="avc1.",Ke=0;Ke<3;Ke++){var yt=Be[Ke].toString(16);yt.length<2&&(yt="0"+yt),Ye+=yt}h.codec=Ye}break;case 8:_=!0,C&&x&&(x.debug+="PPS "),h.pps||(h.pps=[W.data]);break;case 9:_=!1,h.audFound=!0,x&&u(x,h),x=b.avcSample=d(!1,P.pts,P.dts,C?"AUD ":"");break;case 12:_=!1;break;default:_=!1,x&&(x.debug+="unknown NAL "+W.type+" ");break}if(x&&_){var Pt=x.units;Pt.push(W)}}),E&&x&&(u(x,h),this.avcSample=null)},S.getLastNalUnit=function(){var P,E=this.avcSample,b;if(!E||E.units.length===0){var h=this._avcTrack.samples;E=h[h.length-1]}if((P=E)!==null&&P!==void 0&&P.units){var f=E.units;b=f[f.length-1]}return b},S.parseAVCNALu=function(P){var E=P.byteLength,b=this._avcTrack,h=b.naluState||0,f=h,C=[],x=0,_,j,W,w=-1,F=0;for(h===-1&&(w=0,F=P[0]&31,h=0,x=1);x<E;){if(_=P[x++],!h){h=_?0:1;continue}if(h===1){h=_?0:2;continue}if(!_)h=3;else if(_===1){if(w>=0){var I={data:P.subarray(w,x-h-1),type:F};C.push(I)}else{var v=this.getLastNalUnit();if(v&&(f&&x<=4-f&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-f))),j=x-h-1,j>0)){var H=new Uint8Array(v.data.byteLength+j);H.set(v.data,0),H.set(P.subarray(0,j),v.data.byteLength),v.data=H,v.state=0}}x<E?(W=P[x]&31,w=x,F=W,h=0):h=-1}else h=0}if(w>=0&&h>=0){var Y={data:P.subarray(w,E),type:F,state:h};C.push(Y)}if(C.length===0){var ie=this.getLastNalUnit();if(ie){var le=new Uint8Array(ie.data.byteLength+P.byteLength);le.set(ie.data,0),le.set(P,ie.data.byteLength),ie.data=le}}return b.naluState=h,C},S.parseAACPES=function(P){var E=0,b=this._audioTrack,h=this.aacOverFlow,f=P.data;if(h){this.aacOverFlow=null;var C=h.sample.unit.byteLength,x=Math.min(h.missing,C),_=C-x;h.sample.unit.set(f.subarray(0,x),_),b.samples.push(h.sample),E=h.missing}var j,W;for(j=E,W=f.length;j<W-1&&!J.isHeader(f,j);j++);if(j!==E){var w,F;if(j<W-1?(w="AAC PES did not start with ADTS header,offset:"+j,F=!1):(w="no ADTS header found in AAC PES",F=!0),p.logger.warn("parsing error:"+w),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:w}),F)return}J.initTrackConfig(b,this.observer,f,j,this.audioCodec);var I;if(P.pts!==void 0)I=P.pts;else if(h){var v=J.getFrameDuration(b.samplerate);I=h.sample.pts+v}else{p.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;j<W;)if(J.isHeader(f,j)){if(j+5<W){var Y=J.appendFrame(b,f,j,I,H);if(Y)if(Y.missing)this.aacOverFlow=Y;else{j+=Y.length,H++;continue}}break}else j++},S.parseMPEGPES=function(P){var E=P.data,b=E.length,h=0,f=0,C=P.pts;if(C===void 0){p.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<b;)if(K.isHeader(E,f)){var x=K.appendFrame(this._audioTrack,E,f,C,h);if(x)f+=x.length,h++;else break}else f++},S.parseID3PES=function(P){if(P.pts===void 0){p.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(P)},T}();a.minProbeByteLength=188;function d(T,S,A,P){return{key:T,frame:!1,pts:S,dts:A,units:[],debug:P,length:0}}function s(T,S){return(T[S+10]&31)<<8|T[S+11]}function i(T,S,A,P){var E={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(T[S+1]&15)<<8|T[S+2],h=S+3+b-4,f=(T[S+10]&15)<<8|T[S+11];for(S+=12+f;S<h;){var C=(T[S+1]&31)<<8|T[S+2];switch(T[S]){case 207:if(!P){p.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:E.audio===-1&&(E.audio=C);break;case 21:E.id3===-1&&(E.id3=C);break;case 219:if(!P){p.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:E.avc===-1&&(E.avc=C);break;case 3:case 4:A?E.audio===-1&&(E.audio=C,E.isAAC=!1):p.logger.log("MPEG audio found, not supported in this browser");break;case 36:p.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((T[S+3]&15)<<8|T[S+4])+5}return E}function t(T){var S=0,A,P,E,b,h,f=T.data;if(!T||T.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}A=f[0];var x=(A[0]<<16)+(A[1]<<8)+A[2];if(x===1){if(P=(A[4]<<8)+A[5],P&&P>T.size-6)return null;var _=A[7];_&192&&(b=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(h=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,b-h>60*9e4&&(p.logger.warn(Math.round((b-h)/9e4)+"s delta between PTS and DTS, align them"),b=h)):h=b),E=A[8];var j=E+9;if(T.size<=j)return null;T.size-=j;for(var W=new Uint8Array(T.size),w=0,F=f.length;w<F;w++){A=f[w];var I=A.byteLength;if(j)if(j>I){j-=I;continue}else A=A.subarray(j),I-=j,j=0;W.set(A,S),S+=I}return P&&(P-=E+3),{data:W,pts:b,dts:h,len:P}}return null}function u(T,S){if(T.units.length&&T.frame){if(T.pts===void 0){var A=S.samples,P=A.length;if(P){var E=A[P-1];T.pts=E.pts,T.dts=E.dts}else{S.dropped++;return}}S.samples.push(T)}T.debug.length&&p.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function o(T,S){var A=T.length;if(A>0){if(S.pts>=T[A-1].pts)T.push(S);else for(var P=A-1;P>=0;P--)if(S.pts<T[P].pts){T.splice(P,0,S);break}}else T.push(S)}function R(T){for(var S=T.byteLength,A=[],P=1;P<S-2;)T[P]===0&&T[P+1]===0&&T[P+2]===3?(A.push(P+2),P+=2):P++;if(A.length===0)return T;var E=S-A.length,b=new Uint8Array(E),h=0;for(P=0;P<E;h++,P++)h===A[0]&&(h++,A.shift()),b[P]=T[h];return b}Q.default=a},"./src/errors.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ErrorTypes",function(){return J}),B.d(Q,"ErrorDetails",function(){return K});var J;(function(N){N.NETWORK_ERROR="networkError",N.MEDIA_ERROR="mediaError",N.KEY_SYSTEM_ERROR="keySystemError",N.MUX_ERROR="muxError",N.OTHER_ERROR="otherError"})(J||(J={}));var K;(function(N){N.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",N.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",N.KEY_SYSTEM_NO_SESSION="keySystemNoSession",N.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",N.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",N.MANIFEST_LOAD_ERROR="manifestLoadError",N.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",N.MANIFEST_PARSING_ERROR="manifestParsingError",N.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",N.LEVEL_EMPTY_ERROR="levelEmptyError",N.LEVEL_LOAD_ERROR="levelLoadError",N.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",N.LEVEL_SWITCH_ERROR="levelSwitchError",N.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",N.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",N.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",N.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",N.FRAG_LOAD_ERROR="fragLoadError",N.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",N.FRAG_DECRYPT_ERROR="fragDecryptError",N.FRAG_PARSING_ERROR="fragParsingError",N.REMUX_ALLOC_ERROR="remuxAllocError",N.KEY_LOAD_ERROR="keyLoadError",N.KEY_LOAD_TIMEOUT="keyLoadTimeOut",N.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",N.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",N.BUFFER_APPEND_ERROR="bufferAppendError",N.BUFFER_APPENDING_ERROR="bufferAppendingError",N.BUFFER_STALLED_ERROR="bufferStalledError",N.BUFFER_FULL_ERROR="bufferFullError",N.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",N.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",N.INTERNAL_EXCEPTION="internalException",N.INTERNAL_ABORTED="aborted",N.UNKNOWN="unknown"})(K||(K={}))},"./src/events.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"Events",function(){return J});var J;(function(K){K.MEDIA_ATTACHING="hlsMediaAttaching",K.MEDIA_ATTACHED="hlsMediaAttached",K.MEDIA_DETACHING="hlsMediaDetaching",K.MEDIA_DETACHED="hlsMediaDetached",K.BUFFER_RESET="hlsBufferReset",K.BUFFER_CODECS="hlsBufferCodecs",K.BUFFER_CREATED="hlsBufferCreated",K.BUFFER_APPENDING="hlsBufferAppending",K.BUFFER_APPENDED="hlsBufferAppended",K.BUFFER_EOS="hlsBufferEos",K.BUFFER_FLUSHING="hlsBufferFlushing",K.BUFFER_FLUSHED="hlsBufferFlushed",K.MANIFEST_LOADING="hlsManifestLoading",K.MANIFEST_LOADED="hlsManifestLoaded",K.MANIFEST_PARSED="hlsManifestParsed",K.LEVEL_SWITCHING="hlsLevelSwitching",K.LEVEL_SWITCHED="hlsLevelSwitched",K.LEVEL_LOADING="hlsLevelLoading",K.LEVEL_LOADED="hlsLevelLoaded",K.LEVEL_UPDATED="hlsLevelUpdated",K.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",K.LEVELS_UPDATED="hlsLevelsUpdated",K.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",K.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",K.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",K.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",K.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",K.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",K.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",K.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",K.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",K.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",K.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",K.CUES_PARSED="hlsCuesParsed",K.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",K.INIT_PTS_FOUND="hlsInitPtsFound",K.FRAG_LOADING="hlsFragLoading",K.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",K.FRAG_LOADED="hlsFragLoaded",K.FRAG_DECRYPTED="hlsFragDecrypted",K.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",K.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",K.FRAG_PARSING_METADATA="hlsFragParsingMetadata",K.FRAG_PARSED="hlsFragParsed",K.FRAG_BUFFERED="hlsFragBuffered",K.FRAG_CHANGED="hlsFragChanged",K.FPS_DROP="hlsFpsDrop",K.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",K.ERROR="hlsError",K.DESTROYING="hlsDestroying",K.KEY_LOADING="hlsKeyLoading",K.KEY_LOADED="hlsKeyLoaded",K.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",K.BACK_BUFFER_REACHED="hlsBackBufferReached"})(J||(J={}))},"./src/hls.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return T});var J=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(J),N=B("./src/loader/playlist-loader.ts"),$=B("./src/loader/key-loader.ts"),z=B("./src/controller/id3-track-controller.ts"),r=B("./src/controller/latency-controller.ts"),D=B("./src/controller/level-controller.ts"),p=B("./src/controller/fragment-tracker.ts"),g=B("./src/controller/stream-controller.ts"),m=B("./src/is-supported.ts"),a=B("./src/utils/logger.ts"),d=B("./src/config.ts"),s=B("./node_modules/eventemitter3/index.js"),i=B.n(s),t=B("./src/events.ts"),u=B("./src/errors.ts");function o(S,A){for(var P=0;P<A.length;P++){var E=A[P];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function R(S,A,P){return A&&o(S.prototype,A),P&&o(S,P),S}var T=function(){S.isSupported=function(){return Object(m.isSupported)()};function S(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 E=this.config=Object(d.mergeConfig)(S.DefaultConfig,P);this.userConfig=P,Object(a.enableLogs)(E.debug),this._autoLevelCapping=-1,E.progressive&&Object(d.enableStreamingMode)(E);var b=E.abrController,h=E.bufferController,f=E.capLevelController,C=E.fpsController,x=this.abrController=new b(this),_=this.bufferController=new h(this),j=this.capLevelController=new f(this),W=new C(this),w=new N.default(this),F=new $.default(this),I=new z.default(this),v=this.levelController=new D.default(this),H=new p.FragmentTracker(this),Y=this.streamController=new g.default(this,H);j.setStreamController(Y),W.setStreamController(Y);var ie=[v,Y];this.networkControllers=ie;var le=[w,F,x,_,j,W,I,H];this.audioTrackController=this.createController(E.audioTrackController,null,ie),this.createController(E.audioStreamController,H,ie),this.subtitleTrackController=this.createController(E.subtitleTrackController,null,ie),this.createController(E.subtitleStreamController,H,ie),this.createController(E.timelineController,null,le),this.emeController=this.createController(E.emeController,null,le),this.cmcdController=this.createController(E.cmcdController,null,le),this.latencyController=this.createController(r.default,null,le),this.coreComponents=le}var A=S.prototype;return A.createController=function(E,b,h){if(E){var f=b?new E(this,b):new E(this);return h&&h.push(f),f}return null},A.on=function(E,b,h){h===void 0&&(h=this),this._emitter.on(E,b,h)},A.once=function(E,b,h){h===void 0&&(h=this),this._emitter.once(E,b,h)},A.removeAllListeners=function(E){this._emitter.removeAllListeners(E)},A.off=function(E,b,h,f){h===void 0&&(h=this),this._emitter.off(E,b,h,f)},A.listeners=function(E){return this._emitter.listeners(E)},A.emit=function(E,b,h){return this._emitter.emit(E,b,h)},A.trigger=function(E,b){if(this.config.debug)return this.emit(E,E,b);try{return this.emit(E,E,b)}catch(h){a.logger.error("An internal error happened while handling event "+E+'. 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:E,error:h})}return!1},A.listenerCount=function(E){return this._emitter.listenerCount(E)},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(E){return E.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(E){return E.destroy()}),this.coreComponents.length=0},A.attachMedia=function(E){a.logger.log("attachMedia"),this._media=E,this.trigger(t.Events.MEDIA_ATTACHING,{media:E})},A.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(E){this.stopLoad();var b=this.media,h=this.url,f=this.url=J.buildAbsoluteURL(self.location.href,E,{alwaysNormalize:!0});a.logger.log("loadSource:"+f),b&&h&&h!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(t.Events.MANIFEST_LOADING,{url:E})},A.startLoad=function(E){E===void 0&&(E=-1),a.logger.log("startLoad("+E+")"),this.networkControllers.forEach(function(b){b.startLoad(E)})},A.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(E){E.stopLoad()})},A.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){a.logger.log("recoverMediaError");var E=this._media;this.detachMedia(),E&&this.attachMedia(E)},A.removeLevel=function(E,b){b===void 0&&(b=0),this.levelController.removeLevel(E,b)},R(S,[{key:"levels",get:function(){var E=this.levelController.levels;return E||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(E){a.logger.log("set currentLevel:"+E),this.loadLevel=E,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(E){a.logger.log("set nextLevel:"+E),this.levelController.manualLevel=E,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(E){a.logger.log("set loadLevel:"+E),this.levelController.manualLevel=E}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(E){this.levelController.nextLoadLevel=E}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(E){a.logger.log("set firstLevel:"+E),this.levelController.firstLevel=E}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(E){a.logger.log("set startLevel:"+E),E!==-1&&(E=Math.max(E,this.minAutoLevel)),this.levelController.startLevel=E}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(E){var b=!!E;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(E){this._autoLevelCapping!==E&&(a.logger.log("set autoLevelCapping:"+E),this._autoLevelCapping=E)}},{key:"bandwidthEstimate",get:function(){var E=this.abrController.bwEstimator;return E?E.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var E=this.levels,b=this.config.minAutoBitrate;if(!E)return 0;for(var h=E.length,f=0;f<h;f++)if(E[f].maxBitrate>b)return f;return 0}},{key:"maxAutoLevel",get:function(){var E=this.levels,b=this.autoLevelCapping,h;return b===-1&&E&&E.length?h=E.length-1:h=b,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(E){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,E)}},{key:"audioTracks",get:function(){var E=this.audioTrackController;return E?E.audioTracks:[]}},{key:"audioTrack",get:function(){var E=this.audioTrackController;return E?E.audioTrack:-1},set:function(E){var b=this.audioTrackController;b&&(b.audioTrack=E)}},{key:"subtitleTracks",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTrack:-1},set:function(E){var b=this.subtitleTrackController;b&&(b.subtitleTrack=E)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var E=this.subtitleTrackController;return E?E.subtitleDisplay:!1},set:function(E){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=E)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(E){this.config.lowLatencyMode=E}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return t.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:d.hlsDefaultConfig},set:function(E){S.defaultConfig=E}}]),S}();T.defaultConfig=void 0},"./src/is-supported.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isSupported",function(){return N}),B.d(Q,"changeTypeSupported",function(){return $});var J=B("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function N(){var z=Object(J.getMediaSource)();if(!z)return!1;var r=K(),D=z&&typeof z.isTypeSupported=="function"&&z.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!D&&!!p}function $(){var z,r=K();return typeof(r==null||((z=r.prototype)===null||z===void 0)?void 0:z.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a}),B.d(Q,"LoadError",function(){return s});var J=B("./src/polyfills/number.ts"),K=B("./src/errors.ts");function N(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,p(i,t)}function $(i){var t=typeof Map=="function"?new Map:void 0;return $=function(o){if(o===null||!D(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(o))return t.get(o);t.set(o,R)}function R(){return z(o,arguments,g(this).constructor)}return R.prototype=Object.create(o.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),p(R,o)},$(i)}function z(i,t,u){return r()?z=Reflect.construct:z=function(R,T,S){var A=[null];A.push.apply(A,T);var P=Function.bind.apply(R,A),E=new P;return S&&p(E,S.prototype),E},z.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function p(i,t){return p=Object.setPrototypeOf||function(o,R){return o.__proto__=R,o},p(i,t)}function g(i){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},g(i)}var m=Math.pow(2,17),a=function(){function i(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var t=i.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(o,R){var T=this,S=o.url;if(!S)return Promise.reject(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var A=this.config,P=A.fLoader,E=A.loader;return new Promise(function(b,h){T.loader&&T.loader.destroy();var f=T.loader=o.loader=P?new P(A):new E(A),C=d(o),x={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:m};o.stats=f.stats,f.load(C,x,{onSuccess:function(j,W,w,F){T.resetLoader(o,f),b({frag:o,part:null,payload:j.data,networkDetails:F})},onError:function(j,W,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:j,networkDetails:w}))},onAbort:function(j,W,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:w}))},onTimeout:function(j,W,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:w}))},onProgress:function(j,W,w,F){R&&R({frag:o,part:null,payload:w,networkDetails:F})}})})},t.loadPart=function(o,R,T){var S=this;this.abort();var A=this.config,P=A.fLoader,E=A.loader;return new Promise(function(b,h){S.loader&&S.loader.destroy();var f=S.loader=o.loader=P?new P(A):new E(A),C=d(o,R),x={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:m};R.stats=f.stats,f.load(C,x,{onSuccess:function(j,W,w,F){S.resetLoader(o,f),S.updateStatsFromPart(o,R);var I={frag:o,part:R,payload:j.data,networkDetails:F};T(I),b(I)},onError:function(j,W,w){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:R,response:j,networkDetails:w}))},onAbort:function(j,W,w){o.stats.aborted=R.stats.aborted,S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:R,networkDetails:w}))},onTimeout:function(j,W,w){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:R,networkDetails:w}))}})})},t.updateStatsFromPart=function(o,R){var T=o.stats,S=R.stats,A=S.total;if(T.loaded+=S.loaded,A){var P=Math.round(o.duration/R.duration),E=Math.min(Math.round(T.loaded/A),P),b=P-E,h=b*Math.round(T.loaded/E);T.total=T.loaded+h}else T.total=Math.max(T.loaded,T.total);var f=T.loading,C=S.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},t.resetLoader=function(o,R){o.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},i}();function d(i,t){t===void 0&&(t=null);var u=t||i,o={frag:i,part:t,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,T=u.byteRangeEndOffset;return Object(J.isFiniteNumber)(R)&&Object(J.isFiniteNumber)(T)&&(o.rangeStart=R,o.rangeEnd=T),o}var s=function(i){N(t,i);function t(u){for(var o,R=arguments.length,T=new Array(R>1?R-1:0),S=1;S<R;S++)T[S-1]=arguments[S];return o=i.call.apply(i,[this].concat(T))||this,o.data=void 0,o.data=u,o}return t}($(Error))},"./src/loader/fragment.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ElementaryStreamTypes",function(){return a}),B.d(Q,"BaseSegment",function(){return d}),B.d(Q,"Fragment",function(){return s}),B.d(Q,"Part",function(){return i});var J=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),N=B.n(K),$=B("./src/utils/logger.ts"),z=B("./src/loader/level-key.ts"),r=B("./src/loader/load-stats.ts");function D(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,p(t,u)}function p(t,u){return p=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},p(t,u)}function g(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function m(t,u,o){return u&&g(t.prototype,u),o&&g(t,o),t}var a;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(a||(a={}));var d=function(){function t(o){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[a.AUDIO]=null,R[a.VIDEO]=null,R[a.AUDIOVIDEO]=null,R),this.baseurl=o}var u=t.prototype;return u.setByteRange=function(R,T){var S=R.split("@",2),A=[];S.length===1?A[0]=T?T.byteRangeEndOffset:0:A[0]=parseInt(S[1]),A[1]=parseInt(S[0])+A[0],this._byteRange=A},m(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(K.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),t}(),s=function(t){D(u,t);function u(R,T){var S;return S=t.call(this,T)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new r.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=R,S}var o=u.prototype;return o.createInitializationVector=function(T){for(var S=new Uint8Array(16),A=12;A<16;A++)S[A]=T>>8*(15-A)&255;return S},o.setDecryptDataFromLevelKey=function(T,S){var A=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(A=z.LevelKey.fromURI(T.uri),A.method=T.method,A.iv=this.createInitializationVector(S),A.keyFormat="identity"),A},o.setElementaryStreamInfo=function(T,S,A,P,E,b){b===void 0&&(b=!1);var h=this.elementaryStreams,f=h[T];if(!f){h[T]={startPTS:S,endPTS:A,startDTS:P,endDTS:E,partial:b};return}f.startPTS=Math.min(f.startPTS,S),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,P),f.endDTS=Math.max(f.endDTS,E)},o.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[a.AUDIO]=null,T[a.VIDEO]=null,T[a.AUDIOVIDEO]=null},m(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&$.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(J.isFiniteNumber)(this.programDateTime))return null;var T=Object(J.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),u}(d),i=function(t){D(u,t);function u(o,R,T,S,A){var P;P=t.call(this,T)||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=R,P.index=S;var E=o.enumeratedString("BYTERANGE");return E&&P.setByteRange(E,A),A&&(P.fragOffset=A.fragOffset+A.duration),P}return m(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(d)},"./src/loader/key-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return $});var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/utils/logger.ts"),$=function(){function z(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var r=z.prototype;return r._registerListeners=function(){this.hls.on(J.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(J.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var g=this.loaders[p];g&&g.destroy()}this.loaders={}},r.onKeyLoading=function(p,g){var m=g.frag,a=m.type,d=this.loaders[a];if(!m.decryptdata){N.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=m.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(d&&(N.logger.warn("abort previous key loader for type:"+a),d.abort()),!s){N.logger.warn("key uri is falsy");return}var t=i.loader,u=m.loader=this.loaders[a]=new t(i);this.decrypturl=s,this.decryptkey=null;var o={url:s,frag:m,responseType:"arraybuffer"},R={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(o,R,T)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(J.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(p,g,m){var a=m.frag;if(!a.decryptdata){N.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(p.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(J.Events.KEY_LOADED,{frag:a})},r.loaderror=function(p,g){var m=g.frag,a=m.loader;a&&a.abort(),delete this.loaders[m.type],this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:p})},r.loadtimeout=function(p,g){var m=g.frag,a=m.loader;a&&a.abort(),delete this.loaders[m.type],this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},z}()},"./src/loader/level-details.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LevelDetails",function(){return z});var J=B("./src/polyfills/number.ts");function K(r,D){for(var p=0;p<D.length;p++){var g=D[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function N(r,D,p){return D&&K(r.prototype,D),p&&K(r,p),r}var $=10,z=function(){function r(p){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=p}var D=r.prototype;return D.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-g.lastPartSn,a=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!a||!!m,this.advanced=this.endSN>g.endSN||m>0||m===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},N(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(J.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||$}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var m=this.driftEnd-this.driftStart;return m*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LevelKey",function(){return z});var J=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(J);function N(r,D){for(var p=0;p<D.length;p++){var g=D[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function $(r,D,p){return D&&N(r.prototype,D),p&&N(r,p),r}var z=function(){r.fromURL=function(p,g){return new r(p,g)},r.fromURI=function(p){return new r(p)};function r(D,p){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,p?this._uri=Object(J.buildAbsoluteURL)(D,p,{alwaysNormalize:!0}):this._uri=D}return $(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LoadStats",function(){return J});var J=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u});var J=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),N=B.n(K),$=B("./src/loader/fragment.ts"),z=B("./src/loader/level-details.ts"),r=B("./src/loader/level-key.ts"),D=B("./src/utils/attr-list.ts"),p=B("./src/utils/logger.ts"),g=B("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,d=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,E;return i.test((P=(E=K.parseURL(A))===null||E===void 0?void 0:E.path)!=null?P:"")}var u=function(){function A(){}return A.findGroup=function(E,b){for(var h=0;h<E.length;h++){var f=E[h];if(f.id===b)return f}},A.convertAVC1ToAVCOTI=function(E){var b=E.split(".");if(b.length>2){var h=b.shift()+".";return h+=parseInt(b.shift()).toString(16),h+=("000"+parseInt(b.shift()).toString(16)).substr(-4),h}return E},A.resolve=function(E,b){return K.buildAbsoluteURL(b,E,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(E,b){var h=[],f={},C=!1;m.lastIndex=0;for(var x;(x=m.exec(E))!=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],b)},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 w=new D.AttrList(x[3]);w["DATA-ID"]&&(C=!0,f[w["DATA-ID"]]=w)}return{levels:h,sessionData:C?f:null}},A.parseMasterPlaylistMedia=function(E,b,h,f){f===void 0&&(f=[]);var C,x=[],_=0;for(a.lastIndex=0;(C=a.exec(E))!==null;){var j=new D.AttrList(C[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,b):""};if(f.length){var w=A.findGroup(f,W.groupId)||f[0];R(W,w,"audioCodec"),R(W,w,"textCodec")}x.push(W)}}return x},A.parseLevelPlaylist=function(E,b,h,f,C){var x=new z.LevelDetails(b),_=x.fragments,j=null,W=0,w=0,F=0,I=0,v=null,H=new $.Fragment(f,b),Y,ie,le,he=-1,we=!1;for(d.lastIndex=0,x.m3u8=E;(Y=d.exec(E))!==null;){we&&(we=!1,H=new $.Fragment(f,b),H.start=F,H.sn=W,H.cc=I,H.level=h,j&&(H.initSegment=j,H.rawProgramDateTime=j.rawProgramDateTime));var Pe=Y[1];if(Pe){H.duration=parseFloat(Pe);var xe=(" "+Y[2]).slice(1);H.title=xe||null,H.tagList.push(xe?["INF",Pe,xe]:["INF",Pe])}else if(Y[3])Object(J.isFiniteNumber)(H.duration)&&(H.start=F,le&&(H.levelkey=le),H.sn=W,H.level=h,H.cc=I,H.urlId=C,_.push(H),H.relurl=(" "+Y[3]).slice(1),S(H,v),v=H,F+=H.duration,W++,w=0,we=!0);else if(Y[4]){var Oe=(" "+Y[4]).slice(1);v?H.setByteRange(Oe,v):H.setByteRange(Oe)}else if(Y[5])H.rawProgramDateTime=(" "+Y[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),he===-1&&(he=_.length);else{if(Y=Y[0].match(s),!Y){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<Y.length&&!(typeof Y[ie]!="undefined");ie++);var pe=(" "+Y[ie]).slice(1),be=(" "+Y[ie+1]).slice(1),ne=Y[ie+2]?(" "+Y[ie+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":x.type=be.toUpperCase();break;case"MEDIA-SEQUENCE":W=x.startSN=parseInt(be);break;case"SKIP":{var fe=new D.AttrList(be),_e=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(J.isFiniteNumber)(_e)){x.skippedSegments=_e;for(var ke=_e;ke--;)_.unshift(null);W+=_e}var qe=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");qe&&(x.recentlyRemovedDateranges=qe.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(be);break;case"VERSION":x.version=parseInt(be);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(be||ne)&&H.tagList.push(ne?[be,ne]:[be]);break;case"DIS":I++;case"GAP":H.tagList.push([pe]);break;case"BITRATE":H.tagList.push([pe,be]);break;case"DISCONTINUITY-SEQ":I=parseInt(be);break;case"KEY":{var je,st=new D.AttrList(be),vt=st.enumeratedString("METHOD"),Re=st.URI,Be=st.hexadecimalInteger("IV"),Ye=st.enumeratedString("KEYFORMATVERSIONS"),Ke=st.enumeratedString("KEYID"),yt=(je=st.enumeratedString("KEYFORMAT"))!=null?je:"identity",Pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Pt.indexOf(yt)>-1){p.logger.warn("Keyformat "+yt+" is not supported from the manifest");continue}else if(yt!=="identity")continue;vt&&(le=r.LevelKey.fromURL(b,Re),Re&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(vt)>=0&&(le.method=vt,le.keyFormat=yt,Ke&&(le.keyID=Ke),Ye&&(le.keyFormatVersions=Ye),le.iv=Be));break}case"START":{var Ht=new D.AttrList(be),Xt=Ht.decimalFloatingPoint("TIME-OFFSET");Object(J.isFiniteNumber)(Xt)&&(x.startTimeOffset=Xt);break}case"MAP":{var an=new D.AttrList(be);H.relurl=an.URI,an.BYTERANGE&&H.setByteRange(an.BYTERANGE),H.level=h,H.sn="initSegment",le&&(H.levelkey=le),H.initSegment=null,j=H,we=!0;break}case"SERVER-CONTROL":{var tn=new D.AttrList(be);x.canBlockReload=tn.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=tn.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&tn.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=tn.optionalFloat("PART-HOLD-BACK",0),x.holdBack=tn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new D.AttrList(be);x.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ze=x.partList;Ze||(Ze=x.partList=[]);var Ct=w>0?Ze[Ze.length-1]:void 0,At=w++,dt=new $.Part(new D.AttrList(be),H,b,At,Ct);Ze.push(dt),H.duration+=dt.duration;break}case"PRELOAD-HINT":{var ft=new D.AttrList(be);x.preloadHint=ft;break}case"RENDITION-REPORT":{var He=new D.AttrList(be);x.renditionReports=x.renditionReports||[],x.renditionReports.push(He);break}default:p.logger.warn("line parsed but not handled: "+Y);break}}}v&&!v.relurl?(_.pop(),F-=v.duration,x.partList&&(x.fragmentHint=v)):x.partList&&(S(H,v),H.cc=I,x.fragmentHint=H);var Ne=_.length,Ue=_[0],ge=_[Ne-1];if(F+=x.skippedSegments*x.targetduration,F>0&&Ne&&ge){x.averagetargetduration=F/Ne;var Ee=ge.sn;x.endSN=Ee!=="initSegment"?Ee:0,Ue&&(x.startCC=Ue.cc,Ue.initSegment||x.fragments.every(function(De){return De.relurl&&t(De.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new $.Fragment(f,b),H.relurl=ge.relurl,H.level=h,H.sn="initSegment",Ue.initSegment=H,x.needSidxRanges=!0))}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(F+=x.fragmentHint.duration),x.totalduration=F,x.endCC=I,he>0&&T(_,he),x},A}();function o(A,P){["video","audio","text"].forEach(function(E){var b=A.filter(function(f){return Object(g.isCodecType)(f,E)});if(b.length){var h=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});P[E+"Codec"]=h.length>0?h[0]:b[0],A=A.filter(function(f){return b.indexOf(f)===-1})}}),P.unknownCodecs=A}function R(A,P,E){var b=P[E];b&&(A[E]=b)}function T(A,P){for(var E=A[P],b=P;b--;){var h=A[b];if(!h)return;h.programDateTime=E.programDateTime-h.duration*1e3,E=h}}function S(A,P){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):P!=null&&P.programDateTime&&(A.programDateTime=P.endProgramDateTime),Object(J.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/errors.ts"),$=B("./src/utils/logger.ts"),z=B("./src/utils/mp4-tools.ts"),r=B("./src/loader/m3u8-parser.ts"),D=B("./src/types/loader.ts"),p=B("./src/utils/attr-list.ts");function g(d){var s=d.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 m(d,s){var i=d.url;return(i===void 0||i.indexOf("data:")===0)&&(i=s.url),i}var a=function(){function d(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var s=d.prototype;return s.registerListeners=function(){var t=this.hls;t.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var t=this.hls;t.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(t){var u=this.hls.config,o=u.pLoader,R=u.loader,T=o||R,S=new T(u);return t.loader=S,this.loaders[t.type]=S,S},s.getInternalLoader=function(t){return this.loaders[t.type]},s.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},s.destroyInternalLoaders=function(){for(var t in this.loaders){var u=this.loaders[t];u&&u.destroy(),this.resetInternalLoader(t)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(t,u){var o=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},s.onLevelLoading=function(t,u){var o=u.id,R=u.level,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:T,deliveryDirectives:S})},s.onAudioTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:S})},s.onSubtitleTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:S})},s.load=function(t){var u,o=this.hls.config,R=this.getInternalLoader(t);if(R){var T=R.context;if(T&&T.url===t.url){$.logger.trace("[playlist-loader]: playlist request ongoing");return}$.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),R.abort()}var S,A,P,E;switch(t.type){case D.PlaylistContextType.MANIFEST:S=o.manifestLoadingMaxRetry,A=o.manifestLoadingTimeOut,P=o.manifestLoadingRetryDelay,E=o.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,A=o.levelLoadingTimeOut;break;default:S=o.levelLoadingMaxRetry,A=o.levelLoadingTimeOut,P=o.levelLoadingRetryDelay,E=o.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(t),(u=t.deliveryDirectives)!==null&&u!==void 0&&u.part){var b;if(t.type===D.PlaylistContextType.LEVEL&&t.level!==null?b=this.hls.levels[t.level].details:t.type===D.PlaylistContextType.AUDIO_TRACK&&t.id!==null?b=this.hls.audioTracks[t.id].details:t.type===D.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(b=this.hls.subtitleTracks[t.id].details),b){var h=b.partTarget,f=b.targetduration;h&&f&&(A=Math.min(Math.max(h*3,f*.8)*1e3,A))}}var C={timeout:A,maxRetry:S,retryDelay:P,maxRetryDelay:E,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(t,C,x)},s.loadsuccess=function(t,u,o,R){if(R===void 0&&(R=null),o.isSidxRequest){this.handleSidxRequest(t,o),this.handlePlaylistLoaded(t,u,o,R);return}this.resetInternalLoader(o.type);var T=t.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,o,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,u,o,R):this.handleMasterPlaylist(t,u,o,R)},s.loaderror=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!1,t)},s.loadtimeout=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!0)},s.handleMasterPlaylist=function(t,u,o,R){var T=this.hls,S=t.data,A=m(t,o),P=r.default.parseMasterPlaylist(S,A),E=P.levels,b=P.sessionData;if(!E.length){this.handleManifestParsingError(t,o,"no level found in manifest",R);return}var h=E.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),f=E.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=r.default.parseMasterPlaylistMedia(S,A,"AUDIO",h),x=r.default.parseMasterPlaylistMedia(S,A,"SUBTITLES",f),_=r.default.parseMasterPlaylistMedia(S,A,"CLOSED-CAPTIONS");if(C.length){var j=C.some(function(W){return!W.url});!j&&E[0].audioCodec&&!E[0].attrs.AUDIO&&($.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}T.trigger(K.Events.MANIFEST_LOADED,{levels:E,audioTracks:C,subtitles:x,captions:_,url:A,stats:u,networkDetails:R,sessionData:b})},s.handleTrackOrLevelPlaylist=function(t,u,o,R){var T=this.hls,S=o.id,A=o.level,P=o.type,E=m(t,o),b=Object(J.isFiniteNumber)(S)?S:0,h=Object(J.isFiniteNumber)(A)?A:b,f=g(o),C=r.default.parseLevelPlaylist(t.data,E,h,f,b);if(!C.fragments.length){T.trigger(K.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:E,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 p.AttrList({}),bitrate:0,details:C,name:"",url:E};T.trigger(K.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:E,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),C.needSidxRanges){var _,j=(_=C.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:j,isSidxRequest:!0,type:P,level:A,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=C,this.handlePlaylistLoaded(t,u,o,R)},s.handleSidxRequest=function(t,u){var o=Object(z.parseSegmentIndex)(new Uint8Array(t.data));if(!o)return;var R=o.references,T=u.levelDetails;R.forEach(function(S,A){var P=S.info,E=T.fragments[A];E.byteRange.length===0&&E.setByteRange(String(1+P.end-P.start)+"@"+String(P.start)),E.initSegment&&E.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(t,u,o,R){this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===D.PlaylistContextType.MANIFEST,url:t.url,reason:o,response:t,context:u,networkDetails:R})},s.handleNetworkError=function(t,u,o,R){o===void 0&&(o=!1),$.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var T=N.ErrorDetails.UNKNOWN,S=!1,A=this.getInternalLoader(t);switch(t.type){case D.PlaylistContextType.MANIFEST:T=o?N.ErrorDetails.MANIFEST_LOAD_TIMEOUT:N.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:T=o?N.ErrorDetails.LEVEL_LOAD_TIMEOUT:N.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:T=o?N.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:T=o?N.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:N.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}A&&this.resetInternalLoader(t.type);var P={type:N.ErrorTypes.NETWORK_ERROR,details:T,fatal:S,url:t.url,loader:A,context:t,networkDetails:u};R&&(P.response=R),this.hls.trigger(K.Events.ERROR,P)},s.handlePlaylistLoaded=function(t,u,o,R){var T=o.type,S=o.level,A=o.id,P=o.groupId,E=o.loader,b=o.levelDetails,h=o.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(t,o,"invalid target duration",R);return}if(!E)return;b.live&&(E.getCacheAge&&(b.ageHeader=E.getCacheAge()||0),(!E.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(T){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:b,level:S||0,id:A||0,stats:u,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:b,id:A||0,groupId:P||"",stats:u,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:b,id:A||0,groupId:P||"",stats:u,networkDetails:R,deliveryDirectives:h});break}},d}();Q.default=a},"./src/polyfills/number.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isFiniteNumber",function(){return J}),B.d(Q,"MAX_SAFE_INTEGER",function(){return K});var J=Number.isFinite||function(N){return typeof N=="number"&&isFinite(N)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Q,B){"use strict";B.r(Q);var J=function(){function K(){}return K.getSilentFrame=function($,z){switch($){case"mp4a.40.2":if(z===1)return new Uint8Array([0,200,0,128,35,128]);if(z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(z===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(z===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(z===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(z===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(z===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},K}();Q.default=J},"./src/remux/mp4-generator.ts":function(te,Q,B){"use strict";B.r(Q);var J=Math.pow(2,32)-1,K=function(){function N(){}return N.init=function(){N.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var z;for(z in N.types)N.types.hasOwnProperty(z)&&(N.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);N.HDLR_TYPES={video:r,audio:D};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);N.STTS=N.STSC=N.STCO=g,N.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),N.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),N.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);N.FTYP=N.box(N.types.ftyp,m,d,m,a),N.DINF=N.box(N.types.dinf,N.box(N.types.dref,p))},N.box=function(z){for(var r=8,D=arguments.length,p=new Array(D>1?D-1:0),g=1;g<D;g++)p[g-1]=arguments[g];for(var m=p.length,a=m;m--;)r+=p[m].byteLength;var d=new Uint8Array(r);for(d[0]=r>>24&255,d[1]=r>>16&255,d[2]=r>>8&255,d[3]=r&255,d.set(z,4),m=0,r=8;m<a;m++)d.set(p[m],r),r+=p[m].byteLength;return d},N.hdlr=function(z){return N.box(N.types.hdlr,N.HDLR_TYPES[z])},N.mdat=function(z){return N.box(N.types.mdat,z)},N.mdhd=function(z,r){r*=z;var D=Math.floor(r/(J+1)),p=Math.floor(r%(J+1));return N.box(N.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,z>>24&255,z>>16&255,z>>8&255,z&255,D>>24,D>>16&255,D>>8&255,D&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},N.mdia=function(z){return N.box(N.types.mdia,N.mdhd(z.timescale,z.duration),N.hdlr(z.type),N.minf(z))},N.mfhd=function(z){return N.box(N.types.mfhd,new Uint8Array([0,0,0,0,z>>24,z>>16&255,z>>8&255,z&255]))},N.minf=function(z){return z.type==="audio"?N.box(N.types.minf,N.box(N.types.smhd,N.SMHD),N.DINF,N.stbl(z)):N.box(N.types.minf,N.box(N.types.vmhd,N.VMHD),N.DINF,N.stbl(z))},N.moof=function(z,r,D){return N.box(N.types.moof,N.mfhd(z),N.traf(D,r))},N.moov=function(z){for(var r=z.length,D=[];r--;)D[r]=N.trak(z[r]);return N.box.apply(null,[N.types.moov,N.mvhd(z[0].timescale,z[0].duration)].concat(D).concat(N.mvex(z)))},N.mvex=function(z){for(var r=z.length,D=[];r--;)D[r]=N.trex(z[r]);return N.box.apply(null,[N.types.mvex].concat(D))},N.mvhd=function(z,r){r*=z;var D=Math.floor(r/(J+1)),p=Math.floor(r%(J+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,z>>24&255,z>>16&255,z>>8&255,z&255,D>>24,D>>16&255,D>>8&255,D&255,p>>24,p>>16&255,p>>8&255,p&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return N.box(N.types.mvhd,g)},N.sdtp=function(z){var r=z.samples||[],D=new Uint8Array(4+r.length),p,g;for(p=0;p<r.length;p++)g=r[p].flags,D[p+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return N.box(N.types.sdtp,D)},N.stbl=function(z){return N.box(N.types.stbl,N.stsd(z),N.box(N.types.stts,N.STTS),N.box(N.types.stsc,N.STSC),N.box(N.types.stsz,N.STSZ),N.box(N.types.stco,N.STCO))},N.avc1=function(z){var r=[],D=[],p,g,m;for(p=0;p<z.sps.length;p++)g=z.sps[p],m=g.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(g));for(p=0;p<z.pps.length;p++)g=z.pps[p],m=g.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(g));var a=N.box(N.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|z.sps.length].concat(r).concat([z.pps.length]).concat(D))),d=z.width,s=z.height,i=z.pixelRatio[0],t=z.pixelRatio[1];return N.box(N.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,d&255,s>>8&255,s&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,N.box(N.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),N.box(N.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},N.esds=function(z){var r=z.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(z.config).concat([6,1,2]))},N.mp4a=function(z){var r=z.samplerate;return N.box(N.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),N.box(N.types.esds,N.esds(z)))},N.mp3=function(z){var r=z.samplerate;return N.box(N.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},N.stsd=function(z){return z.type==="audio"?!z.isAAC&&z.codec==="mp3"?N.box(N.types.stsd,N.STSD,N.mp3(z)):N.box(N.types.stsd,N.STSD,N.mp4a(z)):N.box(N.types.stsd,N.STSD,N.avc1(z))},N.tkhd=function(z){var r=z.id,D=z.duration*z.timescale,p=z.width,g=z.height,m=Math.floor(D/(J+1)),a=Math.floor(D%(J+1));return N.box(N.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&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,p>>8&255,p&255,0,0,g>>8&255,g&255,0,0]))},N.traf=function(z,r){var D=N.sdtp(z),p=z.id,g=Math.floor(r/(J+1)),m=Math.floor(r%(J+1));return N.box(N.types.traf,N.box(N.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),N.box(N.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,m>>24,m>>16&255,m>>8&255,m&255])),N.trun(z,D.length+16+20+8+16+8+8),D)},N.trak=function(z){return z.duration=z.duration||4294967295,N.box(N.types.trak,N.tkhd(z),N.mdia(z))},N.trex=function(z){var r=z.id;return N.box(N.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},N.trun=function(z,r){var D=z.samples||[],p=D.length,g=12+16*p,m=new Uint8Array(g),a,d,s,i,t,u;for(r+=8+g,m.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),a=0;a<p;a++)d=D[a],s=d.duration,i=d.size,t=d.flags,u=d.cts,m.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*a);return N.box(N.types.trun,m)},N.initSegment=function(z){N.types||N.init();var r=N.moov(z),D=new Uint8Array(N.FTYP.byteLength+r.byteLength);return D.set(N.FTYP),D.set(r,N.FTYP.byteLength),D},N}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0,Q.default=K},"./src/remux/mp4-remuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"normalizePts",function(){return o});var J=B("./src/polyfills/number.ts"),K=B("./src/remux/aac-helper.ts"),N=B("./src/remux/mp4-generator.ts"),$=B("./src/events.ts"),z=B("./src/errors.ts"),r=B("./src/utils/logger.ts"),D=B("./src/types/loader.ts"),p=B("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(A){for(var P=1;P<arguments.length;P++){var E=arguments[P];for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(A[b]=E[b])}return A},g.apply(this,arguments)}var m=10*1e3,a=1024,d=1152,s=null,i=null,t=!1,u=function(){function A(E,b,h,f){if(f===void 0&&(f=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=E,this.config=b,this.typeSupported=h,this.ISGenerated=!1,s===null){var C=navigator.userAgent||"",x=C.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(b){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},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(b){var h=!1,f=b.reduce(function(C,x){var _=x.pts-C;return _<-4294967296?(h=!0,o(C,x.pts)):_>0?C:x.pts},b[0].pts);return h&&r.logger.debug("PTS rollover detected"),f},P.remux=function(b,h,f,C,x,_,j,W){var w,F,I,v,H,Y,ie=x,le=x,he=b.pid>-1,we=h.pid>-1,Pe=h.samples.length,xe=b.samples.length>0,Oe=Pe>1,pe=(!he||xe)&&(!we||Oe)||this.ISGenerated||j;if(pe){this.ISGenerated||(I=this.generateIS(b,h,x));var be=this.isVideoContiguous,ne=-1;if(Oe&&(ne=R(h.samples),!be&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,ne>0){r.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Pe+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(ne),h.dropped+=ne,le+=(h.samples[0].pts-fe)/(h.timescale||9e4)}else ne===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Pe+" video samples"),Y=!1);if(this.ISGenerated){if(xe&&Oe){var _e=this.getVideoStartPts(h.samples),ke=o(b.samples[0].pts,_e)-_e,qe=ke/h.inputTimeScale;ie+=Math.max(0,qe),le+=Math.max(0,-qe)}if(xe){if(b.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(b,h,x)),F=this.remuxAudio(b,ie,this.isAudioContiguous,_,we||Oe||W===D.PlaylistLevelType.AUDIO?le:void 0),Oe){var je=F?F.endPTS-F.startPTS:0;h.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(b,h,x)),w=this.remuxVideo(h,le,be,je)}}else Oe&&(w=this.remuxVideo(h,le,be,0));w&&(w.firstKeyFrame=ne,w.independent=ne!==-1)}}return this.ISGenerated&&(f.samples.length&&(H=this.remuxID3(f,x)),C.samples.length&&(v=this.remuxText(C,x))),{audio:F,video:w,initSegment:I,independent:Y,text:v,id3:H}},P.generateIS=function(b,h,f){var C=b.samples,x=h.samples,_=this.typeSupported,j={},W=!Object(J.isFiniteNumber)(this._initPTS),w="audio/mp4",F,I,v;if(W&&(F=I=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(_.mpeg?(w="audio/mpeg",b.codec=""):_.mp3&&(b.codec="mp3")),j.audio={id:"audio",container:w,codec:b.codec,initSegment:!b.isAAC&&_.mpeg?new Uint8Array(0):N.default.initSegment([b]),metadata:{channelCount:b.channelCount}},W&&(v=b.inputTimeScale,F=I=C[0].pts-Math.round(v*f))),h.sps&&h.pps&&x.length&&(h.timescale=h.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:N.default.initSegment([h]),metadata:{width:h.width,height:h.height}},W)){v=h.inputTimeScale;var H=this.getVideoStartPts(x),Y=Math.round(v*f);I=Math.min(I,o(x[0].dts,H)-Y),F=Math.min(F,H-Y)}if(Object.keys(j).length)return this.ISGenerated=!0,W&&(this._initPTS=F,this._initDTS=I),{tracks:j,initPTS:F,timescale:v}},P.remuxVideo=function(b,h,f,C){var x=b.inputTimeScale,_=b.samples,j=[],W=_.length,w=this._initPTS,F=this.nextAvcDts,I=8,v,H,Y,ie=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,he=0,we=!1;if(!f||F===null){var Pe=h*x,xe=_[0].pts-o(_[0].dts,_[0].pts);F=Pe-xe}for(var Oe=0;Oe<W;Oe++){var pe=_[Oe];if(pe.pts=o(pe.pts-w,F),pe.dts=o(pe.dts-w,F),pe.dts>pe.pts){var be=9e4*.2;he=Math.max(Math.min(he,pe.pts-pe.dts),-1*be)}pe.dts<_[Oe>0?Oe-1:Oe].dts&&(we=!0)}we&&_.sort(function($n,vn){var ln=$n.dts-vn.dts,hn=$n.pts-vn.pts;return ln||hn}),H=_[0].dts,Y=_[_.length-1].dts;var ne=Math.round((Y-H)/(W-1));if(he<0){if(he<ne*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(p.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var fe=he,_e=0;_e<W;_e++)_[_e].dts=fe=Math.max(fe,_[_e].pts-ne),_[_e].pts=Math.max(fe,_[_e].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(p.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var ke=0;ke<W;ke++)_[ke].dts=_[ke].dts+he}H=_[0].dts}if(f){var qe=H-F,je=qe>ne,st=qe<-1;if(je||st){je?r.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(qe,!0)+" ms ("+qe+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-qe,!0)+" ms ("+qe+"dts) overlapping between fragments detected"),H=F;var vt=_[0].pts-qe;_[0].dts=H,_[0].pts=vt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(vt,!0)+"/"+Object(p.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(qe,!0)+" ms")}}t&&(H=Math.max(0,H));for(var Re=0,Be=0,Ye=0;Ye<W;Ye++){for(var Ke=_[Ye],yt=Ke.units,Pt=yt.length,Ht=0,Xt=0;Xt<Pt;Xt++)Ht+=yt[Xt].data.length;Be+=Ht,Re+=Pt,Ke.length=Ht,Ke.dts=Math.max(Ke.dts,H),Ke.pts=Math.max(Ke.pts,Ke.dts,0),ie=Math.min(Ke.pts,ie),le=Math.max(Ke.pts,le)}Y=_[W-1].dts;var an=Be+4*Re+8,tn;try{tn=new Uint8Array(an)}catch($n){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:an,reason:"fail allocating video mdat "+an});return}var et=new DataView(tn.buffer);et.setUint32(0,an),tn.set(N.default.types.mdat,4);for(var Ze=0;Ze<W;Ze++){for(var Ct=_[Ze],At=Ct.units,dt=0,ft=0,He=At.length;ft<He;ft++){var Ne=At[ft],Ue=Ne.data,ge=Ne.data.byteLength;et.setUint32(I,ge),I+=4,tn.set(Ue,I),I+=ge,dt+=4+ge}if(Ze<W-1)v=_[Ze+1].dts-Ct.dts;else{var Ee=this.config,De=Ct.dts-_[Ze>0?Ze-1:Ze].dts;if(Ee.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(Ee.maxBufferHole*x),Fe=(C?ie+C*x:this.nextAudioPts)-Ct.pts;Fe>ue?(v=Fe-De,v<0&&(v=De),r.logger.log("[mp4-remuxer]: It is approximately "+Fe/90+" ms to the next segment; using duration "+v/90+" ms for the last video frame.")):v=De}else v=De}var at=Math.round(Ct.pts-Ct.dts);j.push(new T(Ct.key,v,dt,at))}if(j.length&&s&&s<70){var xt=j[0].flags;xt.dependsOn=2,xt.isNonSync=0}console.assert(v!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=Y+v,this.isVideoContiguous=!0;var Gt=N.default.moof(b.sequenceNumber++,H,g({},b,{samples:j})),$t="video",Yt={data1:Gt,data2:tn,startPTS:ie/x,endPTS:(le+v)/x,startDTS:H/x,endDTS:F/x,type:$t,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(tn.length,"MDAT length must not be zero"),Yt},P.remuxAudio=function(b,h,f,C,x){var _=b.inputTimeScale,j=b.samplerate?b.samplerate:_,W=_/j,w=b.isAAC?a:d,F=w*W,I=this._initPTS,v=!b.isAAC&&this.typeSupported.mpeg,H=[],Y=b.samples,ie=v?0:8,le=this.nextAudioPts||-1,he=h*_;if(this.isAudioContiguous=f=f||Y.length&&le>0&&(C&&Math.abs(he-le)<9e3||Math.abs(o(Y[0].pts-I,he)-le)<20*F),Y.forEach(function(Ue){Ue.pts=o(Ue.pts-I,he)}),!f||le<0){if(Y=Y.filter(function(Ue){return Ue.pts>=0}),!Y.length)return;x===0?le=0:C?le=Math.max(0,he):le=Y[0].pts}if(b.isAAC)for(var we=x!==void 0,Pe=this.config.maxAudioFramesDrift,xe=0,Oe=le;xe<Y.length;xe++){var pe=Y[xe],be=pe.pts,ne=be-Oe,fe=Math.abs(1e3*ne/_);if(ne<=-Pe*F&&we)xe===0&&(r.logger.warn("Audio frame @ "+(be/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/_)+" ms."),this.nextAudioPts=le=Oe=be);else if(ne>=Pe*F&&fe<m&&we){var _e=Math.round(ne/F);Oe=be-_e*F,Oe<0&&(_e--,Oe+=F),xe===0&&(this.nextAudioPts=le=Oe),r.logger.warn("[mp4-remuxer]: Injecting "+_e+" audio frame @ "+(Oe/_).toFixed(3)+"s due to "+Math.round(1e3*ne/_)+" ms gap.");for(var ke=0;ke<_e;ke++){var qe=Math.max(Oe,0),je=K.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);je||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),je=pe.unit.subarray()),Y.splice(xe,0,{unit:je,pts:qe}),Oe+=F,xe++}}pe.pts=Oe,Oe+=F}for(var st=null,vt=null,Re,Be=0,Ye=Y.length;Ye--;)Be+=Y[Ye].unit.byteLength;for(var Ke=0,yt=Y.length;Ke<yt;Ke++){var Pt=Y[Ke],Ht=Pt.unit,Xt=Pt.pts;if(vt!==null){var an=H[Ke-1];an.duration=Math.round((Xt-vt)/W)}else if(f&&b.isAAC&&(Xt=le),st=Xt,Be>0){Be+=ie;try{Re=new Uint8Array(Be)}catch(Ue){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Be,reason:"fail allocating audio mdat "+Be});return}if(!v){var tn=new DataView(Re.buffer);tn.setUint32(0,Be),Re.set(N.default.types.mdat,4)}}else return;Re.set(Ht,ie);var et=Ht.byteLength;ie+=et,H.push(new T(!0,w,et,0)),vt=Xt}var Ze=H.length;if(!Ze)return;var Ct=H[H.length-1];this.nextAudioPts=le=vt+W*Ct.duration;var At=v?new Uint8Array(0):N.default.moof(b.sequenceNumber++,st/W,g({},b,{samples:H}));b.samples=[];var dt=st/_,ft=le/_,He="audio",Ne={data1:At,data2:Re,startPTS:dt,endPTS:ft,startDTS:dt,endDTS:ft,type:He,hasAudio:!0,hasVideo:!1,nb:Ze};return this.isAudioContiguous=!0,console.assert(Re.length,"MDAT length must not be zero"),Ne},P.remuxEmptyAudio=function(b,h,f,C){var x=b.inputTimeScale,_=b.samplerate?b.samplerate:x,j=x/_,W=this.nextAudioPts,w=(W!==null?W:C.startDTS*x)+this._initDTS,F=C.endDTS*x+this._initDTS,I=j*a,v=Math.ceil((F-w)/I),H=K.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],ie=0;ie<v;ie++){var le=w+ie*I;Y.push({unit:H,pts:le,dts:le})}return b.samples=Y,this.remuxAudio(b,h,f,!1)},P.remuxID3=function(b,h){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,x=this._initPTS,_=this._initDTS,j=0;j<f;j++){var W=b.samples[j];W.pts=o(W.pts-x,h*C)/C,W.dts=o(W.dts-_,h*C)/C}var w=b.samples;return b.samples=[],{samples:w}},P.remuxText=function(b,h){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,x=this._initPTS,_=0;_<f;_++){var j=b.samples[_];j.pts=o(j.pts-x,h*C)/C}b.samples.sort(function(w,F){return w.pts-F.pts});var W=b.samples;return b.samples=[],{samples:W}},A}();function o(A,P){var E;if(P===null)return A;for(P<A?E=-8589934592:E=8589934592;Math.abs(A-P)>4294967296;)A+=E;return A}function R(A){for(var P=0;P<A.length;P++)if(A[P].key)return P;return-1}var T=function(P,E,b,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=E,this.size=b,this.cts=h,this.flags=new S(P)},S=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(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/utils/mp4-tools.ts"),N=B("./src/loader/fragment.ts"),$=B("./src/utils/logger.ts"),z=function(){function p(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var g=p.prototype;return g.destroy=function(){},g.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(a,d,s){this.audioCodec=d,this.videoCodec=s,this.generateInitSegment(a),this.emitInitSegment=!0},g.generateInitSegment=function(a){var d=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);d||(d=D(i.audio,N.ElementaryStreamTypes.AUDIO)),s||(s=D(i.video,N.ElementaryStreamTypes.VIDEO));var t={};i.audio&&i.video?t.audiovideo={container:"video/mp4",codec:d+","+s,initSegment:a,id:"main"}:i.audio?t.audio={container:"audio/mp4",codec:d,initSegment:a,id:"audio"}:i.video?t.video={container:"video/mp4",codec:s,initSegment:a,id:"main"}:$.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},g.remux=function(a,d,s,i,t){var u=this.initPTS,o=this.lastEndDTS,R={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};Object(J.isFiniteNumber)(o)||(o=this.lastEndDTS=t||0);var T=d.samples;if(!T||!T.length)return R;var S={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(T),A=this.initData),!A||!A.length)return $.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(J.isFiniteNumber)(u)||(this.initPTS=S.initPTS=u=r(A,T,o));var P=Object(K.getDuration)(T,A),E=o,b=P+E;Object(K.offsetStartDTS)(A,T,u),P>0?this.lastEndDTS=b:($.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!A.audio,f=!!A.video,C="";h&&(C+="audio"),f&&(C+="video");var x={data1:T,startPTS:E,startDTS:E,endPTS:b,endDTS:b,type:C,hasAudio:h,hasVideo:f,nb:1,dropped:0};return R.audio=x.type==="audio"?x:void 0,R.video=x.type!=="audio"?x:void 0,R.text=i,R.id3=s,R.initSegment=S,R},p}(),r=function(g,m,a){return Object(K.getStartDTS)(g,m)-a};function D(p,g){var m=p==null?void 0:p.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||g===N.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=z},"./src/task-loop.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var N=K.prototype;return N.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},N.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},N.onHandlerDestroyed=function(){},N.hasInterval=function(){return!!this._tickInterval},N.hasNextTick=function(){return!!this._tickTimer},N.setInterval=function(z){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,z),!0)},N.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},N.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},N.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},N.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},N.doTick=function(){},K}()},"./src/types/cmcd.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"CMCDVersion",function(){return J}),B.d(Q,"CMCDObjectType",function(){return K}),B.d(Q,"CMCDStreamingFormat",function(){return N}),B.d(Q,"CMCDStreamType",function(){return $});var J=1,K;(function(z){z.MANIFEST="m",z.AUDIO="a",z.VIDEO="v",z.MUXED="av",z.INIT="i",z.CAPTION="c",z.TIMED_TEXT="tt",z.KEY="k",z.OTHER="o"})(K||(K={}));var N;(function(z){z.DASH="d",z.HLS="h",z.SMOOTH="s",z.OTHER="o"})(N||(N={}));var $;(function(z){z.VOD="v",z.LIVE="l"})($||($={}))},"./src/types/level.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"HlsSkip",function(){return N}),B.d(Q,"getSkipValue",function(){return $}),B.d(Q,"HlsUrlParameters",function(){return z}),B.d(Q,"Level",function(){return r});function J(D,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function K(D,p,g){return p&&J(D.prototype,p),g&&J(D,g),D}var N;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(N||(N={}));function $(D,p){var g=D.canSkipUntil,m=D.canSkipDateRanges,a=D.endSN,d=p!==void 0?p-a:0;return g&&d<g?m?N.v2:N.Yes:N.No}var z=function(){function D(g,m,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=m,this.skip=a}var p=D.prototype;return p.addDirectives=function(m){var a=new self.URL(m);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(p){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=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return K(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(g){var m=g%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),D}()},"./src/types/loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"PlaylistContextType",function(){return J}),B.d(Q,"PlaylistLevelType",function(){return K});var J;(function(N){N.MANIFEST="manifest",N.LEVEL="level",N.AUDIO_TRACK="audioTrack",N.SUBTITLE_TRACK="subtitleTrack"})(J||(J={}));var K;(function(N){N.MAIN="main",N.AUDIO="audio",N.SUBTITLE="subtitle"})(K||(K={}))},"./src/types/transmuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ChunkMetadata",function(){return J});var J=function($,z,r,D,p,g){D===void 0&&(D=0),p===void 0&&(p=-1),g===void 0&&(g=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=K(),this.buffering={audio:K(),video:K(),audiovideo:K()},this.level=$,this.sn=z,this.id=r,this.size=D,this.part=p,this.partial=g};function K(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"AttrList",function(){return N});var J=/^(\d+)x(\d+)$/,K=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,N=function(){function $(r){typeof r=="string"&&(r=$.parseAttrList(r));for(var D in r)r.hasOwnProperty(D)&&(this[D]=r[D])}var z=$.prototype;return z.decimalInteger=function(D){var p=parseInt(this[D],10);return p>Number.MAX_SAFE_INTEGER?Infinity:p},z.hexadecimalInteger=function(D){if(this[D]){var p=(this[D]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var g=new Uint8Array(p.length/2),m=0;m<p.length/2;m++)g[m]=parseInt(p.slice(m*2,m*2+2),16);return g}else return null},z.hexadecimalIntegerAsNumber=function(D){var p=parseInt(this[D],16);return p>Number.MAX_SAFE_INTEGER?Infinity:p},z.decimalFloatingPoint=function(D){return parseFloat(this[D])},z.optionalFloat=function(D,p){var g=this[D];return g?parseFloat(g):p},z.enumeratedString=function(D){return this[D]},z.bool=function(D){return this[D]==="YES"},z.decimalResolution=function(D){var p=J.exec(this[D]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},$.parseAttrList=function(D){var p,g={},m='"';for(K.lastIndex=0;(p=K.exec(D))!==null;){var a=p[2];a.indexOf(m)===0&&a.lastIndexOf(m)===a.length-1&&(a=a.slice(1,-1)),g[p[1]]=a}return g},$}()},"./src/utils/binary-search.ts":function(te,Q,B){"use strict";B.r(Q);var J={search:function(N,$){for(var z=0,r=N.length-1,D=null,p=null;z<=r;){D=(z+r)/2|0,p=N[D];var g=$(p);if(g>0)z=D+1;else if(g<0)r=D-1;else return p}return null}};Q.default=J},"./src/utils/buffer-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"BufferHelper",function(){return N});var J=B("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},N=function(){function $(){}return $.isBuffered=function(r,D){try{if(r){for(var p=$.getBuffered(r),g=0;g<p.length;g++)if(D>=p.start(g)&&D<=p.end(g))return!0}}catch(m){}return!1},$.bufferInfo=function(r,D,p){try{if(r){var g=$.getBuffered(r),m=[],a;for(a=0;a<g.length;a++)m.push({start:g.start(a),end:g.end(a)});return this.bufferedInfo(m,D,p)}}catch(d){}return{len:0,start:D,end:D,nextStart:void 0}},$.bufferedInfo=function(r,D,p){D=Math.max(0,D),r.sort(function(S,A){var P=S.start-A.start;return P||A.end-S.end});var g=[];if(p)for(var m=0;m<r.length;m++){var a=g.length;if(a){var d=g[a-1].end;r[m].start-d<p?r[m].end>d&&(g[a-1].end=r[m].end):g.push(r[m])}else g.push(r[m])}else g=r;for(var s=0,i,t=D,u=D,o=0;o<g.length;o++){var R=g[o].start,T=g[o].end;if(D+p>=R&&D<T)t=R,u=T,s=u-D;else if(D+p<R){i=R;break}}return{len:s,start:t||0,end:u||0,nextStart:i}},$.getBuffered=function(r){try{return r.buffered}catch(D){return J.logger.log("failed to get media.buffered",D),K}},$}()},"./src/utils/cea-608-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"Row",function(){return u}),B.d(Q,"CaptionScreen",function(){return o});var J=B("./src/utils/logger.ts"),K={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},N=function(b){var h=b;return K.hasOwnProperty(b)&&(h=K[b]),String.fromCharCode(h)},$=15,z=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(E){E[E.ERROR=0]="ERROR",E[E.TEXT=1]="TEXT",E[E.WARNING=2]="WARNING",E[E.INFO=2]="INFO",E[E.DEBUG=3]="DEBUG",E[E.DATA=3]="DATA"})(a||(a={}));var d=function(){function E(){this.time=null,this.verboseLevel=a.ERROR}var b=E.prototype;return b.log=function(f,C){this.verboseLevel>=f&&J.logger.log(this.time+" ["+f+"] "+C)},E}(),s=function(b){for(var h=[],f=0;f<b.length;f++)h.push(b[f].toString(16));return h},i=function(){function E(h,f,C,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=C||!1,this.background=x||"black",this.flash=_||!1}var b=E.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],x=0;x<C.length;x++){var _=C[x];f.hasOwnProperty(_)&&(this[_]=f[_])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},b.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},E}(),t=function(){function E(h,f,C,x,_,j){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new i(f,C,x,_,j)}var b=E.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},b.setPenState=function(f){this.penState.copy(f)},b.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},b.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},E}(),u=function(){function E(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<z;f++)this.chars.push(new t);this.logger=h,this.pos=0,this.currPenState=new i}var b=E.prototype;return b.equals=function(f){for(var C=!0,x=0;x<z;x++)if(!this.chars[x].equals(f.chars[x])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<z;C++)this.chars[C].copy(f.chars[C])},b.isEmpty=function(){for(var f=!0,C=0;C<z;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},b.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>z&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=z)},b.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var x=this.pos+1;x<C+1;x++)this.chars[x].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(f){f>=144&&this.backSpace();var C=N(f);if(this.pos>=z){this.logger.log(a.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var C;for(C=f;C<z;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var f=[],C=!0,x=0;x<z;x++){var _=this.chars[x].uchar;_!==" "&&(C=!1),f.push(_)}return C?"":f.join("")},b.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.setPenState(this.currPenState)},E}(),o=function(){function E(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<$;f++)this.rows.push(new u(h));this.logger=h,this.currRow=$-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=E.prototype;return b.reset=function(){for(var f=0;f<$;f++)this.rows[f].clear();this.currRow=$-1},b.equals=function(f){for(var C=!0,x=0;x<$;x++)if(!this.rows[x].equals(f.rows[x])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<$;C++)this.rows[C].copy(f.rows[C])},b.isEmpty=function(){for(var f=!0,C=0;C<$;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},b.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},b.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},b.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},b.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},b.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},b.setCursor=function(f){this.logger.log(a.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},b.setPAC=function(f){this.logger.log(a.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var x=0;x<$;x++)this.rows[x].clear();var _=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var W=j.rows[_].cueStartTime,w=this.logger.time;if(W&&w!==null&&W<w)for(var F=0;F<this.nrRollUpRows;F++)this.rows[C-this.nrRollUpRows+F+1].copy(j.rows[_+F])}}this.currRow=C;var I=this.rows[this.currRow];if(f.indent!==null){var v=f.indent,H=Math.max(v-1,0);I.setCursor(f.indent),f.color=I.chars[H].penState.foreground}var Y={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(Y)},b.setBkgData=function(f){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},b.setRollUpRows=function(f){this.nrRollUpRows=f},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(a.INFO,"Rolling up")},b.getDisplayText=function(f){f=f||!1;for(var C=[],x="",_=-1,j=0;j<$;j++){var W=this.rows[j].getTextString();W&&(_=j+1,f?C.push("Row "+_+": '"+W+"'"):C.push(W.trim()))}return C.length>0&&(f?x="["+C.join(" | ")+"]":x=C.join(`
|
|
`)),x},b.getTextAndFormat=function(){return this.rows},E}(),R=function(){function E(h,f,C){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new o(C),this.nonDisplayedMemory=new o(C),this.lastOutputScreen=new o(C),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=E.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(a.INFO,"MODE="+f),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=f},b.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var 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())},b.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(f){this.logger.log(a.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},b.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(f){this.logger.log(a.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},b.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var x=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=_[x]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},E}(),T=function(){function E(h,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new d;this.channels=[null,new R(h,f,x),new R(h+1,C,x)],this.cmdHistory=P(),this.logger=x}var b=E.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,C){this.channels[f].setHandler(C)},b.addData=function(f,C){var x,_,j,W=!1;this.logger.time=f;for(var w=0;w<C.length;w+=2){if(_=C[w]&127,j=C[w+1]&127,_===0&&j===0)continue;if(this.logger.log(a.DATA,"["+s([C[w],C[w+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 I=this.channels[F];I.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([C[w],C[w+1]]))}},b.parseCmd=function(f,C){var x=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,j=(f===23||f===31)&&C>=33&&C<=35;if(!(_||j))return!1;if(A(f,C,x))return S(null,null,x),this.logger.log(a.DEBUG,"Repeated command ("+s([f,C])+") is dropped"),!0;var W=f===20||f===21||f===23?1:2,w=this.channels[W];return f===20||f===21||f===28||f===29?C===32?w.ccRCL():C===33?w.ccBS():C===34?w.ccAOF():C===35?w.ccAON():C===36?w.ccDER():C===37?w.ccRU(2):C===38?w.ccRU(3):C===39?w.ccRU(4):C===40?w.ccFON():C===41?w.ccRDC():C===42?w.ccTR():C===43?w.ccRTD():C===44?w.ccEDM():C===45?w.ccCR():C===46?w.ccENM():C===47&&w.ccEOC():w.ccTO(C-32),S(f,C,x),this.currentChannel=W,!0},b.parseMidrow=function(f,C){var x=0;if((f===17||f===25)&&C>=32&&C<=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(C),this.logger.log(a.DEBUG,"MIDROW ("+s([f,C])+")"),!0):!1}return!1},b.parsePAC=function(f,C){var x,_=this.cmdHistory,j=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,W=(f===16||f===24)&&C>=64&&C<=95;if(!(j||W))return!1;if(A(f,C,_))return S(null,null,_),!0;var w=f<=23?1:2;C>=64&&C<=95?x=w===1?r[f]:p[f]:x=w===1?D[f]:g[f];var F=this.channels[w];return F?(F.setPAC(this.interpretPAC(x,C)),S(f,C,_),this.currentChannel=w,!0):!1},b.interpretPAC=function(f,C){var x,_={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?x=C-96:x=C-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,_},b.parseChars=function(f,C){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=C+80:j===18?W=C+112:W=C+144,this.logger.log(a.INFO,"Special char '"+N(W)+"' in channel "+x),_=[W]}else f>=32&&f<=127&&(_=C===0?[f]:[f,C]);if(_){var w=s(_);this.logger.log(a.DEBUG,"Char codes = "+w.join(",")),S(f,C,this.cmdHistory)}return _},b.parseBackgroundAttributes=function(f,C){var x=(f===16||f===24)&&C>=32&&C<=47,_=(f===23||f===31)&&C>=45&&C<=47;if(!(x||_))return!1;var j,W={};f===16||f===24?(j=Math.floor((C-32)/2),W.background=m[j],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var w=f<=23?1:2,F=this.channels[w];return F.setBkgData(W),S(f,C,this.cmdHistory),!0},b.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=P()},b.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var x=this.channels[C];x&&x.cueSplitAtTime(f)}},E}();function S(E,b,h){h.a=E,h.b=b}function A(E,b,h){return h.a===E&&h.b===b}function P(){return{a:null,b:null}}Q.default=T},"./src/utils/codecs.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isCodecType",function(){return K}),B.d(Q,"isCodecSupportedInMp4",function(){return N});var J={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function K($,z){var r=J[z];return!!r&&r[$.slice(0,4)]===!0}function N($,z){return MediaSource.isTypeSupported((z||"video")+'/mp4;codecs="'+$+'"')}},"./src/utils/cues.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/vttparser.ts"),K=B("./src/utils/webvtt-parser.ts"),N=B("./src/utils/texttrack-utils.ts"),$=/\s/,z={newCue:function(D,p,g,m){for(var a=[],d,s,i,t,u,o=self.VTTCue||self.TextTrackCue,R=0;R<m.rows.length;R++)if(d=m.rows[R],i=!0,t=0,u="",!d.isEmpty()){for(var T=0;T<d.chars.length;T++)$.test(d.chars[T].uchar)&&i?t++:(u+=d.chars[T].uchar,i=!1);d.cueStartTime=p,p===g&&(g+=1e-4),t>=16?t--:t++;var S=Object(J.fixLineBreaks)(u.trim()),A=Object(K.generateCueId)(p,g,S);(!D||!D.cues||!D.cues.getCueById(A))&&(s=new o(p,g,S),s.id=A,s.line=R+1,s.align="left",s.position=10+Math.min(80,Math.floor(t*8/32)*10),a.push(s))}return D&&a.length&&(a.sort(function(P,E){return P.line==="auto"||E.line==="auto"?0:P.line>8&&E.line>8?E.line-P.line:P.line-E.line}),a.forEach(function(P){return Object(N.addCueToTrack)(D,P)})),a}};Q.default=z},"./src/utils/discontinuities.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"findFirstFragWithCC",function(){return $}),B.d(Q,"shouldAlignOnDiscontinuities",function(){return z}),B.d(Q,"findDiscontinuousReferenceFrag",function(){return r}),B.d(Q,"adjustSlidingStart",function(){return p}),B.d(Q,"alignStream",function(){return g}),B.d(Q,"alignPDT",function(){return a}),B.d(Q,"alignFragmentByPDTDelta",function(){return d}),B.d(Q,"alignMediaPlaylistByPDT",function(){return s});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts"),N=B("./src/controller/level-helper.ts");function $(i,t){for(var u=null,o=0,R=i.length;o<R;o++){var T=i[o];if(T&&T.cc===t){u=T;break}}return u}function z(i,t,u){return!!(t.details&&(u.endCC>u.startCC||i&&i.cc<u.startCC))}function r(i,t){var u=i.fragments,o=t.fragments;if(!o.length||!u.length){K.logger.log("No fragments to align");return}var R=$(u,o[0].cc);if(!R||R&&!R.startPTS){K.logger.log("No frag in previous level to align on");return}return R}function D(i,t){if(i){var u=i.start+t;i.start=i.startPTS=u,i.endPTS=u+i.duration}}function p(i,t){for(var u=t.fragments,o=0,R=u.length;o<R;o++)D(u[o],i);t.fragmentHint&&D(t.fragmentHint,i),t.alignedSliding=!0}function g(i,t,u){if(!t)return;m(i,u,t),!u.alignedSliding&&t.details&&a(u,t.details),!u.alignedSliding&&t.details&&!u.skippedSegments&&Object(N.adjustSliding)(t.details,u)}function m(i,t,u){if(z(i,u,t)){var o=r(u.details,t);o&&Object(J.isFiniteNumber)(o.start)&&(K.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),p(o.start,t))}}function a(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=i.fragments[0].programDateTime,R=(o-u)/1e3+t.fragments[0].start;R&&Object(J.isFiniteNumber)(R)&&(K.logger.log("Adjusting PTS using programDateTime delta "+(o-u)+"ms, sliding:"+R.toFixed(3)+" "+i.url+" "),p(R,i))}function d(i,t){var u=i.programDateTime;if(!u)return;var o=(u-t)/1e3;i.start=i.startPTS=o,i.endPTS=o+i.duration}function s(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=t.fragments[0].start,R=u-o*1e3;i.fragments.forEach(function(T){d(T,R)}),i.fragmentHint&&d(i.fragmentHint,R),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/ewma.ts"),K=function(){function N(z,r,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new J.default(z),this.fast_=new J.default(r)}var $=N.prototype;return $.update=function(r,D){var p=this.slow_,g=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new J.default(r,p.getEstimate(),p.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new J.default(D,g.getEstimate(),g.getTotalWeight()))},$.sample=function(r,D){r=Math.max(r,this.minDelayMs_);var p=8*D,g=r/1e3,m=p/g;this.fast_.sample(g,m),this.slow_.sample(g,m)},$.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},$.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},$.destroy=function(){},N}();Q.default=K},"./src/utils/ewma.ts":function(te,Q,B){"use strict";B.r(Q);var J=function(){function K($,z,r){z===void 0&&(z=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=$,this.alpha_=$?Math.exp(Math.log(.5)/$):0,this.estimate_=z,this.totalWeight_=r}var N=K.prototype;return N.sample=function(z,r){var D=Math.pow(this.alpha_,z);this.estimate_=r*(1-D)+D*this.estimate_,this.totalWeight_+=z},N.getTotalWeight=function(){return this.totalWeight_},N.getEstimate=function(){if(this.alpha_){var z=1-Math.pow(this.alpha_,this.totalWeight_);if(z)return this.estimate_/z}return this.estimate_},K}();Q.default=J},"./src/utils/fetch-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"fetchSupported",function(){return d});var J=B("./src/polyfills/number.ts"),K=B("./src/loader/load-stats.ts"),N=B("./src/demux/chunk-cache.ts");function $(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,g(o,R)}function z(o){var R=typeof Map=="function"?new Map:void 0;return z=function(S){if(S===null||!p(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(S))return R.get(S);R.set(S,A)}function A(){return r(S,arguments,m(this).constructor)}return A.prototype=Object.create(S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,S)},z(o)}function r(o,R,T){return D()?r=Reflect.construct:r=function(A,P,E){var b=[null];b.push.apply(b,P);var h=Function.bind.apply(A,b),f=new h;return E&&g(f,E.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 p(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function g(o,R){return g=Object.setPrototypeOf||function(S,A){return S.__proto__=A,S},g(o,R)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(o)}function a(){return a=Object.assign||function(o){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&(o[S]=T[S])}return o},a.apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var s=function(){function o(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||t,this.controller=new self.AbortController,this.stats=new K.LoadStats}var R=o.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(S,A,P){var E=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var h=i(S,this.controller.signal),f=P.onProgress,C=S.responseType==="arraybuffer",x=C?"byteLength":"length";this.context=S,this.config=A,this.callbacks=P,this.request=this.fetchSetup(S,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){E.abortInternal(),P.onTimeout(b,S,E.response)},A.timeout),self.fetch(this.request).then(function(_){if(E.response=E.loader=_,!_.ok){var j=_.status,W=_.statusText;throw new u(W||"fetch, bad network response",j,_)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object(J.isFiniteNumber)(A.highWaterMark)?E.loadProgressively(_,b,S,A.highWaterMark,f):C?_.arrayBuffer():_.text()}).then(function(_){var j=E.response;self.clearTimeout(E.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=_[x];var W={url:j.url,data:_};f&&!Object(J.isFiniteNumber)(A.highWaterMark)&&f(b,S,_,j),P.onSuccess(W,b,S,j)}).catch(function(_){if(self.clearTimeout(E.requestTimeout),b.aborted)return;var j=_.code||0;P.onError({code:j,text:_.message},S,_.details)})},R.getCacheAge=function(){var S=null;if(this.response){var A=this.response.headers.get("age");S=A?parseFloat(A):null}return S},R.loadProgressively=function(S,A,P,E,b){E===void 0&&(E=0);var h=new N.default,f=S.body.getReader(),C=function x(){return f.read().then(function(_){if(_.done)return h.dataLength&&b(A,P,h.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=_.value,W=j.length;return A.loaded+=W,W<E||h.dataLength?(h.push(j),h.dataLength>=E&&b(A,P,h.flush(),S)):b(A,P,j,S),x()}).catch(function(){return Promise.reject()})};return C()},o}();function i(o,R){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(a({},o.headers))};return o.rangeEnd&&T.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),T}function t(o,R){return new self.Request(o.url,R)}var u=function(o){$(R,o);function R(T,S,A){var P;return P=o.call(this,T)||this,P.code=void 0,P.details=void 0,P.code=S,P.details=A,P}return R}(z(Error));Q.default=s},"./src/utils/imsc1-ttml-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"IMSC1_CODEC",function(){return p}),B.d(Q,"parseIMSC1",function(){return d});var J=B("./src/utils/mp4-tools.ts"),K=B("./src/utils/vttparser.ts"),N=B("./src/utils/vttcue.ts"),$=B("./src/demux/id3.ts"),z=B("./src/utils/timescale-conversion.ts"),r=B("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(E){for(var b=1;b<arguments.length;b++){var h=arguments[b];for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(E[f]=h[f])}return E},D.apply(this,arguments)}var p="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function d(E,b,h,f,C){var x=Object(J.findBox)(new Uint8Array(E),["mdat"]);if(x.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var _=x[0],j=Object($.utf8ArrayToStr)(new Uint8Array(E,_.start,_.end-_.start)),W=Object(z.toTimescaleFromScale)(b,1,h);try{f(s(j,W))}catch(w){C(w)}}function s(E,b){var h=new DOMParser,f=h.parseFromString(E,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var x={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(x).reduce(function(I,v){return I[v]=C.getAttribute("ttp:"+v)||x[v],I},{}),j=C.getAttribute("xml:space")!=="preserve",W=t(i(C,"styling","style")),w=t(i(C,"layout","region")),F=i(C,"body","[begin]");return[].map.call(F,function(I){var v=u(I,j);if(!v||!I.hasAttribute("begin"))return null;var H=S(I.getAttribute("begin"),_),Y=S(I.getAttribute("dur"),_),ie=S(I.getAttribute("end"),_);if(H===null)throw T(I);if(ie===null){if(Y===null)throw T(I);ie=H+Y}var le=new N.default(H-b,ie-b,v);le.id=Object(r.generateCueId)(le.startTime,le.endTime,le.text);var he=w[I.getAttribute("region")],we=W[I.getAttribute("style")];le.position=10,le.size=80;var Pe=o(he,we),xe=Pe.textAlign;if(xe){var Oe=a[xe];Oe&&(le.lineAlign=Oe),le.align=xe}return D(le,Pe),le}).filter(function(I){return I!==null})}function i(E,b,h){var f=E.getElementsByTagName(b)[0];return f?[].slice.call(f.querySelectorAll(h)):[]}function t(E){return E.reduce(function(b,h){var f=h.getAttribute("xml:id");return f&&(b[f]=h),b},{})}function u(E,b){return[].slice.call(E.childNodes).reduce(function(h,f,C){var x;return f.nodeName==="br"&&C?h+`
|
|
`:(x=f.childNodes)!==null&&x!==void 0&&x.length?u(f,b):b?h+f.textContent.trim().replace(/\s+/g," "):h+f.textContent},"")}function o(E,b){var h="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,x){var _=R(b,h,x)||R(E,h,x);return _&&(C[x]=_),C},{})}function R(E,b,h){return E.hasAttributeNS(b,h)?E.getAttributeNS(b,h):null}function T(E){return new Error("Could not parse ttml timestamp "+E)}function S(E,b){if(!E)return null;var h=Object(K.parseTimeStamp)(E);return h===null&&(g.test(E)?h=A(E,b):m.test(E)&&(h=P(E,b))),h}function A(E,b){var h=g.exec(E),f=(h[4]|0)+(h[5]|0)/b.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+f/b.frameRate}function P(E,b){var h=m.exec(E),f=Number(h[1]),C=h[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/b.frameRate;case"t":return f/b.tickRate}return f}},"./src/utils/logger.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"enableLogs",function(){return r}),B.d(Q,"logger",function(){return D});var J=function(){},K={trace:J,debug:J,log:J,warn:J,info:J,error:J},N=K;function $(p){var g=self.console[p];return g?g.bind(self.console,"["+p+"] >"):J}function z(p){for(var g=arguments.length,m=new Array(g>1?g-1:0),a=1;a<g;a++)m[a-1]=arguments[a];m.forEach(function(d){N[d]=p[d]?p[d].bind(p):$(d)})}function r(p){if(self.console&&p===!0||typeof p=="object"){z(p,"debug","log","info","warn","error");try{N.log()}catch(g){N=K}}else N=K}var D=N},"./src/utils/mediakeys-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"KeySystems",function(){return J}),B.d(Q,"requestMediaKeySystemAccess",function(){return K});var J;(function(N){N.WIDEVINE="com.widevine.alpha",N.PLAYREADY="com.microsoft.playready"})(J||(J={}));var K=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"getMediaSource",function(){return J});function J(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"bin2str",function(){return z}),B.d(Q,"readUint16",function(){return r}),B.d(Q,"readUint32",function(){return D}),B.d(Q,"writeUint32",function(){return p}),B.d(Q,"findBox",function(){return g}),B.d(Q,"parseSegmentIndex",function(){return m}),B.d(Q,"parseInitSegment",function(){return a}),B.d(Q,"getStartDTS",function(){return d}),B.d(Q,"getDuration",function(){return s}),B.d(Q,"computeRawDurationFromSamples",function(){return i}),B.d(Q,"offsetStartDTS",function(){return t}),B.d(Q,"segmentValidRange",function(){return u}),B.d(Q,"appendUint8Array",function(){return o});var J=B("./src/utils/typed-array.ts"),K=B("./src/loader/fragment.ts"),N=Math.pow(2,32)-1,$=[].push;function z(R){return String.fromCharCode.apply(null,R)}function r(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<8|R[T+1];return S<0?65536+S:S}function D(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<24|R[T+1]<<16|R[T+2]<<8|R[T+3];return S<0?4294967296+S:S}function p(R,T,S){"data"in R&&(T+=R.start,R=R.data),R[T]=S>>24,R[T+1]=S>>16&255,R[T+2]=S>>8&255,R[T+3]=S&255}function g(R,T){var S=[];if(!T.length)return S;var A,P,E;"data"in R?(A=R.data,P=R.start,E=R.end):(A=R,P=0,E=A.byteLength);for(var b=P;b<E;){var h=D(A,b),f=z(A.subarray(b+4,b+8)),C=h>1?b+h:E;if(f===T[0])if(T.length===1)S.push({data:A,start:b+8,end:C});else{var x=g({data:A,start:b+8,end:C},T.slice(1));x.length&&$.apply(S,x)}b=C}return S}function m(R){var T=g(R,["moov"]),S=T[0],A=S?S.end:null,P=g(R,["sidx"]);if(!P||!P[0])return null;var E=[],b=P[0],h=b.data[0],f=h===0?8:16,C=D(b,f);f+=4;var x=0,_=0;h===0?f+=8:f+=16,f+=2;var j=b.end+_,W=r(b,f);f+=2;for(var w=0;w<W;w++){var F=f,I=D(b,F);F+=4;var v=I&2147483647,H=(I&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=D(b,F);F+=4,E.push({referenceSize:v,subsegmentDuration:Y,info:{duration:Y/C,start:j,end:j+v-1}}),j+=v,F+=4,f=F}return{earliestPresentationTime:x,timescale:C,version:h,referencesCount:W,references:E,moovEndOffset:A}}function a(R){for(var T=[],S=g(R,["moov","trak"]),A=0;A<S.length;A++){var P=S[A],E=g(P,["tkhd"])[0];if(E){var b=E.data[E.start],h=b===0?12:20,f=D(E,h),C=g(P,["mdia","mdhd"])[0];if(C){b=C.data[C.start],h=b===0?12:20;var x=D(C,h),_=g(P,["mdia","hdlr"])[0];if(_){var j=z(_.data.subarray(_.start+8,_.start+12)),W={soun:K.ElementaryStreamTypes.AUDIO,vide:K.ElementaryStreamTypes.VIDEO}[j];if(W){var w=g(P,["mdia","minf","stbl","stsd"])[0],F=void 0;w&&(F=z(w.data.subarray(w.start+12,w.start+16))),T[f]={timescale:x,type:W},T[W]={timescale:x,id:f,codec:F}}}}}}var I=g(R,["moov","mvex","trex"]);return I.forEach(function(v){var H=D(v,4),Y=T[H];Y&&(Y.default={duration:D(v,12),flags:D(v,20)})}),T}function d(R,T){return g(T,["moof","traf"]).reduce(function(S,A){var P=g(A,["tfdt"])[0],E=P.data[P.start],b=g(A,["tfhd"]).reduce(function(h,f){var C=D(f,4),x=R[C];if(x){var _=D(P,4);E===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 b!==null&&isFinite(b)&&(S===null||b<S)?b:S},null)||0}function s(R,T){for(var S=0,A=0,P=0,E=g(R,["moof","traf"]),b=0;b<E.length;b++){var h=E[b],f=g(h,["tfhd"])[0],C=D(f,4),x=T[C];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 w=x.timescale||9e4,F=g(h,["trun"]),I=0;I<F.length;I++){if(W){var v=D(F[I],4);S=W*v}else S=i(F[I]);x.type===K.ElementaryStreamTypes.VIDEO?A+=S/w:x.type===K.ElementaryStreamTypes.AUDIO&&(P+=S/w)}}if(A===0&&P===0){var H=m(R);if(H!=null&&H.references)return H.references.reduce(function(Y,ie){return Y+ie.info.duration||0},0)}return A||P}function i(R){var T=D(R,0),S=8;T&1&&(S+=4),T&4&&(S+=4);for(var A=0,P=D(R,4),E=0;E<P;E++){if(T&256){var b=D(R,S);A+=b,S+=4}T&512&&(S+=4),T&1024&&(S+=4),T&2048&&(S+=4)}return A}function t(R,T,S){g(T,["moof","traf"]).forEach(function(A){g(A,["tfhd"]).forEach(function(P){var E=D(P,4),b=R[E];if(!b)return;var h=b.timescale||9e4;g(A,["tfdt"]).forEach(function(f){var C=f.data[f.start],x=D(f,4);if(C===0)p(f,4,x-S*h);else{x*=Math.pow(2,32),x+=D(f,8),x-=S*h,x=Math.max(x,0);var _=Math.floor(x/(N+1)),j=Math.floor(x%(N+1));p(f,4,_),p(f,8,j)}})})})}function u(R){var T={valid:null,remainder:null},S=g(R,["moof"]);if(S){if(S.length<2)return T.remainder=R,T}else return T;var A=S[S.length-1];return T.valid=Object(J.sliceUint8)(R,0,A.start-8),T.remainder=Object(J.sliceUint8)(R,A.start-8),T}function o(R,T){var S=new Uint8Array(R.length+T.length);return S.set(R),S.set(T,R.length),S}},"./src/utils/output-filter.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=$,this.trackName=z}var N=K.prototype;return N.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},N.newCue=function(z,r,D){(this.startTime===null||this.startTime>z)&&(this.startTime=z),this.endTime=r,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},N.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"sendAddTrackEvent",function(){return K}),B.d(Q,"addCueToTrack",function(){return N}),B.d(Q,"clearCurrentCues",function(){return $}),B.d(Q,"removeCuesInRange",function(){return z}),B.d(Q,"getCuesInRange",function(){return D});var J=B("./src/utils/logger.ts");function K(p,g){var m;try{m=new Event("addtrack")}catch(a){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=p,g.dispatchEvent(m)}function N(p,g){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(g.id))try{if(p.addCue(g),!p.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(d){J.logger.debug("[texttrack-utils]: "+d);var a=new self.TextTrackCue(g.startTime,g.endTime,g.text);a.id=g.id,p.addCue(a)}m==="disabled"&&(p.mode=m)}function $(p){var g=p.mode;if(g==="disabled"&&(p.mode="hidden"),p.cues)for(var m=p.cues.length;m--;)p.removeCue(p.cues[m]);g==="disabled"&&(p.mode=g)}function z(p,g,m){var a=p.mode;if(a==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var d=D(p.cues,g,m),s=0;s<d.length;s++)p.removeCue(d[s]);a==="disabled"&&(p.mode=a)}function r(p,g){if(g<p[0].startTime)return 0;var m=p.length-1;if(g>p[m].endTime)return-1;for(var a=0,d=m;a<=d;){var s=Math.floor((d+a)/2);if(g<p[s].startTime)d=s-1;else if(g>p[s].startTime&&a<m)a=s+1;else return s}return p[a].startTime-g<g-p[d].startTime?a:d}function D(p,g,m){var a=[],d=r(p,g);if(d>-1)for(var s=d,i=p.length;s<i;s++){var t=p[s];if(t.startTime>=g&&t.endTime<=m)a.push(t);else if(t.startTime>m)return a}return a}},"./src/utils/time-ranges.ts":function(te,Q,B){"use strict";B.r(Q);var J={toString:function(N){for(var $="",z=N.length,r=0;r<z;r++)$+="["+N.start(r).toFixed(3)+","+N.end(r).toFixed(3)+"]";return $}};Q.default=J},"./src/utils/timescale-conversion.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"toTimescaleFromBase",function(){return K}),B.d(Q,"toTimescaleFromScale",function(){return N}),B.d(Q,"toMsFromMpegTsClock",function(){return $}),B.d(Q,"toMpegTsClockFromTimescale",function(){return z});var J=9e4;function K(r,D,p,g){p===void 0&&(p=1),g===void 0&&(g=!1);var m=r*D*p;return g?Math.round(m):m}function N(r,D,p,g){return p===void 0&&(p=1),g===void 0&&(g=!1),K(r,D,1/p,g)}function $(r,D){return D===void 0&&(D=!1),K(r,1e3,1/J,D)}function z(r,D){return D===void 0&&(D=1),K(r,J,1/D)}},"./src/utils/typed-array.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"sliceUint8",function(){return J});function J(K,N,$){return Uint8Array.prototype.slice?K.slice(N,$):new Uint8Array(Array.prototype.slice.call(K,N,$))}},"./src/utils/vttcue.ts":function(te,Q,B){"use strict";B.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var J=["","lr","rl"],K=["start","middle","end","left","right"];function N(p,g){if(typeof g!="string")return!1;if(!Array.isArray(p))return!1;var m=g.toLowerCase();return~p.indexOf(m)?m:!1}function $(p){return N(J,p)}function z(p){return N(K,p)}function r(p){for(var g=arguments.length,m=new Array(g>1?g-1:0),a=1;a<g;a++)m[a-1]=arguments[a];for(var d=1;d<arguments.length;d++){var s=arguments[d];for(var i in s)p[i]=s[i]}return p}function D(p,g,m){var a=this,d={enumerable:!0};a.hasBeenReset=!1;var s="",i=!1,t=p,u=g,o=m,R=null,T="",S=!0,A="auto",P="start",E=50,b="middle",h=50,f="middle";Object.defineProperty(a,"id",r({},d,{get:function(){return s},set:function(x){s=""+x}})),Object.defineProperty(a,"pauseOnExit",r({},d,{get:function(){return i},set:function(x){i=!!x}})),Object.defineProperty(a,"startTime",r({},d,{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({},d,{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({},d,{get:function(){return o},set:function(x){o=""+x,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",r({},d,{get:function(){return R},set:function(x){R=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",r({},d,{get:function(){return T},set:function(x){var _=$(x);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",r({},d,{get:function(){return S},set:function(x){S=!!x,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",r({},d,{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({},d,{get:function(){return P},set:function(x){var _=z(x);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");P=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",r({},d,{get:function(){return E},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");E=x,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",r({},d,{get:function(){return b},set:function(x){var _=z(x);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");b=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",r({},d,{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({},d,{get:function(){return f},set:function(x){var _=z(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 p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"parseTimeStamp",function(){return N}),B.d(Q,"fixLineBreaks",function(){return g}),B.d(Q,"VTTParser",function(){return m});var J=B("./src/utils/vttcue.ts"),K=function(){function a(){}var d=a.prototype;return d.decode=function(i,t){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},a}();function N(a){function d(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?d(s[2],s[3],0,s[4]):d(s[1],s[2],s[3],s[4]):null}var $=function(){function a(){this.values=Object.create(null)}var d=a.prototype;return d.set=function(i,t){!this.get(i)&&t!==""&&(this.values[i]=t)},d.get=function(i,t,u){return u?this.has(i)?this.values[i]:t[u]:this.has(i)?this.values[i]:t},d.has=function(i){return i in this.values},d.alt=function(i,t,u){for(var o=0;o<u.length;++o)if(t===u[o]){this.set(i,t);break}},d.integer=function(i,t){/^-?\d+$/.test(t)&&this.set(i,parseInt(t,10))},d.percent=function(i,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var u=parseFloat(t);if(u>=0&&u<=100)return this.set(i,u),!0}return!1},a}();function z(a,d,s,i){var t=i?a.split(i):[a];for(var u in t){if(typeof t[u]!="string")continue;var o=t[u].split(s);if(o.length!==2)continue;var R=o[0],T=o[1];d(R,T)}}var r=new J.default(0,0,""),D=r.align==="middle"?"middle":"center";function p(a,d,s){var i=a;function t(){var R=N(a);if(R===null)throw new Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,T){var S=new $;z(R,function(E,b){var h;switch(E){case"region":for(var f=s.length-1;f>=0;f--)if(s[f].id===b){S.set(E,s[f].region);break}break;case"vertical":S.alt(E,b,["rl","lr"]);break;case"line":h=b.split(","),S.integer(E,h[0]),S.percent(E,h[0])&&S.set("snapToLines",!1),S.alt(E,h[0],["auto"]),h.length===2&&S.alt("lineAlign",h[1],["start",D,"end"]);break;case"position":h=b.split(","),S.percent(E,h[0]),h.length===2&&S.alt("positionAlign",h[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(E,b);break;case"align":S.alt(E,b,["start",D,"end","left","right"]);break}},/:/,/\s/),T.region=S.get("region",null),T.vertical=S.get("vertical","");var A=S.get("line","auto");A==="auto"&&r.line===-1&&(A=-1),T.line=A,T.lineAlign=S.get("lineAlign","start"),T.snapToLines=S.get("snapToLines",!0),T.size=S.get("size",100),T.align=S.get("align",D);var P=S.get("position","auto");P==="auto"&&r.position===50&&(P=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=P}function o(){a=a.replace(/^\s+/,"")}if(o(),d.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(),d.endTime=t(),o(),u(a,d)}function g(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=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 d=a.prototype;return d.parse=function(i){var t=this;i&&(t.buffer+=t.decoder.decode(i,{stream:!0}));function u(){var P=t.buffer,E=0;for(P=g(P);E<P.length&&P[E]!=="\r"&&P[E]!==`
|
|
`;)++E;var b=P.substr(0,E);return P[E]==="\r"&&++E,P[E]===`
|
|
`&&++E,t.buffer=P.substr(E),b}function o(P){z(P,function(E,b){},/:/)}try{var R="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;R=u();var T=R.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var S=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;S?S=!1:R=u();switch(t.state){case"HEADER":/:/.test(R)?o(R):R||(t.state="ID");continue;case"NOTE":R||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){t.state="NOTE";break}if(!R)continue;if(t.cue=new J.default(0,0,""),t.state="CUE",R.indexOf("-->")===-1){t.cue.id=R;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{p(R,t.cue,t.regionList)}catch(P){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var A=R.indexOf("-->")!==-1;if(!R||A&&(S=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=R}continue;case"BADCUE":R||(t.state="ID")}}}catch(P){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},d.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){i.onparsingerror&&i.onparsingerror(t)}return i.onflush&&i.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"generateCueId",function(){return m}),B.d(Q,"parseWebVTT",function(){return d});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/vttparser.ts"),N=B("./src/demux/id3.ts"),$=B("./src/utils/timescale-conversion.ts"),z=B("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,D=function(i,t,u){return u===void 0&&(u=0),i.substr(u,t.length)===t},p=function(i){var t=parseInt(i.substr(-3)),u=parseInt(i.substr(-6,2)),o=parseInt(i.substr(-9,2)),R=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(J.isFiniteNumber)(t)||!Object(J.isFiniteNumber)(u)||!Object(J.isFiniteNumber)(o)||!Object(J.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*u,t+=60*1e3*o,t+=60*60*1e3*R,t},g=function(i){for(var t=5381,u=i.length;u;)t=t*33^i.charCodeAt(--u);return(t>>>0).toString()};function m(s,i,t){return g(s.toString())+g(i.toString())+g(t)}var a=function(i,t,u){var o=i[t],R=i[o.prevCC];if(!R||!R.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(T=R)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=o.start-R.start,o.new=!1,o=R,R=i[o.prevCC]}i.presentationOffset=u};function d(s,i,t,u,o,R,T,S){var A=new K.VTTParser,P=Object(N.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
|
|
`).split(`
|
|
`),E=[],b=Object($.toMpegTsClockFromTimescale)(i,t),h="00:00.000",f=0,C=0,x,_=!0,j=!1;A.oncue=function(W){var w=u[o],F=u.ccOffset,I=(f-b)/9e4;if(w!=null&&w.new&&(C!==void 0?F=u.ccOffset=w.start:a(u,o,I)),I&&(F=I-u.presentationOffset),j){var v=W.endTime-W.startTime,H=Object(z.normalizePts)((W.startTime+F-C)*9e4,R*9e4)/9e4;W.startTime=H,W.endTime=H+v}var Y=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(Y)),W.id||(W.id=m(W.startTime,W.endTime,Y)),W.endTime>0&&E.push(W)},A.onparsingerror=function(W){x=W},A.onflush=function(){if(x){S(x);return}T(E)},P.forEach(function(W){if(_)if(D(W,"X-TIMESTAMP-MAP=")){_=!1,j=!0,W.substr(16).split(",").forEach(function(w){D(w,"LOCAL:")?h=w.substr(6):D(w,"MPEGTS:")&&(f=parseInt(w.substr(7)))});try{C=p(h)/1e3}catch(w){j=!1,x=w}return}else W===""&&(_=!1);A.parse(W+`
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/logger.ts"),K=B("./src/loader/load-stats.ts"),N=/^age:\s*[\d.]+\s*$/m,$=function(){function z(D){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=D?D.xhrSetup:null,this.stats=new K.LoadStats,this.retryDelay=0}var r=z.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},r.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(p,g,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=g,this.callbacks=m,this.retryDelay=g.retryDelay,this.loadInternal()},r.loadInternal=function(){var p=this.config,g=this.context;if(!p)return;var m=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var d=this.xhrSetup;try{if(d)try{d(m,g.url)}catch(t){m.open("GET",g.url,!0),d(m,g.url)}m.readyState||m.open("GET",g.url,!0);var s=this.context.headers;if(s)for(var i in s)m.setRequestHeader(i,s[i])}catch(t){this.callbacks.onError({code:m.status,text:t.message},g,m);return}g.rangeEnd&&m.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),m.send()},r.readystatechange=function(){var p=this.context,g=this.loader,m=this.stats;if(!p||!g)return;var a=g.readyState,d=this.config;if(m.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),a===4){g.onreadystatechange=null,g.onprogress=null;var s=g.status;if(s>=200&&s<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var i,t;if(p.responseType==="arraybuffer"?(i=g.response,t=i.byteLength):(i=g.responseText,t=i.length),m.loaded=m.total=t,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(m,p,i,g),!this.callbacks)return;var o={url:g.responseURL,data:i};this.callbacks.onSuccess(o,m,p,g)}else m.retry>=d.maxRetry||s>=400&&s<499?(J.logger.error(s+" while loading "+p.url),this.callbacks.onError({code:s,text:g.statusText},p,g)):(J.logger.warn(s+" while loading "+p.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,d.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),d.timeout)},r.loadtimeout=function(){J.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(p){var g=this.stats;g.loaded=p.loaded,p.lengthComputable&&(g.total=p.total)},r.getCacheAge=function(){var p=null;if(this.loader&&N.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");p=g?parseFloat(g):null}return p},z}();Q.default=$}}).default})},vHTk:function(kt,Ae,U){kt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Ht});var te=U("rePB"),Q=U("VTBJ"),B=U("KQm4"),J=U("U8pU"),K=U("ODXe"),N=U("q1tI"),$=U("TSYQ"),z=U.n($),r=U("Gytx"),D=U.n(r),p=U("Kwbf"),g=U("t23M"),m=U("qx4F"),a=U("6eGT"),d=U("IBYe"),s=U("Ff2n"),i=U("c+Xe"),t=U("fyJ8"),u=U("biw7");function o(et,Ze,Ct,At,dt){var ft=Ct[et]||{},He=Ct[Ze]||{},Ne,Ue;ft.fixed==="left"?Ne=At.left[et]:He.fixed==="right"&&(Ue=At.right[Ze]);var ge=!1,Ee=!1,De=!1,ue=!1,Fe=Ct[Ze+1],at=Ct[et-1];if(dt==="rtl"){if(Ne!==void 0){var xt=at&&at.fixed==="left";ue=!xt}else if(Ue!==void 0){var Gt=Fe&&Fe.fixed==="right";De=!Gt}}else if(Ne!==void 0){var $t=Fe&&Fe.fixed==="left";ge=!$t}else if(Ue!==void 0){var Yt=at&&at.fixed==="right";Ee=!Yt}return{fixLeft:Ne,fixRight:Ue,lastFixLeft:ge,firstFixRight:Ee,lastFixRight:De,firstFixLeft:ue,isSticky:At.isSticky}}var R=U("sR1s");function T(et){var Ze=et.cells,Ct=et.stickyOffsets,At=et.flattenColumns,dt=et.rowComponent,ft=et.cellComponent,He=et.onHeaderRow,Ne=et.index,Ue=N.useContext(u.a),ge=Ue.prefixCls,Ee=Ue.direction,De;He&&(De=He(Ze.map(function(Fe){return Fe.column}),Ne));var ue=Object(R.a)(Ze.map(function(Fe){return Fe.column}));return N.createElement(dt,Object.assign({},De),Ze.map(function(Fe,at){var xt=Fe.column,Gt=o(Fe.colStart,Fe.colEnd,At,Ct,Ee),$t;return xt&&xt.onHeaderCell&&($t=Fe.column.onHeaderCell(xt)),N.createElement(t.a,Object.assign({},Fe,{ellipsis:xt.ellipsis,align:xt.align,component:ft,prefixCls:ge,key:ue[at]},Gt,{additionalProps:$t,rowType:"header"}))}))}T.displayName="HeaderRow";var S=T;function A(et){var Ze=[];function Ct(He,Ne){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ze[Ue]=Ze[Ue]||[];var ge=Ne,Ee=He.filter(Boolean).map(function(De){var ue={key:De.key,className:De.className||"",children:De.title,column:De,colStart:ge},Fe=1,at=De.children;return at&&at.length>0&&(Fe=Ct(at,ge,Ue+1).reduce(function(xt,Gt){return xt+Gt},0),ue.hasSubColumns=!0),"colSpan"in De&&(Fe=De.colSpan),"rowSpan"in De&&(ue.rowSpan=De.rowSpan),ue.colSpan=Fe,ue.colEnd=ue.colStart+Fe-1,Ze[Ue].push(ue),ge+=Fe,Fe});return Ee}Ct(et,0);for(var At=Ze.length,dt=function(Ne){Ze[Ne].forEach(function(Ue){!("rowSpan"in Ue)&&!Ue.hasSubColumns&&(Ue.rowSpan=At-Ne)})},ft=0;ft<At;ft+=1)dt(ft);return Ze}function P(et){var Ze=et.stickyOffsets,Ct=et.columns,At=et.flattenColumns,dt=et.onHeaderRow,ft=N.useContext(u.a),He=ft.prefixCls,Ne=ft.getComponent,Ue=N.useMemo(function(){return A(Ct)},[Ct]),ge=Ne(["header","wrapper"],"thead"),Ee=Ne(["header","row"],"tr"),De=Ne(["header","cell"],"th");return N.createElement(ge,{className:"".concat(He,"-thead")},Ue.map(function(ue,Fe){var at=N.createElement(S,{key:Fe,flattenColumns:At,cells:ue,stickyOffsets:Ze,rowComponent:Ee,cellComponent:De,onHeaderRow:dt,index:Fe});return at}))}var E=P,b=U("hW8S");function h(et){for(var Ze=et.colWidths,Ct=et.columns,At=et.columCount,dt=[],ft=At||Ct.length,He=!1,Ne=ft-1;Ne>=0;Ne-=1){var Ue=Ze[Ne],ge=Ct&&Ct[Ne],Ee=ge&&ge[b.a];(Ue||Ee||He)&&(dt.unshift(N.createElement("col",Object.assign({key:Ne,style:{width:Ue,minWidth:Ue}},Ee))),He=!0)}return N.createElement("colgroup",null,dt)}var f=h;function C(et,Ze){return Object(N.useMemo)(function(){for(var Ct=[],At=0;At<Ze;At+=1){var dt=et[At];if(dt!==void 0)Ct[At]=dt;else return null}return Ct},[et.join("_"),Ze])}var x=N.forwardRef(function(et,Ze){var Ct=et.noData,At=et.columns,dt=et.flattenColumns,ft=et.colWidths,He=et.columCount,Ne=et.stickyOffsets,Ue=et.direction,ge=et.fixHeader,Ee=et.offsetHeader,De=et.stickyClassName,ue=et.onScroll,Fe=Object(s.a)(et,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),at=N.useContext(u.a),xt=at.prefixCls,Gt=at.scrollbarSize,$t=at.isSticky,Yt=$t&&!ge?0:Gt,$n=N.useRef(null),vn=N.useCallback(function(br){Object(i.b)(Ze,br),Object(i.b)($n,br)},[]);N.useEffect(function(){var br;function Rr(Jt){var Ar=Jt.currentTarget,Nn=Jt.deltaX;Nn&&(ue({currentTarget:Ar,scrollLeft:Ar.scrollLeft+Nn}),Jt.preventDefault())}return(br=$n.current)===null||br===void 0||br.addEventListener("wheel",Rr),function(){var Jt;(Jt=$n.current)===null||Jt===void 0||Jt.removeEventListener("wheel",Rr)}},[]);var ln=dt[dt.length-1],hn={fixed:ln?ln.fixed:null,onHeaderCell:function(){return{className:"".concat(xt,"-cell-scrollbar")}}},Gn=Object(N.useMemo)(function(){return Yt?[].concat(Object(B.a)(At),[hn]):At},[Yt,At]),fr=Object(N.useMemo)(function(){return Yt?[].concat(Object(B.a)(dt),[hn]):dt},[Yt,dt]),vr=Object(N.useMemo)(function(){var br=Ne.right,Rr=Ne.left;return Object(Q.a)(Object(Q.a)({},Ne),{},{left:Ue==="rtl"?[].concat(Object(B.a)(Rr.map(function(Jt){return Jt+Yt})),[0]):Rr,right:Ue==="rtl"?br:[].concat(Object(B.a)(br.map(function(Jt){return Jt+Yt})),[0]),isSticky:$t})},[Yt,Ne,$t]),ir=C(ft,He);return N.createElement("div",{style:Object(Q.a)({overflow:"hidden"},$t?{top:Ee}:{}),ref:vn,className:z()("".concat(xt,"-header"),Object(te.a)({},De,!!De))},N.createElement("table",{style:{tableLayout:"fixed",visibility:Ct||ir?null:"hidden"}},N.createElement(f,{colWidths:ir?[].concat(Object(B.a)(ir),[Yt]):[],columCount:He+1,columns:fr}),N.createElement(E,Object.assign({},Fe,{stickyOffsets:vr,columns:Gn,flattenColumns:fr}))))});x.displayName="FixedHeader";var _=x,j=N.createContext(null),W=j;function w(et){var Ze=et.prefixCls,Ct=et.children,At=et.component,dt=et.cellComponent,ft=et.fixHeader,He=et.fixColumn,Ne=et.horizonScroll,Ue=et.className,ge=et.expanded,Ee=et.componentWidth,De=et.colSpan,ue=N.useContext(u.a),Fe=ue.scrollbarSize;return N.useMemo(function(){var at=Ct;return He&&(at=N.createElement("div",{style:{width:Ee-(ft?Fe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ze,"-expanded-row-fixed")},at)),N.createElement(At,{className:Ue,style:{display:ge?null:"none"}},N.createElement(t.a,{component:dt,prefixCls:Ze,colSpan:De},at))},[Ct,At,ft,Ne,Ue,ge,Ee,De,Fe])}var F=w;function I(et){var Ze=et.className,Ct=et.style,At=et.record,dt=et.index,ft=et.rowKey,He=et.getRowKey,Ne=et.rowExpandable,Ue=et.expandedKeys,ge=et.onRow,Ee=et.indent,De=Ee===void 0?0:Ee,ue=et.rowComponent,Fe=et.cellComponent,at=et.childrenColumnName,xt=N.useContext(u.a),Gt=xt.prefixCls,$t=xt.fixedInfoList,Yt=N.useContext(W),$n=Yt.fixHeader,vn=Yt.fixColumn,ln=Yt.horizonScroll,hn=Yt.componentWidth,Gn=Yt.flattenColumns,fr=Yt.expandableType,vr=Yt.expandRowByClick,ir=Yt.onTriggerExpand,br=Yt.rowClassName,Rr=Yt.expandedRowClassName,Jt=Yt.indentSize,Ar=Yt.expandIcon,Nn=Yt.expandedRowRender,Tn=Yt.expandIconColumnIndex,pr=N.useState(!1),_r=Object(K.a)(pr,2),Pr=_r[0],yr=_r[1],mt=Ue&&Ue.has(et.recordKey);N.useEffect(function(){mt&&yr(!0)},[mt]);var Ge=fr==="row"&&(!Ne||Ne(At)),Ot=fr==="nest",Me=at&&At&&At[at],ye=Ge||Ot,ve;ge&&(ve=ge(At,dt));var or=function(O){if(vr&&ye&&ir(At,O),ve&&ve.onClick){for(var M,X=arguments.length,se=new Array(X>1?X-1:0),Z=1;Z<X;Z++)se[Z-1]=arguments[Z];(M=ve).onClick.apply(M,[O].concat(se))}},en;typeof br=="string"?en=br:typeof br=="function"&&(en=br(At,dt,De));var Ie=Object(R.a)(Gn),gt=N.createElement(ue,Object.assign({},ve,{"data-row-key":ft,className:z()(Ze,"".concat(Gt,"-row"),"".concat(Gt,"-row-level-").concat(De),en,ve&&ve.className),style:Object(Q.a)(Object(Q.a)({},Ct),ve?ve.style:null),onClick:or}),Gn.map(function(q,O){var M=q.render,X=q.dataIndex,se=q.className,Z=Ie[O],Le=$t[O],ot;O===(Tn||0)&&Ot&&(ot=N.createElement(N.Fragment,null,N.createElement("span",{style:{paddingLeft:"".concat(Jt*De,"px")},className:"".concat(Gt,"-row-indent indent-level-").concat(De)}),Ar({prefixCls:Gt,expanded:mt,expandable:Me,record:At,onExpand:ir})));var wt;return q.onCell&&(wt=q.onCell(At,dt)),N.createElement(t.a,Object.assign({className:se,ellipsis:q.ellipsis,align:q.align,component:Fe,prefixCls:Gt,key:Z,record:At,index:dt,dataIndex:X,render:M,shouldCellUpdate:q.shouldCellUpdate},Le,{appendNode:ot,additionalProps:wt}))})),Ce;if(Ge&&(Pr||mt)){var cn=Nn(At,dt,De+1,mt),hr=Rr&&Rr(At,dt,De);Ce=N.createElement(F,{expanded:mt,className:z()("".concat(Gt,"-expanded-row"),"".concat(Gt,"-expanded-row-level-").concat(De+1),hr),prefixCls:Gt,fixHeader:$n,fixColumn:vn,horizonScroll:ln,component:ue,componentWidth:hn,cellComponent:Fe,colSpan:Gn.length},cn)}var mr;return Me&&mt&&(mr=(At[at]||[]).map(function(q,O){var M=He(q,O);return N.createElement(I,Object.assign({},et,{key:M,rowKey:M,record:q,recordKey:M,index:O,indent:De+1}))})),N.createElement(N.Fragment,null,gt,Ce,mr)}I.displayName="BodyRow";var v=I,H=N.createContext(null),Y=H;function ie(et){var Ze=et.columnKey,Ct=et.onColumnResize,At=N.useRef();return N.useEffect(function(){At.current&&Ct(Ze,At.current.offsetWidth)},[]),N.createElement(g.a,{onResize:function(ft){var He=ft.offsetWidth;Ct(Ze,He)}},N.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},N.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function le(et){var Ze=et.data,Ct=et.getRowKey,At=et.measureColumnWidth,dt=et.expandedKeys,ft=et.onRow,He=et.rowExpandable,Ne=et.emptyNode,Ue=et.childrenColumnName,ge=N.useContext(Y),Ee=ge.onColumnResize,De=N.useContext(u.a),ue=De.prefixCls,Fe=De.getComponent,at=N.useContext(W),xt=at.fixHeader,Gt=at.horizonScroll,$t=at.flattenColumns,Yt=at.componentWidth;return N.useMemo(function(){var $n=Fe(["body","wrapper"],"tbody"),vn=Fe(["body","row"],"tr"),ln=Fe(["body","cell"],"td"),hn;Ze.length?hn=Ze.map(function(fr,vr){var ir=Ct(fr,vr);return N.createElement(v,{key:ir,rowKey:ir,record:fr,recordKey:ir,index:vr,rowComponent:vn,cellComponent:ln,expandedKeys:dt,onRow:ft,getRowKey:Ct,rowExpandable:He,childrenColumnName:Ue})}):hn=N.createElement(F,{expanded:!0,className:"".concat(ue,"-placeholder"),prefixCls:ue,fixHeader:xt,fixColumn:Gt,horizonScroll:Gt,component:vn,componentWidth:Yt,cellComponent:ln,colSpan:$t.length},Ne);var Gn=Object(R.a)($t);return N.createElement($n,{className:"".concat(ue,"-tbody")},At&&N.createElement("tr",{"aria-hidden":"true",className:"".concat(ue,"-measure-row"),style:{height:0}},Gn.map(function(fr){return N.createElement(ie,{key:fr,columnKey:fr,onColumnResize:Ee})})),hn)},[Ze,ue,ft,At,dt,Ct,Fe,Yt,Ne,$t])}var he=N.memo(le);he.displayName="Body";var we=he,Pe=U("wRmb"),xe=U("xEkU"),Oe=U.n(xe);function pe(et){var Ze=Object(N.useRef)(et),Ct=Object(N.useState)({}),At=Object(K.a)(Ct,2),dt=At[1],ft=Object(N.useRef)(null),He=Object(N.useRef)([]);function Ne(Ue){ft.current===null&&(He.current=[],ft.current=Oe()(function(){He.current.forEach(function(ge){Ze.current=ge(Ze.current)}),ft.current=null,dt({})})),He.current.push(Ue)}return Object(N.useEffect)(function(){return function(){Oe.a.cancel(ft.current)}},[]),[Ze.current,Ne]}function be(et){var Ze=Object(N.useRef)(et),Ct=Object(N.useRef)(null);function At(){window.clearTimeout(Ct.current)}function dt(He){Ze.current=He,At(),Ct.current=window.setTimeout(function(){Ze.current=null,Ct.current=null},100)}function ft(){return Ze.current}return Object(N.useEffect)(function(){return At},[]),[dt,ft]}function ne(et,Ze,Ct){var At=Object(N.useMemo)(function(){for(var dt=[],ft=[],He=0,Ne=0,Ue=0;Ue<Ze;Ue+=1)if(Ct==="rtl"){ft[Ue]=Ne,Ne+=et[Ue]||0;var ge=Ze-Ue-1;dt[ge]=He,He+=et[ge]||0}else{dt[Ue]=He,He+=et[Ue]||0;var Ee=Ze-Ue-1;ft[Ee]=Ne,Ne+=et[Ee]||0}return{left:dt,right:ft}},[et,Ze,Ct]);return At}var fe=ne;function _e(et){var Ze=et.className,Ct=et.children;return N.createElement("div",{className:Ze},Ct)}var ke=_e,qe=U("n6Qo");function je(et){var Ze,Ct=et.prefixCls,At=et.record,dt=et.onExpand,ft=et.expanded,He=et.expandable,Ne="".concat(Ct,"-row-expand-icon");if(!He)return N.createElement("span",{className:z()(Ne,"".concat(Ct,"-row-spaced"))});var Ue=function(Ee){dt(At,Ee),Ee.stopPropagation()};return N.createElement("span",{className:z()(Ne,(Ze={},Object(te.a)(Ze,"".concat(Ct,"-row-expanded"),ft),Object(te.a)(Ze,"".concat(Ct,"-row-collapsed"),!ft),Ze)),onClick:Ue})}function st(et,Ze,Ct){var At=[];function dt(ft){(ft||[]).forEach(function(He,Ne){At.push(Ze(He,Ne)),dt(He[Ct])})}return dt(et),At}var vt=U("zT1h"),Re=U("y0+3"),Be=function(Ze,Ct){var At,dt,ft=Ze.scrollBodyRef,He=Ze.onScroll,Ne=Ze.offsetScroll,Ue=N.useContext(u.a),ge=Ue.prefixCls,Ee=((At=ft.current)===null||At===void 0?void 0:At.scrollWidth)||0,De=((dt=ft.current)===null||dt===void 0?void 0:dt.clientWidth)||0,ue=Ee&&De*(De/Ee),Fe=N.useRef(),at=pe({scrollLeft:0,isHiddenScrollBar:!1}),xt=Object(K.a)(at,2),Gt=xt[0],$t=xt[1],Yt=N.useRef({delta:0,x:0}),$n=N.useState(!1),vn=Object(K.a)($n,2),ln=vn[0],hn=vn[1],Gn=function(){hn(!1)},fr=function(Jt){Jt.persist(),Yt.current.delta=Jt.pageX-Gt.scrollLeft,Yt.current.x=0,hn(!0),Jt.preventDefault()},vr=function(Jt){var Ar,Nn=Jt||((Ar=window)===null||Ar===void 0?void 0:Ar.event),Tn=Nn.buttons;if(!ln||Tn===0){ln&&hn(!1);return}var pr=Yt.current.x+Jt.pageX-Yt.current.x-Yt.current.delta;pr<=0&&(pr=0),pr+ue>=De&&(pr=De-ue),He({scrollLeft:pr/De*(Ee+2)}),Yt.current.x=Jt.pageX},ir=function(){var Jt=Object(Re.b)(ft.current).top,Ar=Jt+ft.current.offsetHeight,Nn=document.documentElement.scrollTop+window.innerHeight;Ar-Object(m.a)()<=Nn||Jt>=Nn-Ne?$t(function(Tn){return Object(Q.a)(Object(Q.a)({},Tn),{},{isHiddenScrollBar:!0})}):$t(function(Tn){return Object(Q.a)(Object(Q.a)({},Tn),{},{isHiddenScrollBar:!1})})},br=function(Jt){$t(function(Ar){return Object(Q.a)(Object(Q.a)({},Ar),{},{scrollLeft:Jt/Ee*De||0})})};return N.useImperativeHandle(Ct,function(){return{setScrollLeft:br}}),N.useEffect(function(){var Rr=Object(vt.a)(document.body,"mouseup",Gn,!1),Jt=Object(vt.a)(document.body,"mousemove",vr,!1);return ir(),function(){Rr.remove(),Jt.remove()}},[ue,ln]),N.useEffect(function(){var Rr=Object(vt.a)(window,"scroll",ir,!1),Jt=Object(vt.a)(window,"resize",ir,!1);return function(){Rr.remove(),Jt.remove()}},[]),N.useEffect(function(){Gt.isHiddenScrollBar||$t(function(Rr){var Jt,Ar;return Object(Q.a)(Object(Q.a)({},Rr),{},{scrollLeft:ft.current.scrollLeft/((Jt=ft.current)===null||Jt===void 0?void 0:Jt.scrollWidth)*((Ar=ft.current)===null||Ar===void 0?void 0:Ar.clientWidth)})})},[Gt.isHiddenScrollBar]),Ee<=De||!ue||Gt.isHiddenScrollBar?null:N.createElement("div",{style:{height:Object(m.a)(),width:De,bottom:Ne},className:"".concat(ge,"-sticky-scroll")},N.createElement("div",{onMouseDown:fr,ref:Fe,className:z()("".concat(ge,"-sticky-scroll-bar"),Object(te.a)({},"".concat(ge,"-sticky-scroll-bar-active"),ln)),style:{width:"".concat(ue,"px"),transform:"translate3d(".concat(Gt.scrollLeft,"px, 0, 0)")}}))},Ye=N.forwardRef(Be);function Ke(et,Ze){return N.useMemo(function(){var Ct=!!et;return{isSticky:Ct,stickyClassName:Ct?"".concat(Ze,"-sticky-header"):"",offsetHeader:Object(J.a)(et)==="object"&&et.offsetHeader||0,offsetScroll:Object(J.a)(et)==="object"&&et.offsetScroll||0}},[et,Ze])}var yt=[],Pt={},Ht="rc-table-internal-hook",Xt=N.memo(function(et){var Ze=et.children;return Ze},function(et,Ze){return D()(et.props,Ze.props)?et.pingLeft!==Ze.pingLeft||et.pingRight!==Ze.pingRight:!1});function an(et){var Ze,Ct=et.prefixCls,At=et.className,dt=et.rowClassName,ft=et.style,He=et.data,Ne=et.rowKey,Ue=et.scroll,ge=et.tableLayout,Ee=et.direction,De=et.title,ue=et.footer,Fe=et.summary,at=et.id,xt=et.showHeader,Gt=et.components,$t=et.emptyText,Yt=et.onRow,$n=et.onHeaderRow,vn=et.internalHooks,ln=et.transformColumns,hn=et.internalRefs,Gn=et.sticky,fr=He||yt,vr=!!fr.length,ir=N.useState(0),br=Object(K.a)(ir,2),Rr=br[0],Jt=br[1];N.useEffect(function(){Jt(Object(m.a)())});var Ar=N.useMemo(function(){return Object(R.c)(Gt,{})},[Gt]),Nn=N.useCallback(function(er,tr){return Object(R.b)(Ar,er)||tr},[Ar]),Tn=N.useMemo(function(){return typeof Ne=="function"?Ne:function(er){var tr=er&&er[Ne];return tr}},[Ne]),pr=Object(b.c)(et),_r=pr.expandIcon,Pr=pr.expandedRowKeys,yr=pr.defaultExpandedRowKeys,mt=pr.defaultExpandAllRows,Ge=pr.expandedRowRender,Ot=pr.onExpand,Me=pr.onExpandedRowsChange,ye=pr.expandRowByClick,ve=pr.rowExpandable,or=pr.expandIconColumnIndex,en=pr.expandedRowClassName,Ie=pr.childrenColumnName,gt=pr.indentSize,Ce=_r||je,cn=Ie||"children",hr=N.useMemo(function(){return Ge?"row":et.expandable&&vn===Ht&&et.expandable.__PARENT_RENDER_ICON__||fr.some(function(er){return er&&Object(J.a)(er)==="object"&&er[cn]})?"nest":!1},[!!Ge,fr]),mr=N.useState(function(){return yr||(mt?st(fr,Tn,cn):[])}),q=Object(K.a)(mr,2),O=q[0],M=q[1],X=N.useMemo(function(){return new Set(Pr||O||[])},[Pr,O]),se=N.useCallback(function(er){var tr=Tn(er,fr.indexOf(er)),Qt,Rn=X.has(tr);Rn?(X.delete(tr),Qt=Object(B.a)(X)):Qt=[].concat(Object(B.a)(X),[tr]),M(Qt),Ot&&Ot(!Rn,er),Me&&Me(Qt)},[Tn,X,fr,Ot,Me]),Z=N.useState(0),Le=Object(K.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(Pe.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},et),pr),{},{expandable:!!Ge,expandedKeys:X,getRowKey:Tn,onTriggerExpand:se,expandIcon:Ce,expandIconColumnIndex:or,direction:Ee}),vn===Ht?ln:null),ct=Object(K.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=N.useMemo(function(){return{columns:Et,flattenColumns:Mt}},[Et,Mt]),Yn=N.useRef(),Hn=N.useRef(),fn=N.useRef(),Wt=N.useState(!1),sn=Object(K.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=N.useState(!1),Bn=Object(K.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=pe(new Map),Sn=Object(K.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(R.a)(Mt),nr=Xn.map(function(er){return un.get(er)}),Ln=N.useMemo(function(){return nr},[nr.join("_")]),Kn=fe(Ln,Mt.length,Ee),rn=Ue&&Object(R.d)(Ue.y),_n=Ue&&Object(R.d)(Ue.x),In=_n&&Mt.some(function(er){var tr=er.fixed;return tr}),wn=N.useRef(),Zn=Ke(Gn,Ct),yn=Zn.isSticky,Vn=Zn.offsetHeader,qn=Zn.offsetScroll,kn=Zn.stickyClassName,Pn,Mn,Dn;rn&&(Mn={overflowY:"scroll",maxHeight:Ue.y}),_n&&(Pn={overflowX:"auto"},rn||(Mn={overflowY:"hidden"}),Dn={width:Ue.x===!0?"auto":Ue.x,minWidth:"100%"});var dn=N.useCallback(function(er,tr){Un(function(Qt){var Rn=new Map(Qt);return Rn.set(er,tr),Rn})},[]),Ut=be(null),zt=Object(K.a)(Ut,2),Vt=zt[0],jt=zt[1];function nn(er,tr){if(!tr)return;typeof tr=="function"?tr(er):tr.scrollLeft!==er&&(tr.scrollLeft=er)}var bn=function(tr){var Qt=tr.currentTarget,Rn=tr.scrollLeft,zn=typeof Rn=="number"?Rn:Qt.scrollLeft,rr=Qt||Pt;if(!jt()||jt()===rr){var On;Vt(rr),nn(zn,Hn.current),nn(zn,fn.current),nn(zn,(On=wn.current)===null||On===void 0?void 0:On.setScrollLeft)}if(Qt){var Ir=Qt.scrollWidth,jr=Qt.clientWidth;Ft(zn>0),Jn(zn<Ir-jr)}},gn=function(){fn.current&&bn({currentTarget:fn.current})},bt=function(tr){var Qt=tr.width;gn(),wt(Yn.current?Yn.current.offsetWidth:Qt)};N.useEffect(function(){return gn},[]),N.useEffect(function(){_n&&gn()},[_n]),N.useEffect(function(){vn===Ht&&hn&&(hn.body.current=fn.current)});var lt=Nn(["table"],"table"),Je=N.useMemo(function(){return ge||(In?Ue.x==="max-content"?"auto":"fixed":rn||Mt.some(function(er){var tr=er.ellipsis;return tr})?"fixed":"auto")},[rn,In,Mt,ge]),nt,ze={colWidths:Ln,columCount:Mt.length,stickyOffsets:Kn,onHeaderRow:$n,fixHeader:rn},pt=N.useMemo(function(){return vr?null:typeof $t=="function"?$t():$t},[vr,$t]),rt=N.createElement(we,{data:fr,measureColumnWidth:rn||_n||yn,expandedKeys:X,rowExpandable:ve,getRowKey:Tn,onRow:Yt,emptyNode:pt,childrenColumnName:cn}),Tt=N.createElement(f,{colWidths:Mt.map(function(er){var tr=er.width;return tr}),columns:Mt}),Nt=Fe&&N.createElement(qe.b,null,Fe(fr)),St=Nn(["body"]);if(rn||yn){var Kt;typeof St=="function"?(Kt=St(fr,{scrollbarSize:Rr,ref:fn,onScroll:bn}),ze.colWidths=Mt.map(function(er,tr){var Qt=er.width,Rn=tr===Et.length-1?Qt-Rr:Qt;return typeof Rn=="number"&&!Number.isNaN(Rn)?Rn:(Object(p.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Kt=N.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Pn),Mn),onScroll:bn,ref:fn,className:z()("".concat(Ct,"-body"))},N.createElement(lt,{style:Object(Q.a)(Object(Q.a)({},Dn),{},{tableLayout:Je})},Tt,rt,Nt),yn&&N.createElement(Ye,{ref:wn,offsetScroll:qn,scrollBodyRef:fn,onScroll:bn})),nt=N.createElement(N.Fragment,null,xt!==!1&&N.createElement(_,Object.assign({noData:!fr.length},ze,Cn,{direction:Ee,offsetHeader:Vn,stickyClassName:kn,ref:Hn,onScroll:bn})),Kt)}else nt=N.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Pn),Mn),className:z()("".concat(Ct,"-content")),onScroll:bn,ref:fn},N.createElement(lt,{style:Object(Q.a)(Object(Q.a)({},Dn),{},{tableLayout:Je})},Tt,xt!==!1&&N.createElement(E,Object.assign({},ze,Cn)),rt,Nt));var Rt=Object(b.b)(et),It=N.createElement("div",Object.assign({className:z()(Ct,At,(Ze={},Object(te.a)(Ze,"".concat(Ct,"-rtl"),Ee==="rtl"),Object(te.a)(Ze,"".concat(Ct,"-ping-left"),qt),Object(te.a)(Ze,"".concat(Ct,"-ping-right"),xn),Object(te.a)(Ze,"".concat(Ct,"-layout-fixed"),ge==="fixed"),Object(te.a)(Ze,"".concat(Ct,"-fixed-header"),rn),Object(te.a)(Ze,"".concat(Ct,"-fixed-column"),In),Object(te.a)(Ze,"".concat(Ct,"-scroll-horizontal"),_n),Object(te.a)(Ze,"".concat(Ct,"-has-fix-left"),Mt[0]&&Mt[0].fixed),Object(te.a)(Ze,"".concat(Ct,"-has-fix-right"),Mt[Mt.length-1]&&Mt[Mt.length-1].fixed==="right"),Ze)),style:ft,id:at,ref:Yn},Rt),N.createElement(Xt,{pingLeft:qt,pingRight:xn,props:Object(Q.a)(Object(Q.a)({},et),{},{stickyOffsets:Kn,mergedExpandedKeys:X})},De&&N.createElement(ke,{className:"".concat(Ct,"-title")},De(fr)),N.createElement("div",{className:"".concat(Ct,"-container")},nt),ue&&N.createElement(ke,{className:"".concat(Ct,"-footer")},ue(fr))));_n&&(It=N.createElement(g.a,{onResize:bt},It));var En=N.useMemo(function(){return{prefixCls:Ct,getComponent:Nn,scrollbarSize:Rr,direction:Ee,fixedInfoList:Mt.map(function(er,tr){return o(tr,tr,Mt,Kn,Ee)}),isSticky:yn}},[Ct,Nn,Rr,Ee,Mt,Kn,Ee,yn]),on=N.useMemo(function(){return Object(Q.a)(Object(Q.a)({},Cn),{},{tableLayout:Je,rowClassName:dt,expandedRowClassName:en,componentWidth:ot,fixHeader:rn,fixColumn:In,horizonScroll:_n,expandIcon:Ce,expandableType:hr,expandRowByClick:ye,expandedRowRender:Ge,onTriggerExpand:se,expandIconColumnIndex:or,indentSize:gt})},[Cn,Je,dt,en,ot,rn,In,_n,Ce,hr,ye,Ge,se,or,gt]),gr=N.useMemo(function(){return{onColumnResize:dn}},[dn]);return N.createElement(u.a.Provider,{value:En},N.createElement(W.Provider,{value:on},N.createElement(Y.Provider,{value:gr},It)))}an.Column=d.a,an.ColumnGroup=a.a,an.Summary=qe.a,an.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var tn=Ae.b=an},wRmb:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return D});var te=U("rePB"),Q=U("KQm4"),B=U("VTBJ"),J=U("Ff2n"),K=U("q1tI"),N=U.n(K),$=U("Kwbf"),z=U("Zm9Q"),r=U("hW8S");function D(d){return Object(z.a)(d).filter(function(s){return K.isValidElement(s)}).map(function(s){var i=s.key,t=s.props,u=t.children,o=Object(J.a)(t,["children"]),R=Object(B.a)({key:i},o);return u&&(R.children=D(u)),R})}function p(d){return d.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)(p(o).map(function(R){return Object(B.a)({fixed:u},R)}))):[].concat(Object(Q.a)(s),[Object(B.a)(Object(B.a)({},i),{},{fixed:u})])},[])}function g(d){for(var s=!0,i=0;i<d.length;i+=1){var t=d[i];if(s&&t.fixed!=="left")s=!1;else if(!s&&t.fixed==="left"){Object($.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,o=d.length-1;o>=0;o-=1){var R=d[o];if(u&&R.fixed!=="right")u=!1;else if(!u&&R.fixed==="right"){Object($.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function m(d){return d.map(function(s){var i=s.fixed,t=Object(J.a)(s,["fixed"]),u=i;return i==="left"?u="right":i==="right"&&(u="left"),Object(B.a)({fixed:u},t)})}function a(d,s){var i=d.prefixCls,t=d.columns,u=d.children,o=d.expandable,R=d.expandedKeys,T=d.getRowKey,S=d.onTriggerExpand,A=d.expandIcon,P=d.rowExpandable,E=d.expandIconColumnIndex,b=d.direction,h=d.expandRowByClick,f=K.useMemo(function(){return t||D(u)},[t,u]),C=K.useMemo(function(){if(o){var j,W=E||0,w=f[W],F=(j={},Object(te.a)(j,r.a,{className:"".concat(i,"-expand-icon-col")}),Object(te.a)(j,"title",""),Object(te.a)(j,"fixed",w?w.fixed:null),Object(te.a)(j,"className","".concat(i,"-row-expand-icon-cell")),Object(te.a)(j,"render",function(H,Y,ie){var le=T(Y,ie),he=R.has(le),we=P?P(Y):!0,Pe=A({prefixCls:i,expanded:he,expandable:we,record:Y,onExpand:S});return h?K.createElement("span",{onClick:function(Oe){return Oe.stopPropagation()}},Pe):Pe}),j),I=f.slice();return W>=0&&I.splice(W,0,F),I}return f},[o,f,T,R,A,b]),x=K.useMemo(function(){var j=C;return s&&(j=s(j)),j.length||(j=[{render:function(){return null}}]),j},[s,C,b]),_=K.useMemo(function(){return b==="rtl"?m(p(x)):p(x)},[x,b]);return[x,_]}Ae.b=a},"y0+3":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return p}),U.d(Ae,"b",function(){return m});var te=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},B={cssFloat:1,styleFloat:1,float:1};function J(a){return a.nodeType===1?a.ownerDocument.defaultView.getComputedStyle(a,null):{}}function K(a,d,s){if(d=d.toLowerCase(),s==="auto"){if(d==="height")return a.offsetHeight;if(d==="width")return a.offsetWidth}return d in Q||(Q[d]=te.test(d)),Q[d]?parseFloat(s)||0:s}function N(a,d){var s=arguments.length,i=J(a);return d=B[d]?"cssFloat"in a.style?"cssFloat":"styleFloat":d,s===1?i:K(a,d,i[d]||a.style[d])}function $(a,d,s){var i=arguments.length;if(d=B[d]?"cssFloat"in a.style?"cssFloat":"styleFloat":d,i===3)return typeof s=="number"&&te.test(d)&&(s="".concat(s,"px")),a.style[d]=s,s;for(var t in d)d.hasOwnProperty(t)&&$(a,t,d[t]);return J(a)}function z(a){return a===document.body?document.documentElement.clientWidth:a.offsetWidth}function r(a){return a===document.body?window.innerHeight||document.documentElement.clientHeight:a.offsetHeight}function D(){var a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:a,height:d}}function p(){var a=document.documentElement.clientWidth,d=window.innerHeight||document.documentElement.clientHeight;return{width:a,height:d}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(a){var d=a.getBoundingClientRect(),s=document.documentElement;return{left:d.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:d.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},"yTi+":function(kt,Ae,U){kt.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"},zWo0:function(kt,Ae,U){kt.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"}}}]);
|