(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,6,7,8,20],{"+BqJ":function(Wt,st,z){Wt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(Z,U){"use strict";function ee(o,l){o.cmdState.push(l)}function W(o){return o.cmdState.length>0?o.cmdState[o.cmdState.length-1]:null}function M(o){var l=o.cmdState.pop();l&&l.closeBracket()}function $(o){for(var l=o.cmdState,r=l.length-1;r>=0;r--){var i=l[r];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function X(o,l,r){return function(){this.name=o,this.bracketNo=0,this.style=l,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=X("importmodule","tag",["string","builtin"]),k.documentclass=X("documentclass","tag",["","atom"]),k.usepackage=X("usepackage","tag",["atom"]),k.begin=X("begin","tag",["atom"]),k.end=X("end","tag",["atom"]),k.label=X("label","tag",["atom"]),k.ref=X("ref","tag",["atom"]),k.eqref=X("eqref","tag",["atom"]),k.cite=X("cite","tag",["atom"]),k.bibitem=X("bibitem","tag",["atom"]),k.Bibitem=X("Bibitem","tag",["atom"]),k.RBibitem=X("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(o,l){o.f=l}function m(o,l){var r;if(o.match(/^\\[a-zA-Z@]+/)){var i=o.current().slice(1);return r=k.hasOwnProperty(i)?k[i]:k.DEFAULT,r=new r,ee(l,r),D(l,f),r.style}if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/\\]/))return"tag";if(o.match("\\["))return D(l,function(c,h){return v(c,h,"\\]")}),"keyword";if(o.match("\\("))return D(l,function(c,h){return v(c,h,"\\)")}),"keyword";if(o.match("$$"))return D(l,function(c,h){return v(c,h,"$$")}),"keyword";if(o.match("$"))return D(l,function(c,h){return v(c,h,"$")}),"keyword";var t=o.next();if(t=="%")return o.skipToEnd(),"comment";if(t=="}"||t=="]"){if(r=W(l),r)r.closeBracket(t),D(l,f);else return"error";return"bracket"}else return t=="{"||t=="["?(r=k.DEFAULT,r=new r,ee(l,r),"bracket"):/\d/.test(t)?(o.eatWhile(/[\w.%]/),"atom"):(o.eatWhile(/[\w\-_]/),r=$(l),r.name=="begin"&&(r.argument=o.current()),r.styleIdentifier())}function v(o,l,r){if(o.eatSpace())return null;if(r&&o.match(r))return D(l,m),"keyword";if(o.match(/^\\[a-zA-Z@]+/))return"tag";if(o.match(/^[a-zA-Z]+/))return"variable-2";if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/]/))return"tag";if(o.match(/^[\^_&]/))return"tag";if(o.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(o.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=o.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(o.skipToEnd(),"comment"):"error"}function f(o,l){var r=o.peek(),i;return r=="{"||r=="["?(i=W(l),i.openBracket(r),o.eat(r),D(l,m),"bracket"):/[ \t\r]/.test(r)?(o.eat(r),null):(D(l,m),M(l),m(o,l))}return{startState:function(){var o=U.inMathMode?function(l,r){return v(l,r)}:m;return{cmdState:[],f:o}},copyState:function(o){return{cmdState:o.cmdState.slice(),f:o.f}},token:function(o,l){return l.f(o,l)},blankLine:function(o){o.f=m,o.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(Wt,st,z){},"19Vz":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(X,k,D){var m=D&&D!=oe.Init;if(k&&!m)X.on("blur",W),X.on("change",M),X.on("swapDoc",M),oe.on(X.getInputField(),"compositionupdate",X.state.placeholderCompose=function(){ee(X)}),M(X);else if(!k&&m){X.off("blur",W),X.off("change",M),X.off("swapDoc",M),oe.off(X.getInputField(),"compositionupdate",X.state.placeholderCompose),Z(X);var v=X.getWrapperElement();v.className=v.className.replace(" CodeMirror-empty","")}k&&!X.hasFocus()&&W(X)});function Z(X){X.state.placeholder&&(X.state.placeholder.parentNode.removeChild(X.state.placeholder),X.state.placeholder=null)}function U(X){Z(X);var k=X.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=X.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var D=X.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),k.appendChild(D),X.display.lineSpace.insertBefore(k,X.display.lineSpace.firstChild)}function ee(X){setTimeout(function(){var k=!1,D=X.getInputField();D.nodeName=="TEXTAREA"?k=!D.value:X.lineCount()==1&&(k=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),k?U(X):Z(X)},20)}function W(X){$(X)&&U(X)}function M(X){var k=X.getWrapperElement(),D=$(X);k.className=k.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?U(X):Z(X)}function $(X){return X.lineCount()===1&&X.getLine(0)===""}})},"1ZF9":function(Wt,st,z){Wt.exports=z.p+"static/Authorize.cc9c212f.png"},"1eCo":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";var Z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(ee,W){var M=ee.indentUnit,$={},X=W.htmlMode?Z:U;for(var k in X)$[k]=X[k];for(var k in W)$[k]=W[k];var D,m;function v(d,E){function g(N){return E.tokenize=N,N(d,E)}var y=d.next();if(y=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?g(l("atom","]]>")):null:d.match("--")?g(l("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),g(r(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),E.tokenize=l("meta","?>"),"meta"):(D=d.eat("/")?"closeTag":"openTag",E.tokenize=f,"tag bracket");if(y=="&"){var F;return d.eat("#")?d.eat("x")?F=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):F=d.eatWhile(/[\d]/)&&d.eat(";"):F=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),F?"atom":"error"}else return d.eatWhile(/[^&<]/),null}v.isInText=!0;function f(d,E){var g=d.next();if(g==">"||g=="/"&&d.eat(">"))return E.tokenize=v,D=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return D="equals",null;if(g=="<"){E.tokenize=v,E.state=h,E.tagName=E.tagStart=null;var y=E.tokenize(d,E);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(g)?(E.tokenize=o(g),E.stringStartCol=d.column(),E.tokenize(d,E)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(d){var E=function(g,y){for(;!g.eol();)if(g.next()==d){y.tokenize=f;break}return"string"};return E.isInAttribute=!0,E}function l(d,E){return function(g,y){for(;!g.eol();){if(g.match(E)){y.tokenize=v;break}g.next()}return d}}function r(d){return function(E,g){for(var y;(y=E.next())!=null;){if(y=="<")return g.tokenize=r(d+1),g.tokenize(E,g);if(y==">")if(d==1){g.tokenize=v;break}else return g.tokenize=r(d-1),g.tokenize(E,g)}return"meta"}}function i(d,E,g){this.prev=d.context,this.tagName=E,this.indent=d.indented,this.startOfLine=g,($.doNotIndent.hasOwnProperty(E)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function t(d){d.context&&(d.context=d.context.prev)}function c(d,E){for(var g;;){if(!d.context)return;if(g=d.context.tagName,!$.contextGrabbers.hasOwnProperty(g)||!$.contextGrabbers[g].hasOwnProperty(E))return;t(d)}}function h(d,E,g){return d=="openTag"?(g.tagStart=E.column(),A):d=="closeTag"?S:h}function A(d,E,g){return d=="word"?(g.tagName=E.current(),m="tag",R):$.allowMissingTagName&&d=="endTag"?(m="tag bracket",R(d,E,g)):(m="error",A)}function S(d,E,g){if(d=="word"){var y=E.current();return g.context&&g.context.tagName!=y&&$.implicitlyClosed.hasOwnProperty(g.context.tagName)&&t(g),g.context&&g.context.tagName==y||$.matchClosing===!1?(m="tag",w):(m="tag error",O)}else return $.allowMissingTagName&&d=="endTag"?(m="tag bracket",w(d,E,g)):(m="error",O)}function w(d,E,g){return d!="endTag"?(m="error",w):(t(g),h)}function O(d,E,g){return m="error",w(d,E,g)}function R(d,E,g){if(d=="word")return m="attribute",b;if(d=="endTag"||d=="selfcloseTag"){var y=g.tagName,F=g.tagStart;return g.tagName=g.tagStart=null,d=="selfcloseTag"||$.autoSelfClosers.hasOwnProperty(y)?c(g,y):(c(g,y),g.context=new i(g,y,F==g.indented)),h}return m="error",R}function b(d,E,g){return d=="equals"?_:($.allowMissing||(m="error"),R(d,E,g))}function _(d,E,g){return d=="string"?u:d=="word"&&$.allowUnquoted?(m="string",R):(m="error",R(d,E,g))}function u(d,E,g){return d=="string"?u:R(d,E,g)}return{startState:function(d){var E={tokenize:v,state:h,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(E.baseIndent=d),E},token:function(d,E){if(!E.tagName&&d.sol()&&(E.indented=d.indentation()),d.eatSpace())return null;D=null;var g=E.tokenize(d,E);return(g||D)&&g!="comment"&&(m=null,E.state=E.state(D||g,d,E),m&&(g=m=="error"?g+" error":m)),g},indent:function(d,E,g){var y=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+M;if(y&&y.noIndent)return oe.Pass;if(d.tokenize!=f&&d.tokenize!=v)return g?g.match(/^(\s*)/)[0].length:0;if(d.tagName)return $.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+M*($.multilineTagIndentFactor||1);if($.alignCDATA&&/$/,blockCommentStart:"",configuration:$.htmlMode?"html":"xml",helperType:$.htmlMode?"html":"xml",skipAttribute:function(d){d.state==_&&(d.state=R)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var E=[],g=d.context;g;g=g.prev)g.tagName&&E.push(g.tagName);return E.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2aBv":function(Wt,st,z){"use strict";var oe=z("2qtc"),Z=z("kLXV"),U=z("0Owb"),ee=z("14J3"),W=z("BMrR"),M=z("jCWc"),$=z("kPKH"),X=z("+L6B"),k=z("2/Rp"),D=z("oBTY"),m=z("tJVT"),v=z("q1tI"),f=z.n(v),o=z("ngQI"),l=z("Ty5D"),r=z("YIbm"),i=z.n(r),t=function(h){var A=h.visible,S=h.onOk,w=h.onCancel,O=h.data,R=Object(v.useState)([]),b=Object(m.a)(R,2),_=b[0],u=b[1],d=Object(v.useState)(!1),E=Object(m.a)(d,2),g=E[0],y=E[1],F=Object(l.i)();Object(v.useEffect)(function(){if(!A){u([]),y(!1);return}u(Object(D.a)(O)||[])},[A]);var N=function(){y(!0),S(_,function(){y(!1)})},H=function(){w()},G=function(B,Y,re){var de=Array.from(B),he=de.splice(Y,1),xe=Object(m.a)(he,1),Pe=xe[0];return de.splice(re,0,Pe),de},I=function(B,Y){if(!B.destination)return;var re=G(Y,B.source.index,B.destination.index);u(re)};return f.a.createElement(Z.a,{title:"\u9898\u578B\u6392\u5E8F",visible:A,centered:!0,onCancel:H,footer:f.a.createElement("div",null,f.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),f.a.createElement(k.a,{onClick:H},"\u53D6\u6D88"),f.a.createElement(k.a,{type:"primary",loading:g,onClick:N},"\u786E\u8BA4")),width:"680px"},f.a.createElement("div",{className:i.a.content},f.a.createElement(W.a,null,f.a.createElement($.a,{span:12},"\u5E8F\u53F7"),f.a.createElement($.a,{span:12},"\u9898\u578B\u540D\u79F0")),f.a.createElement(o.a,{onDragEnd:function(B){return I(B,_)}},f.a.createElement(o.c,{droppableId:"droppable"},function(x,B){return f.a.createElement("div",Object(U.a)({ref:x.innerRef},x.droppableProps,{style:{width:"100%"}}),_.map(function(Y,re){return f.a.createElement(o.b,{key:re,draggableId:re.toString(),index:re},function(de,he){return f.a.createElement("aside",Object(U.a)({ref:de.innerRef},de.draggableProps,de.dragHandleProps),f.a.createElement("div",null,f.a.createElement(W.a,{style:{backgroundColor:re%2===0?"#f5f5f5":"#fff"}},f.a.createElement($.a,{span:12},re+1),f.a.createElement($.a,{span:12},Y))))})}))}))))};st.a=t},"55Ip":function(Wt,st,z){"use strict";z.d(st,"a",function(){return c});var oe=z("Ty5D"),Z=z("dI71"),U=z("q1tI"),ee=z.n(U),W=z("YS25"),M=z("17x9"),$=z.n(M),X=z("wx14"),k=z("zLVn"),D=z("9R94"),m=function(_){Object(Z.a)(u,_);function u(){for(var E,g=arguments.length,y=new Array(g),F=0;F=0||g.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;_.setState({goInputText:""}),N(_.getValidValue())},_.go=function(g){var y=_.state.goInputText;if(y==="")return;(g.keyCode===o.ENTER||g.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(W.a)(b,[{key:"getValidValue",value:function(){var u=this.state,d=u.goInputText,E=u.current;return!d||isNaN(d)?E:Number(d)}},{key:"getPageSizeOptions",value:function(){var u=this.props,d=u.pageSize,E=u.pageSizeOptions;return E.some(function(g){return g.toString()===d.toString()})?E:E.concat([d.toString()]).sort(function(g,y){var F=isNaN(Number(g))?0:Number(g),N=isNaN(Number(y))?0:Number(y);return F-N})}},{key:"render",value:function(){var u=this,d=this.props,E=d.pageSize,g=d.locale,y=d.rootPrefixCls,F=d.changeSize,N=d.quickGo,H=d.goButton,G=d.selectComponentClass,I=d.buildOptionText,x=d.selectPrefixCls,B=d.disabled,Y=this.state.goInputText,re="".concat(y,"-options"),de=G,he=null,xe=null,Pe=null;if(!F&&!N)return null;var Ce=this.getPageSizeOptions();if(F&&de){var Oe=Ce.map(function(be,ge){return k.a.createElement(de.Option,{key:ge,value:be.toString()},(I||u.buildOptionText)(be))});he=k.a.createElement(de,{disabled:B,prefixCls:x,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||Ce[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ge){return ge.parentNode}},Oe)}return N&&(H&&(Pe=typeof H=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:B,className:"".concat(re,"-quick-jumper-button")},g.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),xe=k.a.createElement("div",{className:"".concat(re,"-quick-jumper")},g.jump_to,k.a.createElement("input",{disabled:B,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Pe)),k.a.createElement("li",{className:"".concat(re)},he,xe)}}]),b}(k.a.Component);l.defaultProps={pageSizeOptions:["10","20","50","100"]};var r=l,i=z("N2Kk");function t(){}function c(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function h(O,R,b){return b}function A(O,R,b){var _=typeof O=="undefined"?R.pageSize:O;return Math.floor((b.total-1)/_)+1}var S=function(O){Object(M.a)(b,O);var R=Object($.a)(b);function b(_){var u;Object(ee.a)(this,b),u=R.call(this,_),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(A(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(F,N){var H=u.props.prefixCls,G=F||k.a.createElement("button",{type:"button","aria-label":N,className:"".concat(H,"-item-link")});return typeof F=="function"&&(G=k.a.createElement(F,Object(U.a)({},u.props))),G},u.savePaginationNode=function(F){u.paginationNode=F},u.isValid=function(F){return c(F)&&F!==u.state.current},u.shouldDisplayQuickJumper=function(){var F=u.props,N=F.showQuickJumper,H=F.pageSize,G=F.total;return G<=H?!1:N},u.handleKeyDown=function(F){(F.keyCode===o.ARROW_UP||F.keyCode===o.ARROW_DOWN)&&F.preventDefault()},u.handleKeyUp=function(F){var N=u.getValidValue(F),H=u.state.currentInputValue;N!==H&&u.setState({currentInputValue:N}),F.keyCode===o.ENTER?u.handleChange(N):F.keyCode===o.ARROW_UP?u.handleChange(N-1):F.keyCode===o.ARROW_DOWN&&u.handleChange(N+1)},u.changePageSize=function(F){var N=u.state.current,H=A(F,u.state,u.props);N=N>H?H:N,H===0&&(N=u.state.current),typeof F=="number"&&("pageSize"in u.props||u.setState({pageSize:F}),"current"in u.props||u.setState({current:N,currentInputValue:N})),u.props.onShowSizeChange(N,F),"onChange"in u.props&&u.props.onChange&&u.props.onChange(N,F)},u.handleChange=function(F){var N=u.props.disabled,H=F;if(u.isValid(H)&&!N){var G=A(void 0,u.state,u.props);H>G?H=G:H<1&&(H=1),"current"in u.props||u.setState({current:H,currentInputValue:H});var I=u.state.pageSize;return u.props.onChange(H,I),H}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current2?H-2:0),I=2;I=E?y=E:y=Number(d),y}},{key:"getShowSizeChanger",value:function(){var u=this.props,d=u.showSizeChanger,E=u.total,g=u.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:E>g}},{key:"renderPrev",value:function(u){var d=this.props,E=d.prevIcon,g=d.itemRender,y=g(u,"prev",this.getItemIcon(E,"prev page")),F=!this.hasPrev();return Object(X.isValidElement)(y)?Object(X.cloneElement)(y,{disabled:F}):y}},{key:"renderNext",value:function(u){var d=this.props,E=d.nextIcon,g=d.itemRender,y=g(u,"next",this.getItemIcon(E,"next page")),F=!this.hasNext();return Object(X.isValidElement)(y)?Object(X.cloneElement)(y,{disabled:F}):y}},{key:"render",value:function(){var u=this,d=this.props,E=d.prefixCls,g=d.className,y=d.style,F=d.disabled,N=d.hideOnSinglePage,H=d.total,G=d.locale,I=d.showQuickJumper,x=d.showLessItems,B=d.showTitle,Y=d.showTotal,re=d.simple,de=d.itemRender,he=d.showPrevNextJumpers,xe=d.jumpPrevIcon,Pe=d.jumpNextIcon,Ce=d.selectComponentClass,Oe=d.selectPrefixCls,be=d.pageSizeOptions,ge=this.state,te=ge.current,fe=ge.pageSize,_e=ge.currentInputValue;if(N===!0&&H<=fe)return null;var Le=A(void 0,this.state,this.props),$e=[],Ue=null,at=null,ft=null,Ct=null,yt=null,_t=I&&I.goButton,lt=x?1:2,Ft=te-1>0?te-1:0,Xt=te+1=lt*2&&te!==1+2&&($e[0]=Object(X.cloneElement)($e[0],{className:"".concat(E,"-item-after-jump-prev")}),$e.unshift(Ue)),Le-te>=lt*2&&te!==Le-2&&($e[$e.length-1]=Object(X.cloneElement)($e[$e.length-1],{className:"".concat(E,"-item-before-jump-next")}),$e.push(at)),Ot!==1&&$e.unshift(ft),Et!==Le&&$e.push(Ct)}var Be=null;Y&&(Be=k.a.createElement("li",{className:"".concat(E,"-total-text")},Y(H,[H===0?0:(te-1)*fe+1,te*fe>H?H:te*fe])));var Ie=!this.hasPrev()||!Le,ke=!this.hasNext()||!Le;return k.a.createElement("ul",Object(oe.a)({className:m()(E,g,Object(Z.a)({},"".concat(E,"-disabled"),F)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},Jt),Be,k.a.createElement("li",{title:B?G.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(Ft)),$e,k.a.createElement("li",{title:B?G.next_page:null,onClick:this.next,tabIndex:ke?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),ke)),"aria-disabled":ke},this.renderNext(Xt)),k.a.createElement(r,{disabled:F,locale:G,rootPrefixCls:E,selectComponentClass:Ce,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:te,pageSize:fe,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:_t}))}}],[{key:"getDerivedStateFromProps",value:function(u,d){var E={};if("current"in u&&(E.current=u.current,u.current!==d.current&&(E.currentInputValue=E.current)),"pageSize"in u&&u.pageSize!==d.pageSize){var g=d.current,y=A(u.pageSize,d,u);g=g>y?y:g,"current"in u||(E.current=g,E.currentInputValue=g),E.pageSize=u.pageSize}return E}}]),b}(k.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var w=S},"69hG":function(Wt,st,z){Wt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(Wt,st,z){"use strict";var oe=z("wCXF"),Z=z("n6Qo");z.d(st,"b",function(){return Z.a});var U=z("IBYe"),ee=z("6eGT"),W=z("hW8S");z.d(st,"a",function(){return W.a}),st.c=oe.b},"6UM0":function(Wt,st,z){var oe,Z;(function(){var U;(function(){"use strict";var W=[function(k,D,m){var v=m(1).Beautifier,f=m(5).Options;function o(l,r){var i=new v(l,r);return i.beautify()}k.exports=o,k.exports.defaultOptions=function(){return new f}},function(k,D,m){var v=m(2).Output,f=m(3).Token,o=m(4),l=m(5).Options,r=m(7).Tokenizer,i=m(7).line_starters,t=m(7).positionable_operators,c=m(7).TOKEN;function h(x,B){return B.indexOf(x)!==-1}function A(x){return x.replace(/^\s+/g,"")}function S(x){for(var B={},Y=0;YY&&(Y=x.line_indent_level));var re={mode:B,parent:x,last_token:x?x.last_token:new f(c.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:x?x.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},G.prototype._reset=function(x){var B=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new v(this._options,B),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var Y=new r(x,this._options);return this._tokens=Y.tokenize(),x},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,B=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,B&&o.lineBreak.test(B||"")&&(Y=B.match(o.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return x=this._output.get_code(Y),x},G.prototype.handle_token=function(x,B){x.type===c.START_EXPR?this.handle_start_expr(x):x.type===c.END_EXPR?this.handle_end_expr(x):x.type===c.START_BLOCK?this.handle_start_block(x):x.type===c.END_BLOCK?this.handle_end_block(x):x.type===c.WORD?this.handle_word(x):x.type===c.RESERVED?this.handle_word(x):x.type===c.SEMICOLON?this.handle_semicolon(x):x.type===c.STRING?this.handle_string(x):x.type===c.EQUALS?this.handle_equals(x):x.type===c.OPERATOR?this.handle_operator(x):x.type===c.COMMA?this.handle_comma(x):x.type===c.BLOCK_COMMENT?this.handle_block_comment(x,B):x.type===c.COMMENT?this.handle_comment(x,B):x.type===c.DOT?this.handle_dot(x):x.type===c.EOF?this.handle_eof(x):x.type===c.UNKNOWN?this.handle_unknown(x,B):this.handle_unknown(x,B)},G.prototype.handle_whitespace_and_comments=function(x,B){var Y=x.newlines,re=this._options.keep_array_indentation&&y(this._flags.mode);if(x.comments_before)for(var de=x.comments_before.next();de;)this.handle_whitespace_and_comments(de,B),this.handle_token(de,B),de=x.comments_before.next();if(re)for(var he=0;he0,B);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,B);for(var xe=1;xe0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(x){var B=!1;return B=B||O(this._flags.last_token,["var","let","const"])&&x.type===c.WORD,B=B||w(this._flags.last_token,"do"),B=B||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&O(this._flags.last_token,I)&&!x.newlines,B=B||w(this._flags.last_token,"else")&&!(w(x,"if")&&!x.comments_before),B=B||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),B=B||this._flags.last_token.type===c.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==c.WORD&&x.type!==c.RESERVED,B=B||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),B?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,O(x,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var B=d.Expression;if(x.text==="["){if(this._flags.last_token.type===c.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(B),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}B=d.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),h(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,B=d.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,B=d.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var re=this._tokens.peek(-4);O(Y,["async","function"])||Y.text==="*"&&O(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(re.text==="{"||re.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===c.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&h(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===c.START_BLOCK?this.print_newline():(this._flags.last_token.type===c.END_EXPR||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===c.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(B),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===c.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(x),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var B=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):Y&&(h(Y.text,[":",","])&&h(B.type,[c.STRING,c.WORD,c.RESERVED])||h(B.text,["get","set","..."])&&h(Y.type,[c.WORD,c.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(Y.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===c.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):h(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!B.comments_before&&B.text==="}",de=re&&this._flags.last_word==="function"&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var he=0,xe=null;this._flags.inline_frame=!0;do if(he+=1,xe=this._tokens.peek(he-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==c.EOF&&!(xe.type===c.END_BLOCK&&xe.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(de||this._flags.last_token.type===c.EQUALS||O(this._flags.last_token,R)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.COMMA)&&((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type===c.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===d.Statement;)this.restore_mode();var B=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!B?this._output.space_before_token=!0:this._options.brace_style==="expand"?B||this.print_newline():B||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},G.prototype.handle_word=function(x){if(x.type===c.RESERVED){if(h(x.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)x.type=c.WORD;else if(x.text==="import"&&h(this._tokens.peek().text,["(","."]))x.type=c.WORD;else if(h(x.text,["as","from"])&&!this._flags.import_block)x.type=c.WORD;else if(this._flags.mode===d.ObjectLiteral){var B=this._tokens.peek();B.text===":"&&(x.type=c.WORD)}}if(this.start_of_statement(x)?O(this._flags.last_token,["var","let","const"])&&x.type===c.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==c.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(w(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x)),w(x,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===c.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,I)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var Y="NONE";if(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":O(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===d.BlockStatement?Y="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&F(this._flags.mode)?Y="SPACE":this._flags.last_token.type===c.STRING?Y="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&h(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===c.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),O(x,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),O(x,["else","catch","finally"]))if((!(this._flags.last_token.type===c.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?O(this._flags.last_token,R)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?(this._flags.last_token.type!==c.START_EXPR||!O(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(x,"if")&&w(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(x,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===c.WORD||x.previous.type===c.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===c.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(x,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var B=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&w(B,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},G.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===c.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===c.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},G.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},G.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},G.prototype.handle_operator=function(x){var B=x.text==="*"&&(O(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),Y=h(x.text,["-","+"])&&(h(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||h(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var re=!B;this.handle_whitespace_and_comments(x,re)}if(x.text==="*"&&this._flags.last_token.type===c.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===c.OPERATOR&&h(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var de=!0,he=!0,xe=!1;if(x.text===":"?this._flags.ternary_depth===0?de=!1:(this._flags.ternary_depth-=1,xe=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!B&&this._options.preserve_newlines&&h(x.text,t)){var Pe=x.text===":",Ce=Pe&&xe,Oe=Pe&&!xe;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!Oe,this.print_token(x),(!Pe||Ce)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Pe||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case _.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(x),de=!(this._output.just_added_newline()||Oe),this._output.space_before_token=de,this.print_token(x),this._output.space_before_token=!0;return}}if(B){this.allow_wrap_or_preserved_newline(x),de=!1;var be=this._tokens.peek();he=be&&h(be.type,[c.WORD,c.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),de=this._flags.last_token.type===c.START_BLOCK,he=!1;else if(h(x.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),de=!1,he=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ge=O(this._flags.last_token,R)&&x.newlines;ge&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ge,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(de=!0),this._flags.last_token.type===c.RESERVED?de=!0:this._flags.last_token.type===c.END_EXPR?de=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===c.OPERATOR&&(de=h(x.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(x.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||de,this.print_token(x),this._output.space_before_token=he},G.prototype.handle_block_comment=function(x,B){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,B),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!o.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,B)},G.prototype.print_block_commment=function(x,B){var Y=g(x.text),re,de=!1,he=!1,xe=x.whitespace_before,Pe=xe.length;if(this.print_newline(!1,B),this.print_token_line_indentation(x),this._output.add_token(Y[0]),this.print_newline(!1,B),Y.length>1){for(Y=Y.slice(1),de=N(Y,"*"),he=H(Y,xe),de&&(this._flags.alignment=1),re=0;re=0;o--)if(this.__items[o].match(f))return!0;return!1},D.prototype.set_indent=function(f,o){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var o=f.lastIndexOf(`
`);o!==-1?this.__character_count=f.length-o:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function m(f,o){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),o=o||"",f.indent_level>0&&(o=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(f,o){var l=this.__base_string_length;return o=o||0,f<0&&(l=0),l+=f*this.__indent_size,l+=o,l},m.prototype.get_indent_string=function(f,o){var l=this.__base_string;return o=o||0,f<0&&(f=0,l=""),o+=f*this.__indent_size,this.__ensure_cache(o),l+=this.__cache[o],l},m.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var f=this.__cache.length,o=0,l="";this.__indent_size&&f>=this.__indent_size&&(o=Math.floor(f/this.__indent_size),f-=o*this.__indent_size,l=new Array(o+1).join(this.__indent_string)),f&&(l+=new Array(f+1).join(" ")),this.__cache.push(l)};function v(f,o){this.__indent_cache=new m(f,o),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(f,o){return this.__indent_cache.get_indent_string(f,o)},v.prototype.get_indent_size=function(f,o){return this.__indent_cache.get_indent_size(f,o)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(f){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return f!==`
`&&(l=l.replace(/[\n]/g,f)),l},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(f,o){return f=f||0,o=o||0,this.next_line.set_indent(f,o),this.__lines.length>1?(this.current_line.set_indent(f,o),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(f){for(var o=0;o1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(f,o){for(var l=this.__lines.length-2;l>=0;){var r=this.__lines[l];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==o){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},k.exports.Output=v},function(k){function D(m,v,f,o){this.type=m,this.text=v,this.comments_before=null,this.newlines=f||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=D},function(k,D){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",o="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+v+f+o+"])*";D.identifier=new RegExp(l+r,"g"),D.identifierStart=new RegExp(l),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+v+f+o+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(k,D,m){var v=m(6).Options,f=["before-newline","after-newline","preserve-newline"];function o(l){v.call(this,l,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var _=new RegExp(b),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+d.join("|")+")$"),g,y=function(N,H){f.call(this,N,H),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new i(this._input),I=new t(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(r.identifier).matching(r.identifierMatch),number:G.matching(S),punct:G.matching(_),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(//),include:G.starting_with(/#include/).until_after(r.lineBreak),shebang:G.starting_with(/#!/).until_after(r.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};y.prototype=new f,y.prototype._is_comment=function(N){return N.type===h.COMMENT||N.type===h.BLOCK_COMMENT||N.type===h.UNKNOWN},y.prototype._is_opening=function(N){return N.type===h.START_BLOCK||N.type===h.START_EXPR},y.prototype._is_closing=function(N,H){return(N.type===h.END_BLOCK||N.type===h.END_EXPR)&&H&&(N.text==="]"&&H.text==="["||N.text===")"&&H.text==="("||N.text==="}"&&H.text==="{")},y.prototype._reset=function(){g=!1},y.prototype._get_next_token=function(N,H){var G=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(h.EOF,""):(G=G||this._read_non_javascript(I),G=G||this._read_string(I),G=G||this._read_word(N),G=G||this._read_singles(I),G=G||this._read_comment(I),G=G||this._read_regexp(I,N),G=G||this._read_xml(I,N),G=G||this._read_punctuation(),G=G||this._create_token(h.UNKNOWN,this._input.next()),G)},y.prototype._read_word=function(N){var H;if(H=this.__patterns.identifier.read(),H!=="")return H=H.replace(r.allLineBreaks,`
`),!(N.type===h.DOT||N.type===h.RESERVED&&(N.text==="set"||N.text==="get"))&&E.test(H)?(H==="in"||H==="of")&&(N.type===h.WORD||N.type===h.STRING)?this._create_token(h.OPERATOR,H):this._create_token(h.RESERVED,H):this._create_token(h.WORD,H);if(H=this.__patterns.number.read(),H!=="")return this._create_token(h.WORD,H)},y.prototype._read_singles=function(N){var H=null;return N==="("||N==="["?H=this._create_token(h.START_EXPR,N):N===")"||N==="]"?H=this._create_token(h.END_EXPR,N):N==="{"?H=this._create_token(h.START_BLOCK,N):N==="}"?H=this._create_token(h.END_BLOCK,N):N===";"?H=this._create_token(h.SEMICOLON,N):N==="."&&O.test(this._input.peek(1))?H=this._create_token(h.DOT,N):N===","&&(H=this._create_token(h.COMMA,N)),H&&this._input.next(),H},y.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(h.EQUALS,N):N==="?."?this._create_token(h.DOT,N):this._create_token(h.OPERATOR,N)},y.prototype._read_non_javascript=function(N){var H="";if(N==="#"){if(this._is_first_token()&&(H=this.__patterns.shebang.read(),H))return this._create_token(h.UNKNOWN,H.trim()+`
`);if(H=this.__patterns.include.read(),H)return this._create_token(h.UNKNOWN,H.trim()+`
`);N=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(w)){do N=this._input.next(),G+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,G)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(H=this.__patterns.html_comment_start.read(),H){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)H+=this._input.next();return g=!0,this._create_token(h.COMMENT,H)}}else if(g&&N==="-"&&(H=this.__patterns.html_comment_end.read(),H))return g=!1,this._create_token(h.COMMENT,H);return null},y.prototype._read_comment=function(N){var H=null;if(N==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var I=A.get_directives(G);I&&I.ignore==="start"&&(G+=A.readIgnored(this._input)),G=G.replace(r.allLineBreaks,`
`),H=this._create_token(h.BLOCK_COMMENT,G),H.directives=I}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),H=this._create_token(h.COMMENT,G))}return H},y.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var H=this._input.next();return this.has_char_escapes=!1,N==="`"?H+=this._read_string_recursive("`",!0,"${"):H+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(H=F(H)),this._input.peek()===N&&(H+=this._input.next()),H=H.replace(r.allLineBreaks,`
`),this._create_token(h.STRING,H)}return null},y.prototype._allow_regexp_or_xml=function(N){return N.type===h.RESERVED&&c(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===h.END_EXPR&&N.text===")"&&N.opened.previous.type===h.RESERVED&&c(N.opened.previous.text,["if","while","for"])||c(N.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},y.prototype._read_regexp=function(N,H){if(N==="/"&&this._allow_regexp_or_xml(H)){for(var G=this._input.next(),I=!1,x=!1;this._input.hasNext()&&(I||x||this._input.peek()!==N)&&!this._input.testChar(r.newline);)G+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===N&&(G+=this._input.next(),G+=this._input.read(r.identifier)),this._create_token(h.STRING,G)}return null},y.prototype._read_xml=function(N,H){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(H)){var G="",I=this.__patterns.xml.read_match();if(I){for(var x=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),B=x.indexOf("{")===0,Y=0;I;){var re=!!I[1],de=I[2],he=!!I[I.length-1]||de.slice(0,8)==="![CDATA[";if(!he&&(de===x||B&&de.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--Y:++Y),G+=I[0],Y<=0)break;I=this.__patterns.xml.read_match()}return I||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(r.allLineBreaks,`
`),this._create_token(h.STRING,G)}}return null};function F(N){for(var H="",G=0,I=new v(N),x=null;I.hasNext();)if(x=I.match(/([\s]|[^\\]|\\\\)+/g),x&&(H+=x[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")x=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")x=I.match(/u([0-9A-Fa-f]{4})/g);else{H+="\\",I.hasNext()&&(H+=I.next());continue}if(!x)return N;if(G=parseInt(x[1],16),G>126&&G<=255&&x[0].indexOf("x")===0)return N;if(G>=0&&G<32){H+="\\"+x[0];continue}else G===34||G===39||G===92?H+="\\"+String.fromCharCode(G):H+=String.fromCharCode(G)}return H}y.prototype._read_string_recursive=function(N,H,G){var I,x;N==="'"?x=this.__patterns.single_quote:N==='"'?x=this.__patterns.double_quote:N==="`"?x=this.__patterns.template_text:N==="}"&&(x=this.__patterns.template_expression);for(var B=x.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===N||!H&&r.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Y+=this._input.next()):G&&(G==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),G===Y&&(N==="`"?Y+=this._read_string_recursive("}",H,"`"):Y+=this._read_string_recursive("`",H,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=x.read(),B+=Y}return B},k.exports.Tokenizer=y,k.exports.TOKEN=h,k.exports.positionable_operators=R.slice(),k.exports.line_starters=u.slice()},function(k){var D=RegExp.prototype.hasOwnProperty("sticky");function m(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position=0&&v=0&&f=v.length&&this.__input.substring(f-v.length,f).toLowerCase()===v},k.exports.InputScanner=m},function(k,D,m){var v=m(8).InputScanner,f=m(3).Token,o=m(10).TokenStream,l=m(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,c){this._input=new v(t),this._options=c||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,c=new f(r.START,""),h=null,A=[],S=new o;c.type!==r.EOF;){for(t=this._get_next_token(c,h);this._is_comment(t);)S.add(t),t=this._get_next_token(c,h);S.isEmpty()||(t.comments_before=S,S=new o),t.parent=h,this._is_opening(t)?(A.push(h),h=t):h&&this._is_closing(t,h)&&(t.opened=h,h.closed=t,h=A.pop(),t.parent=h),t.previous=c,c.next=t,this.__tokens.add(t),c=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,c){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(r.RAW,h):this._create_token(r.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,c){return!1},i.prototype._create_token=function(t,c){var h=new f(t,c,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=i,k.exports.TOKEN=r},function(k){function D(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position=0&&m/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new v,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(l){var r=this._create();return r._disabled[l]=!0,r._update(),r},o.prototype.read_options=function(l){var r=this._create();for(var i in f)r._disabled[i]=l.templating.indexOf(i)===-1;return r._update(),r},o.prototype.exclude=function(l){var r=this._create();return r._excluded[l]=!0,r._update(),r},o.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),l+=r,r=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},o.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},o.prototype._read_template=function(){var l="",r=this._input.peek();if(r==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(l=l||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},k.exports.TemplatablePattern=o}],M={};function $(k){var D=M[k];if(D!==void 0)return D.exports;var m=M[k]={exports:{}};return W[k](m,m.exports,$),m.exports}var X=$(0);U=X})();var ee=U;!(oe=[],Z=function(){return{js_beautify:ee}}.apply(st,oe),Z!==void 0&&(Wt.exports=Z))})()},"6eGT":function(Wt,st,z){"use strict";function oe(Z){return null}st.a=oe},"7Cbv":function(Wt,st,z){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function U(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(Z)}var ee=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function W(f){return typeof f=="string"&&ee.test(f)}for(var M=W,$=[],X=0;X<256;++X)$.push((X+256).toString(16).substr(1));function k(f){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=($[f[o+0]]+$[f[o+1]]+$[f[o+2]]+$[f[o+3]]+"-"+$[f[o+4]]+$[f[o+5]]+"-"+$[f[o+6]]+$[f[o+7]]+"-"+$[f[o+8]]+$[f[o+9]]+"-"+$[f[o+10]]+$[f[o+11]]+$[f[o+12]]+$[f[o+13]]+$[f[o+14]]+$[f[o+15]]).toLowerCase();if(!M(l))throw TypeError("Stringified UUID is invalid");return l}var D=k;function m(f,o,l){f=f||{};var r=f.random||(f.rng||U)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,o){l=l||0;for(var i=0;i<16;++i)o[l+i]=r[i];return o}return D(r)}var v=st.a=m},"7ahc":function(Wt,st,z){"use strict";z.d(st,"a",function(){return A});var oe=z("k1fw"),Z=z("0Owb"),U=z("+L6B"),ee=z("2/Rp"),W=z("y8nQ"),M=z("Vl3Y"),$=z("tJVT"),X=z("OaEy"),k=z("2fM7"),D=z("q1tI"),m=z.n(D),v=z("VrN/"),f=z.n(v),o=z("p77/"),l=z.n(o),r=z("c5Ni"),i=z.n(r),t=k.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},h={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};st.b=function(S){var w=S.callback,O=S.onCancel,R=Object(D.useState)("python"),b=Object($.a)(R,2),_=b[0],u=b[1];function d(g){u(h[g][1])}function E(g){w(g)}return m.a.createElement(M.a,Object(Z.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(k.a,{onChange:d},Object.keys(h).map(function(g){return m.a.createElement(t,{key:g,value:g},h[g][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(A,{mode:_})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(ee.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(ee.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function A(S){var w=S.value,O=S.onChange,R=S.mode,b=S.options,_=b===void 0?{}:b,u=Object(D.useRef)(),d=Object(D.useState)(),E=Object($.a)(d,2),g=E[0],y=E[1];return Object(D.useEffect)(function(){if(g){function F(N){var H=N.getValue();O&&O(H)}return g.on("change",F),function(){g.off("change",F)}}},[g,O]),Object(D.useEffect)(function(){g&&g.setOption("mode",R)},[g,R]),Object(D.useEffect)(function(){g&&((w!==g.getValue()||w==="")&&setTimeout(function(){g.setValue(w||" ")},300))},[g,w]),Object(D.useEffect)(function(){if(u.current&&!g){var F=f.a.fromTextArea(u.current,Object(oe.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));y(F)}},[u.current,g]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:u}))}},"7qnI":function(Wt,st,z){"use strict";var oe=z("5Dmo"),Z=z("3S7+"),U=z("fWQN"),ee=z("mtLc"),W=z("yKVA"),M=z("879j"),$=z("5NDa"),X=z("5rEg"),k=z("q1tI"),D=z.n(k),m=z("O2Wb"),v=z.n(m),f=X.a.TextArea,o=function(l){Object(W.a)(i,l);var r=Object(M.a)(i);function i(){return Object(U.a)(this,i),r.apply(this,arguments)}return Object(ee.a)(i,[{key:"render",value:function(){var c=this,h=this.props,A=h.index,S=h.onAnswerChange,w=h.addChildAnswer,O=h.exerciseIsPublish,R=h.answers,b=h.activeOptionErrorIndex,_=h.flex,u=_===void 0?"0 0 1000px":_;return D.a.createElement("div",{className:v.a.flex},D.a.createElement("div",{className:"".concat(v.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",A+1,"):"),D.a.createElement("div",{className:"".concat(v.a.flex," ").concat(v.a.flex1),style:{flexDirection:"column"}},R.map(function(d,E){var g="".concat(A,"-").concat(E);return D.a.createElement("div",{className:"".concat(v.a.flex," ").concat(v.a.flex1),key:E},D.a.createElement("div",{className:v.a.flex1,style:{flex:u}},D.a.createElement("div",null,D.a.createElement(f,{className:g===b?v.a.error:"",spellCheck:!1,rows:4,value:d||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(E==0?"":"(\u53EF\u9009)"),onChange:function(F){return S(A,E,F.target.value)},style:{minHeight:95}}))),!O&&D.a.createElement(D.a.Fragment,null,E!=0&&D.a.createElement(Z.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(v.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswer(A,E)},style:{float:"right"}})),E===0&&D.a.createElement(Z.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(v.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswermain(A,E)},style:{float:"right"}})),D.a.createElement(Z.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(v.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return w(A)},style:{float:"right",visibility:E==R.length-1?"":"hidden"}}))))})))}}]),i}(k.Component);st.a=o},"815F":function(Wt,st,z){"use strict";z.d(st,"e",function(){return $}),z.d(st,"c",function(){return k}),z.d(st,"d",function(){return D}),z.d(st,"a",function(){return v}),z.d(st,"f",function(){return f}),z.d(st,"b",function(){return o});var oe=z("KQm4"),Z=z("VTBJ"),U=z("Ff2n"),ee=z("Zm9Q"),W=z("Kwbf"),M=z("OZM5");function $(l,r){return l!=null?l:r}function X(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=new Map;function i(t){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(h){var A=h.key,S=h.children;Object(W.a)(A!=null,"Tree node must have a certain key: [".concat(c).concat(A,"]"));var w=String(A);Object(W.a)(!r.has(w)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(w)),r.set(w,!0),i(S,"".concat(c).concat(w," > "))})}i(l)}function k(l){function r(i){var t=Object(ee.a)(i);return t.map(function(c){if(!Object(M.i)(c))return Object(W.a)(!c,"Tree/TreeNode can only accept TreeNode as children."),null;var h=c.key,A=c.props,S=A.children,w=Object(U.a)(A,["children"]),O=Object(Z.a)({key:h},w),R=r(S);return R.length&&(O.children=R),O}).filter(function(c){return c})}return r(l)}function D(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(r===!0?[]:r),t=[];function c(h){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(S,w){var O=Object(M.h)(A?A.pos:"0",w),R=$(S.key,O),b=Object(Z.a)(Object(Z.a)({},S),{},{parent:A,pos:O,children:null,data:S,isStart:[].concat(Object(oe.a)(A?A.isStart:[]),[w===0]),isEnd:[].concat(Object(oe.a)(A?A.isEnd:[]),[w===h.length-1])});return t.push(b),r===!0||i.has(R)?b.children=c(S.children||[],b):b.children=[],b})}return c(l),t}function m(l,r,i){var t;i?typeof i=="string"?t=function(A){return A[i]}:typeof i=="function"&&(t=function(A){return i(A)}):t=function(A,S){return $(A.key,S)};function c(h,A,S){var w=h?h.children:l,O=h?Object(M.h)(S.pos,A):"0";if(h){var R=t(h,O),b={node:h,index:A,pos:O,key:R,parentPos:S.node?S.pos:null,level:S.level+1};r(b)}w&&w.forEach(function(_,u){c(_,u,{node:h,pos:O,level:S?S.level+1:-1})})}c(null)}function v(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.initWrapper,t=r.processEntity,c=r.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,A={},S={},w={posEntities:A,keyEntities:S};return i&&(w=i(w)||w),m(l,function(O){var R=O.node,b=O.index,_=O.pos,u=O.key,d=O.parentPos,E=O.level,g={node:R,index:b,key:u,pos:_,level:E},y=$(u,_);A[_]=g,S[y]=g,g.parent=A[d],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),t&&t(g,w)},h),c&&c(w),w}function f(l,r){var i=r.expandedKeys,t=r.selectedKeys,c=r.loadedKeys,h=r.loadingKeys,A=r.checkedKeys,S=r.halfCheckedKeys,w=r.dragOverNodeKey,O=r.dropPosition,R=r.keyEntities,b=R[l],_={eventKey:l,expanded:i.indexOf(l)!==-1,selected:t.indexOf(l)!==-1,loaded:c.indexOf(l)!==-1,loading:h.indexOf(l)!==-1,checked:A.indexOf(l)!==-1,halfChecked:S.indexOf(l)!==-1,pos:String(b?b.pos:""),dragOver:w===l&&O===0,dragOverGapTop:w===l&&O===-1,dragOverGapBottom:w===l&&O===1};return _}function o(l){var r=l.data,i=l.expanded,t=l.selected,c=l.checked,h=l.loaded,A=l.loading,S=l.halfChecked,w=l.dragOver,O=l.dragOverGapTop,R=l.dragOverGapBottom,b=l.pos,_=l.active,u=Object(Z.a)(Object(Z.a)({},r),{},{expanded:i,selected:t,checked:c,loaded:h,loading:A,halfChecked:S,dragOver:w,dragOverGapTop:O,dragOverGapBottom:R,pos:b,active:_});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),l}}),u}},"8EBN":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";oe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Z=0;Z-1&&ee.substring($+1,ee.length);if(X)return oe.findModeByExtension(X)},oe.findModeByName=function(ee){ee=ee.toLowerCase();for(var W=0;W=V.length?ae.slice(V.length):ae}).join(`
`)}var i=[],t=[""],c=new o.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){i.length=0,t=[""]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(q,C,L,V){if(C>=q.length||q[C].level<=L)return C;var ae=q[C];V.push("- "+ae.text+""),C++;var Q=[];return C=w(q,C,ae.level,Q),Q.length>0&&(V.push("
"),Q.forEach(function(Ae){V.push(Ae)}),V.push("
")),V.push(" "),C=w(q,C,L,V),C}function O(){return w(i,0,0,t),t.push("
"),t.join("")}var R={heading:function(C){var L=h.exec(C);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(C){var L=this.rules.block.fences.exec(C);if(L){var V=L[0],ae=r(V,L[3]||""),Q=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Q)>=0){var Ae=u(),nt=ae;ae=Ae,d[Ae]={type:"block",expression:nt}}return{type:"code",raw:V,lang:Q,text:ae}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,u=function(){return"__special_katext_id_".concat(_++,"__")},d={};function E(){return d}function g(){_=0,d={}}function y(q){return q=q.replace(b,function(C,L){var V=u();return d[V]={type:"inline",expression:L},V}),q}var F=c.listitem;c.listitem=function(q){return F(y(q))};var N=c.paragraph;c.paragraph=function(q){return N(y(q))};var H=c.tablecell;c.tablecell=function(q,C){return H(y(q),C)},c.code=function(q,C,L){var V=(C||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"".concat(q,"
"):'
').concat(L?q:Object(l.escape)(q,!0),`
`):''+(L?q:Object(l.escape)(q,!0))+"
"},c.heading=function(q,C,L){var V=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:V,level:C,text:q}),"'+q+""},o.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),o.a.use({tokenizer:R,renderer:c});var G=o.a,I=z("SJMd"),x=z("ulZh"),B=z.n(x),Y=z("m3rI"),re=z("Oy/b"),de=z("p5ED"),he=z("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var xe=function(q,C){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var ae in V)Object.prototype.hasOwnProperty.call(V,ae)&&(L[ae]=V[ae])})(q,C)};function Pe(q,C){function L(){this.constructor=q}xe(q,C),q.prototype=C===null?Object.create(C):(L.prototype=C.prototype,new L)}function Ce(q,C,L,V){return new(L||(L=Promise))(function(ae,Q){function Ae(Dt){try{xt(V.next(Dt))}catch(ot){Q(ot)}}function nt(Dt){try{xt(V.throw(Dt))}catch(ot){Q(ot)}}function xt(Dt){var ot;Dt.done?ae(Dt.value):(ot=Dt.value,ot instanceof L?ot:new L(function(vt){vt(ot)})).then(Ae,nt)}xt((V=V.apply(q,C||[])).next())})}function Oe(q,C){var L,V,ae,Q,Ae={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return Q={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function nt(xt){return function(Dt){return function(ot){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,V&&(ae=2&ot[0]?V.return:ot[0]?V.throw||((ae=V.return)&&ae.call(V),0):V.next)&&!(ae=ae.call(V,ot[1])).done)return ae;switch(V=0,ae&&(ot=[2&ot[0],ae.value]),ot[0]){case 0:case 1:ae=ot;break;case 4:return Ae.label++,{value:ot[1],done:!1};case 5:Ae.label++,V=ot[1],ot=[0];continue;case 7:ot=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ae=Ae.trys,(ae=ae.length>0&&ae[ae.length-1])||ot[0]!==6&&ot[0]!==2)){Ae=0;continue}if(ot[0]===3&&(!ae||ot[1]>ae[0]&&ot[1]',"select"),this.addActionButton(V,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(V,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(V,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(V,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(V,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(V,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(V,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Q){var Ae=document.createElement("div");Ae.className=""+L.toolbarButtonStyleClass.name,Ae.setAttribute("data-type-name",Q.typeName),Ae.innerHTML=Q.icon,Ae.addEventListener("click",function(){L.markerToolbarButtonClicked(Ae,Q)}),L.buttons.push(Ae),L.markerButtons.push(Ae)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",ae.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ae),this.addActionButton(ae,'',"render"),this.addActionButton(ae,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},q.prototype.addButtonClickListener=function(C){this.buttonClickListeners.push(C)},q.prototype.removeButtonClickListener=function(C){this.buttonClickListeners.indexOf(C)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(C),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var C=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L0&&this.buttonClickListeners.forEach(function(V){return V("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(C,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(C){this.resetButtonStyles(),C.className=C.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),C.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(C){var L=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===C});L&&this.setActiveButton(L)},q.prototype.setCurrentMarker=function(C){var L=this;this.currentMarker=C,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){L.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},q}(),ft=function(){function q(C,L,V,ae){this.panels=[],this.panelButtons=[],this.markerjsContainer=C,this.displayMode=L,this.uiStyleSettings=V,this.styles=ae,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var C;this.toolboxStyleClass=this.styles.addClass(new Ue("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ue("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ue("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ue("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ue("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ue("toolbox-panel-row_colors",`
background-color: `+((C=this.uiStyleSettings.toolboxBackgroundColor)!==null&&C!==void 0?C:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ue("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},q.prototype.show=function(C){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(C){var L,V,ae=this;this.panels=C,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Ae;Q.uiStyleSettings=ae.uiStyleSettings;var nt=document.createElement("div");nt.className=ae.toolboxButtonStyleClass.name+" "+((Ae=ae.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:ae.toolboxButtonStyleColorsClass.name),nt.innerHTML=Q.icon,nt.title=Q.title,nt.addEventListener("click",function(){ae.panelButtonClick(Q)}),ae.panelButtons.push(nt),ae.buttonRow.appendChild(nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(C){var L=this,V=-1;if(C!==this.activePanel){V=this.panels.indexOf(C),this.panelRow.innerHTML="";var ae=C.getUi();ae.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ae),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=C}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,Ae){var nt,xt;Q.className=L.toolboxButtonStyleClass.name+" "+(Ae===V?""+((nt=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&nt!==void 0?nt:L.toolboxActiveButtonStyleColorsClass.name):""+((xt=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xt!==void 0?xt:L.toolboxButtonStyleColorsClass.name))})},q}(),Ct=function(q,C){this.title=q,this.icon=C},yt=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'')||this;return Ae.colors=[],Ae.addTransparent=!1,Ae.colorBoxes=[],Ae.colors=V,Ae.currentColor=ae,Ae.setCurrentColor=Ae.setCurrentColor.bind(Ae),Ae.getColorBox=Ae.getColorBox.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(ae){var Q=L.getColorBox(ae);V.appendChild(Q),L.colorBoxes.push(Q)}),V},C.prototype.getColorBox=function(L){var V=this,ae=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-ae,Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.boxSizing="content-box",Ae.style.width=Q-2+"px",Ae.style.height=Q-2+"px",Ae.style.padding="1px",Ae.style.marginRight="2px",Ae.style.marginBottom="2px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderRadius=(Q+2)/2+"px",Ae.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){V.setCurrentColor(L,Ae)});var nt=document.createElement("div");return nt.style.display="inline-block",nt.style.width=Q-2+"px",nt.style.height=Q-2+"px",nt.style.backgroundColor=L,nt.style.borderRadius=Q/2+"px",L==="transparent"&&(nt.style.fill=this.uiStyleSettings.toolboxAccentColor,nt.innerHTML=``),Ae.appendChild(nt),Ae},C.prototype.setCurrentColor=function(L,V){var ae=this;this.currentColor=L,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},C}(Ct),_t=function(){function q(C,L,V){this._state="new",this._isSelected=!1,this._container=C,this._overlayContainer=L,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(C){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(C,L){},q.prototype.dblClick=function(C,L){},q.prototype.manipulate=function(C){},q.prototype.pointerUp=function(C){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(C){this.container.childNodes.length>0?this.container.insertBefore(C,this.container.childNodes[0]):this.container.appendChild(C)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(C){this._state=C.state,this.notes=C.notes},q.prototype.scale=function(C,L){},q.prototype.colorChanged=function(C){this.onColorChanged&&this.onColorChanged(C),this.stateChanged()},q.prototype.fillColorChanged=function(C){this.onFillColorChanged&&this.onFillColorChanged(C),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var C=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),C.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(C)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),lt=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(C){return this.topLeft.ownsTarget(C)?this.topLeft:this.topCenter.ownsTarget(C)?this.topCenter:this.topRight.ownsTarget(C)?this.topRight:this.centerLeft.ownsTarget(C)?this.centerLeft:this.centerRight.ownsTarget(C)?this.centerRight:this.bottomLeft.ownsTarget(C)?this.bottomLeft:this.bottomCenter.ownsTarget(C)?this.bottomCenter:this.bottomRight.ownsTarget(C)?this.bottomRight:void 0},q}(),Ft=function(){function q(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},q}(),Xt=function(){function q(){}return q.toITransformMatrix=function(C){return{a:C.a,b:C.b,c:C.c,d:C.d,e:C.e,f:C.f}},q.toSVGMatrix=function(C,L){return C.a=L.a,C.b=L.b,C.c=L.c,C.d=L.d,C.e=L.e,C.f=L.f,C},q}(),Jt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(ge.createTransform()),Q.setupControlBox(),Q}return Pe(C,q),Object.defineProperty(C.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var V=ge.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ae=this.unrotatePoint(L);if(this.manipulationStartX=ae.x,this.manipulationStartY=ae.y,this.offsetX=ae.x-this.left,this.offsetY=ae.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ae=this.container.transform.baseVal.getItem(0);Ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},C.prototype.pointerUp=function(L){var V=this.state;q.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},C.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},C.prototype.manipulate=function(L){var V=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(L)},C.prototype.resize=function(L){var V=this.manipulationStartLeft,ae=this.manipulationStartWidth,Q=this.manipulationStartTop,Ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+L.x-this.manipulationStartX,ae=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ae=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+L.y-this.manipulationStartY,Ae=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ae=this.manipulationStartHeight+L.y-this.manipulationStartY}ae>=0?(this.left=V,this.width=ae):(this.left=V+ae,this.width=-ae),Ae>=0?(this.top=Q,this.height=Ae):(this.top=Q+Ae,this.height=-Ae),this.setSize()},C.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},C.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var V=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},C.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},C.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM(),ae=ge.createPoint(L.x,L.y);return{x:(ae=ae.matrixTransform(V)).x,y:ae.y}},C.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM();V=V.inverse();var ae=ge.createPoint(L.x,L.y);return{x:(ae=ae.matrixTransform(V)).x,y:ae.y}},C.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var L=ge.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=ge.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ge.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new lt,this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},C.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},C.prototype.createGrip=function(){var L=new Ft;return L.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(L.visual),L},C.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,V=-L/2,ae=V,Q=(this.width+this.CB_DISTANCE)/2-L/2,Ae=(this.height+this.CB_DISTANCE)/2-L/2,nt=this.height+this.CB_DISTANCE-L/2,xt=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,V,ae),this.positionGrip(this.controlGrips.topCenter.visual,Q,ae),this.positionGrip(this.controlGrips.topRight.visual,xt,ae),this.positionGrip(this.controlGrips.centerLeft.visual,V,Ae),this.positionGrip(this.controlGrips.centerRight.visual,xt,Ae),this.positionGrip(this.controlGrips.bottomLeft.visual,V,nt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,nt),this.positionGrip(this.controlGrips.bottomRight.visual,xt,nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,ae-3*this.CB_DISTANCE)},C.prototype.positionGrip=function(L,V,ae){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,ae),L.transform.baseVal.replaceItem(Q,0)},C.prototype.hideControlBox=function(){this.controlBox.style.display="none"},C.prototype.showControlBox=function(){this.controlBox.style.display=""},C.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V);var ae=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:ae.x*L,y:ae.y*V});this.left=Q.x,this.top=Q.y,this.width=this.width*L,this.height=this.height*V,this.adjustControlBox()},C}(_t),rn=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},C.prototype.setSize=function(){q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},C.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize()},C.title="Rectangle marker",C}(Jt),En=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'')||this;return Ae.widths=[],Ae.widthBoxes=[],Ae.widths=V,Ae.currentWidth=ae,Ae.setCurrentWidth=Ae.setCurrentWidth.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ae===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentWidth(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.innerText=ae.toString(),Ae.style.marginRight="5px",Q.appendChild(Ae);var nt=document.createElement("div");nt.style.minHeight="20px",nt.style.flexGrow="2",nt.style.display="flex",nt.style.alignItems="center";var xt=document.createElement("hr");xt.style.minWidth="20px",xt.style.border="0px",xt.style.borderTop=ae+"px solid "+L.uiStyleSettings.toolboxColor,xt.style.flexGrow="2",nt.appendChild(xt),Q.appendChild(nt),L.widthBoxes.push(Q)}),V},C.prototype.setCurrentWidth=function(L,V){var ae=this;this.currentWidth=L,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},C}(Ct),mn=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'')||this;return Ae.styles=[],Ae.styleBoxes=[],Ae.styles=V,Ae.currentStyle=ae,Ae.setCurrentStyle=Ae.setCurrentStyle.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.styles.length-5+"%",Q.style.borderColor=ae===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentStyle(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.overflow="hidden";var nt=``;Ae.innerHTML=nt,Q.appendChild(Ae),L.styleBoxes.push(Q)}),V},C.prototype.setCurrentStyle=function(L,V){var ae=this;this.currentStyle=L,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},C}(Ct),Ye=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="FrameMarker",C.title="Frame marker",C.icon='',C}(rn),Xe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ot=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},C.prototype.pointerUp=function(L){var V=this.state;q.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},C.prototype.adjustVisual=function(){},C.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},C.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},C.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){this.positionGrips()},C.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},C.prototype.createGrip=function(){var L=new Ft;return L.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(L.visual),L},C.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},C.prototype.positionGrip=function(L,V,ae){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,ae),L.transform.baseVal.replaceItem(Q,0)},C.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.x1=this.x1*L,this.y1=this.y1*V,this.x2=this.x2*L,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},C}(_t),Et=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},C.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},C.typeName="LineMarker",C.title="Line marker",C.icon='',C}(Ot),Je=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'')||this;return Ae.fonts=[],Ae.fontBoxes=[],Ae.fonts=V,Ae.currentFont=ae,Ae.setCurrentFont=Ae.setCurrentFont.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(ae){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.fonts.length-5+"%",Q.style.borderColor=ae===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentFont(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.fontFamily=ae,Ae.style.overflow="hidden";var nt=document.createElement("div");nt.style.whiteSpace="nowrap",nt.style.overflow="hidden",nt.style.textOverflow="ellipsis",nt.innerHTML="The quick brown fox jumps over the lazy dog",Ae.appendChild(nt),Q.appendChild(Ae),L.fontBoxes.push(Q)}),V},C.prototype.setCurrentFont=function(L,V){var ae=this;this.currentFont=L,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},C}(Ct),mt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=ae.defaultColor,Q.fontFamily=ae.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new yt("Color",ae.defaultColorSet,ae.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new Je("Font",ae.defaultFontFamilies,ae.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){if(q.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(ae){ae===L&&(V=!0)}),V},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(V){L.textElement.appendChild(ge.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},C.prototype.getTextScale=function(){var L=this.textElement.getBBox(),V=1;if(L.width>0&&L.height>0){var ae=(1*this.width-this.width*this.padding*2/100)/L.width,Q=(1*this.height-this.height*this.padding*2/100)/L.height;V=Math.min(ae,Q)}return V},C.prototype.getTextPosition=function(L){var V=this.textElement.getBBox(),ae=0,Q=0;return V.width>0&&V.height>0&&(ae=(this.width-V.width*L)/2,Q=this.height/2-V.height*L/2),{x:ae,y:Q}},C.prototype.sizeText=function(){var L=this.textElement.getBBox(),V=this.getTextScale(),ae=this.getTextPosition(V);ae.y-=L.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ae.x+"px, "+ae.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ae.x,ae.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},C.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},C.prototype.pointerUp=function(L){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,L),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},C.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&V>.9;)V-=.1,L.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var ae=V.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(ae)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},C.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ae=this.textElement.getBBox(),Q={x:ae.width*L,y:ae.height*L};V.x-=Q.x/2,V.y-=Q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},C.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},C.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},C.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},C.prototype.dblClick=function(L,V){q.prototype.dblClick.call(this,L,V),this.showTextEditor()},C.prototype.setColor=function(L){this.textElement&&ge.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},C.prototype.setFont=function(L){this.textElement&&ge.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},C.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},C.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){var V=L;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize(),this.sizeText(),this.positionTextEditor()},C.typeName="TextMarker",C.title="Text marker",C.icon='',C}(Jt),Be=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=ae.defaultColor,Q.lineWidth=ae.defaultStrokeWidth,Q.pixelRatio=ae.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new yt("Color",ae.defaultColorSet,ae.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var L=ge.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):q.prototype.pointerDown.call(this,L,V)},C.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,L)},C.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},C.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},C.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},C.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ae=V[0],Q=V[1],Ae=V[2],nt=V[3],xt=!1,Dt=0;Dt0&&(xt=!0,Dtnt&&(nt=Dt),ot>Ae&&(Ae=ot));if(xt){this.left=ae/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Ae-ae)/this.pixelRatio,this.height=(nt-Q)/this.pixelRatio;var vt=document.createElement("canvas");vt.width=Ae-ae,vt.height=nt-Q,vt.getContext("2d").putImageData(this.canvasContext.getImageData(ae,Q,Ae-ae,nt-Q),0,0),this.drawingImgUrl=vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},C.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},C.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},C.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){this.createVisual(),q.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setDrawingImage()},C.typeName="FreehandMarker",C.title="Freehand marker",C.icon='',C}(Jt),Ie=function(q){function C(L,V,ae){var Q=q.call(this,L,ae||'')||this;return Q.typeBoxes=[],Q.currentType=V,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var ae=function(nt){var xt="both";switch(nt){case 0:xt="both";break;case 1:xt="start";break;case 2:xt="end";break;case 3:xt="none"}var Dt=document.createElement("div");if(Dt.style.display="flex",Dt.style.flexGrow="2",Dt.style.alignItems="center",Dt.style.justifyContent="space-between",Dt.style.padding="5px",Dt.style.borderWidth="2px",Dt.style.borderStyle="solid",Dt.style.borderColor=xt===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Dt.addEventListener("click",function(){L.setCurrentType(xt,Dt)}),V.appendChild(Dt),xt==="both"||xt==="start"){var ot=document.createElement("div");ot.style.display="flex",ot.style.alignItems="center",ot.style.minHeight="20px",ot.innerHTML=``,ot.style.marginLeft="5px",Dt.appendChild(ot)}var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.style.flexGrow="2";var Lt=document.createElement("hr");if(Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),Lt.style.flexGrow="2",vt.appendChild(Lt),Dt.appendChild(vt),xt==="both"||xt==="end"){var wn=document.createElement("div");wn.style.display="flex",wn.style.alignItems="center",wn.style.minHeight="20px",wn.innerHTML=``,wn.style.marginRight="5px",Dt.appendChild(wn)}Q.typeBoxes.push(Dt)},Q=this,Ae=0;Ae<4;Ae++)ae(Ae);return V},C.prototype.setCurrentType=function(L,V){var ae=this;this.currentType=L,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},C}(Ct),ke=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new Ie("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},C.prototype.getArrowPoints=function(L,V){var ae=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return L-ae/2+","+(V+Q/2)+" "+L+","+(V-Q/2)+" "+(L+ae/2)+","+(V+Q/2)},C.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var ae=this.arrow2.transform.baseVal.getItem(0);ae.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ae,0)}},C.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},C.typeName="ArrowMarker",C.title="Arrow marker",C.icon='',C}(Et),me=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor=ae.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new yt("Color",ae.defaultColorSet,ae.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="CoverMarker",C.title="Cover marker",C.icon='',C}(rn),ye=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'')||this;return Ae.opacities=[],Ae.opacityBoxes=[],Ae.opacities=V,Ae.currentOpacity=ae,Ae.setCurrentOpacity=Ae.setCurrentOpacity.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ae===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentOpacity(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.innerText=100*ae+"%",Q.appendChild(Ae),L.opacityBoxes.push(Q)}),V},C.prototype.setCurrentOpacity=function(L,V){var ae=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},C}(Ct),Re=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=ae.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=ae.defaultHighlightOpacity,Q.fillPanel=new yt("Color",ae.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new ye("Opacity",ae.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Pe(C,q),C.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="HighlightMarker",C.title="Highlight marker",C.icon='',C}(me),ce='',Me=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=ae.defaultStrokeColor,Q.bgColor=ae.defaultFillColor,Q.fontFamily=ae.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new yt("Text color",ae.defaultColorSet,Q.color,''),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new yt("Fill color",ae.defaultColorSet,Q.bgColor,ce),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new Je("Font",ae.defaultFontFamilies,ae.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new Ft,Q.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return q.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},C.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},C.prototype.pointerDown=function(L,V){this.state==="new"&&q.prototype.pointerDown.call(this,L,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,L,V)},C.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,L);else{var V=this.state==="creating";q.prototype.pointerUp.call(this,L),this.setTipPoints(V),this.positionTip()}},C.prototype.manipulate=function(L){if(this.tipMoving){var V=this.unrotatePoint(L);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,L)},C.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",L]]),ge.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},C.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},C.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var V=Math.min(this.height/2,15),ae=this.height/5;L&&(this.tipPosition={x:V+ae/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?Q',C}(mt),tt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.fillColor=ae.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new yt("Line color",be(ae.defaultColorSet,["transparent"]),ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new yt("Fill color",be(ae.defaultColorSet,["transparent"]),Q.fillColor,ce),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new ye("Opacity",ae.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},C.prototype.setSize=function(){q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},C.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},C.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize()},C.typeName="EllipseMarker",C.title="Ellipse marker",C.icon='',C}(Jt),bt=function(q){function C(L,V,ae){return q.call(this,L,V,ae)||this}return Pe(C,q),Object.defineProperty(C.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},C.prototype.createTips=function(){this.tip1=ge.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip2)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ge.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var ae=this.tip2.transform.baseVal.getItem(0);ae.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ae,0)}},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},C.typeName="MeasurementMarker",C.title="Measurement marker",C.icon='',C}(Et),Kt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokePanel.colors=ae.defaultColorSet,Q.fillColor="transparent",Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="EllipseFrameMarker",C.title="Ellipse frame marker",C.icon='',C}(tt),Gt=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(C){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(C)||(this.undoStack.push(C),JSON.stringify(this.lastRedoStep)!==JSON.stringify(C)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(C){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=C)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var C=this.undoStack.pop();return C!==void 0&&this.redoStack.push(C),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),$t=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},C.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},C.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},C.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},C.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},C.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),q.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},C.prototype.scale=function(L,V){this.curveX=this.curveX*L,this.curveY=this.curveY*V,q.prototype.scale.call(this,L,V)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},C.typeName="CurveMarker",C.title="Curve marker",C.icon='',C}(Ot),ei=function(){function q(C,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=C,this.cancelable=L}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),gn=function(q){function C(L,V,ae){var Q=q.call(this,L,!1)||this;return Q.dataUrl=V,Q.state=ae,Q}return Pe(C,q),C}(ei),an=function(q){function C(L,V,ae){ae===void 0&&(ae=!1);var Q=q.call(this,L,ae)||this;return Q.marker=V,Q}return Pe(C,q),C}(ei),dn=function(){function q(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return q.prototype.addEventListener=function(C,L){this[C].push(L)},q.prototype.removeEventListener=function(C,L){var V=this[C].indexOf(L);V>-1&&this[C].splice(V,1)},q}(),zn=function(){function q(C){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Xe,this._isOpen=!1,this.undoRedoManager=new Gt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new dn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=C,this.targetRoot=document.body,this.width=C.clientWidth,this.height=C.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,Kt,tt,Re,Me,bt,me,Et,$t]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,tt,Re,Me]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,Re]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(C){var L=this;this._availableMarkerTypes.splice(0),C.forEach(function(V){if(typeof V=="string"){var ae=L.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===V});ae!==void 0&&L._availableMarkerTypes.push(ae)}else L._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(C){this._zoomLevel=C,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var C=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new ei(C))})},q.prototype.render=function(){return Ce(this,void 0,void 0,function(){var C;return Oe(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(C=new fe).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.markersOnly=this.renderMarkersOnly,C.width=this.renderWidth,C.height=this.renderHeight,[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},q.prototype.close=function(C){var L=this;if(C===void 0&&(C=!1),this.isOpen){var V=!1;C||this.eventListeners.beforeclose.forEach(function(ae){var Q=new ei(L,!0);ae(Q),Q.defaultPrevented&&(V=!0)}),V||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ae){return ae(new ei(L))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var C,L=[],V=0;Vthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*C:this.editorCanvas.clientWidth,V=L',C.title="Powered by marker.js",C.style.display="grid",C.style.alignItems="center",C.style.justifyItems="center",C.style.padding="3px",C.style.width="20px",C.style.height="20px",this.logoUI.appendChild(C),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new at(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(C),1),C.dispose()},q.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},q.prototype.toolbarButtonClicked=function(C,L){if(C==="marker"&&L!==void 0)this.createNewMarker(L);else if(C==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},q.prototype.deleteSelectedMarker=function(){var C=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ae){var Q=new an(C,C._currentMarker,!0);ae(Q),Q.defaultPrevented&&(L=!0)}),!L){var V=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ae){return ae(new an(C,V))})}}},q.prototype.clear=function(){var C=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ae){var nt=new an(C,void 0,!0);Ae(nt),nt.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var V=function(Ae){var nt=ae.markers[Ae];ae.setCurrentMarker(ae.markers[Ae]),ae._currentMarker.dispose(),ae.markerImage.removeChild(ae._currentMarker.container),ae.markers.splice(ae.markers.indexOf(ae._currentMarker),1),ae.eventListeners.markerdelete.forEach(function(xt){return xt(new an(C,nt))})},ae=this,Q=this.markers.length-1;Q>=0;Q--)V(Q);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var C;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(C=this._currentMarker.notes)!==null&&C!==void 0?C:"",this.overlayContainer.appendChild(this.notesArea))},q.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var C=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===L.width&&V.height===L.height){var ae=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ae1&&this.panTo({x:C.clientX,y:C.clientY}))},q.prototype.onPointerUp=function(C){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(C.clientX,C.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(C){this._currentMarker===void 0||this.notesArea!==void 0||C.key!=="Delete"&&C.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.markerImage.getBoundingClientRect();return{x:(C-V.left)/this.zoomLevel,y:(L-V.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},q.prototype.addLicenseKey=function(C){te.addKey(C)},q.prototype.addEventListener=function(C,L){this.eventListeners.addEventListener(C,L)},q.prototype.removeEventListener=function(C,L){this.eventListeners.removeEventListener(C,L)},q.prototype.renderState=function(C){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(C),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var C=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new ei(C))}))},q.prototype.blur=function(){var C=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new ei(C))}))},q.instanceCounter=0,q}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var pi=function(q,C){return(pi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var ae in V)Object.prototype.hasOwnProperty.call(V,ae)&&(L[ae]=V[ae])})(q,C)};function mi(q,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function L(){this.constructor=q}pi(q,C),q.prototype=C===null?Object.create(C):(L.prototype=C.prototype,new L)}function ri(q,C,L,V){return new(L||(L=Promise))(function(ae,Q){function Ae(Dt){try{xt(V.next(Dt))}catch(ot){Q(ot)}}function nt(Dt){try{xt(V.throw(Dt))}catch(ot){Q(ot)}}function xt(Dt){var ot;Dt.done?ae(Dt.value):(ot=Dt.value,ot instanceof L?ot:new L(function(vt){vt(ot)})).then(Ae,nt)}xt((V=V.apply(q,C||[])).next())})}function _i(q,C){var L,V,ae,Q,Ae={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return Q={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function nt(xt){return function(Dt){return function(ot){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,V&&(ae=2&ot[0]?V.return:ot[0]?V.throw||((ae=V.return)&&ae.call(V),0):V.next)&&!(ae=ae.call(V,ot[1])).done)return ae;switch(V=0,ae&&(ot=[2&ot[0],ae.value]),ot[0]){case 0:case 1:ae=ot;break;case 4:return Ae.label++,{value:ot[1],done:!1};case 5:Ae.label++,V=ot[1],ot=[0];continue;case 7:ot=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ae=Ae.trys,(ae=ae.length>0&&ae[ae.length-1])||ot[0]!==6&&ot[0]!==2)){Ae=0;continue}if(ot[0]===3&&(!ae||ot[1]>ae[0]&&ot[1]0&&L>0){var V=new je(C,L),ae=V.ratio>=1?20:V.getHorizontalLength(20),Q=V.ratio<1?20:V.getVerticalLength(20),Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ae);var nt=At.createDefs();Ae.appendChild(nt);var xt=At.createElement("clipPath",[["id","text-bg-clip"]]);nt.appendChild(xt);var Dt=At.createPath(At.getHollowRectanglePath((24-ae)/2,(24-Q)/2,ae,Q,(24-ae)/2+2,(24-Q)/2+2,ae-4,Q-4));Ae.appendChild(Dt);var ot=At.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ot.appendChild(At.createTSpan(C+":"+L)),Ae.appendChild(ot);var vt=ot.getBBox();At.setAttributes(ot,[["x",((24-vt.width)/2).toString()],["y",((24-vt.height)/2-vt.y).toString()]]);var Lt=At.createPath(At.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(vt.width))/2,(24-Math.ceil(vt.height))/2,Math.ceil(vt.width),Math.ceil(vt.height)));return xt.appendChild(Lt),At.setAttributes(Dt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ae),Ae.outerHTML}return''},q}(),Ne=function(q){function C(L,V,ae){var Q=q.call(this,L,V)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=ae,Q}return mi(C,q),C.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=L.className,V.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},C.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},C.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},C.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},C.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},C.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},C}(wi),Ee=function(){function q(C,L){this.GRIP_SIZE=10,this.color=C,this.fillColor=L,this.visual=At.createGroup(),this.visual.appendChild(At.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(At.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},q.prototype.setCenter=function(C,L){this.visual.childNodes.forEach(function(V){return At.setAttributes(V,[["cx",C.toString()],["cy",L.toString()]])})},q}(),ve=function(){function q(C,L,V,ae){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=C,this.canvasHeight=L,this.margin=V,this.container=ae,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(C){this._aspectRatio=C,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.gridContainer&&At.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(C){this._zoomFactor=C,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var C=this;this.cropShadeElement=At.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=At.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;Lthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),At.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var V=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,Ae){var nt=L.y+V*(Ae+1);At.setAttributes(Q,[["x1",""+L.x],["y1",""+nt],["x2",""+(L.x+L.width)],["y2",""+nt]])});var ae=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Ae){var nt=L.x+ae*(Ae+1);At.setAttributes(Q,[["x1",""+nt],["y1",""+L.y],["x2",""+nt],["y2",""+(L.y+L.height)]])}),At.setAttributes(this.cropShadeElement,[["d",At.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},q.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.container.getBoundingClientRect();return{x:C-V.left+this.margin,y:L-V.top+this.margin}},q.prototype.onPointerDown=function(C){this.container.setPointerCapture(C.pointerId),this.previousPoint=this.clientToLocalCoordinates(C.clientX,C.clientY),this.cropRectElement===C.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(C.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(C.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(C.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(C.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(C){if(this.isMoving)this.move(this.clientToLocalCoordinates(C.clientX,C.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(C.clientX,C.clientY);this.resize(L)}C.preventDefault()},q.prototype.onPointerUp=function(C){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(C.pointerId)},q.prototype.move=function(C){var L=C.x-this.previousPoint.x,V=C.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=C},q.prototype.resize=function(C){var L=Object.assign({},this.cropRect),V=C.x-this.previousPoint.x,ae=C.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+Vthis.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-L.width),L.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=ae,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=ae}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=C,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var C=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),ae=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=C-this.cropRect.width/2,this.cropRect.y=L-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},q.prototype.getRescaledRect=function(C,L,V,ae,Q,Ae){var nt=V/C,xt=ae/L;return{x:(Q.x-Ae)*nt+Ae,y:(Q.y-Ae)*xt+Ae,width:Q.width*nt,height:Q.height*xt}},q.prototype.scaleCanvas=function(C,L){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,C,L,this.cropRect,this.margin);this.canvasWidth=C,this.canvasHeight=L,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},q}(),di=function(){function q(C){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=C,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(q.prototype,"angle",{get:function(){return this._angle},set:function(C){this._angle=C,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},q.prototype.onPointerDown=function(C){this.controlContainer.setPointerCapture(C.pointerId),this.isDragging=!0,this.previousPoint={x:C.clientX,y:C.clientY}},q.prototype.onPointerMove=function(C){this.isDragging&&(this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.previousPoint.x=C.clientX)},q.prototype.onPointerUp=function(C){this.isDragging&&this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(C.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var C=this.angleLabelText.getBBox();At.setAttributes(this.angleLabelElement,[["x",((this.width-C.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var C=this.scaleShape.transform.baseVal.getItem(0);C.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(C,0)}},q.prototype.getVisual=function(){var C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("xmlns","http://www.w3.org/2000/svg"),C.setAttribute("width",this.width+"px"),C.setAttribute("height",this.height+"px"),C.setAttribute("viewBox","0 0 "+this.width+" "+this.height),C.style.flexShrink="0",document.body.appendChild(C);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var ae=V%5==0?this.height/3:this.height/6;L+="h4v"+-ae+"h1v"+ae}L+="v1H0Z",this.scaleShape=At.createPath(L);var Q=At.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),C.appendChild(this.scaleShape),this.angleLabelElement=At.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=At.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ae=At.createTSpan("");return Ae.innerHTML="°",this.angleLabelElement.appendChild(Ae),C.appendChild(this.angleLabelElement),document.body.removeChild(C),C},q}(),en=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(C,L,V,ae,Q,Ae,nt){var xt=this;return new Promise(function(Dt){var ot=document.createElement("canvas");ot.width=C.width.baseVal.value-2*ae,ot.height=C.height.baseVal.value-2*ae;var vt=1,Lt=1;xt.naturalSize===!0?(vt=L.naturalWidth/(C.width.baseVal.value-2*ae)/Ae,Lt=L.naturalHeight/(C.height.baseVal.value-2*ae)/nt,ot.width=L.naturalWidth/Ae,ot.height=L.naturalHeight/nt):xt.width!==void 0&&xt.height!==void 0&&(vt=xt.width/V.width,Lt=xt.height/V.height,ot.width*=vt,ot.height*=Lt);var wn=ot.getContext("2d");wn.translate(ot.width/2,ot.height/2),wn.rotate(Q*Math.PI/180),wn.scale(Ae,nt),wn.translate(-ot.width/2,-ot.height/2),wn.drawImage(L,0,0,ot.width,ot.height);var Xn=document.createElement("canvas");Xn.width=V.width*vt,Xn.height=V.height*Lt,Xn.getContext("2d").putImageData(wn.getImageData((V.x-ae)*vt,(V.y-ae)*Lt,V.width*vt,V.height*Lt),0,0),Dt(Xn.toDataURL(xt.imageType,xt.imageQuality))})},q}(),De=function(){function q(C){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=q.instanceCounter++,this.styles=new Wn(this.instanceNo),this.target=C,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(C){this._zoomToCropEnabled=C,C?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(C){this._gridLines=C,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(C){this._rotationAngle=C,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var C;return(C=this._aspectRatio)!==null&&C!==void 0?C:this.aspectRatios[0]},set:function(C){this._aspectRatio=C},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(C){C===void 0&&(C=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),C||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(C){this.renderEventListeners.push(C)},q.prototype.removeRenderEventListener=function(C){this.renderEventListeners.indexOf(C)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(C),1)},q.prototype.addCloseEventListener=function(C){this.closeEventListeners.push(C)},q.prototype.removeCloseEventListener=function(C){this.closeEventListeners.indexOf(C)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(C),1)},q.prototype.setupResizeObserver=function(){var C=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var C=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/C>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*C:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=L+2*this.CANVAS_MARGINC+this.CANVAS_MARGIN?this.target.offsetTop-(C+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var C=this;this.topToolbar=new Oi,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new Ni;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var V=[];this.aspectRatios.forEach(function(Lt){var wn=new wi(It.getIcon(Lt.horizontal,Lt.vertical),Lt.horizontal===0&&Lt.vertical===0?"FREE":Lt.horizontal+":"+Lt.vertical);wn.onClick=function(){return C.ratioButtonClicked(Lt)},V.push(wn)}),this.aspectRatioButton=new Ne(It.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ae=new wi('',"Toggle grid");ae.isActive=this.isGridVisible,ae.onClick=function(){C.isGridVisible=!C.isGridVisible,ae.isActive=C.isGridVisible},L.addButton(ae);var Q=new wi('',"Zoom to selection");if(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){C.zoomToCropEnabled=!C.zoomToCropEnabled,Q.isActive=C.zoomToCropEnabled},L.addButton(Q),!Si.isLicensed){var Ae=new ct;this.topToolbar.addElementBlock(Ae);var nt=document.createElement("div");nt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var xt=document.createElement("a");xt.style.color="currentColor",xt.href="https://markerjs.com/products/cropro",xt.target="_blank",xt.innerHTML='',nt.appendChild(xt),Ae.addElement(nt)}var Dt=new Ni;Dt.minWidth=3*this.toolbarHeight+"px",Dt.contentAlign="end",this.topToolbar.addButtonBlock(Dt);var ot=new wi('',"OK");ot.onClick=this.startRenderAndClose,Dt.addButton(ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var vt=new wi('',"Close");vt.onClick=this.close,Dt.addButton(vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var C=this;this.bottomToolbar=new Oi,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new Ni;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var V=new wi('',"Rotate left");V.onClick=this.rotateLeftButtonClicked,L.addButton(V);var ae=new wi('',"Rotate right");ae.onClick=this.rotateRightButtonClicked,L.addButton(ae);var Q=new ct;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new di("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Dt){C.rotateBy(Dt),C.straightener.angle=C.rotationAngle},Q.addElement(this.straightener.getUI());var Ae=new Ni;Ae.minWidth=2*this.toolbarHeight+"px",Ae.contentAlign="end",this.bottomToolbar.addButtonBlock(Ae);var nt=new wi('',"Flip horizontal");nt.onClick=this.flipHorizontallyButtonClicked,Ae.addButton(nt);var xt=new wi('',"Flip vertical");xt.onClick=this.flipVerticallyButtonClicked,Ae.addButton(xt)},q.prototype.ratioButtonClicked=function(C){this.aspectRatio=C,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=It.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new je(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(C){if(C){var L=this.cropLayer.getRescaledRect(C.width,C.height,this.imageWidth,this.imageHeight,C.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=C.flippedHorizontally,this.flippedVertically=C.flippedVertically,this.applyFlip(),this.rotationAngle=C.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.cropImage.getBoundingClientRect();return{x:C-V.left,y:L-V.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var C=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=C+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},q.prototype.rotateLeftButtonClicked=function(){var C=this.rotationAngle-90;this.rotationAngle%90!=0&&(C+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(C)},q.prototype.rotateRightButtonClicked=function(){var C=this.rotationAngle+90;this.rotationAngle%90!=0&&(C-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(C)},q.prototype.rotateTo=function(C){C=(C=C>180?C-360:C)<=-180?C+360:C,this.rotationAngle=C,this.applyRotation()},q.prototype.rotateBy=function(C){this.rotateTo((this.rotationAngle+C)%360)},q.prototype.applyRotation=function(){var C=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=C},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return ri(this,void 0,void 0,function(){var C,L;return _i(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return C=V.sent(),L=this.getState(),this.renderEventListeners.forEach(function(ae){return ae(C,L)}),this.close(!0),[2]}})})},q.prototype.render=function(){return ri(this,void 0,void 0,function(){var C;return _i(this,function(L){switch(L.label){case 0:return(C=new en).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.width=this.renderWidth,C.height=this.renderHeight,this.unzoomFromCrop(),At.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,C.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return L.sent(),[4,C.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,L.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ti("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ti("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ti("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var C=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ti("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*C)+`px;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ti("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ti("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new hi("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new hi("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ti("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new ti("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ti("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new ti("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ti("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},q.instanceCounter=0,q}(),ht=z("8hTe"),we=z.n(ht),un=/]*>/g;function fi(q){var C=document.createElement("div");return C.innerHTML=q,C.childNodes.length===0?"":C.childNodes[0].nodeValue}var gi=st.a=function(q){var C=q.value,L=C===void 0?"":C,V=q.edit,ae=V===void 0?!1:V,Q=q.className,Ae=q.showTextOnly,nt=q.showLines,xt=q.replaces,Dt=q.zoomImg,ot=q.hasMask,vt=q.style,Lt=vt===void 0?{}:vt,wn=q.stylesPrev,Xn=wn===void 0?{}:wn,jn=String(L),cn=Object(D.useRef)(),jt=Object(D.useRef)(),nn=Object(D.useState)(""),qt=Object($.a)(nn,2),Nt=qt[0],$n=qt[1],Un=Object(D.useState)("office"),xn=Object($.a)(Un,2),Yn=xn[0],hn=xn[1],Tn=function(){var vn=new De(jt.current);vn.displayMode="popup",vn.addRenderEventListener(function(){var Ln=Object(M.a)(k.a.mark(function Cn(Qn){var _n;return k.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return cn.current.style.display="none",qn.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn}});case 3:_n=qn.sent,_n!=null&&_n.id&&xt(jt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 5:case"end":return qn.stop()}},Cn)}));return function(Cn){return Ln.apply(this,arguments)}}()),vn.show()},sn=function(){var vn=new zn(jt.current);vn.settings.displayMode="popup",vn.addEventListener("render",function(){var Ln=Object(M.a)(k.a.mark(function Cn(Qn){var _n;return k.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(cn.current.style.display="none",!jt.current){qn.next=6;break}return qn.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn.dataUrl}});case 4:_n=qn.sent,_n!=null&&_n.id&&xt(jt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 6:case"end":return qn.stop()}},Cn)}));return function(Cn){return Ln.apply(this,arguments)}}()),vn.show(),window.markerArea=vn},Mn=Object(D.useMemo)(function(){cn.current&&(cn.current.style.zIndex=-1);try{var tn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,vn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ln=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;jn=jn.replace(tn,"("+Y.a.API_SERVER+"/api/attachments/").replace(vn,'"'+Y.a.API_SERVER+"/api/attachments/").replace(Ln,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Gn){}var Cn=G(jn),Qn=E();if(jn.match(/\[TOC\]/)&&(Cn=Cn.replace("[TOC]
",O()),A()),Cn=Cn.replace(/(__special_katext_id_\d+__)/g,function(Gn,qn){var In=Qn[qn],Dn=In.type,kn=In.expression;return Object(re.renderToString)(fi(kn)||"",{displayMode:Dn==="block",throwOnError:!1,output:"html"})}),Cn=Cn.replace(/▁/g,"\u2581\u2581\u2581"),g(),Ae){var _n=document.createElement("div");return _n.innerHTML=Cn,_n.innerText}return setTimeout(function(){return Pn()},500),Cn},[jn]),Vn=Object(D.useRef)();S.WebkitLineClamp=nt,nt&&(Lt=Object(W.a)(Object(W.a)({},Lt),S));function ni(tn){var vn=tn.target;if(vn.tagName.toUpperCase()==="IMG"){if(Dt){var Ln=vn.getAttribute("src");$n(Ln),hn("image")}}else if(vn.tagName.toUpperCase()==="A"){var Cn=vn.getAttribute("href");if(Cn.indexOf("office")>-1)tn.preventDefault(),$n(Cn),hn("office");else if(Cn.indexOf("application/pdf")>-1)tn.preventDefault(),$n(Cn),hn("pdf");else if(Cn.indexOf("text/html")>-1)tn.preventDefault(),$n(Cn),hn("html");else if(Cn.startsWith("#")){tn.preventDefault();var Qn=document.getElementById(Cn.replace("#",""));Qn&&Qn.scrollIntoView(!0)}}}var Pn=function(){var vn,Ln=(vn=Vn.current)===null||vn===void 0?void 0:vn.querySelectorAll("video");Ln==null||Ln.forEach(function(Cn){if(Cn.oncontextmenu=function(){return!1},Cn.src.indexOf(".m3u8")>-1&&!Cn.canPlayType("application/vnd.apple.mpegurl")){if(B.a.isSupported()){var Qn=new B.a;Qn.loadSource(Cn.src),Qn.attachMedia(Cn)}}})};Object(D.useEffect)(function(){if(Vn.current&&Mn&&(Mn.match(un)&&window.PR.prettyPrint()),Vn.current)return Vn.current.addEventListener("click",ni),function(){Vn.current.removeEventListener("click",ni),g(),A()}},[Mn,Vn.current,ni]);var Hn=function(vn){if(!ae)return;vn.target.nodeName==="IMG"?(cn.current.style.zIndex=1,cn.current.style.display="flex",cn.current.style.width=vn.target.clientWidth+"px",cn.current.style.height=vn.target.clientHeight+"px",cn.current.style.top=vn.target.offsetTop+"px",cn.current.style.left=vn.target.offsetLeft+"px",jt.current.src=vn.target.getAttribute("src")):cn.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Vn,style:Object(W.a)({},Lt),className:"".concat(Q||""," markdown-body ").concat(we.a.mdBody),onMouseOver:Hn,dangerouslySetInnerHTML:{__html:Mn}}),m.a.createElement("div",{ref:cn,className:we.a.button},m.a.createElement(Z.a,null,m.a.createElement(ee.a,{onClick:function(){return Tn()}},"\u88C1\u526A"),m.a.createElement(ee.a,{onClick:function(){return sn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:jt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(de.a,{close:!0,data:Nt,type:Nt!=null&&Nt.length?Yn:"",style:Object(W.a)({},Xn),onClose:function(){return $n("")}}))}},"9VGf":function(Wt,st,z){"use strict";z.d(st,"a",function(){return U});var oe=z("q1tI"),Z=z.n(oe);function U(ee,W){var M=Object(oe.useRef)();Object(oe.useEffect)(function(){M.current=ee}),Object(oe.useEffect)(function(){function $(){M.current()}if(W!==null){var X=setInterval($,W);return function(){return clearInterval(X)}}},[W])}},"9z17":function(Wt,st,z){"use strict";z.d(st,"b",function(){return w});var oe=z("g9YV"),Z=z("wCAj"),U=z("5NDa"),ee=z("5rEg"),W=z("y8nQ"),M=z("Vl3Y"),$=z("2qtc"),X=z("kLXV"),k=z("7Kak"),D=z("9yH6"),m=z("9og8"),v=z("tJVT"),f=z("WmNS"),o=z.n(f),l=z("q1tI"),r=z.n(l),i=z("ie49"),t=z.n(i),c=z("HBuW"),h=function(_){var u=_.total,d=_.used,E=_.copy,g=_.canNotCopy,y=_.inPaper,F="";return E>0&&g>0?F="\u5176\u4E2D\u6709".concat(E,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(g,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):E>0&&g===0?F="\u5176\u4E2D\u6709".concat(E,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):E===0&&g>0&&(F="\u5176\u4E2D\u6709".concat(g,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236")),"\u5F53\u524D\u9009\u4E2D".concat(u,"\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(d,"\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(F).concat(y?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},A=function(_){return _?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},S=function(_){var u=_.onCancel,d=_.onOk,E=_.visible,g=_.inPaper,y=_.renderData,F=_.type,N=Object(l.useState)(1),H=Object(v.a)(N,2),G=H[0],I=H[1],x=Object(l.useState)(!1),B=Object(v.a)(x,2),Y=B[0],re=B[1],de=Object(l.useMemo)(function(){return(y==null?void 0:y.total_num)===1&&(y==null?void 0:y.can_copy_num)===1},[y]);return r.a.createElement(r.a.Fragment,null,de?r.a.createElement(X.a,{centered:!0,closable:!0,visible:E,title:"\u63D0\u793A",width:600,confirmLoading:Y,onCancel:u,onOk:Object(m.a)(o.a.mark(function he(){return o.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return re(!0),Pe.next=3,d(G);case 3:re(!1);case 4:case"end":return Pe.stop()}},he)}))},r.a.createElement("div",{className:t.a.content,style:{marginBottom:20}},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D\uFF1F"),r.a.createElement(D.a.Group,{value:G,onChange:function(xe){return I(xe.target.value)},className:t.a.content,style:{marginBottom:30}},r.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),r.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),r.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),r.a.createElement("div",{className:t.a.content},"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),r.a.createElement("div",{className:t.a.content},"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")):r.a.createElement(X.a,{centered:!0,closable:!0,visible:E,title:"\u63D0\u793A",width:600,onCancel:u,onOk:Object(m.a)(o.a.mark(function he(){return o.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return re(!0),Pe.next=3,d(0);case 3:re(!1);case 4:case"end":return Pe.stop()}},he)}))},r.a.createElement("div",{className:t.a.content},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F")))},w=function(){var _=Object(l.useState)(!1),u=Object(v.a)(_,2),d=u[0],E=u[1],g=Object(l.useState)(),y=Object(v.a)(g,2),F=y[0],N=y[1],H=function(){return E(!1)},G=function(){var I=Object(m.a)(o.a.mark(function x(B){var Y;return o.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return de.next=2,Object(c.p)(B);case 2:if(Y=de.sent,!("status"in Y)){de.next=5;break}return de.abrupt("return",!1);case 5:if(!(Y.repeat_shixun_num===0)){de.next=7;break}return de.abrupt("return",!1);case 7:return N(Y),E(!0),de.abrupt("return",!0);case 10:case"end":return de.stop()}},x)}));return function(B){return I.apply(this,arguments)}}();return[d,H,F,G]},O=function(_){var u=M.a.useForm(),d=Object(v.a)(u,1),E=d[0],g=Object(l.useState)(!1),y=Object(v.a)(g,2),F=y[0],N=y[1],H=_.onCancel,G=_.onOk,I=_.visible,x=_.inPaper,B=x===void 0?!1:x,Y=_.renderData,re=_.type,de=Object(l.useMemo)(function(){return B?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426"))),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,be){return r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_use"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,be){return r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426")))}}]},[B]),he=Object(l.useMemo)(function(){return B?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement("span",null,Oe),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],initialValue:0},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426"))),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})))}}]},[B]),xe=Object(l.useMemo)(function(){return h({total:Y==null?void 0:Y.total_num,used:Y==null?void 0:Y.repeat_shixun_num,copy:Y==null?void 0:Y.can_copy_num,canNotCopy:Y==null?void 0:Y.no_copy_num,inPaper:B})},[Y,B]),Pe=Object(l.useMemo)(function(){return A(B)},[B]);return r.a.createElement(X.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:I,confirmLoading:F,onOk:Object(m.a)(o.a.mark(function Ce(){var Oe,be;return o.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return N(!0),Oe=E.getFieldsValue(),be=Object.keys(Oe).map(function(fe){return{id:parseInt(fe),is_use:Oe[fe].is_use,is_copy:Oe[fe].is_copy}}),te.next=5,G(be);case 5:N(!1);case 6:case"end":return te.stop()}},Ce)})),onCancel:H,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},r.a.createElement(M.a,{form:E,preserve:!1},r.a.createElement("div",{className:t.a.brief},xe),(Y==null?void 0:Y.can_copy_num)>0&&r.a.createElement("div",null,r.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),r.a.createElement("div",{className:t.a.content},Pe.reproducible),r.a.createElement("div",{className:t.a.tips},r.a.createElement("div",null,"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),r.a.createElement("div",null,"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")),r.a.createElement(Z.a,{columns:de,className:t.a.antdTable,dataSource:Y==null?void 0:Y.can_copy_list,rowKey:re==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(Y==null?void 0:Y.no_copy_num)>0&&r.a.createElement("div",null,r.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),r.a.createElement("div",{className:t.a.content},Pe.irreproducible),r.a.createElement(Z.a,{columns:he,className:t.a.antdTable,dataSource:Y==null?void 0:Y.no_copy_list,rowKey:re==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(Y==null?void 0:Y.no_use_list.length)>0&&(Y==null?void 0:Y.no_use_list.map(function(Ce){return r.a.createElement("div",{key:re==="subject"?Ce.stage_shixun_id:Ce.id},r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?Ce==null?void 0:Ce.stage_shixun_id:Ce.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?Ce==null?void 0:Ce.stage_shixun_id:Ce.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}))))},R=function(_){var u=_.modalType;return u==="multiple"?r.a.createElement(O,_):r.a.createElement(S,_)};st.a=R},BU3w:function(Wt,st,z){"use strict";z.d(st,"a",function(){return M});var oe=z("MNnm"),Z="rc-util-key";function U($){if($.attachTo)return $.attachTo;var X=document.querySelector("head");return X||document.body}function ee($){var X,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var D=document.createElement("style");if((X=k.csp)===null||X===void 0?void 0:X.nonce){var m;D.nonce=(m=k.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=$;var v=U(k),f=v.firstChild;return k.prepend&&v.prepend?v.prepend(D):k.prepend&&f?v.insertBefore(D,f):v.appendChild(D),D}var W=new Map;function M($,X){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=U(k);if(!W.has(D)){var m=ee("",k),v=m.parentNode;W.set(D,v),v.removeChild(m)}var f=Array.from(W.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Z]===X});if(f){var o,l;if(((o=k.csp)===null||o===void 0?void 0:o.nonce)&&f.nonce!==((l=k.csp)===null||l===void 0?void 0:l.nonce)){var r;f.nonce=(r=k.csp)===null||r===void 0?void 0:r.nonce}return f.innerHTML!==$&&(f.innerHTML=$),f}var i=ee($,k);return i[Z]=X,i}},Bd2K:function(Wt,st,z){(function(oe){oe(z("VrN/"),z("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(k,D,m){if(m!=oe.Init&&m&&k.removeKeyMap("autoCloseTags"),!D)return;var v={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(v["'/'"]=function(f){return M(f)}),(typeof D!="object"||D.whenOpening!==!1)&&(v["'>'"]=function(f){return ee(f)}),k.addKeyMap(v)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function ee(k){if(k.getOption("disableInput"))return oe.Pass;for(var D=k.listSelections(),m=[],v=k.getOption("autoCloseTags"),f=0;fo.ch&&(c=c.slice(0,c.length-l.end+o.ch));var w=c.toLowerCase();if(!c||l.type=="string"&&(l.end!=o.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&t.close||l.string.indexOf("/")==o.ch-l.start-1||A&&$(A,w)>-1||X(k,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(i)||[],c,o,!0))return oe.Pass;var O=typeof v=="object"&&v.emptyTags;if(O&&$(O,c)>-1){m[f]={text:"/>",newPos:oe.Pos(o.line,o.ch+2)};continue}var R=S&&$(S,w)>-1;m[f]={indent:R,text:">"+(R?`
`:"")+""+c+">",newPos:R?oe.Pos(o.line+1,0):oe.Pos(o.line,o.ch+1)}}for(var b=typeof v=="object"&&v.dontIndentOnAutoClose,f=D.length-1;f>=0;f--){var _=m[f];k.replaceRange(_.text,D[f].head,D[f].anchor,"+insert");var u=k.listSelections().slice(0);u[f]={head:_.newPos,anchor:_.newPos},k.setSelections(u),!b&&_.indent&&(k.indentLine(_.newPos.line,null,!0),k.indentLine(_.newPos.line+1,null,!0))}}function W(k,D){for(var m=k.listSelections(),v=[],f=D?"/":"",o=k.getOption("autoCloseTags"),l=typeof o=="object"&&o.dontIndentOnSlash,r=0;r"&&(A+=">"),v[r]=A}if(k.replaceSelections(v),m=k.listSelections(),!l)for(var r=0;r=0&&D[i]==m;i--)++r;v=l.to;for(var i=1;i0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;mBe.length)&&(Ie=Be.length);for(var ke=0,me=new Array(Ie);ke=Be.length?{done:!0}:{done:!1,value:Be[me++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ke=Be[Symbol.iterator](),ke.next.bind(ke)}function M(Be,Ie){return Ie={exports:{}},Be(Ie,Ie.exports),Ie.exports}var $=M(function(Be){function Ie(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ke(me){Be.exports.defaults=me}Be.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:ke}}),X=$.defaults,k=$.getDefaults,D=$.changeDefaults,m=/[&<>"']/,v=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},r=function(Ie){return l[Ie]};function i(Be,Ie){if(Ie){if(m.test(Be))return Be.replace(v,r)}else if(f.test(Be))return Be.replace(o,r);return Be}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(Be){return Be.replace(t,function(Ie,ke){return ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""})}var h=/(^|[^\[])\^/g;function A(Be,Ie){Be=Be.source||Be,Ie=Ie||"";var ke={replace:function(ye,Re){return Re=Re.source||Re,Re=Re.replace(h,"$1"),Be=Be.replace(ye,Re),ke},getRegex:function(){return new RegExp(Be,Ie)}};return ke}var S=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Be,Ie,ke){if(Be){var me;try{me=decodeURIComponent(c(ke)).replace(S,"").toLowerCase()}catch(ye){return null}if(me.indexOf("javascript:")===0||me.indexOf("vbscript:")===0||me.indexOf("data:")===0)return null}Ie&&!w.test(ke)&&(ke=d(Ie,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(ye){return null}return ke}var R={},b=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Be,Ie){R[" "+Be]||(b.test(Be)?R[" "+Be]=Be+"/":R[" "+Be]=F(Be,"/",!0)),Be=R[" "+Be];var ke=Be.indexOf(":")===-1;return Ie.substring(0,2)==="//"?ke?Ie:Be.replace(_,"$1")+Ie:Ie.charAt(0)==="/"?ke?Ie:Be.replace(u,"$1")+Ie:Be+Ie}var E={exec:function(){}};function g(Be){for(var Ie=1,ke,me;Ie=0&&Me[bt]==="\\";)tt=!tt;return tt?"|":" |"}),me=ke.split(/ \|/),ye=0;if(me.length>Ie)me.splice(Ie);else for(;me.length=me.length?ye.slice(me.length):ye}).join(`
`)}var xe=function(){function Be(ke){this.options=ke||I}var Ie=Be.prototype;return Ie.space=function(me){var ye=this.rules.block.newline.exec(me);if(ye)return ye[0].length>1?{type:"space",raw:ye[0]}:{raw:`
`}},Ie.code=function(me,ye){var Re=this.rules.block.code.exec(me);if(Re){var ce=ye[ye.length-1];if(ce&&ce.type==="paragraph")return{raw:Re[0],text:Re[0].trimRight()};var Me=Re[0].replace(/^ {4}/gm,"");return{type:"code",raw:Re[0],codeBlockStyle:"indented",text:this.options.pedantic?Me:x(Me,`
`)}}},Ie.fences=function(me){var ye=this.rules.block.fences.exec(me);if(ye){var Re=ye[0],ce=he(Re,ye[3]||"");return{type:"code",raw:Re,lang:ye[2]?ye[2].trim():ye[2],text:ce}}},Ie.heading=function(me){var ye=this.rules.block.heading.exec(me);if(ye)return{type:"heading",raw:ye[0],depth:ye[1].length,text:ye[2]}},Ie.nptable=function(me){var ye=this.rules.block.nptable.exec(me);if(ye){var Re={type:"table",header:B(ye[1].replace(/^ *| *\| *$/g,"")),align:ye[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ye[3]?ye[3].replace(/\n$/,"").split(`
`):[],raw:ye[0]};if(Re.header.length===Re.align.length){var ce=Re.align.length,Me;for(Me=0;Me ?/gm,"");return{type:"blockquote",raw:ye[0],text:Re}}},Ie.list=function(me){var ye=this.rules.block.list.exec(me);if(ye){for(var Re=ye[0],ce=ye[2],Me=ce.length>1,tt=ce[ce.length-1]===")",bt={type:"list",raw:Re,ordered:Me,start:Me?+ce.slice(0,-1):"",loose:!1,items:[]},Kt=ye[0].match(this.rules.block.item),Gt=!1,$t,ei,gn,an,dn,zn,pi,mi=Kt.length,ri=0;ri1||this.options.smartLists&&gn!==ce)&&(an=Kt.slice(ri+1).join(`
`),bt.raw=bt.raw.substring(0,bt.raw.length-an.length),ri=mi-1)),dn=Gt||/\n\n(?!\s*$)/.test($t),ri!==mi-1&&(Gt=$t.charAt($t.length-1)===`
`,dn||(dn=Gt)),dn&&(bt.loose=!0),zn=/^\[[ xX]\] /.test($t),pi=void 0,zn&&(pi=$t[1]!==" ",$t=$t.replace(/^\[[ xX]\] +/,"")),bt.items.push({type:"list_item",raw:Re,task:zn,checked:pi,loose:dn,text:$t});return bt}},Ie.html=function(me){var ye=this.rules.block.html.exec(me);if(ye)return{type:this.options.sanitize?"paragraph":"html",raw:ye[0],pre:!this.options.sanitizer&&(ye[1]==="pre"||ye[1]==="script"||ye[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):Y(ye[0]):ye[0]}},Ie.def=function(me){var ye=this.rules.block.def.exec(me);if(ye){ye[3]&&(ye[3]=ye[3].substring(1,ye[3].length-1));var Re=ye[1].toLowerCase().replace(/\s+/g," ");return{tag:Re,raw:ye[0],href:ye[2],title:ye[3]}}},Ie.table=function(me){var ye=this.rules.block.table.exec(me);if(ye){var Re={type:"table",header:B(ye[1].replace(/^ *| *\| *$/g,"")),align:ye[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ye[3]?ye[3].replace(/\n$/,"").split(`
`):[]};if(Re.header.length===Re.align.length){Re.raw=ye[0];var ce=Re.align.length,Me;for(Me=0;Me/i.test(ce[0])&&(ye=!1),!Re&&/^<(pre|code|kbd|script)(\s|>)/i.test(ce[0])?Re=!0:Re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ce[0])&&(Re=!1),{type:this.options.sanitize?"text":"html",raw:ce[0],inLink:ye,inRawBlock:Re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Y(ce[0]):ce[0]}},Ie.link=function(me){var ye=this.rules.inline.link.exec(me);if(ye){var Re=re(ye[2],"()");if(Re>-1){var ce=ye[0].indexOf("!")===0?5:4,Me=ce+ye[1].length+Re;ye[2]=ye[2].substring(0,Re),ye[0]=ye[0].substring(0,Me).trim(),ye[3]=""}var tt=ye[2],bt="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(tt);Kt?(tt=Kt[1],bt=Kt[3]):bt=""}else bt=ye[3]?ye[3].slice(1,-1):"";tt=tt.trim().replace(/^<([\s\S]*)>$/,"$1");var Gt=de(ye,{href:tt&&tt.replace(this.rules.inline._escapes,"$1"),title:bt&&bt.replace(this.rules.inline._escapes,"$1")},ye[0]);return Gt}},Ie.reflink=function(me,ye){var Re;if((Re=this.rules.inline.reflink.exec(me))||(Re=this.rules.inline.nolink.exec(me))){var ce=(Re[2]||Re[1]).replace(/\s+/g," ");if(ce=ye[ce.toLowerCase()],!ce||!ce.href){var Me=Re[0].charAt(0);return{type:"text",raw:Me,text:Me}}var tt=de(Re,ce,Re[0]);return tt}},Ie.strong=function(me,ye,Re){Re===void 0&&(Re="");var ce=this.rules.inline.strong.start.exec(me);if(ce&&(!ce[1]||ce[1]&&(Re===""||this.rules.inline.punctuation.exec(Re)))){ye=ye.slice(-1*me.length);var Me=ce[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Me.lastIndex=0;for(var tt;(ce=Me.exec(ye))!=null;)if(tt=this.rules.inline.strong.middle.exec(ye.slice(0,ce.index+3)),tt)return{type:"strong",raw:me.slice(0,tt[0].length),text:me.slice(2,tt[0].length-2)}}},Ie.em=function(me,ye,Re){Re===void 0&&(Re="");var ce=this.rules.inline.em.start.exec(me);if(ce&&(!ce[1]||ce[1]&&(Re===""||this.rules.inline.punctuation.exec(Re)))){ye=ye.slice(-1*me.length);var Me=ce[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Me.lastIndex=0;for(var tt;(ce=Me.exec(ye))!=null;)if(tt=this.rules.inline.em.middle.exec(ye.slice(0,ce.index+2)),tt)return{type:"em",raw:me.slice(0,tt[0].length),text:me.slice(1,tt[0].length-1)}}},Ie.codespan=function(me){var ye=this.rules.inline.code.exec(me);if(ye){var Re=ye[2].replace(/\n/g," "),ce=/[^ ]/.test(Re),Me=Re.startsWith(" ")&&Re.endsWith(" ");return ce&&Me&&(Re=Re.substring(1,Re.length-1)),Re=Y(Re,!0),{type:"codespan",raw:ye[0],text:Re}}},Ie.br=function(me){var ye=this.rules.inline.br.exec(me);if(ye)return{type:"br",raw:ye[0]}},Ie.del=function(me){var ye=this.rules.inline.del.exec(me);if(ye)return{type:"del",raw:ye[0],text:ye[1]}},Ie.autolink=function(me,ye){var Re=this.rules.inline.autolink.exec(me);if(Re){var ce,Me;return Re[2]==="@"?(ce=Y(this.options.mangle?ye(Re[1]):Re[1]),Me="mailto:"+ce):(ce=Y(Re[1]),Me=ce),{type:"link",raw:Re[0],text:ce,href:Me,tokens:[{type:"text",raw:ce,text:ce}]}}},Ie.url=function(me,ye){var Re;if(Re=this.rules.inline.url.exec(me)){var ce,Me;if(Re[2]==="@")ce=Y(this.options.mangle?ye(Re[0]):Re[0]),Me="mailto:"+ce;else{var tt;do tt=Re[0],Re[0]=this.rules.inline._backpedal.exec(Re[0])[0];while(tt!==Re[0]);ce=Y(Re[0]),Re[1]==="www."?Me="http://"+ce:Me=ce}return{type:"link",raw:Re[0],text:ce,href:Me,tokens:[{type:"text",raw:ce,text:ce}]}}},Ie.inlineText=function(me,ye,Re){var ce=this.rules.inline.text.exec(me);if(ce){var Me;return ye?Me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Y(ce[0]):ce[0]:Me=Y(this.options.smartypants?Re(ce[0]):ce[0]),{type:"text",raw:ce[0],text:Me}}},Be}(),Pe=G.noopTest,Ce=G.edit,Oe=G.merge,be={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Ce(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Ce(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Ce(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",be._comment=//,be.html=Ce(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Ce(be._paragraph).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Ce(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Oe({},be),be.gfm=Oe({},be.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),be.gfm.nptable=Ce(be.gfm.nptable).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Ce(be.gfm.table).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=Oe({},be.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Pe,paragraph:Ce(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",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]*?(?:(?=[\\?@\\[\\]`^{|}~",ge.punctuation=Ce(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=Ce(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=Ce(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=Ce(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=Ce(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=Ce(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=Ce(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=Ce(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=Ce(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=Ce(ge._blockSkip,"g").getRegex(),ge.overlapSkip=Ce(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ge.autolink=Ce(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=Ce(ge.tag).replace("comment",be._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=Ce(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=Ce(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=Ce(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=Oe({},ge),ge.pedantic=Oe({},ge.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=Oe({},ge.normal,{escape:Ce(ge.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(me="x"+me.toString(16)),Ie+=""+me+";";return Ie}var at=function(){function Be(ke){this.tokens=[],this.tokens.links=Object.create(null),this.options=ke||fe,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var me={block:_e.normal,inline:Le.normal};this.options.pedantic?(me.block=_e.pedantic,me.inline=Le.pedantic):this.options.gfm&&(me.block=_e.gfm,this.options.breaks?me.inline=Le.breaks:me.inline=Le.gfm),this.tokenizer.rules=me}Be.lex=function(me,ye){var Re=new Be(ye);return Re.lex(me)};var Ie=Be.prototype;return Ie.lex=function(me){return me=me.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(me,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(me,ye,Re){ye===void 0&&(ye=[]),Re===void 0&&(Re=!0),me=me.replace(/^ +$/gm,"");for(var ce,Me,tt,bt;me;){if(ce=this.tokenizer.space(me)){me=me.substring(ce.raw.length),ce.type&&ye.push(ce);continue}if(ce=this.tokenizer.code(me,ye)){me=me.substring(ce.raw.length),ce.type?ye.push(ce):(bt=ye[ye.length-1],bt.raw+=`
`+ce.raw,bt.text+=`
`+ce.text);continue}if(ce=this.tokenizer.fences(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.heading(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.nptable(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.hr(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.blockquote(me)){me=me.substring(ce.raw.length),ce.tokens=this.blockTokens(ce.text,[],Re),ye.push(ce);continue}if(ce=this.tokenizer.list(me)){for(me=me.substring(ce.raw.length),tt=ce.items.length,Me=0;Me0)for(;(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(bt))!=null;)Gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(bt=bt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Kt=this.tokenizer.rules.inline.blockSkip.exec(bt))!=null;)bt=bt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;me;){if(tt=this.tokenizer.escape(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.tag(me,Re,ce)){me=me.substring(tt.raw.length),Re=tt.inLink,ce=tt.inRawBlock,ye.push(tt);continue}if(tt=this.tokenizer.link(me)){me=me.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,ce)),ye.push(tt);continue}if(tt=this.tokenizer.reflink(me,this.tokens.links)){me=me.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,ce)),ye.push(tt);continue}if(tt=this.tokenizer.strong(me,bt,Me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.em(me,bt,Me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.codespan(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.br(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.del(me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.autolink(me,Ue)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(!Re&&(tt=this.tokenizer.url(me,Ue))){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.inlineText(me,ce,$e)){me=me.substring(tt.raw.length),Me=tt.raw.slice(-1),ye.push(tt);continue}if(me){var $t="Infinite loop on byte: "+me.charCodeAt(0);if(this.options.silent){console.error($t);break}else throw new Error($t)}}return ye},Z(Be,null,[{key:"rules",get:function(){return{block:_e,inline:Le}}}]),Be}(),ft=$.defaults,Ct=G.cleanUrl,yt=G.escape,_t=function(){function Be(ke){this.options=ke||ft}var Ie=Be.prototype;return Ie.code=function(me,ye,Re){var ce=(ye||"").match(/\S*/)[0];if(this.options.highlight){var Me=this.options.highlight(me,ce);Me!=null&&Me!==me&&(Re=!0,me=Me)}return ce?''+(Re?me:yt(me,!0))+`
`:""+(Re?me:yt(me,!0))+`
`},Ie.blockquote=function(me){return`
`+me+`
`},Ie.html=function(me){return me},Ie.heading=function(me,ye,Re,ce){return this.options.headerIds?"
`:""+me+"
`},Ie.hr=function(){return this.options.xhtml?`
`:`
`},Ie.list=function(me,ye,Re){var ce=ye?"ol":"ul",Me=ye&&Re!==1?' start="'+Re+'"':"";return"<"+ce+Me+`>
`+me+""+ce+`>
`},Ie.listitem=function(me){return""+me+`
`},Ie.checkbox=function(me){return" "},Ie.paragraph=function(me){return""+me+`
`},Ie.table=function(me,ye){return ye&&(ye=""+ye+""),`
`},Ie.tablerow=function(me){return`
`+me+`
`},Ie.tablecell=function(me,ye){var Re=ye.header?"th":"td",ce=ye.align?"<"+Re+' align="'+ye.align+'">':"<"+Re+">";return ce+me+""+Re+`>
`},Ie.strong=function(me){return""+me+""},Ie.em=function(me){return""+me+""},Ie.codespan=function(me){return""+me+""},Ie.br=function(){return this.options.xhtml?"
":"
"},Ie.del=function(me){return""+me+""},Ie.link=function(me,ye,Re){if(me=Ct(this.options.sanitize,this.options.baseUrl,me),me===null)return Re;var ce='"+Re+"",ce},Ie.image=function(me,ye,Re){if(me=Ct(this.options.sanitize,this.options.baseUrl,me),me===null)return Re;var ce='
":">",ce},Ie.text=function(me){return me},Be}(),lt=function(){function Be(){}var Ie=Be.prototype;return Ie.strong=function(me){return me},Ie.em=function(me){return me},Ie.codespan=function(me){return me},Ie.del=function(me){return me},Ie.html=function(me){return me},Ie.text=function(me){return me},Ie.link=function(me,ye,Re){return""+Re},Ie.image=function(me,ye,Re){return""+Re},Ie.br=function(){return""},Be}(),Ft=function(){function Be(){this.seen={}}var Ie=Be.prototype;return Ie.slug=function(me){var ye=me.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ye)){var Re=ye;do this.seen[Re]++,ye=Re+"-"+this.seen[Re];while(this.seen.hasOwnProperty(ye))}return this.seen[ye]=0,ye},Be}(),Xt=$.defaults,Jt=G.unescape,rn=function(){function Be(ke){this.options=ke||Xt,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new Ft}Be.parse=function(me,ye){var Re=new Be(ye);return Re.parse(me)};var Ie=Be.prototype;return Ie.parse=function(me,ye){ye===void 0&&(ye=!0);var Re="",ce,Me,tt,bt,Kt,Gt,$t,ei,gn,an,dn,zn,pi,mi,ri,_i,Si,At,Wn=me.length;for(ce=0;ce0&&ri.tokens[0].type==="text"?(ri.tokens[0].text=At+" "+ri.tokens[0].text,ri.tokens[0].tokens&&ri.tokens[0].tokens.length>0&&ri.tokens[0].tokens[0].type==="text"&&(ri.tokens[0].tokens[0].text=At+" "+ri.tokens[0].tokens[0].text)):ri.tokens.unshift({type:"text",text:At}):mi+=At),mi+=this.parse(ri.tokens,pi),gn+=this.renderer.listitem(mi,Si,_i);Re+=this.renderer.list(gn,dn,zn);continue}case"html":{Re+=this.renderer.html(an.text);continue}case"paragraph":{Re+=this.renderer.paragraph(this.parseInline(an.tokens));continue}case"text":{for(gn=an.tokens?this.parseInline(an.tokens):an.text;ce+1An error occurred:
"+Ye(tt.message+"",!0)+"
";throw tt}}Je.options=Je.setOptions=function(Be){return En(Je.defaults,Be),Ot(Je.defaults),Je},Je.getDefaults=Xe,Je.defaults=Et,Je.use=function(Be){var Ie=En({},Be);if(Be.renderer&&function(){var me=Je.defaults.renderer||new _t,ye=function(Me){var tt=me[Me];me[Me]=function(){for(var bt=arguments.length,Kt=new Array(bt),Gt=0;Gt`,triples:"",explode:"[]{}"},U=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(l,r,i){i&&i!=oe.Init&&(l.removeKeyMap(W),l.state.closeBrackets=null),r&&(M(ee(r,"pairs")),l.state.closeBrackets=r,l.addKeyMap(W))});function ee(l,r){return r=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[r]!=null?l[r]:Z[r]}var W={Backspace:k,Enter:D};function M(l){for(var r=0;r=0;c--){var A=t[c].head;l.replaceRange("",U(A.line,A.ch-1),U(A.line,A.ch+1),"+delete")}}function D(l){var r=X(l),i=r&&ee(r,"explode");if(!i||l.getOption("disableInput"))return oe.Pass;for(var t=l.listSelections(),c=0;c0;return{anchor:new U(l.anchor.line,l.anchor.ch+(r?-1:1)),head:new U(l.head.line,l.head.ch+(r?1:-1))}}function v(l,r){var i=X(l);if(!i||l.getOption("disableInput"))return oe.Pass;var t=ee(i,"pairs"),c=t.indexOf(r);if(c==-1)return oe.Pass;for(var h=ee(i,"closeBefore"),A=ee(i,"triples"),S=t.charAt(c+1)==r,w=l.listSelections(),O=c%2==0,R,b=0;b=0&&l.getRange(u,U(u.line,u.ch+3))==r+r+r?d="skipThree":d="skip";else if(S&&u.ch>1&&A.indexOf(r)>=0&&l.getRange(U(u.line,u.ch-2),u)==r+r){if(u.ch>2&&/\bstring/.test(l.getTokenTypeAt(U(u.line,u.ch-2))))return oe.Pass;d="addFour"}else if(S){var g=u.ch==0?" ":l.getRange(U(u.line,u.ch-1),u);if(!oe.isWordChar(E)&&g!=r&&!oe.isWordChar(g))d="both";else return oe.Pass}else if(O&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))d="both";else return oe.Pass;if(!R)R=d;else if(R!=d)return oe.Pass}var y=c%2?t.charAt(c-1):r,F=c%2?r:t.charAt(c+1);l.operation(function(){if(R=="skip")l.execCommand("goCharRight");else if(R=="skipThree")for(var N=0;N<3;N++)l.execCommand("goCharRight");else if(R=="surround"){for(var H=l.getSelections(),N=0;N0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var x=new FormData;G.data&&Object.keys(G.data).forEach(function(Y){var re=G.data[Y];if(Array.isArray(re)){re.forEach(function(de){x.append(Y+"[]",de)});return}x.append(Y,G.data[Y])}),G.file instanceof Blob?x.append(G.filename,G.file,G.file.name):x.append(G.filename,G.file),I.onerror=function(re){G.onError(re)},I.onload=function(){return I.status<200||I.status>=300?G.onError(W(G,I),M(I)):G.onSuccess(M(I),I)},I.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var B=G.headers||{};return B["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(B).forEach(function(Y){B[Y]!==null&&I.setRequestHeader(Y,B[Y])}),I.send(x),{abort:function(){I.abort()}}}var X=+new Date,k=0;function D(){return"rc-upload-"+X+"-"+ ++k}function m(G,I){return G.indexOf(I,G.length-I.length)!==-1}var v=function(G,I){if(G&&I){var x=Array.isArray(I)?I:I.split(","),B=G.name||"",Y=G.type||"",re=Y.replace(/\/.*$/,"");return x.some(function(de){var he=de.trim();return he.charAt(0)==="."?m(B.toLowerCase(),he.toLowerCase()):/\/\*$/.test(he)?re===he.replace(/\/.*$/,""):Y===he})}return!0};function f(G,I){var x=G.createReader(),B=[];function Y(){x.readEntries(function(re){var de=Array.prototype.slice.apply(re);B=B.concat(de);var he=!de.length;he?I(B):Y()})}Y()}var o=function(I,x,B){var Y=function re(de,he){he=he||"",de.isFile?de.file(function(xe){B(xe)&&(de.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=de.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),x([xe]))}):de.isDirectory&&f(de,function(xe){xe.forEach(function(Pe){re(Pe,""+he+de.name+"/")})})};I.forEach(function(re){Y(re.webkitGetAsEntry())})},l=o,r=Object.assign||function(G){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(G,B))continue;x[B]=G[B]}return x}function A(G,I){if(!(G instanceof I))throw new TypeError("Cannot call a class as a function")}function S(G,I){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:G}function w(G,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);G.prototype=Object.create(I&&I.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(G,I):G.__proto__=I)}var O=function(I){return Object.keys(I).reduce(function(x,B){return(B.substr(0,5)==="data-"||B.substr(0,5)==="aria-"||B==="role")&&(x[B]=I[B]),x},{})},R=function(G){w(I,G);function I(){var x,B,Y,re;A(this,I);for(var de=arguments.length,he=Array(de),xe=0;xe1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:hn,onChange:function(Ii){return Tn(Ii.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:wn,onChange:function(Ii){return Xn(Ii)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:tn,max:1e4,min:0,onChange:function(Ii){vn(Ii)}})," \u5206 \xA0 ",!!tn&&!!Qn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(tn/Qn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:gt,onChange:function(Ii){it(Ii.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Bt,selectvalues:De==null?void 0:De.tag_discipline_ids,onChange:Zt,subId:(Ui=ve.editData)===null||Ui===void 0||((Vi=Ui.exercise)===null||Vi===void 0)?void 0:Vi.sub_discipline_id,knowledgeOptions:Ht,onAddKnowledgeFinish:Pt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:We,onChange:function(Ii){dt(Ii)}}))),t.a.createElement("aside",{className:"tr"},(ht!==-1||De.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){gi(),Dn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){on()}},"\u4FDD\u5B58")))},On=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(bi){var si,Ei;return(ve==null||((si=ve.editData)===null||si===void 0||((Ei=si.exercise)===null||Ei===void 0))?void 0:Ei.exercise_status)===1?bi:bi.id!=="del"&&bi.id!=="add"}),Li=function(){var bi=Object(oe.a)(r.a.mark(function si(Ei){return r.a.wrap(function(xi){for(;;)switch(xi.prev=xi.next){case 0:if(!(ht!==-1)){xi.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),xi.abrupt("return");case 3:xi.t0=Ei.id,xi.next=xi.t0==="del"?6:xi.t0==="up"||xi.t0==="down"?8:xi.t0==="edit"?12:xi.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Vi(){return r.a.wrap(function(Ii){for(;;)switch(Ii.prev=Ii.next){case 0:return Ii.next=2,Object(I.n)({id:De.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},wt)});case 3:case"end":return Ii.stop()}},Vi)}))()}}),xi.abrupt("break",17);case 8:return xi.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:De.question_id,opr:Ei.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},wt)}),xi.abrupt("break",17);case 12:return un(De.dragKey),Dn(!0),xi.abrupt("break",17);case 15:return C({key:De.key,insert_id:De==null?void 0:De.question_id,question_type:3}),xi.abrupt("break",17);case 17:case"end":return xi.stop()}},si)}));return function(Ei){return bi.apply(this,arguments)}}(),ji=function(){var si;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(De!=null&&De.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},De.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",De.question_score,"\u5206\uFF09")),De!=null&&De.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},De.key,"."),t.a.createElement(xe.a,{value:De.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",De.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:De.question_title})),t.a.createElement("div",{className:he.a.questionChoices},De==null||((si=De.standard_answer)===null||si===void 0)?void 0:si.map(function(Ei,yi){return t.a.createElement(k.a,{key:yi,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Ei.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(k.a,{align:"middle",gutter:[1,1]},Ei.answer_text.map(function(xi,Ui){return t.a.createElement(O.a,{span:24,key:Ui},t.a.createElement(S.a,{key:yi,checked:De.standard_answer.includes(yi),disabled:!0,value:xi}))}))))})),t.a.createElement("div",{className:he.a.action},!De.hideAction&&On.map(function(Ei,yi){return Ei.id==="up"&&De.key===1||Ei.id==="down"&&De.key===De.len?null:t.a.createElement(h.a,{key:yi,placement:"bottom",title:Ei.name},t.a.createElement("span",{onClick:function(){return Li(Ei)},className:Ei.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!In&&ji(),In&&ii())},ge=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(be)),te=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],fe=function(je,It){var Ne=je.problemset,Ee=je.globalSetting,ve=je.exercise,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.editKey,fi=je.setEditKey,gi=fi===void 0?function(){}:fi,q=je.cancelAdd,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(){}:ae,Ae=je.setIsClaer,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),Dt=Object(i.useState)(),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)([]),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)(""),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],ln=Object(i.useRef)(!1),Mt=function(Ve){Hn([].concat(Object(F.a)(Pn),[Object(v.a)({},Ve)]))},zt=Object(H.i)();Object(i.useEffect)(function(){if(ln.current)return;if(!(we!=null&&we.question_choices)){Nt(!0),cn(""),Yn(2),Lt("");return}qn(!(we!=null&&we.repeat_answer)),cn(we==null?void 0:we.question_title),Yn(we==null?void 0:we.question_score),Cn(we==null?void 0:we.difficulty),Lt(we.standard_answer[0]+""),Mn(we.tag_discipline_ids),An(we==null?void 0:we.analysis)},[we,qt]),Object(i.useEffect)(function(){qt&&it();function it(){return Ve.apply(this,arguments)}function Ve(){return Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(I.I)({sub_discipline_id:(We=ve.editData)===null||We===void 0||((dt=We.exercise)===null||dt===void 0)?void 0:dt.sub_discipline_id});case 2:Ze=kt.sent,Hn(Ze.tag_disciplines);case 4:case"end":return kt.stop()}},qe)})),Ve.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(It,function(){return{onSave:Bt,isEdit:qt}}),Object(i.useEffect)(function(){var it,Ve=ve!=null&&(it=ve.tagDisciplineData)!==null&&it!==void 0&&it.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Hn(Ve)},[ve.tagDisciplineData]);var Vt=function(Ve){(Ve==null?void 0:Ve.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Nt(!1),gi(-1),ln.current=!1,V())},Bt=function(){var it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt,Ze,wt,kt;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(jn){Ht.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ht.abrupt("return",!1);case 3:if(vt){Ht.next=6;break}return y.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ht.abrupt("return",!1);case 6:if(qe=[{choice_text:"\u6B63\u786E",is_answer:vt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:vt==="2"?2:0}],ln.current=!0,!we.question_id){Ht.next=19;break}if(!((we==null?void 0:we.is_my)===1)){Ht.next=13;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var St=Object(oe.a)(r.a.mark(function bn(){var on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(Yt){return Yt.choice_text}),standard_answers:qe.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:sn,sub_discipline_id:(on=ve.editData)===null||on===void 0||((vi=on.exercise)===null||vi===void 0)?void 0:vi.sub_discipline_id,difficulty:Ln,is_cover:1,repeat_answer:!Gn,analysis:kn}});case 2:We=Zn.sent,Vt(We);case 4:case"end":return Zn.stop()}},bn)}));function Pt(){return St.apply(this,arguments)}return Pt}(),onCancel:function(){var St=Object(oe.a)(r.a.mark(function bn(){var on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(Yt){return Yt.choice_text}),standard_answers:qe.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:sn,sub_discipline_id:(on=ve.editData)===null||on===void 0||((vi=on.exercise)===null||vi===void 0)?void 0:vi.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 2:We=Zn.sent,Vt(We);case 4:case"end":return Zn.stop()}},bn)}));function Pt(){return St.apply(this,arguments)}return Pt}()}),Ht.next=17;break;case 13:return Ht.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(St){return St.choice_text}),standard_answers:qe.filter(function(St){return St.is_answer}).map(function(St){return St.is_answer}),tag_discipline_ids:sn,sub_discipline_id:(dt=ve.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 15:We=Ht.sent,Vt(We);case 17:Ht.next=23;break;case 19:return Ht.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:zt.categoryId,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(St){return St.choice_text}),standard_answers:qe.filter(function(St){return St.is_answer}).map(function(St){return St.is_answer}),tag_discipline_ids:sn,sub_discipline_id:(wt=ve.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 21:We=Ht.sent,Vt(We);case 23:return Ht.abrupt("return",{name:jn,choices:qe});case 24:case"end":return Ht.stop()}},Ve)}));return function(){return it.apply(this,arguments)}}(),Zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(it){var Ve,qe;return(ve==null||((Ve=ve.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0))?void 0:qe.exercise_status)===1?it:it.id!=="del"&&it.id!=="add"}),yn=function(){var it=Object(oe.a)(r.a.mark(function Ve(qe){return r.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:if(!(un!==-1)){dt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),dt.abrupt("return");case 3:dt.t0=qe.id,dt.next=dt.t0==="del"?6:dt.t0==="up"||dt.t0==="down"?8:dt.t0==="edit"?12:dt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function wt(){return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},zt)});case 3:case"end":return Tt.stop()}},wt)}))()}}),dt.abrupt("break",17);case 8:return dt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:qe.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},zt)}),dt.abrupt("break",17);case 12:return gi(we.dragKey),Nt(!0),dt.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:2}),dt.abrupt("break",17);case 17:case"end":return dt.stop()}},Ve)}));return function(qe){return it.apply(this,arguments)}}(),pn=function(){var Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},we==null||((Ve=we.question_choices)===null||Ve===void 0)?void 0:Ve.map(function(qe,We){return t.a.createElement(u.a,{key:We,checked:we.standard_answer.includes(We+1),disabled:!0},te[We],". ",t.a.createElement("span",{className:"c-black font14"},qe.choice_text))})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Zt.map(function(qe,We){return qe.id==="up"&&we.key===1||qe.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:We,placement:"bottom",title:qe.name},t.a.createElement("span",{onClick:function(){return yn(qe)},className:qe.icon}))})))},gt=function(){var Ve,qe;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:jn,onChange:function(dt){return cn(dt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:vt,onChange:function(dt){return Lt(dt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:he.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:kn,onChange:function(dt){return An(dt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:xn,max:1e4,min:0,onChange:function(dt){Yn(dt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Ln,onChange:function(dt){Cn(dt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:sn,selectvalues:we==null?void 0:we.tag_discipline_ids,onChange:Mn,subId:(Ve=ve.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:Mt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Gn,onChange:function(dt){qn(dt)}}))),t.a.createElement("aside",{className:"tr"},(un!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){C(),Nt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Bt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!qt&&pn(),qt&>())},_e=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(fe)),Le=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$e=Object(i.forwardRef)(function(ct,je){var It=ct.problemset,Ne=ct.globalSetting,Ee=ct.exercise,ve=ct.loading,di=ct.dispatch,en=ct.onRef,De=en===void 0?function(){}:en,ht=ct.editData,we=ct.cancelAdd,un=we===void 0?function(){}:we,fi=ct.editKey,gi=ct.setEditKey,q=gi===void 0?function(){}:gi,C=ct.setIsClaer,L=C===void 0?function(){}:C,V=ct.addCallback,ae=V===void 0?function(kt){}:V,Q=ct.reload,Ae=Q===void 0?function(){}:Q,nt=Object(N.a)(ct,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),xt=Object(i.useState)([]),Dt=Object(o.a)(xt,2),ot=Dt[0],vt=Dt[1],Lt=Object(i.useState)(),wn=Object(o.a)(Lt,2),Xn=wn[0],jn=wn[1],cn=Object(i.useState)([]),jt=Object(o.a)(cn,2),nn=jt[0],qt=jt[1],Nt=Object(i.useState)(""),$n=Object(o.a)(Nt,2),Un=$n[0],xn=$n[1],Yn=Object(i.useState)(),hn=Object(o.a)(Yn,2),Tn=hn[0],sn=hn[1],Mn=Object(i.useState)(!1),Vn=Object(o.a)(Mn,2),ni=Vn[0],Pn=Vn[1],Hn=Object(i.useState)([]),tn=Object(o.a)(Hn,2),vn=tn[0],Ln=tn[1],Cn=Object(i.useState)(1),Qn=Object(o.a)(Cn,2),_n=Qn[0],Gn=Qn[1],qn=Object(i.useState)(!1),In=Object(o.a)(qn,2),Dn=In[0],kn=In[1],An=Object(i.useState)(""),ln=Object(o.a)(An,2),Mt=ln[0],zt=ln[1],Vt=Object(i.useState)([]),Bt=Object(o.a)(Vt,2),Zt=Bt[0],yn=Bt[1],pn=Object(i.useRef)(!1),gt=function(Tt){yn([].concat(Object(F.a)(Zt),[Object(v.a)({},Tt)]))},it=Object(H.i)();Object(i.useEffect)(function(){vt(["","","",""])},[]),Object(i.useEffect)(function(){if(pn.current)return;if(!(ht!=null&&ht.question_choices)){Pn(!0),xn(""),sn(5),vt(["","","",""]),qt([]);return}xn(ht==null?void 0:ht.question_title),sn(ht==null?void 0:ht.question_score),kn(!(ht!=null&&ht.repeat_answer)),Gn(ht==null?void 0:ht.difficulty),vt(ht==null?void 0:ht.question_choices.map(function(Tt){return Tt.choice_text}));var kt=[];ht==null||ht.standard_answer.map(function(Tt,Ht){kt.push(Tt-1)}),qt(kt),Ln(ht.tag_discipline_ids),zt(ht==null?void 0:ht.analysis)},[ht,ni]),Object(i.useEffect)(function(){ni&&kt();function kt(){return Tt.apply(this,arguments)}function Tt(){return Tt=Object(oe.a)(r.a.mark(function Ht(){var St,Pt,bn;return r.a.wrap(function(vi){for(;;)switch(vi.prev=vi.next){case 0:return vi.next=2,Object(I.I)({sub_discipline_id:(St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id});case 2:bn=vi.sent,yn(bn.tag_disciplines);case 4:case"end":return vi.stop()}},Ht)})),Tt.apply(this,arguments)}},[ni]),Object(i.useImperativeHandle)(je,function(){return{onSave:qe,isEdit:ni}}),Object(i.useEffect)(function(){var kt,Tt=Ee!=null&&(kt=Ee.tagDisciplineData)!==null&&kt!==void 0&&kt.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];yn(Tt)},[Ee.tagDisciplineData]);var Ve=function(Tt){(Tt==null?void 0:Tt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),q(-1),pn.current=!1,Ae())},qe=function(){var kt=Object(oe.a)(r.a.mark(function Tt(){var Ht,St,Pt,bn,on,vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(Un){Yt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Yt.abrupt("return",!1);case 3:if(Ht=ot.findIndex(function(Sn){return!Sn}),!(Ht>-1)){Yt.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Le[Ht]," \u9009\u9879\u7684\u5185\u5BB9")),Yt.abrupt("return",!1);case 7:if(nn.length){Yt.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Yt.abrupt("return",!1);case 10:if(!(nn.length<1)){Yt.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Yt.abrupt("return",!1);case 13:if(St=ot.map(function(Sn,Kn){return{choice_text:Sn,is_answer:nn.includes(Kn)?Kn+1:0}}),pn.current=!0,!ht.question_id){Yt.next=26;break}if(!((ht==null?void 0:ht.is_my)===1)){Yt.next=20;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Sn=Object(oe.a)(r.a.mark(function ii(){var On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(si){return si.choice_text}),standard_answers:St.filter(function(si){return si.is_answer}).map(function(si){return si.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(On=Ee.editData)===null||On===void 0||((Li=On.exercise)===null||Li===void 0)?void 0:Li.sub_discipline_id,difficulty:_n,is_cover:1,repeat_answer:!Dn,analysis:Mt}});case 2:Pt=bi.sent,Ve(Pt);case 4:case"end":return bi.stop()}},ii)}));function Kn(){return Sn.apply(this,arguments)}return Kn}(),onCancel:function(){var Sn=Object(oe.a)(r.a.mark(function ii(){var On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(si){return si.choice_text}),standard_answers:St.filter(function(si){return si.is_answer}).map(function(si){return si.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(On=Ee.editData)===null||On===void 0||((Li=On.exercise)===null||Li===void 0)?void 0:Li.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 2:Pt=bi.sent,Ve(Pt);case 4:case"end":return bi.stop()}},ii)}));function Kn(){return Sn.apply(this,arguments)}return Kn}()}),Yt.next=24;break;case 20:return Yt.next=22,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(Sn){return Sn.choice_text}),standard_answers:St.filter(function(Sn){return Sn.is_answer}).map(function(Sn){return Sn.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 22:Pt=Yt.sent,Ve(Pt);case 24:Yt.next=30;break;case 26:return Yt.next=28,di({type:"exercise/addExerciseQuestion",payload:{insert_id:ht==null?void 0:ht.insert_id,categoryId:it.categoryId,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(Sn){return Sn.choice_text}),standard_answers:St.filter(function(Sn){return Sn.is_answer}).map(function(Sn){return Sn.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 28:Pt=Yt.sent,Ve(Pt);case 30:case"end":return Yt.stop()}},Tt)}));return function(){return kt.apply(this,arguments)}}(),We=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(kt){var Tt,Ht;return(Ee==null||((Tt=Ee.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0))?void 0:Ht.exercise_status)===1?kt:kt.id!=="del"&&kt.id!=="add"}),dt=function(){var kt=Object(oe.a)(r.a.mark(function Tt(Ht){return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(!(fi!==-1)){Pt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Pt.abrupt("return");case 3:Pt.t0=Ht.id,Pt.next=Pt.t0==="del"?6:Pt.t0==="up"||Pt.t0==="down"?8:Pt.t0==="edit"?12:Pt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function on(){return r.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(I.n)({id:ht.question_id});case 2:di({type:"exercise/editExercise",payload:Object(v.a)({},it)});case 3:case"end":return Jn.stop()}},on)}))()}}),Pt.abrupt("break",17);case 8:return Pt.next=10,di({type:"exercise/exeriseMoveUpDown",payload:{id:ht.question_id,opr:Ht.id}});case 10:return di({type:"exercise/editExercise",payload:Object(v.a)({},it)}),Pt.abrupt("break",17);case 12:return q(ht.dragKey),Pn(!0),Pt.abrupt("break",17);case 15:return ae({key:ht.key,insert_id:ht==null?void 0:ht.question_id,question_type:1}),Pt.abrupt("break",17);case 17:case"end":return Pt.stop()}},Tt)}));return function(Ht){return kt.apply(this,arguments)}}(),Ze=function(){var Tt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(ht!=null&&ht.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ht.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ht.question_score,"\u5206\uFF09")),ht!=null&&ht.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ht.key,"."),t.a.createElement(xe.a,{value:ht.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ht.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ht.question_title})),t.a.createElement("div",{className:he.a.questionChoices},ht==null||((Tt=ht.question_choices)===null||Tt===void 0)?void 0:Tt.map(function(Ht,St){return t.a.createElement(k.a,{key:St},t.a.createElement(O.a,null,t.a.createElement(E.a,{key:St,checked:ht.standard_answer.includes(St+1),disabled:!0},Le[St],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ht.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!ht.hideAction&&We.map(function(Ht,St){return Ht.id==="up"&&ht.key===1||Ht.id==="down"&&ht.key===ht.len?null:t.a.createElement(h.a,{key:St,placement:"bottom",title:Ht.name},t.a.createElement("span",{onClick:function(){return dt(Ht)},className:Ht.icon}))})))},wt=function(){var Tt,Ht;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Un,onChange:function(Pt){return xn(Pt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ot.map(function(St,Pt){var bn,on;return t.a.createElement("div",{className:he.a.choiceWrap,key:Pt},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(nn.includes(Pt)?he.a.activeAnswer:""),onClick:function(){nn.includes(Pt)?qt(nn.filter(function(Jn){return Jn!==Pt})):qt([].concat(Object(F.a)(nn),[Pt]))}},Le[Pt])),t.a.createElement("div",{className:he.a.editorWrap},Xn===Pt?t.a.createElement(x.a,{id:"single-question-option-".concat(Pt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:St,onChange:function(Jn){ot[Pt]=Jn,vt(ot)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return jn(Pt)}},t.a.createElement(xe.a,{value:St}))),((bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Pt>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return vt(ot.filter(function(Jn,Zn){return Zn!==Pt}))}})),Pt<7&&Pt===ot.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return vt([].concat(Object(F.a)(ot),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mt,onChange:function(Pt){return zt(Pt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Tn,max:1e4,min:0,onChange:function(Pt){sn(Pt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:_n,onChange:function(Pt){Gn(Pt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:vn,selectvalues:ht==null?void 0:ht.tag_discipline_ids,onChange:Ln,subId:(Tt=Ee.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,knowledgeOptions:Zt,onAddKnowledgeFinish:gt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Dn,onChange:function(Pt){kn(Pt)}}))),t.a.createElement("aside",{className:"tr"},(fi!==-1||ht.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){un(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){qe()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!ni&&Ze(),ni&&wt())}),Ue=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})($e),at=z("55Ip"),ft=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ct=function(je,It){var Ne=je.problemset,Ee=je.globalSetting,ve=je.exercise,di=je.loading,en=je.dispatch,De=je.editData,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.editKey,fi=je.setEditKey,gi=fi===void 0?function(){}:fi,q=je.addCallback,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.setIsClaer,Q=ae===void 0?function(){}:ae,Ae=Object(N.a)(je,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),nt=Object(i.useState)(""),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(""),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)(""),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(i.useState)([]),Nt=Object(o.a)(qt,2),$n=Nt[0],Un=Nt[1],xn=Object(i.useState)(""),Yn=Object(o.a)(xn,2),hn=Yn[0],Tn=Yn[1],sn=Object(i.useState)(),Mn=Object(o.a)(sn,2),Vn=Mn[0],ni=Mn[1],Pn=Object(i.useState)(!1),Hn=Object(o.a)(Pn,2),tn=Hn[0],vn=Hn[1],Ln=Object(i.useState)([]),Cn=Object(o.a)(Ln,2),Qn=Cn[0],_n=Cn[1],Gn=Object(i.useState)(!1),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=Object(i.useState)(!1),An=Object(o.a)(kn,2),ln=An[0],Mt=An[1],zt=Object(H.i)(),Vt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Ve;if(Vt.current)return;De.edit&&(Dn(!0),Xn(""),ot(""),_n([])),ot(De.shixun_name),Xn(De.question_title);var qe=[];(Ve=De.shixun)===null||Ve===void 0||Ve.map(function(We){qe.push(We.challenge_score)}),_n(qe)},[De]),Object(i.useEffect)(function(){vn(!1)},[In]),Object(i.useImperativeHandle)(It,function(){return{onSave:Zt,isEdit:In}});var Bt=function(qe){(qe==null?void 0:qe.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Dn(!1),gi(-1),Vt.current=!1,V())},Zt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(We=[],dt=!1,!dt){kt.next=4;break}return kt.abrupt("return",!1);case 4:if(Vt.current=!0,Mt(!0),!De.question_id){kt.next=12;break}return kt.next=9,en({type:"exercise/editExerciseQuestion",payload:{id:De.question_id,question_title:wn,shixun_name:Dt,shixun_id:De.shixun_id,question_type:5,question_scores:Qn}});case 9:Ze=kt.sent,kt.next=15;break;case 12:return kt.next=14,en({type:"exercise/addExerciseQuestion",payload:{insert_id:De==null?void 0:De.insert_id,categoryId:zt.categoryId,question_title:wn,shixun_name:Dt,shixun_id:De.shixun_id,question_type:5,question_scores:Qn,is_copy:De.is_copy}});case 14:Ze=kt.sent;case 15:return Bt(Ze),Mt(!1),kt.abrupt("return",{name:wn,analysis:jt,standard_answers:We,is_ordered:Vn});case 18:case"end":return kt.stop()}},qe)}));return function(){return Ve.apply(this,arguments)}}(),yn=function(){var qe;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:Dt,onChange:function(dt){ot(dt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(x.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:wn,onChange:function(dt){Xn(dt)}})),t.a.createElement("div",{className:"mt20"},(qe=De.shixun)===null||qe===void 0?void 0:qe.map(function(We,dt){return t.a.createElement(k.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},dt+1,".",We.challenge_name),t.a.createElement(O.a,null,t.a.createElement(U.a,{defaultValue:Qn[dt],onChange:function(wt){Qn[dt]=wt,_n(Qn),console.log("srore:L",Qn[dt])}})," \u5206"))})),t.a.createElement("div",{className:"mt20"},$n.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:Vn,onChange:function(dt){return ni(dt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(un!==-1||!(De!=null&&De.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Dn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:ln,className:"ml20",type:"primary",onClick:function(){Zt()}},"\u4FDD\u5B58")))},pn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Ve){var qe,We;return(ve==null||((qe=ve.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0))?void 0:We.exercise_status)===1?Ve:Ve.id!=="del"&&Ve.id!=="add"}),gt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(We){return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(un!==-1)){Ze.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ze.abrupt("return");case 3:Ze.t0=We.id,Ze.next=Ze.t0==="del"?6:Ze.t0==="up"||Ze.t0==="down"?8:Ze.t0==="edit"?12:Ze.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function kt(){return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(I.n)({id:De.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},zt)});case 3:case"end":return Ht.stop()}},kt)}))()}}),Ze.abrupt("break",17);case 8:return Ze.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:De.question_id,opr:We.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},zt)}),Ze.abrupt("break",17);case 12:return gi(De.dragKey),Dn(!0),Ze.abrupt("break",17);case 15:return en({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:De.key,insert_id:De==null?void 0:De.question_id,question_type:5}}}),Ze.abrupt("break",17);case 17:case"end":return Ze.stop()}},qe)}));return function(We){return Ve.apply(this,arguments)}}(),it=function(){var qe,We;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(De!=null&&De.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},De.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",De.question_score,"\u5206\uFF09")),De!=null&&De.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},De.key,"."),t.a.createElement(xe.a,{value:De.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",De.question_score,"\u5206\uFF09"),!!((qe=De.schools)!==null&&qe!==void 0&&qe.length)&&t.a.createElement(h.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:De.shixun_name})),t.a.createElement("div",{className:"mt30"}),(We=De.shixun)===null||We===void 0?void 0:We.map(function(dt,Ze){return t.a.createElement("div",{key:Ze},"\u7B2C",Ze+1,"\u5173 ",t.a.createElement("span",{className:"ml10"},dt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},dt.challenge_score," \u5206"))}),t.a.createElement("div",{className:he.a.action},t.a.createElement(at.a,{target:"_blank",to:"/shixuns/".concat(De.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!De.hideAction&&pn.map(function(dt,Ze){return dt.id==="up"&&De.key===1||dt.id==="down"&&De.key===De.len?null:t.a.createElement(h.a,{key:Ze,placement:"bottom",title:dt.name},t.a.createElement("span",{onClick:function(){return gt(dt)},className:dt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!In&&it(),In&&yn())},yt=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ct)),_t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],lt=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.setIsClaer,V=L===void 0?function(){}:L,ae=je.reload,Q=ae===void 0?function(){}:ae,Ae=je.addCallback,nt=Ae===void 0?function(Ht){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)([]),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(""),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)(!1),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],ln=Object(i.useState)(""),Mt=Object(o.a)(ln,2),zt=Mt[0],Vt=Mt[1],Bt=Object(H.i)(),Zt=Object(i.useRef)(null),yn=Object(i.useRef)(!1),pn=Object(i.useState)([]),gt=Object(o.a)(pn,2),it=gt[0],Ve=gt[1],qe=function(St){Ve([].concat(Object(F.a)(it),[Object(v.a)({},St)]))};Object(i.useEffect)(function(){Lt(["","","",""])},[]),Object(i.useEffect)(function(){if(yn.current)return;if(!(we!=null&&we.question_choices)){Cn(!0),Yn(""),Mn(5),Lt(["","","",""]),Nt([]);return}Yn(we==null?void 0:we.question_title),Mn(we==null?void 0:we.question_score),An(!(we!=null&&we.repeat_answer)),Vt(we==null?void 0:we.analysis),qn(we==null?void 0:we.difficulty),Lt(we==null?void 0:we.question_choices.map(function(St){return St.choice_text}));var Ht=[];we==null||we.standard_answer.map(function(St,Pt){Ht.push(St-1)}),Hn(we.tag_discipline_ids),Nt(Ht)},[we,Ln]),Object(i.useEffect)(function(){Ln&&Ht();function Ht(){return St.apply(this,arguments)}function St(){return St=Object(oe.a)(r.a.mark(function Pt(){var bn,on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,Object(I.I)({sub_discipline_id:(bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.sub_discipline_id});case 2:vi=Zn.sent,Ve(vi.tag_disciplines);case 4:case"end":return Zn.stop()}},Pt)})),St.apply(this,arguments)}},[Ln]),Object(i.useEffect)(function(){var Ht,St=Ee!=null&&(Ht=Ee.tagDisciplineData)!==null&&Ht!==void 0&&Ht.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Ve(St)},[Ee.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:dt,isEdit:Ln}});var We=function(St){(St==null?void 0:St.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Cn(!1),C(-1),yn.current=!1,Q())},dt=function(){var Ht=Object(oe.a)(r.a.mark(function St(){var Pt,bn,on,vi,Jn,Zn,Yt;return r.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(xn){Kn.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Kn.abrupt("return",!1);case 3:if(Pt=vt.findIndex(function(ii){return!ii}),!(Pt>-1)){Kn.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(_t[Pt]," \u9009\u9879\u7684\u5185\u5BB9")),Kn.abrupt("return",!1);case 7:if(qt.length){Kn.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Kn.abrupt("return",!1);case 10:if(!(qt.length<1)){Kn.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Kn.abrupt("return",!1);case 13:if(bn=vt.map(function(ii,On){return{choice_text:ii,is_answer:qt.includes(On)?On+1:0}}),yn.current=!0,!we.question_id){Kn.next=26;break}if(!((we==null?void 0:we.is_my)===1)){Kn.next=20;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var ii=Object(oe.a)(r.a.mark(function Li(){var ji,bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:sn,question_choices:bn.map(function(yi){return yi.choice_text}),standard_answers:bn.filter(function(yi){return yi.is_answer}).map(function(yi){return yi.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(ji=Ee.editData)===null||ji===void 0||((bi=ji.exercise)===null||bi===void 0)?void 0:bi.sub_discipline_id,difficulty:Gn,is_cover:1,repeat_answer:!kn,analysis:zt}});case 2:on=Ei.sent,We(on);case 4:case"end":return Ei.stop()}},Li)}));function On(){return ii.apply(this,arguments)}return On}(),onCancel:function(){var ii=Object(oe.a)(r.a.mark(function Li(){var ji,bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:sn,question_choices:bn.map(function(yi){return yi.choice_text}),standard_answers:bn.filter(function(yi){return yi.is_answer}).map(function(yi){return yi.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(ji=Ee.editData)===null||ji===void 0||((bi=ji.exercise)===null||bi===void 0)?void 0:bi.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 2:on=Ei.sent,We(on);case 4:case"end":return Ei.stop()}},Li)}));function On(){return ii.apply(this,arguments)}return On}()}),Kn.next=24;break;case 20:return Kn.next=22,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:sn,question_choices:bn.map(function(ii){return ii.choice_text}),standard_answers:bn.filter(function(ii){return ii.is_answer}).map(function(ii){return ii.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 22:on=Kn.sent,We(on);case 24:Kn.next=30;break;case 26:return Kn.next=28,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Bt.categoryId,question_title:xn,question_type:1,question_score:sn,question_choices:bn.map(function(ii){return ii.choice_text}),standard_answers:bn.filter(function(ii){return ii.is_answer}).map(function(ii){return ii.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(Zn=Ee.editData)===null||Zn===void 0||((Yt=Zn.exercise)===null||Yt===void 0)?void 0:Yt.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 28:on=Kn.sent,We(on);case 30:case"end":return Kn.stop()}},St)}));return function(){return Ht.apply(this,arguments)}}(),Ze=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Ht){var St,Pt;return(Ee==null||((St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0))?void 0:Pt.exercise_status)===1?Ht:Ht.id!=="del"&&Ht.id!=="add"}),wt=function(){var Ht=Object(oe.a)(r.a.mark(function St(Pt){return r.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(gi!==-1)){on.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),on.abrupt("return");case 3:on.t0=Pt.id,on.next=on.t0==="del"?6:on.t0==="up"||on.t0==="down"?8:on.t0==="edit"?12:on.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Jn(){return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Bt)});case 3:case"end":return Yt.stop()}},Jn)}))()}}),on.abrupt("break",17);case 8:return on.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Pt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Bt)}),on.abrupt("break",17);case 12:return C(we.dragKey),Cn(!0),on.abrupt("break",17);case 15:return nt({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:0}),on.abrupt("break",17);case 17:case"end":return on.stop()}},St)}));return function(Pt){return Ht.apply(this,arguments)}}(),kt=function(){var St;return t.a.createElement("aside",{ref:Zt},t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5355\u9009\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},we==null||((St=we.question_choices)===null||St===void 0)?void 0:St.map(function(Pt,bn){return t.a.createElement(k.a,{key:bn},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:bn,checked:we.standard_answer.includes(bn+1),disabled:!0},_t[bn],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Pt.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Ze.map(function(Pt,bn){return Pt.id==="up"&&we.key===1||Pt.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:bn,placement:"bottom",title:Pt.name},t.a.createElement("span",{onClick:function(){return wt(Pt)},className:Pt.icon}))})))},Tt=function(){var St,Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xn,onChange:function(on){return Yn(on)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),vt.map(function(bn,on){var vi,Jn;return t.a.createElement("div",{className:he.a.choiceWrap,key:on},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qt.includes(on)?he.a.activeAnswer:""),onClick:function(){qt.includes(on)?Nt(qt.filter(function(Yt){return Yt!==on})):Nt([].concat(Object(F.a)(qt),[on]))}},_t[on])),t.a.createElement("div",{className:he.a.editorWrap},jn===on?t.a.createElement(x.a,{id:"single-question-option-".concat(on),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:bn,onChange:function(Yt){vt[on]=Yt,Lt(vt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return cn(on)}},t.a.createElement(xe.a,{value:bn}))),((vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,on>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Lt(vt.filter(function(Yt,Sn){return Sn!==on}))}})),on<7&&on===vt.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Lt([].concat(Object(F.a)(vt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:zt,onChange:function(on){return Vt(on)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:sn,max:1e4,min:0,onChange:function(on){Mn(on)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Gn,onChange:function(on){qn(on.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:we==null?void 0:we.tag_discipline_ids,value:Pn,onChange:Hn,subId:(St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,knowledgeOptions:it,onAddKnowledgeFinish:qe})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:kn,onChange:function(on){An(on)}}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),Cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){dt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!Ln&&kt(),Ln&&Tt())},Ft=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(lt)),Xt=z("Z9P2"),Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],rn=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(){}:ae,Ae=je.setIsClaer,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),Dt=Object(i.useState)(""),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(""),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)([[],[]]),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],ln=Object(i.useRef)(!1),Mt=Object(H.i)(),zt=Object(i.useState)([]),Vt=Object(o.a)(zt,2),Bt=Vt[0],Zt=Vt[1],yn=function(Ze){Zt([].concat(Object(F.a)(Bt),[Object(v.a)({},Ze)]))};Object(i.useEffect)(function(){var dt;if(ln.current)return;if(!(we!=null&&we.question_title)){Mn(!0),Lt(""),Nt(""),Yn(10);return}qn(!(we!=null&&we.repeat_answer)),Lt(we==null?void 0:we.question_title),Nt(we==null||((dt=we.standard_answer)===null||dt===void 0)?void 0:dt[0]),Yn(we==null?void 0:we.question_score),Hn(we.tag_discipline_ids),Cn(we==null?void 0:we.difficulty),cn(we==null?void 0:we.analysis),An([we==null?void 0:we.normal_keywords,we==null?void 0:we.main_keywords])},[Ne.editData,sn]),Object(i.useEffect)(function(){var dt,Ze=Ee!=null&&(dt=Ee.tagDisciplineData)!==null&&dt!==void 0&&dt.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Zt(Ze)},[Ee.tagDisciplineData]),Object(i.useEffect)(function(){sn&&dt();function dt(){return Ze.apply(this,arguments)}function Ze(){return Ze=Object(oe.a)(r.a.mark(function wt(){var kt,Tt,Ht;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(I.I)({sub_discipline_id:(kt=Ee.editData)===null||kt===void 0||((Tt=kt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id});case 2:Ht=Pt.sent,Zt(Ht.tag_disciplines);case 4:case"end":return Pt.stop()}},wt)})),Ze.apply(this,arguments)}},[sn]),Object(i.useImperativeHandle)(It,function(){return{onSave:gt,isEdit:sn}});var pn=function(Ze){(Ze==null?void 0:Ze.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Mn(!1),C(-1),ln.current=!1,V())},gt=function(){var dt=Object(oe.a)(r.a.mark(function Ze(){var wt,kt,Tt,Ht,St,Pt,bn;return r.a.wrap(function(vi){for(;;)switch(vi.prev=vi.next){case 0:if(vt){vi.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),vi.abrupt("return",!1);case 3:if(wt=kn[0],kt=kn[1],ln.current=!0,!we.question_id){vi.next=17;break}if(!((we==null?void 0:we.is_my)===1)){vi.next=11;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Jn=Object(oe.a)(r.a.mark(function Yt(){var Sn,Kn;return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Sn=Ee.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,difficulty:Ln,is_cover:1,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 2:Tt=On.sent,pn(Tt);case 4:case"end":return On.stop()}},Yt)}));function Zn(){return Jn.apply(this,arguments)}return Zn}(),onCancel:function(){var Jn=Object(oe.a)(r.a.mark(function Yt(){var Sn,Kn;return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Sn=Ee.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 2:Tt=On.sent,pn(Tt);case 4:case"end":return On.stop()}},Yt)}));function Zn(){return Jn.apply(this,arguments)}return Zn}()}),vi.next=15;break;case 11:return vi.next=13,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Ht=Ee.editData)===null||Ht===void 0||((St=Ht.exercise)===null||St===void 0)?void 0:St.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 13:Tt=vi.sent,pn(Tt);case 15:vi.next=21;break;case 17:return vi.next=19,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Mt.categoryId,exercise_bank_id:Mt.categoryId,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Pt=Ee.editData)===null||Pt===void 0||((bn=Pt.exercise)===null||bn===void 0)?void 0:bn.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 19:Tt=vi.sent,pn(Tt);case 21:return vi.abrupt("return",{name:vt,answer_texts:[qt],analysis:jn,normal_keywords:wt,main_keywords:kt});case 22:case"end":return vi.stop()}},Ze)}));return function(){return dt.apply(this,arguments)}}(),it=function(){var Ze,wt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:vt,onChange:function(Tt){return Lt(Tt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(x.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qt,onChange:function(Tt){return Nt(Tt)}}),t.a.createElement(Xt.a,{value:kn,onChange:An}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:jn,onChange:function(Tt){return cn(Tt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:xn,max:1e4,min:0,onChange:function(Tt){Yn(Tt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Ln,onChange:function(Tt){Cn(Tt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Pn,selectvalues:we==null?void 0:we.tag_discipline_ids,onChange:Hn,subId:(Ze=Ee.editData)===null||Ze===void 0||((wt=Ze.exercise)===null||wt===void 0)?void 0:wt.sub_discipline_id,knowledgeOptions:Bt,onAddKnowledgeFinish:yn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Gn,onChange:function(Tt){qn(Tt)}}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),Mn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){gt()}},"\u4FDD\u5B58")))},Ve=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(dt){var Ze,wt;return(Ee==null||((Ze=Ee.editData)===null||Ze===void 0||((wt=Ze.exercise)===null||wt===void 0))?void 0:wt.exercise_status)===1?dt:dt.id!=="del"&&dt.id!=="add"}),qe=function(){var dt=Object(oe.a)(r.a.mark(function Ze(wt){return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(!(gi!==-1)){Tt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Tt.abrupt("return");case 3:Tt.t0=wt.id,Tt.next=Tt.t0==="del"?6:Tt.t0==="up"||Tt.t0==="down"?8:Tt.t0==="edit"?12:Tt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function St(){return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Mt)});case 3:case"end":return bn.stop()}},St)}))()}}),Tt.abrupt("break",17);case 8:return Tt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:wt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Mt)}),Tt.abrupt("break",17);case 12:return C(we.dragKey),Mn(!0),Tt.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:4}),Tt.abrupt("break",17);case 17:case"end":return Tt.stop()}},Ze)}));return function(wt){return dt.apply(this,arguments)}}(),We=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:qt||""})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Ve.map(function(Ze,wt){return Ze.id==="up"&&we.key===1||Ze.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:wt,placement:"bottom",title:Ze.name},t.a.createElement("span",{onClick:function(){return qe(Ze)},className:Ze.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!sn&&We(),sn&&it())},En=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(rn)),mn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ye=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.addCallback,V=L===void 0?function(){}:L,ae=je.setIsClaer,Q=ae===void 0?function(){}:ae,Ae=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),nt=Object(i.useState)([]),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)([]),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(i.useState)(""),Nt=Object(o.a)(qt,2),$n=Nt[0],Un=Nt[1],xn=Object(i.useState)(5),Yn=Object(o.a)(xn,2),hn=Yn[0],Tn=Yn[1],sn=Object(i.useState)(!1),Mn=Object(o.a)(sn,2),Vn=Mn[0],ni=Mn[1],Pn=Object(H.g)(),Hn=Object(H.i)();Object(i.useEffect)(function(){ot(["","","",""])},[]),Object(i.useEffect)(function(){if(!(we!=null&&we.question_choices)){ni(!0),Un(""),Tn(5),ot(["","","",""]),nn([]);return}Un(we==null?void 0:we.question_title),Tn(we==null?void 0:we.question_score),ot(we==null?void 0:we.question_choices.map(function(Gn){return Gn.choice_text}));var _n=[];we==null||we.standard_answer.map(function(Gn,qn){_n.push(Gn-1)}),nn(_n)},[we]),Object(i.useImperativeHandle)(It,function(){return{onSave:tn,isEdit:Vn}});var tn=function(){var _n=Object(oe.a)(r.a.mark(function Gn(){var qn,In,Dn;return r.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if($n){An.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),An.abrupt("return",!1);case 3:if(qn=Dt.findIndex(function(ln){return!ln}),!(qn>-1)){An.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(mn[qn]," \u9009\u9879\u7684\u5185\u5BB9")),An.abrupt("return",!1);case 7:if(jt.length){An.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),An.abrupt("return",!1);case 10:if(!(jt.length<1)){An.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),An.abrupt("return",!1);case 13:if(In=Dt.map(function(ln,Mt){return{choice_text:ln,is_answer:jt.includes(Mt)?Mt+1:0}}),!we.question_id){An.next=20;break}return An.next=17,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:$n,question_type:1,question_score:hn,question_choices:In.map(function(ln){return ln.choice_text}),standard_answers:In.filter(function(ln){return ln.is_answer}).map(function(ln){return ln.is_answer})}});case 17:Dn=An.sent,An.next=23;break;case 20:return An.next=22,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Hn.categoryId,question_title:$n,question_type:1,question_score:"5.0",question_choices:In.map(function(ln){return ln.choice_text}),standard_answers:In.filter(function(ln){return ln.is_answer}).map(function(ln){return ln.is_answer})}});case 22:Dn=An.sent;case 23:Dn.status===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),ni(!1),en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)}));case 24:case"end":return An.stop()}},Gn)}));return function(){return _n.apply(this,arguments)}}(),vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(_n){var Gn,qn;return(Ee==null||((Gn=Ee.editData)===null||Gn===void 0||((qn=Gn.exercise)===null||qn===void 0))?void 0:qn.exercise_status)===1?_n:_n.id!=="del"&&_n.id!=="add"}),Ln=function(){var _n=Object(oe.a)(r.a.mark(function Gn(qn){return r.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(!(gi!==-1)){Dn.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Dn.abrupt("return");case 3:Dn.t0=qn.id,Dn.next=Dn.t0==="del"?6:Dn.t0==="up"||Dn.t0==="down"?8:Dn.t0==="edit"?12:Dn.t0==="add"?14:16;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function An(){return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)});case 3:case"end":return Mt.stop()}},An)}))()}}),Dn.abrupt("break",16);case 8:return Dn.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:qn.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)}),Dn.abrupt("break",16);case 12:return Pn.push("/problems/".concat(we==null?void 0:we.hack_identifier,"/edit?type=exercises&express_id=").concat(Hn.categoryId,"&question_id=").concat(we==null?void 0:we.question_id,"&score=").concat(we==null?void 0:we.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Dn.abrupt("break",16);case 14:return V({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:6}),Dn.abrupt("break",16);case 16:case"end":return Dn.stop()}},Gn)}));return function(qn){return _n.apply(this,arguments)}}(),Cn=function(){var _n=Object(oe.a)(r.a.mark(function Gn(qn){var In;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return qn.preventDefault(),kn.next=3,Object(I.X)({id:we==null?void 0:we.hack_identifier});case 3:In=kn.sent,In.status===0&&Object(re.S)("/myproblems/".concat(In==null?void 0:In.identifier));case 5:case"end":return kn.stop()}},Gn)}));return function(qn){return _n.apply(this,arguments)}}(),Qn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement(xe.a,{value:we.description||""})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&vn.map(function(Gn,qn){return Gn.id==="up"&&we.key===1||Gn.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:qn,placement:"bottom",title:Gn.name},t.a.createElement("span",{onClick:function(){return Ln(Gn)},className:Gn.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},Qn())},Xe=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ye)),Ot=z("LvDl"),Et=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Je=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.setIsClaer,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(gt){}:ae,Ae=je.reload,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(!1),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!0),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(1),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(H.i)(),vn=Object(i.useRef)(null),Ln=Object(i.useState)(""),Cn=Object(o.a)(Ln,2),Qn=Cn[0],_n=Cn[1],Gn=Object(i.useState)([]),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=Object(i.useRef)(!1),An=function(it){Hn([].concat(Object(F.a)(Pn),[Object(v.a)({},it)]))};Object(i.useEffect)(function(){var gt;if(kn.current)return;if(!(we!=null&&we.question_title)){cn(!0),_n("");return}_n(we==null?void 0:we.question_title),Mn(!(we!=null&&we.repeat_answer)),Yn(we==null?void 0:we.difficulty),Lt(we.tag_discipline_ids);var it=we==null||((gt=we.sub_exercise_questions)===null||gt===void 0)?void 0:gt.map(function(Ve){var qe,We,dt;return Object(v.a)(Object(v.a)({},Ve),{},{id:Ve.question_id,name:Ve.question_title,open:!1,score:Ve.question_score,qusList:Ve==null||((qe=Ve.question_choices)===null||qe===void 0)?void 0:qe.map(function(Ze){return Ze.choice_text}),activeQusEditor:null,qusAnswer:(We=[Ve==null||((dt=Ve.question_choices)===null||dt===void 0)?void 0:dt.findIndex(function(Ze){return Ze.standard_boolean})])===null||We===void 0?void 0:We.filter(function(Ze){return Ze!==-1})})});Dn(it)},[we,jn]),Object(i.useEffect)(function(){jn&>();function gt(){return it.apply(this,arguments)}function it(){return it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(I.I)({sub_discipline_id:(qe=Ee.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id});case 2:dt=wt.sent,Hn(dt.tag_disciplines);case 4:case"end":return wt.stop()}},Ve)})),it.apply(this,arguments)}},[jn]),Object(i.useEffect)(function(){var gt,it=Ee!=null&&(gt=Ee.tagDisciplineData)!==null&>!==void 0&>.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Hn(it)},[Ee.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:Mt,isEdit:jn}});var ln=function(it){(it==null?void 0:it.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),cn(!1),C(-1),kn.current=!1,nt())},Mt=function(){var gt=Object(oe.a)(r.a.mark(function it(){var Ve,qe,We,dt,Ze,wt,kt,Tt;return r.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(Qn){St.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),St.abrupt("return",!1);case 3:if(!(In.length===0)){St.next=6;break}return y.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),St.abrupt("return",!1);case 6:Ve=0;case 7:if(!(Ve-1)){St.next=19;break}return y.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Ve+1,"\u5C0F\u9898").concat(Et[dt],"\u9009\u9879\u7684\u5185\u5BB9")),St.abrupt("return",!1);case 19:if(We!=null&&We.qusAnswer.length){St.next=22;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Ve+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),St.abrupt("return",!1);case 22:Ve++,St.next=7;break;case 25:if(Ze=In.map(function(Pt){var bn;return{id:Pt.id>1?Pt.id:null,question_title:Pt.name,question_type:1,question_choices:Pt.qusList,question_score:Pt.score,standard_answers:[((bn=Pt.qusAnswer)===null||bn===void 0?void 0:bn[0])+1]}}),kn.current=!0,!we.question_id){St.next=36;break}if(!((we==null?void 0:we.is_my)===1)){St.next=32;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Pt=Object(oe.a)(r.a.mark(function on(){var vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:xn,is_cover:1,repeat_answer:!sn}});case 2:wt=Yt.sent,ln(wt);case 4:case"end":return Yt.stop()}},on)}));function bn(){return Pt.apply(this,arguments)}return bn}(),onCancel:function(){var Pt=Object(oe.a)(r.a.mark(function on(){var vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:xn,repeat_answer:!sn}});case 2:wt=Yt.sent,ln(wt);case 4:case"end":return Yt.stop()}},on)}));function bn(){return Pt.apply(this,arguments)}return bn}()}),St.next=36;break;case 32:return St.next=34,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(kt=Ee.editData)===null||kt===void 0||((Tt=kt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:xn,repeat_answer:!sn}});case 34:wt=St.sent,ln(wt);case 36:case"end":return St.stop()}},it)}));return function(){return gt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(gt){var it,Ve;return(Ee==null||((it=Ee.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0))?void 0:Ve.exercise_status)===1?gt:gt.id!=="del"&>.id!=="add"}),Vt=function(){var gt=Object(oe.a)(r.a.mark(function it(Ve){return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(!(gi!==-1)){We.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),We.abrupt("return");case 3:We.t0=Ve.id,We.next=We.t0==="del"?6:We.t0==="up"||We.t0==="down"?8:We.t0==="edit"?12:We.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Ze(){return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},tn)});case 3:case"end":return kt.stop()}},Ze)}))()}}),We.abrupt("break",17);case 8:return We.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Ve.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},tn)}),We.abrupt("break",17);case 12:return C(we.dragKey),cn(!0),We.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:0}),We.abrupt("break",17);case 17:case"end":return We.stop()}},it)}));return function(Ve){return gt.apply(this,arguments)}}(),Bt=function(){var it;return t.a.createElement("aside",{ref:vn},t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",we==null?void 0:we.sub_q_count,"\u5C0F\u9898\uFF0C",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{style:{display:qt?"block":"none"},className:he.a.questionChoices},we==null||((it=we.sub_exercise_questions)===null||it===void 0)?void 0:it.map(function(Ve,qe){var We;return t.a.createElement("div",{key:qe},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,".",qe+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:Ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ve.question_score,"\u5206\uFF09")),Ve==null||((We=Ve.question_choices)===null||We===void 0)?void 0:We.map(function(dt,Ze){return t.a.createElement(k.a,{key:Ze},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:Ze,checked:Ve.standard_answer.includes(Ze+1),disabled:!0},Et[Ze],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:dt.choice_text}))))}))})),t.a.createElement("div",{className:he.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Nt(!qt)},style:{}},qt?"\u6536\u8D77":"\u5C55\u5F00"),!we.hideAction&&zt.map(function(Ve,qe){return Ve.id==="up"&&we.key===1||Ve.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:qe,placement:"bottom",title:Ve.name},t.a.createElement("span",{onClick:function(){return Vt(Ve)},className:Ve.icon}))})))},Zt=function(){var it,Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:he.a.wrap,style:{padding:0}},t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Qn,onChange:function(We){return _n(We)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",In==null?void 0:In.length),In==null?void 0:In.map(function(qe,We){var dt;return t.a.createElement("div",{className:he.a.fold,key:qe.id},t.a.createElement("div",{onClick:function(){return pn("open",We)},className:he.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:qe.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",We+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(wt){wt.stopPropagation(),pn("delete",We)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:qe.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:qe==null?void 0:qe.name,onChange:function(wt){return pn("value",We,wt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),qe==null||((dt=qe.qusList)===null||dt===void 0)?void 0:dt.map(function(Ze,wt){var kt,Tt;return t.a.createElement("div",{className:he.a.choiceWrap,key:wt},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qe!=null&&(kt=qe.qusAnswer)!==null&&kt!==void 0&&kt.includes(wt)?he.a.activeAnswer:""),onClick:function(){return pn("answer",We,wt)}},Et[wt])),t.a.createElement("div",{className:he.a.editorWrap},(qe==null?void 0:qe.activeQusEditor)===wt?t.a.createElement(x.a,{id:"single-question-option-".concat(wt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ze,onChange:function(St){return pn("details",We,St)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return pn("edit",We,wt)}},t.a.createElement(xe.a,{value:Ze}))),wt>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return pn("deleteQus",We,wt)}})),wt<7&&wt===(qe==null||((Tt=qe.qusList)===null||Tt===void 0)?void 0:Tt.length)-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return pn("addQus",We)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:qe.score,max:1e4,min:0,onChange:function(wt){return pn("score",We,wt)}})," ","\u5206")))}),In.length<20&&t.a.createElement(m.a,{type:"primary",onClick:yn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:xn,onChange:function(We){Yn(We.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:we==null?void 0:we.tag_discipline_ids,value:vt,onChange:Lt,subId:(it=Ee.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:An}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Mt()}},"\u4FDD\u5B58")))},yn=function(){var it={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Dn(In.concat(it))},pn=function(it,Ve,qe){var We=Object(Ot.cloneDeep)(In);if(it==="open"&&(We[Ve].open=!We[Ve].open),it==="delete"&&We.splice(Ve,1),it==="value"&&(We[Ve].name=qe),it==="answer"&&(We[Ve].qusAnswer=[qe]),it==="edit"&&(We[Ve].activeQusEditor=qe),it==="details"&&(We[Ve].qusList[We[Ve].activeQusEditor]=qe),it==="addQus"&&(We[Ve].qusList=We[Ve].qusList.concat("")),it==="deleteQus"){var dt;We[Ve].qusList=We[Ve].qusList.filter(function(Ze,wt){return wt!==qe}),We[Ve].qusAnswer=(dt=We[Ve].qusAnswer)===null||dt===void 0?void 0:dt.filter(function(Ze){return Ze!==qe})}it==="analysis"&&(We[Ve].analysis=qe),it==="score"&&(We[Ve].score=qe),Dn(We)};return t.a.createElement("section",{className:he.a.wrap},!jn&&Bt(),jn&&Zt())},mt=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Je)),Be=z("ngQI"),Ie=z("loLm"),ke=z.n(Ie),me=z("ErOA"),ye=z("vCeJ"),Re=z("Nog9"),ce=z.n(Re),Me=z("hQp1"),tt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],bt=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(Ve){}:gi,C=Object(i.useState)([]),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(""),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(H.i)(),Dn=Object(i.useRef)(null),kn=Object(i.useRef)(!1),An=Object(i.useState)([]),ln=Object(o.a)(An,2),Mt=ln[0],zt=ln[1],Vt=function(qe){zt([].concat(Object(F.a)(Mt),[Object(v.a)({},qe)]))};Object(i.useEffect)(function(){ae(["","","",""])},[]),Object(i.useEffect)(function(){if(kn.current)return;if(!(ve!=null&&ve.question_choices)){Mn(!0),cn(""),Nt(5),ae(["","","",""]),Lt([]);return}cn(ve==null?void 0:ve.question_title),Nt(ve==null?void 0:ve.question_score),Cn(!(ve!=null&&ve.repeat_answer)),qn(ve==null?void 0:ve.analysis),Hn(ve==null?void 0:ve.difficulty),ae(ve==null?void 0:ve.question_choices.map(function(qe){return qe.choice_text}));var Ve=[];ve==null||ve.standard_answer.map(function(qe,We){Ve.push(qe-1)}),Yn(ve.tag_discipline_ids),Lt(Ve)},[ve,sn]),Object(i.useEffect)(function(){sn&&Ve();function Ve(){return qe.apply(this,arguments)}function qe(){return qe=Object(oe.a)(r.a.mark(function We(){var dt,Ze,wt;return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(dt=Ne.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id});case 2:wt=Tt.sent,zt(wt.tag_disciplines);case 4:case"end":return Tt.stop()}},We)})),qe.apply(this,arguments)}},[sn]),Object(i.useEffect)(function(){var Ve,qe=Ne!=null&&(Ve=Ne.tagDisciplineData)!==null&&Ve!==void 0&&Ve.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];zt(qe)},[Ne.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:Zt,isEdit:sn}});var Bt=function(qe){(qe==null?void 0:qe.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Mn(!1),we(-1),kn.current=!1,fi())},Zt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze,wt,kt,Tt,Ht;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(jn){Pt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pt.abrupt("return",!1);case 3:if(We=V.findIndex(function(bn){return!bn}),!(We>-1)){Pt.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tt[We]," \u9009\u9879\u7684\u5185\u5BB9")),Pt.abrupt("return",!1);case 7:if(vt.length){Pt.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Pt.abrupt("return",!1);case 10:if(!(vt.length<1)){Pt.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pt.abrupt("return",!1);case 13:if(dt=V.map(function(bn,on){return{choice_text:bn,is_answer:vt.includes(on)?1:0}}),kn.current=!0,!ve.question_id){Pt.next=22;break}return Pt.next=18,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:In.id,question_id:ve.question_id,name:jn,item_type:vt.length>1?Me.a.Multiple:Me.a.Single,question_score:qt,choices:dt,tag_discipline_ids:xn,sub_discipline_id:(wt=Ne.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:Pn,repeat_answer:!Ln,analysis:Gn}});case 18:Ze=Pt.sent,Bt(Ze),Pt.next=26;break;case 22:return Pt.next=24,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:In.id,name:jn,item_type:vt.length>1?Me.a.Multiple:Me.a.Single,question_score:qt,choices:dt,tag_discipline_ids:xn,sub_discipline_id:(Tt=Ne.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,difficulty:Pn,repeat_answer:!Ln,analysis:Gn}});case 24:Ze=Pt.sent,Bt(Ze);case 26:case"end":return Pt.stop()}},qe)}));return function(){return Ve.apply(this,arguments)}}(),yn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],pn=function(){var Ve=Object(oe.a)(r.a.mark(function qe(We){return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(De!==-1)){Ze.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ze.abrupt("return");case 3:Ze.t0=We.id,Ze.next=Ze.t0==="del"?6:Ze.t0==="edit"?8:Ze.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function kt(){return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(ye.g)({exam_id:In.id,question_id:ve.question_id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},In)});case 3:case"end":return Ht.stop()}},kt)}))()}}),Ze.abrupt("break",13);case 8:return we(ve.dragKey),Mn(!0),Ze.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),Ze.abrupt("break",13);case 13:case"end":return Ze.stop()}},qe)}));return function(We){return Ve.apply(this,arguments)}}(),gt=function(){var qe;return t.a.createElement("aside",{ref:Dn},t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((qe=ve.question_choices)===null||qe===void 0)?void 0:qe.map(function(We,dt){return t.a.createElement(k.a,{key:dt},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:dt,checked:ve.standard_answer.includes(dt+1),disabled:!0},tt[dt],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:We.choice_text}))))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&yn.map(function(We,dt){return t.a.createElement(h.a,{key:dt,placement:"bottom",title:We.name},t.a.createElement("span",{onClick:function(){return pn(We)},className:We.icon}))})))},it=function(){var qe,We;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:jn,onChange:function(Ze){return cn(Ze)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),V.map(function(dt,Ze){return t.a.createElement("div",{className:ce.a.choiceWrap,key:Ze},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(vt.includes(Ze)?ce.a.activeAnswer:""),onClick:function(){vt.includes(Ze)?Lt(function(kt){return kt.filter(function(Tt){return Tt!==Ze})}):Lt(function(kt){return[].concat(Object(F.a)(kt),[Ze])})}},tt[Ze])),t.a.createElement("div",{className:ce.a.editorWrap},nt===Ze?t.a.createElement(x.a,{id:"single-question-option-".concat(Ze),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:dt,onChange:function(kt){V[Ze]=kt,ae(V)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return xt(Ze)}},t.a.createElement(xe.a,{value:dt}))),t.a.createElement(t.a.Fragment,null,Ze>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return ae(V.filter(function(kt,Tt){return Tt!==Ze}))}})),Ze<7&&Ze===V.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ae([].concat(Object(F.a)(V),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gn,onChange:function(Ze){return qn(Ze)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:qt,max:1e4,min:0,onChange:function(Ze){Nt(Ze)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Pn,onChange:function(Ze){Hn(Ze.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:xn,onChange:Yn,subId:(qe=Ne.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id,knowledgeOptions:Mt,onAddKnowledgeFinish:Vt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Ln,onChange:function(Ze){Cn(Ze)}}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Mn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Zt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!sn&>(),sn&&it())},Kt=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(bt)),Gt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$t=Object(i.forwardRef)(function(ct,je){var It=ct.newExercisePaper,Ne=ct.dispatch,Ee=ct.editData,ve=ct.cancelAdd,di=ve===void 0?function(){}:ve,en=ct.editKey,De=ct.setEditKey,ht=De===void 0?function(){}:De,we=ct.addCallback,un=we===void 0?function(gt){}:we,fi=ct.reload,gi=fi===void 0?function(){}:fi,q=Object(i.useState)([]),C=Object(o.a)(q,2),L=C[0],V=C[1],ae=Object(i.useState)(),Q=Object(o.a)(ae,2),Ae=Q[0],nt=Q[1],xt=Object(i.useState)([]),Dt=Object(o.a)(xt,2),ot=Dt[0],vt=Dt[1],Lt=Object(i.useState)(""),wn=Object(o.a)(Lt,2),Xn=wn[0],jn=wn[1],cn=Object(i.useState)(),jt=Object(o.a)(cn,2),nn=jt[0],qt=jt[1],Nt=Object(i.useState)(!1),$n=Object(o.a)(Nt,2),Un=$n[0],xn=$n[1],Yn=Object(i.useState)([]),hn=Object(o.a)(Yn,2),Tn=hn[0],sn=hn[1],Mn=Object(i.useState)(1),Vn=Object(o.a)(Mn,2),ni=Vn[0],Pn=Vn[1],Hn=Object(i.useState)(!1),tn=Object(o.a)(Hn,2),vn=tn[0],Ln=tn[1],Cn=Object(i.useState)(""),Qn=Object(o.a)(Cn,2),_n=Qn[0],Gn=Qn[1],qn=Object(i.useState)([]),In=Object(o.a)(qn,2),Dn=In[0],kn=In[1],An=Object(i.useRef)(!1),ln=function(it){kn([].concat(Object(F.a)(Dn),[Object(v.a)({},it)]))},Mt=Object(H.i)();Object(i.useEffect)(function(){V(["","","",""])},[]),Object(i.useEffect)(function(){if(An.current)return;if(!(Ee!=null&&Ee.question_choices)){xn(!0),jn(""),qt(5),V(["","","",""]),vt([]);return}jn(Ee==null?void 0:Ee.question_title),qt(Ee==null?void 0:Ee.question_score),Ln(!(Ee!=null&&Ee.repeat_answer)),Pn(Ee==null?void 0:Ee.difficulty),V(Ee==null?void 0:Ee.question_choices.map(function(it){return it.choice_text}));var gt=[];Ee==null||Ee.standard_answer.map(function(it,Ve){gt.push(it-1)}),vt(gt),sn(Ee.tag_discipline_ids),Gn(Ee==null?void 0:Ee.analysis)},[Ee,Un]),Object(i.useEffect)(function(){Un&>();function gt(){return it.apply(this,arguments)}function it(){return it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(I.I)({sub_discipline_id:(qe=It.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id});case 2:dt=wt.sent,kn(dt.tag_disciplines);case 4:case"end":return wt.stop()}},Ve)})),it.apply(this,arguments)}},[Un]),Object(i.useImperativeHandle)(je,function(){return{onSave:Vt,isEdit:Un}}),Object(i.useEffect)(function(){var gt,it=It!=null&&(gt=It.tagDisciplineData)!==null&>!==void 0&>.tag_disciplines&&Array.isArray(It.tagDisciplineData.tag_disciplines)?It.tagDisciplineData.tag_disciplines:[];kn(it)},[It.tagDisciplineData]);var zt=function(it){(it==null?void 0:it.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),ht(-1),An.current=!1,gi())},Vt=function(){var gt=Object(oe.a)(r.a.mark(function it(){var Ve,qe,We,dt,Ze,wt,kt;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(Xn){Ht.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ht.abrupt("return",!1);case 3:if(Ve=L.findIndex(function(St){return!St}),!(Ve>-1)){Ht.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Gt[Ve]," \u9009\u9879\u7684\u5185\u5BB9")),Ht.abrupt("return",!1);case 7:if(ot.length){Ht.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ht.abrupt("return",!1);case 10:if(!(ot.length<1)){Ht.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ht.abrupt("return",!1);case 13:if(qe=L.map(function(St,Pt){return{choice_text:St,is_answer:ot.includes(Pt)?1:0}}),An.current=!0,!Ee.question_id){Ht.next=22;break}return Ht.next=18,Ne({type:"newExercisePaper/editExerciseQuestion",payload:{id:Mt.id,question_id:Ee.question_id,name:Xn,item_type:ot.length>1?Me.a.Multiple:Me.a.Single,question_score:nn,choices:qe,tag_discipline_ids:Tn,sub_discipline_id:(dt=It.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:ni,repeat_answer:!vn,analysis:_n}});case 18:We=Ht.sent,zt(We),Ht.next=26;break;case 22:return Ht.next=24,Ne({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:Ee==null?void 0:Ee.insert_id,id:Mt.id,name:Xn,item_type:ot.length>1?Me.a.Multiple:Me.a.Single,question_score:nn,choices:qe,tag_discipline_ids:Tn,sub_discipline_id:(wt=It.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:ni,repeat_answer:!vn,analysis:_n}});case 24:We=Ht.sent,zt(We);case 26:case"end":return Ht.stop()}},it)}));return function(){return gt.apply(this,arguments)}}(),Bt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Zt=function(){var gt=Object(oe.a)(r.a.mark(function it(Ve){return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(!(en!==-1)){We.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),We.abrupt("return");case 3:We.t0=Ve.id,We.next=We.t0==="del"?6:We.t0==="edit"?8:We.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Ze(){return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(ye.g)({question_id:Ee.question_id,exam_id:Mt.id});case 2:Ne({type:"newExercisePaper/editExercise",payload:Object(v.a)({},Mt)});case 3:case"end":return kt.stop()}},Ze)}))()}}),We.abrupt("break",13);case 8:return ht(Ee.dragKey),xn(!0),We.abrupt("break",13);case 11:return un({key:Ee.key,insert_id:Ee==null?void 0:Ee.question_id,question_type:1}),We.abrupt("break",13);case 13:case"end":return We.stop()}},it)}));return function(Ve){return gt.apply(this,arguments)}}(),yn=function(){var it;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(Ee!=null&&Ee.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ee.key,"\u3001\u591A\u9009\u9898"),"\uFF08",Ee.question_score,"\u5206\uFF09")),Ee!=null&&Ee.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ee.key,"."),t.a.createElement(xe.a,{value:Ee.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ee.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ee.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},Ee==null||((it=Ee.question_choices)===null||it===void 0)?void 0:it.map(function(Ve,qe){return t.a.createElement(k.a,{key:qe},t.a.createElement(O.a,null,t.a.createElement(E.a,{key:qe,checked:Ee.standard_answer.includes(qe+1),disabled:!0},Gt[qe],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ve.choice_text}))))})),t.a.createElement("div",{className:ce.a.action},!Ee.hideAction&&Bt.map(function(Ve,qe){return t.a.createElement(h.a,{key:qe,placement:"bottom",title:Ve.name},t.a.createElement("span",{onClick:function(){return Zt(Ve)},className:Ve.icon}))})))},pn=function(){var it,Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:function(We){return jn(We)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),L.map(function(qe,We){var dt,Ze;return t.a.createElement("div",{className:ce.a.choiceWrap,key:We},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(ot.includes(We)?ce.a.activeAnswer:""),onClick:function(){ot.includes(We)?vt(ot.filter(function(kt){return kt!==We})):vt([].concat(Object(F.a)(ot),[We]))}},Gt[We])),t.a.createElement("div",{className:ce.a.editorWrap},Ae===We?t.a.createElement(x.a,{id:"single-question-option-".concat(We),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:qe,onChange:function(kt){L[We]=kt,V(L)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return nt(We)}},t.a.createElement(xe.a,{value:qe}))),((dt=It.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,We>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return V(L.filter(function(kt,Tt){return Tt!==We}))}})),We<7&&We===L.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return V([].concat(Object(F.a)(L),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:_n,onChange:function(We){return Gn(We)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:nn,max:1e4,min:0,onChange:function(We){qt(We)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:ni,onChange:function(We){Pn(We.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Tn,selectvalues:Ee==null?void 0:Ee.tag_discipline_ids,onChange:sn,subId:(it=It.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,knowledgeOptions:Dn,onAddKnowledgeFinish:ln})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:vn,onChange:function(We){Ln(We)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||Ee.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){di(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Vt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!Un&&yn(),Un&&pn())}),ei=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})($t),gn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],an=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.setEditKey,De=en===void 0?function(){}:en,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(){}:gi,C=Object(i.useState)(),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(!1),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)([]),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(1),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(!1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(""),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useRef)(!1),_n=function(zt){Yn([].concat(Object(F.a)(xn),[Object(v.a)({},zt)]))},Gn=Object(H.i)();Object(i.useEffect)(function(){if(Qn.current)return;if(!(ve!=null&&ve.question_choices)){Lt(!0),xt(""),cn(2),ae("");return}Hn(!(ve!=null&&ve.repeat_answer)),xt(ve==null?void 0:ve.question_title),cn(ve==null?void 0:ve.question_score),Mn(ve==null?void 0:ve.difficulty),ae(ve.standard_answer[0]+""),Nt(ve.tag_discipline_ids),Cn(ve==null?void 0:ve.analysis)},[ve,vt]),Object(i.useEffect)(function(){vt&&Mt();function Mt(){return zt.apply(this,arguments)}function zt(){return zt=Object(oe.a)(r.a.mark(function Vt(){var Bt,Zt,yn;return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(I.I)({sub_discipline_id:(Bt=Ne.editData)===null||Bt===void 0||((Zt=Bt.exercise)===null||Zt===void 0)?void 0:Zt.sub_discipline_id});case 2:yn=gt.sent,Yn(yn.tag_disciplines);case 4:case"end":return gt.stop()}},Vt)})),zt.apply(this,arguments)}},[vt]),Object(i.useImperativeHandle)(It,function(){return{onSave:In,isEdit:vt}}),Object(i.useEffect)(function(){var Mt,zt=Ne!=null&&(Mt=Ne.tagDisciplineData)!==null&&Mt!==void 0&&Mt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Yn(zt)},[Ne.tagDisciplineData]);var qn=function(zt){(zt==null?void 0:zt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Lt(!1),De(-1),Qn.current=!1,fi())},In=function(){var Mt=Object(oe.a)(r.a.mark(function zt(){var Vt,Bt,Zt,yn,pn,gt;return r.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(nt){Ve.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ve.abrupt("return",!1);case 3:if(V){Ve.next=6;break}return y.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ve.abrupt("return",!1);case 6:if(Vt=[{choice_text:"\u6B63\u786E",is_answer:V==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:V==="2"?1:0}],Qn.current=!0,!ve.question_id){Ve.next=15;break}return Ve.next=11,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:Gn.id,question_id:ve.question_id,name:nt,item_type:Me.a.Judge,question_score:jn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(Zt=Ne.editData)===null||Zt===void 0||((yn=Zt.exercise)===null||yn===void 0)?void 0:yn.sub_discipline_id,difficulty:sn,repeat_answer:!Pn,analysis:Ln}});case 11:Bt=Ve.sent,qn(Bt),Ve.next=19;break;case 15:return Ve.next=17,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{id:Gn.id,insert_id:ve==null?void 0:ve.insert_id,name:nt,item_type:Me.a.Judge,question_score:jn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(pn=Ne.editData)===null||pn===void 0||((gt=pn.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id,difficulty:sn,repeat_answer:!Pn,analysis:Ln}});case 17:Bt=Ve.sent,qn(Bt);case 19:return Ve.abrupt("return",{name:nt,choices:Vt});case 20:case"end":return Ve.stop()}},zt)}));return function(){return Mt.apply(this,arguments)}}(),Dn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],kn=function(){var Mt=Object(oe.a)(r.a.mark(function zt(Vt){return r.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(!(di!==-1)){Zt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Zt.abrupt("return");case 3:Zt.t0=Vt.id,Zt.next=Zt.t0==="del"?6:Zt.t0==="edit"?8:Zt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function pn(){return r.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:Gn.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},Gn)});case 3:case"end":return it.stop()}},pn)}))()}}),Zt.abrupt("break",13);case 8:return De(ve.dragKey),Lt(!0),Zt.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),Zt.abrupt("break",13);case 13:case"end":return Zt.stop()}},zt)}));return function(Vt){return Mt.apply(this,arguments)}}(),An=function(){var zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((zt=ve.question_choices)===null||zt===void 0)?void 0:zt.map(function(Vt,Bt){return t.a.createElement(u.a,{key:Bt,checked:ve.standard_answer.includes(Bt+1),disabled:!0},gn[Bt],". ",t.a.createElement("span",{className:"c-black font14"},Vt.choice_text))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&Dn.map(function(Vt,Bt){return t.a.createElement(h.a,{key:Bt,placement:"bottom",title:Vt.name},t.a.createElement("span",{onClick:function(){return kn(Vt)},className:Vt.icon}))})))},ln=function(){var zt,Vt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt,onChange:function(Zt){return xt(Zt)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:V,onChange:function(Zt){return ae(Zt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(ce.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:ce.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ln,onChange:function(Zt){return Cn(Zt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:jn,max:1e4,min:0,onChange:function(Zt){cn(Zt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:sn,onChange:function(Zt){Mn(Zt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:qt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Nt,subId:(zt=Ne.editData)===null||zt===void 0||((Vt=zt.exercise)===null||Vt===void 0)?void 0:Vt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:_n})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Pn,onChange:function(Zt){Hn(Zt)}}))),t.a.createElement("aside",{className:"tr"},(di!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Lt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){In()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!vt&&An(),vt&&ln())},dn=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(an)),zn=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.setEditKey,De=en===void 0?function(){}:en,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.addCallback,fi=un===void 0?function(){}:un,gi=je.reload,q=gi===void 0?function(){}:gi,C=Object(i.useState)(""),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(!1),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(0),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)([]),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],ln=Object(i.useState)(1),Mt=Object(o.a)(ln,2),zt=Mt[0],Vt=Mt[1],Bt=Object(i.useState)(!1),Zt=Object(o.a)(Bt,2),yn=Zt[0],pn=Zt[1],gt=Object(i.useRef)(!1),it=Object(H.i)(),Ve=Object(i.useState)([]),qe=Object(o.a)(Ve,2),We=qe[0],dt=qe[1],Ze=function(Sn){dt([].concat(Object(F.a)(We),[Object(v.a)({},Sn)]))};Object(i.useEffect)(function(){if(gt.current)return;if(!(ve!=null&&ve.question_title)){Cn(!0),ae(""),Nt(!1),Mn(2),Lt([]),cn(""),Yn(!1);return}ae(ve==null?void 0:ve.question_title),Nt(ve==null?void 0:ve.is_ordered),Vt(ve==null?void 0:ve.difficulty),pn(!(ve!=null&&ve.repeat_answer)),Mn(ve==null?void 0:ve.question_score);var Yt=ve==null?void 0:ve.standard_answer.map(function(Sn){return Sn.answer_text});Lt(Object(F.a)(Yt)),An(ve.tag_discipline_ids),xt(ve==null?void 0:ve.analysis)},[ve,Ln]),Object(i.useEffect)(function(){Yn(!1),Ln&&Yt();function Yt(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(oe.a)(r.a.mark(function Kn(){var ii,On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,Object(I.I)({sub_discipline_id:(ii=Ne.editData)===null||ii===void 0||((On=ii.exercise)===null||On===void 0)?void 0:On.sub_discipline_id});case 2:Li=bi.sent,dt(Li.tag_disciplines);case 4:case"end":return bi.stop()}},Kn)})),Sn.apply(this,arguments)}},[Ln]),Object(i.useImperativeHandle)(It,function(){return{onSave:kt,isEdit:Ln}}),Object(i.useEffect)(function(){var Yt,Sn=Ne!=null&&(Yt=Ne.tagDisciplineData)!==null&&Yt!==void 0&&Yt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];dt(Sn)},[Ne.tagDisciplineData]);var wt=function(Sn){(Sn==null?void 0:Sn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Cn(!1),De(-1),gt.current=!1,q())},kt=function(){var Yt=Object(oe.a)(r.a.mark(function Sn(){var Kn,ii,On,Li,ji,bi,si;return r.a.wrap(function(yi){for(;;)switch(yi.prev=yi.next){case 0:if(Kn=[],ii=!1,qn(!0),vt.forEach(function(xi,Ui){Kn.push({position:Ui+1,answer_text:[]}),xi.forEach(function(Vi,Fi){Kn[Ui].answer_text.push(Vi),(!Vi||!Object(re.db)(Vi,1e4))&&(cn("".concat(Ui,"-").concat(Fi)),y.b.info(Vi?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),ii=!0)})}),!ii){yi.next=7;break}return qn(!1),yi.abrupt("return",!1);case 7:if(gt.current=!0,!ve.question_id){yi.next=15;break}return yi.next=11,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:it.id,question_id:ve.question_id,name:V,item_type:3,question_score:sn,is_ordered:qt,standard_answers:Kn,tag_discipline_ids:kn,sub_discipline_id:(Li=Ne.editData)===null||Li===void 0||((ji=Li.exercise)===null||ji===void 0)?void 0:ji.sub_discipline_id,difficulty:zt,repeat_answer:!yn,analysis:nt}});case 11:On=yi.sent,wt(On),yi.next=19;break;case 15:return yi.next=17,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:it.id,name:V,item_type:3,question_score:sn,is_ordered:qt,standard_answers:Kn,tag_discipline_ids:kn,sub_discipline_id:(bi=Ne.editData)===null||bi===void 0||((si=bi.exercise)===null||si===void 0)?void 0:si.sub_discipline_id,difficulty:zt,repeat_answer:!yn,analysis:nt}});case 17:On=yi.sent,wt(On);case 19:return qn(!1),yi.abrupt("return",{name:V,analysis:nt,standard_answers:Kn,is_ordered:qt});case 21:case"end":return yi.stop()}},Sn)}));return function(){return Yt.apply(this,arguments)}}(),Tt=function(Sn,Kn,ii){var On=vt.slice();if(Kn&&On.splice(Sn,Kn),ii&&xn||!ve.question_id)for(var Li=0;Li1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:qt,onChange:function(On){return Nt(On.target.checked)},className:"".concat(ce.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ce.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:nt,onChange:function(On){return xt(On)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:sn,max:1e4,min:0,onChange:function(On){Mn(On)}})," \u5206 \xA0 ",!!sn&&!!Pn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(sn/Pn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:zt,onChange:function(On){Vt(On.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:kn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:An,subId:(Sn=Ne.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,knowledgeOptions:We,onAddKnowledgeFinish:Ze})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:yn,onChange:function(On){pn(On)}}))),t.a.createElement("aside",{className:"tr"},(di!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){kt()}},"\u4FDD\u5B58")))},vi=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Jn=function(){var Yt=Object(oe.a)(r.a.mark(function Sn(Kn){return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(di!==-1)){On.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),On.abrupt("return");case 3:On.t0=Kn.id,On.next=On.t0==="del"?6:On.t0==="edit"?8:On.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function ji(){return r.a.wrap(function(si){for(;;)switch(si.prev=si.next){case 0:return si.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:it.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},it)});case 3:case"end":return si.stop()}},ji)}))()}}),On.abrupt("break",13);case 8:return De(ve.dragKey),Cn(!0),On.abrupt("break",13);case 11:return fi({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),On.abrupt("break",13);case 13:case"end":return On.stop()}},Sn)}));return function(Kn){return Yt.apply(this,arguments)}}(),Zn=function(){var Sn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((Sn=ve.standard_answer)===null||Sn===void 0)?void 0:Sn.map(function(Kn,ii){return t.a.createElement(k.a,{key:ii,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Kn.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(k.a,{align:"middle",gutter:[1,1]},Kn.answer_text.map(function(On,Li){return t.a.createElement(O.a,{span:24,key:Li},t.a.createElement(S.a,{key:ii,checked:ve.standard_answer.includes(ii),disabled:!0,value:On}))}))))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&vi.map(function(Kn,ii){return Kn.id==="up"&&ve.key===1||Kn.id==="down"&&ve.key===ve.len?null:t.a.createElement(h.a,{key:ii,placement:"bottom",title:Kn.name},t.a.createElement("span",{onClick:function(){return Jn(Kn)},className:Kn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!Ln&&Zn(),Ln&&on())},pi=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(zn)),mi=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(){}:gi,C=Object(i.useState)(""),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(""),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(1),Tn=Object(o.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(!1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)([[],[]]),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useRef)(!1),_n=Object(H.i)(),Gn=Object(i.useState)([]),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=function(yn){Dn([].concat(Object(F.a)(In),[Object(v.a)({},yn)]))};Object(i.useEffect)(function(){var Zt;if(Qn.current)return;if(!(ve!=null&&ve.question_title)){Nt(!0),ae(""),Lt(""),cn(10);return}Hn(!(ve!=null&&ve.repeat_answer)),ae(ve==null?void 0:ve.question_title),Lt(ve==null||((Zt=ve.standard_answer)===null||Zt===void 0)?void 0:Zt[0]),cn(ve==null?void 0:ve.question_score),Yn(ve.tag_discipline_ids),Mn(ve==null?void 0:ve.difficulty),xt(ve==null?void 0:ve.analysis),Cn([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Ne.editData,qt]),Object(i.useEffect)(function(){var Zt,yn=Ne!=null&&(Zt=Ne.tagDisciplineData)!==null&&Zt!==void 0&&Zt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Dn(yn)},[Ne.tagDisciplineData]),Object(i.useEffect)(function(){qt&&Zt();function Zt(){return yn.apply(this,arguments)}function yn(){return yn=Object(oe.a)(r.a.mark(function pn(){var gt,it,Ve;return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return We.next=2,Object(I.I)({sub_discipline_id:(gt=Ne.editData)===null||gt===void 0||((it=gt.exercise)===null||it===void 0)?void 0:it.sub_discipline_id});case 2:Ve=We.sent,Dn(Ve.tag_disciplines);case 4:case"end":return We.stop()}},pn)})),yn.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(It,function(){return{onSave:ln,isEdit:qt}});var An=function(yn){(yn==null?void 0:yn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Nt(!1),we(-1),Qn.current=!1,fi())},ln=function(){var Zt=Object(oe.a)(r.a.mark(function yn(){var pn,gt,it,Ve,qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(V){wt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),wt.abrupt("return",!1);case 3:if(pn=Ln[0],gt=Ln[1],Qn.current=!0,!ve.question_id){wt.next=13;break}return wt.next=9,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:_n.id,question_id:ve.question_id,name:V,item_type:4,question_score:jn,answer_texts:[vt],tag_discipline_ids:xn,sub_discipline_id:(Ve=Ne.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,difficulty:sn,repeat_answer:!Pn,analysis:nt,normal_keywords:pn,main_keywords:gt}});case 9:it=wt.sent,An(it),wt.next=17;break;case 13:return wt.next=15,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:_n.id,name:V,item_type:4,question_score:jn,answer_texts:[vt],tag_discipline_ids:xn,sub_discipline_id:(We=Ne.editData)===null||We===void 0||((dt=We.exercise)===null||dt===void 0)?void 0:dt.sub_discipline_id,difficulty:sn,repeat_answer:!Pn,analysis:nt,normal_keywords:pn,main_keywords:gt}});case 15:it=wt.sent,An(it);case 17:return wt.abrupt("return",{name:V,answer_texts:[vt],analysis:nt,normal_keywords:pn,main_keywords:gt});case 18:case"end":return wt.stop()}},yn)}));return function(){return Zt.apply(this,arguments)}}(),Mt=function(){var yn,pn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:V,onChange:function(it){return ae(it)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(x.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:vt,onChange:function(it){return Lt(it)}}),t.a.createElement(Xt.a,{value:Ln,onChange:Cn}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:nt,onChange:function(it){return xt(it)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:jn,max:1e4,min:0,onChange:function(it){cn(it)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:sn,onChange:function(it){Mn(it.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:xn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Yn,subId:(yn=Ne.editData)===null||yn===void 0||((pn=yn.exercise)===null||pn===void 0)?void 0:pn.sub_discipline_id,knowledgeOptions:In,onAddKnowledgeFinish:kn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Pn,onChange:function(it){Hn(it)}}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Nt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ln()}},"\u4FDD\u5B58")))},zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7B80\u7B54\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Vt=function(){var Zt=Object(oe.a)(r.a.mark(function yn(pn){return r.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(!(De!==-1)){it.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),it.abrupt("return");case 3:it.t0=pn.id,it.next=it.t0==="del"?6:it.t0==="up"||it.t0==="down"?8:it.t0==="edit"?12:it.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function qe(){return r.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:_n.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},_n)});case 3:case"end":return dt.stop()}},qe)}))()}}),it.abrupt("break",17);case 8:return it.next=10,Ee({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:pn.id}});case 10:return Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},_n)}),it.abrupt("break",17);case 12:return we(ve.dragKey),Nt(!0),it.abrupt("break",17);case 15:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),it.abrupt("break",17);case 17:case"end":return it.stop()}},yn)}));return function(pn){return Zt.apply(this,arguments)}}(),Bt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:vt||""})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&zt.map(function(yn,pn){return t.a.createElement(h.a,{key:pn,placement:"bottom",title:yn.name},t.a.createElement("span",{onClick:function(){return Vt(yn)},className:yn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!qt&&Bt(),qt&&Mt())},ri=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(mi)),_i=function(je,It){var Ne=je.dispatch,Ee=je.editData,ve=je.cancelAdd,di=ve===void 0?function(){}:ve,en=je.editKey,De=je.setEditKey,ht=De===void 0?function(){}:De,we=je.reload,un=we===void 0?function(){}:we,fi=Object(i.useState)(""),gi=Object(o.a)(fi,2),q=gi[0],C=gi[1],L=Object(i.useState)(""),V=Object(o.a)(L,2),ae=V[0],Q=V[1],Ae=Object(i.useState)(""),nt=Object(o.a)(Ae,2),xt=nt[0],Dt=nt[1],ot=Object(i.useState)([]),vt=Object(o.a)(ot,2),Lt=vt[0],wn=vt[1],Xn=Object(i.useState)(),jn=Object(o.a)(Xn,2),cn=jn[0],jt=jn[1],nn=Object(i.useState)(!1),qt=Object(o.a)(nn,2),Nt=qt[0],$n=qt[1],Un=Object(i.useState)([]),xn=Object(o.a)(Un,2),Yn=xn[0],hn=xn[1],Tn=Object(i.useState)(!1),sn=Object(o.a)(Tn,2),Mn=sn[0],Vn=sn[1],ni=Object(i.useState)(!1),Pn=Object(o.a)(ni,2),Hn=Pn[0],tn=Pn[1],vn=Object(H.i)(),Ln=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Dn;if(Ln.current)return;Ee.edit&&(Vn(!0),Q(""),C(""),hn([])),C(Ee.shixun_name),Q(Ee.question_title);var kn=[];(Dn=Ee.shixun)===null||Dn===void 0||Dn.map(function(An){kn.push(An.challenge_score)}),hn(kn)},[Ee]),Object(i.useEffect)(function(){$n(!1)},[Mn]),Object(i.useImperativeHandle)(It,function(){return{onSave:Qn,isEdit:Mn}});var Cn=function(kn){(kn==null?void 0:kn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Vn(!1),ht(-1),Ln.current=!1,un())},Qn=function(){var Dn=Object(oe.a)(r.a.mark(function kn(){var An,ln,Mt;return r.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(An=[],ln=!1,!ln){Vt.next=4;break}return Vt.abrupt("return",!1);case 4:if(Ln.current=!0,tn(!0),!Ee.question_id){Vt.next=12;break}return Vt.next=9,Ne({type:"newExercisePaper/editExerciseQuestion",payload:{id:vn.id,question_id:Ee.question_id,name:ae,shixun_name:q,shixun_id:Ee.shixun_id,item_type:5,question_scores:Yn}});case 9:Mt=Vt.sent,Vt.next=15;break;case 12:return Vt.next=14,Ne({type:"newExercisePaper/addExerciseQuestion",payload:{id:vn.id,insert_id:Ee==null?void 0:Ee.insert_id,name:ae,shixun_name:q,shixun_id:Ee.shixun_id,item_type:5,question_scores:Yn,is_copy:Ee.is_copy}});case 14:Mt=Vt.sent;case 15:return Cn(Mt),tn(!1),Vt.abrupt("return",{name:ae,analysis:xt,standard_answers:An,is_ordered:cn});case 18:case"end":return Vt.stop()}},kn)}));return function(){return Dn.apply(this,arguments)}}(),_n=function(){var kn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:q,onChange:function(ln){C(ln.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(x.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:ae,onChange:function(ln){Q(ln)}})),t.a.createElement("div",{className:"mt20"},(kn=Ee.shixun)===null||kn===void 0?void 0:kn.map(function(An,ln){return t.a.createElement(k.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},ln+1,".",An.challenge_name),t.a.createElement(O.a,null,t.a.createElement(U.a,{defaultValue:Yn[ln],onChange:function(zt){Yn[ln]=zt,hn(Yn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Lt.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:cn,onChange:function(ln){return jt(ln.target.checked)},className:"".concat(ce.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ce.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(en!==-1||!(Ee!=null&&Ee.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){di(),Vn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Hn,className:"ml20",type:"primary",onClick:function(){Qn()}},"\u4FDD\u5B58")))},Gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var Dn=Object(oe.a)(r.a.mark(function kn(An){return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(!(en!==-1)){Mt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Mt.abrupt("return");case 3:Mt.t0=An.id,Mt.next=Mt.t0==="del"?6:Mt.t0==="edit"?8:Mt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Vt(){return r.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(ye.g)({question_id:Ee.question_id,exam_id:vn.id});case 2:Ne({type:"newExercisePaper/editExercise",payload:Object(v.a)({},vn)});case 3:case"end":return Zt.stop()}},Vt)}))()}}),Mt.abrupt("break",13);case 8:return ht(Ee.dragKey),Vn(!0),Mt.abrupt("break",13);case 11:return Ne({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:Ee.key,insert_id:Ee==null?void 0:Ee.question_id,question_type:5}}}),Mt.abrupt("break",13);case 13:case"end":return Mt.stop()}},kn)}));return function(An){return Dn.apply(this,arguments)}}(),In=function(){var kn,An;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(Ee!=null&&Ee.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ee.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ee.question_score,"\u5206\uFF09")),Ee!=null&&Ee.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ee.key,"."),t.a.createElement(xe.a,{value:Ee.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ee.question_score,"\u5206\uFF09"),!!((kn=Ee.schools)!==null&&kn!==void 0&&kn.length)&&t.a.createElement(h.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ee.shixun_name})),t.a.createElement("div",{className:"mt30"}),(An=Ee.shixun)===null||An===void 0?void 0:An.map(function(ln,Mt){return t.a.createElement("div",{key:Mt},"\u7B2C",Mt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},ln.challenge_name)," ",t.a.createElement("span",{className:"ml10"},ln.challenge_score," \u5206"))}),t.a.createElement("div",{className:ce.a.action},t.a.createElement(at.a,{target:"_blank",to:"/shixuns/".concat(Ee.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ee.hideAction&&Gn.map(function(ln,Mt){return t.a.createElement(h.a,{key:Mt,placement:"bottom",title:ln.name},t.a.createElement("span",{onClick:function(){return qn(ln)},className:ln.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!Mn&&In(),Mn&&_n())},Si=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(_i)),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Wn=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.addCallback,De=en===void 0?function(){}:en,ht=Object(i.useState)([]),we=Object(o.a)(ht,2),un=we[0],fi=we[1],gi=Object(i.useState)(),q=Object(o.a)(gi,2),C=q[0],L=q[1],V=Object(i.useState)([]),ae=Object(o.a)(V,2),Q=ae[0],Ae=ae[1],nt=Object(i.useState)(""),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(5),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)(!1),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(H.i)();Object(i.useEffect)(function(){fi(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){nn(!0),ot(""),Xn(5),fi(["","","",""]),Ae([]);return}ot(ve==null?void 0:ve.question_title),Xn(ve==null?void 0:ve.question_score),fi(ve==null?void 0:ve.question_choices.map(function(Tn){return Tn.choice_text}));var hn=[];ve==null||ve.standard_answer.map(function(Tn,sn){hn.push(Tn-1)}),Ae(hn)},[ve]),Object(i.useImperativeHandle)(It,function(){return{onSave:Nt,isEdit:jt}});var Nt=function(){var hn=Object(oe.a)(r.a.mark(function Tn(){var sn,Mn,Vn;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Dt){Pn.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pn.abrupt("return",!1);case 3:if(sn=un.findIndex(function(Hn){return!Hn}),!(sn>-1)){Pn.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(At[sn]," \u9009\u9879\u7684\u5185\u5BB9")),Pn.abrupt("return",!1);case 7:if(Q.length){Pn.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Pn.abrupt("return",!1);case 10:if(!(Q.length<1)){Pn.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pn.abrupt("return",!1);case 13:if(Mn=un.map(function(Hn,tn){return{choice_text:Hn,is_answer:Q.includes(tn)?tn+1:0}}),!ve.question_id){Pn.next=20;break}return Pn.next=17,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:Dt,question_type:1,question_score:wn,question_choices:Mn.map(function(Hn){return Hn.choice_text}),standard_answers:Mn.filter(function(Hn){return Hn.is_answer}).map(function(Hn){return Hn.is_answer})}});case 17:Vn=Pn.sent,Pn.next=23;break;case 20:return Pn.next=22,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:qt.categoryId,question_title:Dt,question_type:1,question_score:"5.0",question_choices:Mn.map(function(Hn){return Hn.choice_text}),standard_answers:Mn.filter(function(Hn){return Hn.is_answer}).map(function(Hn){return Hn.is_answer})}});case 22:Vn=Pn.sent;case 23:Vn.status===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),nn(!1),Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},qt)}));case 24:case"end":return Pn.stop()}},Tn)}));return function(){return hn.apply(this,arguments)}}(),$n=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Un=function(){var hn=Object(oe.a)(r.a.mark(function Tn(sn){return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:if(!(di!==-1)){Vn.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Vn.abrupt("return");case 3:Vn.t0=sn.id,Vn.next=Vn.t0==="del"?6:Vn.t0==="edit"?8:Vn.t0==="add"?10:12;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Pn(){return r.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(ye.g)({exam_id:qt.id,question_id:ve.question_id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},qt)});case 3:case"end":return tn.stop()}},Pn)}))()}}),Vn.abrupt("break",12);case 8:return G.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(qt.id,"&question_id=").concat(ve==null?void 0:ve.question_id,"&score=").concat(ve==null?void 0:ve.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Vn.abrupt("break",12);case 10:return De({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),Vn.abrupt("break",12);case 12:case"end":return Vn.stop()}},Tn)}));return function(sn){return hn.apply(this,arguments)}}(),xn=function(){var hn=Object(oe.a)(r.a.mark(function Tn(sn){var Mn;return r.a.wrap(function(ni){for(;;)switch(ni.prev=ni.next){case 0:return sn.preventDefault(),ni.next=3,Object(I.X)({id:ve==null?void 0:ve.hack_identifier});case 3:Mn=ni.sent,Mn.status===0&&Object(re.S)("/myproblems/".concat(Mn==null?void 0:Mn.identifier));case 5:case"end":return ni.stop()}},Tn)}));return function(sn){return hn.apply(this,arguments)}}(),Yn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},t.a.createElement(xe.a,{value:ve.description||""})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&$n.map(function(Tn,sn){return t.a.createElement(h.a,{key:sn,placement:"bottom",title:Tn.name},t.a.createElement("span",{onClick:function(){return Un(Tn)},className:Tn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},Yn())},hi=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Wn)),ti=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oi=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.addCallback,fi=un===void 0?function(ln){}:un,gi=je.reload,q=gi===void 0?function(){}:gi,C=Object(i.useState)([]),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(!1),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(!0),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(1),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(H.i)(),Tn=Object(i.useRef)(null),sn=Object(i.useState)(""),Mn=Object(o.a)(sn,2),Vn=Mn[0],ni=Mn[1],Pn=Object(i.useState)([]),Hn=Object(o.a)(Pn,2),tn=Hn[0],vn=Hn[1],Ln=Object(i.useRef)(!1),Cn=function(Mt){Yn([].concat(Object(F.a)(xn),[Object(v.a)({},Mt)]))};Object(i.useEffect)(function(){var ln;if(Ln.current)return;if(!(ve!=null&&ve.question_title)){xt(!0),ni("");return}ni(ve==null?void 0:ve.question_title),Nt(!(ve!=null&&ve.repeat_answer)),cn(ve==null?void 0:ve.difficulty),ae(ve.tag_discipline_ids);var Mt=ve==null||((ln=ve.sub_exercise_questions)===null||ln===void 0)?void 0:ln.map(function(zt){return Object(v.a)(Object(v.a)({},zt),{},{id:zt.question_id,name:zt.question_title,open:!1,question_score:zt.question_score,choices:zt==null?void 0:zt.question_choices.map(function(Vt){return{choice_text:Vt.choice_text,is_answer:Vt.standard_boolean?1:0}}),activeQusEditor:null})});vn(Mt)},[ve,nt]),Object(i.useEffect)(function(){nt&&ln();function ln(){return Mt.apply(this,arguments)}function Mt(){return Mt=Object(oe.a)(r.a.mark(function zt(){var Vt,Bt,Zt;return r.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(I.I)({sub_discipline_id:(Vt=Ne.editData)===null||Vt===void 0||((Bt=Vt.exercise)===null||Bt===void 0)?void 0:Bt.sub_discipline_id});case 2:Zt=pn.sent,Yn(Zt.tag_disciplines);case 4:case"end":return pn.stop()}},zt)})),Mt.apply(this,arguments)}},[nt]),Object(i.useEffect)(function(){var ln,Mt=Ne!=null&&(ln=Ne.tagDisciplineData)!==null&&ln!==void 0&&ln.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Yn(Mt)},[Ne.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:_n,isEdit:nt}});var Qn=function(Mt){(Mt==null?void 0:Mt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),xt(!1),we(-1),Ln.current=!1,q())},_n=function(){var ln=Object(oe.a)(r.a.mark(function Mt(){var zt,Vt,Bt,Zt,yn,pn,gt,it,Ve,qe,We;return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(Vn){Ze.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ze.abrupt("return",!1);case 3:if(!(tn.length===0)){Ze.next=6;break}return y.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Ze.abrupt("return",!1);case 6:zt=0;case 7:if(!(zt-1)){Ze.next=19;break}return y.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898").concat(ti[Zt],"\u9009\u9879\u7684\u5185\u5BB9")),Ze.abrupt("return",!1);case 19:if(!(Bt.choices.findIndex(function(wt){return wt.is_answer===1})===-1)){Ze.next=22;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(zt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Ze.abrupt("return",!1);case 22:zt++,Ze.next=7;break;case 25:if(yn=tn.map(function(wt){return{id:wt.id>1?wt.id:null,name:wt.name,item_type:Me.a.Single,choices:wt.choices,question_score:wt.question_score}}),Ln.current=!0,!ve.question_id){Ze.next=34;break}return Ze.next=30,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:hn.id,question_id:ve.question_id,name:Vn,item_type:Me.a.Combine,sub_item_banks:yn,tag_discipline_ids:V,sub_discipline_id:(gt=Ne.editData)===null||gt===void 0||((it=gt.exercise)===null||it===void 0)?void 0:it.sub_discipline_id,difficulty:jn,repeat_answer:!qt}});case 30:pn=Ze.sent,Qn(pn),Ze.next=38;break;case 34:return Ze.next=36,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{id:hn.id,insert_id:ve==null?void 0:ve.insert_id,name:Vn,item_type:Me.a.Combine,tag_discipline_ids:V,sub_discipline_id:(Ve=Ne.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,difficulty:jn,repeat_answer:!qt,sub_item_banks:yn}});case 36:pn=Ze.sent,((We=pn)===null||We===void 0?void 0:We.status)===0&&(we(-1),y.b.success("\u4FDD\u5B58\u6210\u529F"),xt(!1),Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},hn)}));case 38:case"end":return Ze.stop()}},Mt)}));return function(){return ln.apply(this,arguments)}}(),Gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var ln=Object(oe.a)(r.a.mark(function Mt(zt){return r.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!(De!==-1)){Bt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Bt.abrupt("return");case 3:Bt.t0=zt.id,Bt.next=Bt.t0==="del"?6:Bt.t0==="edit"?8:Bt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function yn(){return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:hn.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},hn)});case 3:case"end":return gt.stop()}},yn)}))()}}),Bt.abrupt("break",13);case 8:return we(ve.dragKey),xt(!0),Bt.abrupt("break",13);case 11:return fi({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Me.a.Single}),Bt.abrupt("break",13);case 13:case"end":return Bt.stop()}},Mt)}));return function(zt){return ln.apply(this,arguments)}}(),In=function(){var Mt;return t.a.createElement("aside",{ref:Tn},t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ve==null?void 0:ve.sub_q_count,"\u5C0F\u9898\uFF0C",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:vt?"block":"none"},className:ce.a.questionChoices},ve==null||((Mt=ve.sub_exercise_questions)===null||Mt===void 0)?void 0:Mt.map(function(zt,Vt){var Bt;return t.a.createElement("div",{key:Vt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,".",Vt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:zt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",zt.question_score,"\u5206\uFF09")),zt==null||((Bt=zt.question_choices)===null||Bt===void 0)?void 0:Bt.map(function(Zt,yn){return t.a.createElement(k.a,{key:yn},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:yn,checked:Zt.standard_boolean,disabled:!0},ti[yn],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Zt.choice_text}))))}))})),t.a.createElement("div",{className:ce.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Lt(!vt)},style:{}},vt?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Gn.map(function(zt,Vt){return t.a.createElement(h.a,{key:Vt,placement:"bottom",title:zt.name},t.a.createElement("span",{onClick:function(){return qn(zt)},className:zt.icon}))})))},Dn=function(){var Mt,zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ce.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vn,onChange:function(Bt){return ni(Bt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",tn==null?void 0:tn.length),tn==null?void 0:tn.map(function(Vt,Bt){var Zt;return t.a.createElement("div",{className:ce.a.fold,key:Vt.id},t.a.createElement("div",{onClick:function(){return An("open",Bt)},className:ce.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Vt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",Bt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(pn){pn.stopPropagation(),An("delete",Bt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Vt.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vt==null?void 0:Vt.name,onChange:function(pn){return An("value",Bt,pn)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vt==null||((Zt=Vt.choices)===null||Zt===void 0)?void 0:Zt.map(function(yn,pn){var gt;return t.a.createElement("div",{className:ce.a.choiceWrap,key:pn},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(yn.is_answer===1?ce.a.activeAnswer:""),onClick:function(){return An("answer",Bt,pn)}},ti[pn])),t.a.createElement("div",{className:ce.a.editorWrap},(Vt==null?void 0:Vt.activeQusEditor)===pn?t.a.createElement(x.a,{id:"single-question-option-".concat(pn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:yn.choice_text,onChange:function(Ve){return An("details",Bt,Ve)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return An("edit",Bt,pn)}},t.a.createElement(xe.a,{value:yn.choice_text}))),pn>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return An("deleteQus",Bt,pn)}})),pn<7&&pn===(Vt==null||((gt=Vt.choices)===null||gt===void 0)?void 0:gt.length)-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return An("addQus",Bt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Vt.question_score,max:1e4,min:0,onChange:function(pn){return An("score",Bt,pn)}}),"\u5206")))}),tn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:kn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:jn,onChange:function(Bt){cn(Bt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:V,onChange:ae,subId:(Mt=Ne.editData)===null||Mt===void 0||((zt=Mt.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:Cn}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),xt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){_n()}},"\u4FDD\u5B58")))},kn=function(){var Mt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};vn(tn.concat(Mt))},An=function(Mt,zt,Vt){var Bt=Object(Ot.cloneDeep)(tn);Mt==="open"&&(Bt[zt].open=!Bt[zt].open),Mt==="delete"&&Bt.splice(zt,1),Mt==="value"&&(Bt[zt].name=Vt),Mt==="answer"&&Bt[zt].choices.forEach(function(Zt,yn){Zt.is_answer=Vt===yn?1:0}),Mt==="edit"&&(Bt[zt].activeQusEditor=Vt),Mt==="details"&&(Bt[zt].choices[Bt[zt].activeQusEditor].choice_text=Vt),Mt==="addQus"&&(Bt[zt].choices=Bt[zt].choices.concat({choice_text:"",is_answer:0})),Mt==="deleteQus"&&(Bt[zt].choices=Bt[zt].choices.filter(function(Zt,yn){return yn!==Vt})),Mt==="analysis"&&(Bt[zt].analysis=Vt),Mt==="score"&&(Bt[zt].question_score=Vt),vn(Bt)};return t.a.createElement("section",{className:ce.a.wrap},!nt&&In(),nt&&Dn())},Ai=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Oi)),Ni=function(je){var It=je.data,Ne=je.isDragDisabled,Ee=Ne===void 0?!1:Ne,ve=je.editorProps,di=ve===void 0?{}:ve,en=je.onDragEnd,De=en===void 0?function(){}:en,ht=je.dispatch,we=je.markBtnVisible,un=we===void 0?!1:we,fi=je.batchScore,gi=fi===void 0?[]:fi,q=je.reload,C=q===void 0?function(){}:q,L=je.inNewPaperLibrary,V=L===void 0?!1:L,ae=Object(i.useRef)(),Q=Object(H.i)(),Ae=function(){var jt,nn,qt,Nt,$n,Un,xn,Yn,hn,Tn,sn,Mn,Vn,ni,Pn,Hn,tn=[{name:"\u5355\u9009\u9898",type:0,count:It==null||((jt=It.exercise_types)===null||jt===void 0)?void 0:jt.q_singles,score:It==null||((nn=It.exercise_types)===null||nn===void 0)?void 0:nn.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:It==null||((qt=It.exercise_types)===null||qt===void 0)?void 0:qt.q_doubles,score:It==null||((Nt=It.exercise_types)===null||Nt===void 0)?void 0:Nt.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:It==null||(($n=It.exercise_types)===null||$n===void 0)?void 0:$n.q_judges,score:It==null||((Un=It.exercise_types)===null||Un===void 0)?void 0:Un.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:It==null||((xn=It.exercise_types)===null||xn===void 0)?void 0:xn.q_nulls,score:It==null||((Yn=It.exercise_types)===null||Yn===void 0)?void 0:Yn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:It==null||((hn=It.exercise_types)===null||hn===void 0)?void 0:hn.q_mains,score:It==null||((Tn=It.exercise_types)===null||Tn===void 0)?void 0:Tn.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:It==null||((sn=It.exercise_types)===null||sn===void 0)?void 0:sn.q_shixuns,score:It==null||((Mn=It.exercise_types)===null||Mn===void 0)?void 0:Mn.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:It==null||((Vn=It.exercise_types)===null||Vn===void 0)?void 0:Vn.q_pros,score:It==null||((ni=It.exercise_types)===null||ni===void 0)?void 0:ni.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:It==null||((Pn=It.exercise_types)===null||Pn===void 0)?void 0:Pn.q_combinations,score:It==null||((Hn=It.exercise_types)===null||Hn===void 0)?void 0:Hn.q_combination_scores,items:[]}];return tn},nt=function(jt,nn,qt){var Nt=Array.from(jt),$n=Nt.splice(nn,1),Un=Object(o.a)($n,1),xn=Un[0];return Nt.splice(qt,0,xn),Nt},xt=function(jt,nn,qt){if(!jt.destination)return;var Nt=nt(nn,jt.source.index,jt.destination.index);V?De(jt,Nt,qt):De(Nt,qt)},Dt=function(jt){ht({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:jt}})},ot=function(jt,nn){if(nn===0)return V?t.a.createElement(Kt,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Ft,Object(f.a)({reload:C,editData:jt},jt));if(nn===1)return V?t.a.createElement(ei,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Ue,Object(f.a)({reload:C,editData:jt},jt));if(nn===2)return V?t.a.createElement(dn,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(_e,Object(f.a)({reload:C,editData:jt},jt));if(nn===3)return V?t.a.createElement(pi,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(ge,Object(f.a)({reload:C,editData:jt},jt));if(nn===4)return V?t.a.createElement(ri,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(En,Object(f.a)({reload:C,editData:jt},jt));if(nn===5)return V?t.a.createElement(Si,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(yt,Object(f.a)({reload:C,editData:jt},jt));if(nn===6)return V?t.a.createElement(hi,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Xe,Object(f.a)({editData:jt},jt));if(nn===7)return V?t.a.createElement(Ai,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(mt,Object(f.a)({reload:C,editData:jt},jt))},vt=function(jt,nn,qt){return t.a.createElement(Be.a,{onDragEnd:function($n){return xt($n,jt,nn)}},t.a.createElement(Be.c,{droppableId:"droppable"},function(Nt,$n){return t.a.createElement("div",Object(f.a)({ref:Nt.innerRef},Nt.droppableProps,{style:{width:"100%"}}),jt==null?void 0:jt.map(function(Un,xn){var Yn,hn=Object(v.a)(Object(v.a)({},Un),{},{key:xn+1,hideAction:!0,isPreview:!0,dragKey:nn+"-"+xn},di);return t.a.createElement(Be.b,{key:hn==null?void 0:hn.question_id,draggableId:hn==null||((Yn=hn.question_id)===null||Yn===void 0)?void 0:Yn.toString(),index:xn,isDragDisabled:Ee},function(Tn,sn){return t.a.createElement("aside",Object(f.a)({ref:Tn.innerRef},Tn.draggableProps,Tn.dragHandleProps),t.a.createElement("div",{className:ke.a.posWarp,id:hn.dragKey},ot(hn,nn),un&&t.a.createElement(k.a,{className:ke.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return Dt({value:hn,type:nn})}},hn!=null&&hn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement($.a,null),!Ee&&t.a.createElement("div",{className:ke.a.pos},t.a.createElement("div",{className:ke.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Lt=function(jt){var nn=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],qt=["","\u5341","\u767E","\u5343","\u4E07"];jt=parseInt(jt);var Nt=function(Yn){for(var hn=Yn.toString().split("").reverse(),Tn="",sn=0;sn0&&hn[sn]==0&&hn[sn-1]==0?"":nn[hn[sn]]+(hn[sn]==0?qt[0]:qt[sn]))+Tn;return Tn},$n=Math.floor(jt/1e4),Un=jt%1e4;return Un.toString().length<4&&(Un="0"+Un),$n?Nt($n)+"\u4E07"+Nt(Un):Nt(jt)},wn=function(jt){var nn={\u5355\u9009\u9898:2,\u591A\u9009\u9898:5,\u586B\u7A7A\u9898:2,\u5224\u65AD\u9898:2,\u7B80\u7B54\u9898:10,\u7F16\u7A0B\u9898:10,\u5B9E\u8BAD\u9898:5,\u7EC4\u5408\u9898:10};return nn[jt]||0},Xn=function(jt,nn){ae.current=wn(nn),W.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,nn==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":nn,"\uFF1A"),t.a.createElement(U.a,{min:1,defaultValue:ae.current,onChange:function(Nt){ae.current=Nt}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),nn==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(oe.a)(r.a.mark(function $n(){var Un,xn;return r.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:if(!V){hn.next=6;break}return hn.next=3,Object(ye.t)(Q.id,{question_type:jt,score:ae.current});case 3:return Un=hn.sent,Un.status===0&&C(),hn.abrupt("return");case 6:return hn.next=8,Object(me.a)("/api/exercises/".concat(Q.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:jt,score:ae.current}});case 8:xn=hn.sent,xn.status!==-1&&C();case 10:case"end":return hn.stop()}},$n)}));function Nt(){return qt.apply(this,arguments)}return Nt}()})},jn=function(){var jt,nn=Ae();It==null||((jt=It.exercise_questions)===null||jt===void 0)||jt.forEach(function(Nt,$n){if(Nt.question_type===0){var Un,xn;(Un=nn[Nt.question_type])===null||Un===void 0||((xn=Un.items)===null||xn===void 0)||xn.push(Nt)}if(Nt.question_type===1){var Yn,hn;(Yn=nn[Nt.question_type])===null||Yn===void 0||((hn=Yn.items)===null||hn===void 0)||hn.push(Nt)}if(Nt.question_type===2){var Tn,sn;(Tn=nn[Nt.question_type])===null||Tn===void 0||((sn=Tn.items)===null||sn===void 0)||sn.push(Nt)}if(Nt.question_type===3){var Mn,Vn;(Mn=nn[Nt.question_type])===null||Mn===void 0||((Vn=Mn.items)===null||Vn===void 0)||Vn.push(Nt)}if(Nt.question_type===4){var ni,Pn;(ni=nn[Nt.question_type])===null||ni===void 0||((Pn=ni.items)===null||Pn===void 0)||Pn.push(Nt)}if(Nt.question_type===5){var Hn,tn;(Hn=nn[Nt.question_type])===null||Hn===void 0||((tn=Hn.items)===null||tn===void 0)||tn.push(Nt)}if(Nt.question_type===6){var vn,Ln;(vn=nn[Nt.question_type])===null||vn===void 0||((Ln=vn.items)===null||Ln===void 0)||Ln.push(Nt)}if(Nt.question_type===7){var Cn,Qn;(Cn=nn[Nt.question_type])===null||Cn===void 0||((Qn=Cn.items)===null||Qn===void 0)||Qn.push(Nt)}});var qt=It==null?void 0:It.map(function(Nt,$n){return t.a.createElement(t.a.Fragment,{key:$n},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Lt($n+1),"\u3001",Nt.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Nt.count,"\u9898",(Nt==null?void 0:Nt.question_type)===7?"\uFF0C\u5305\u542B".concat(Nt.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Nt.score,"\u5206\uFF09"),(gi==null?void 0:gi.includes(Nt==null?void 0:Nt.name))&&t.a.createElement(m.a,{onClick:function(){return Xn(Nt==null?void 0:Nt.question_type,Nt==null?void 0:Nt.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),vt(Nt.items,Nt==null?void 0:Nt.question_type,Nt==null?void 0:Nt.name))});return qt};return t.a.createElement("div",null," ",jn()," ")},wi=st.a=Object(G.a)()(Ni)},LdHM:function(Wt,st,z){"use strict";z.d(st,"b",function(){return h}),z.d(st,"a",function(){return S});var oe=z("1OyB"),Z=z("vuIU"),U=z("Ji7U"),ee=z("LK+K"),W=z("q1tI"),M=z("rePB"),$=z("Ff2n"),X=z("ODXe"),k=z("4IlW"),D=z("bX4T"),m=z("YrtM"),v=z("TSYQ"),f=z.n(v),o=z("+nKL"),l=z("8OUc"),r=function(B,Y){var re=B.prefixCls,de=B.id,he=B.flattenOptions,xe=B.childrenAsData,Pe=B.values,Ce=B.searchValue,Oe=B.multiple,be=B.defaultActiveFirstOption,ge=B.height,te=B.itemHeight,fe=B.notFoundContent,_e=B.open,Le=B.menuItemSelectedIcon,$e=B.virtual,Ue=B.onSelect,at=B.onToggleOpen,ft=B.onActiveValue,Ct=B.onScroll,yt=B.onMouseEnter,_t="".concat(re,"-item"),lt=Object(m.a)(function(){return he},[_e,he],function(mt,Be){return Be[0]&&mt[1]!==Be[1]}),Ft=W.useRef(null),Xt=function(Be){Be.preventDefault()},Jt=function(Be){Ft.current&&Ft.current.scrollTo({index:Be})},rn=function(Be){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ke=lt.length,me=0;me1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(x).map(function(Y,re){if(!W.isValidElement(Y)||!Y.type)return null;var de=Y.type.isSelectOptGroup,he=Y.key,xe=Y.props,Pe=xe.children,Ce=Object($.a)(xe,["children"]);return B||!de?R(Y):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(he===null?re:he,"__"),label:he},Ce),{},{options:b(Pe)})}).filter(function(Y){return Y})}var _=z("2Qr1"),u=z("qNPg"),d=z("U8pU"),E=z("Kwbf"),g=z("WKfj");function y(x){var B=x.mode,Y=x.options,re=x.children,de=x.backfill,he=x.allowClear,xe=x.placeholder,Pe=x.getInputElement,Ce=x.showSearch,Oe=x.onSearch,be=x.defaultOpen,ge=x.autoFocus,te=x.labelInValue,fe=x.value,_e=x.inputValue,Le=x.optionLabelProp,$e=B==="multiple"||B==="tags",Ue=Ce!==void 0?Ce:$e||B==="combobox",at=Y||b(re);if(Object(E.a)(B!=="tags"||at.every(function(_t){return!_t.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),B==="tags"||B==="combobox"){var ft=at.some(function(_t){return _t.options?_t.options.some(function(lt){return typeof("value"in lt?lt.value:lt.key)=="number"}):typeof("value"in _t?_t.value:_t.key)=="number"});Object(E.a)(!ft,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(B!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(B==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(E.a)(B==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(E.b)(B!=="combobox"||!Pe||!he||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Ue&&B!=="combobox"&&B!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!be||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var Ct=Object(g.d)(fe);Object(E.a)(!te||Ct.every(function(_t){return Object(d.a)(_t)==="object"&&("key"in _t||"value"in _t)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!$e||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var yt=null;Object(O.a)(re).some(function(_t){if(!W.isValidElement(_t)||!_t.type)return!1;var lt=_t.type;if(lt.isSelectOption)return!1;if(lt.isSelectOptGroup){var Ft=Object(O.a)(_t.props.children).every(function(Xt){return!W.isValidElement(Xt)||!_t.type||Xt.type.isSelectOption?!0:(yt=Xt.type,!1)});return!Ft}return yt=lt,!0}),yt&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(yt.displayName||yt.name||yt,"`.")),Object(E.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,N=Object(u.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:b,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:F,fillOptionsWithMissingValue:_.a}),H=function(x){Object(U.a)(Y,x);var B=Object(ee.a)(Y);function Y(){var re;return Object(oe.a)(this,Y),re=B.apply(this,arguments),re.selectRef=W.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(Z.a)(Y,[{key:"render",value:function(){return W.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),Y}(W.Component);H.Option=h,H.OptGroup=S;var G=H,I=st.c=G},M8RZ:function(Wt,st,z){"use strict";z.d(st,"a",function(){return k});var oe=z("fWQN"),Z=z("mtLc"),U=z("yKVA"),ee=z("879j"),W=z("q1tI"),M=z.n(W),$=z("i8i4"),X=z.n($),k=function(D){Object(U.a)(v,D);var m=Object(ee.a)(v);function v(f){var o;Object(oe.a)(this,v),o=m.call(this,f);var l=window.document;return o.node=l.createElement("div"),l.body.appendChild(o.node),o}return Object(Z.a)(v,[{key:"render",value:function(){var o=this.props.children;return Object($.createPortal)(o,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),v}(M.a.Component)},NLgs:function(Wt,st,z){"use strict";z.d(st,"e",function(){return h}),z.d(st,"f",function(){return A}),z.d(st,"d",function(){return w}),z.d(st,"c",function(){return O}),z.d(st,"a",function(){return R}),z.d(st,"b",function(){return b});var oe=z("miYZ"),Z=z("tsqr"),U=z("9og8"),ee=z("2qtc"),W=z("kLXV"),M=z("WmNS"),$=z.n(M),X=z("q1tI"),k=z.n(X),D=z("9kvl"),m=z("xKgJ"),v=z("1vsH"),f=z("RCxd"),o=z("yTi+"),l=z.n(o),r=z("1ZF9"),i=z.n(r),t=z("NoGO"),c=z.n(t),h=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(A(u)&&S(d))},A=function(u){return Object(m.p)()?!0:(u({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},S=function(){var u,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(D.c)()._store.getState(),g=E.user;return(u=g.userInfo)!==null&&u!==void 0&&u.profile_completed?!0:(W.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:d?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){D.d.push("/account/profile/edit")}}),!1)},w=function(){var u,d=Object(D.c)()._store.getState(),E=d.user;return(u=E.userInfo)!==null&&u!==void 0&&u.professional_certification?!0:(W.a.confirm({title:"\u63D0\u793A",centered:!0,content:k.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(v.S)("/account/certification")}}),!1)},O=function(){return Object(m.a)()?!0:(W.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),k.a.createElement("img",{src:c.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},R=function(u,d){return u?!0:(W.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("p",null,d||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),k.a.createElement("div",{style:{marginLeft:"110px"}},k.a.createElement("img",{src:i.a,width:200}),k.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(v.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},b=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(D.c)()._store.getState(),g=E.shixunsDetail.detail;return(g==null?void 0:g.public)===2||(g==null?void 0:g.public)===1||(g==null?void 0:g.shixun_status)===3?(W.a.info({centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(g==null?void 0:g.public)===2?"\u5DF2\u516C\u5F00":(g==null?void 0:g.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",d,"\u3002"),k.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),k.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:l.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(W.a.confirm({centered:!0,icon:k.a.createElement(f.a,null),title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",d,"\u3002"),k.a.createElement("br",null),k.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){W.a.confirm({width:440,centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var F=Object(U.a)($.a.mark(function H(){var G;return $.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,u({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:G=x.sent,G.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),u({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),u({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return x.stop()}},H)}));function N(){return F.apply(this,arguments)}return N}()})}}),!0):!1}},NoGO:function(Wt,st,z){Wt.exports=z.p+"static/newqrcode.d852fdfc.png"},Nog9:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___FKAcC",flex_space_between:"flex_space_between___1W0sn",flex_box_vertical_center:"flex_box_vertical_center___1ZtTo",flex_box_center_end:"flex_box_center_end___3Rjsx",flex_box_column:"flex_box_column___3qWVQ",wrap:"wrap___K2ugW",modal:"modal___3Jrop",titleWrap:"titleWrap___2PdmB",required:"required___XbmpK",title:"title___1w-JF",colorGray:"colorGray___2hKRg",choiceWrap:"choiceWrap___3oJpR",answer:"answer___1Kugg",activeAnswer:"activeAnswer___3MPrD",deleteIcon:"deleteIcon___2j8_2",addIcon:"addIcon___2lm8T",editorWrap:"editorWrap___1f48O",htmlWrap:"htmlWrap___2gSXb",radio:"radio___1S16G",color333:"color333___3rZXR",color999:"color999___2xzRf",questionType:"questionType___2l_WF",questionChoices:"questionChoices___hYMa9",action:"action___1DPov",difficult:"difficult___1CZwg",fold:"fold___2FQQU",head:"head___2Es3Y"}},NvD2:function(Wt,st,z){"use strict";z.d(st,"a",function(){return M});var oe=z("Kwbf");function Z($,X){var k=new Set;return $.forEach(function(D){X.has(D)||k.add(D)}),k}function U($){var X=$||{},k=X.disabled,D=X.disableCheckbox,m=X.checkable;return!!(k||D)||m===!1}function ee($,X,k,D){for(var m=new Set($),v=new Set,f=0;f<=k;f+=1){var o=X.get(f)||new Set;o.forEach(function(t){var c=t.key,h=t.node,A=t.children,S=A===void 0?[]:A;m.has(c)&&!D(h)&&S.filter(function(w){return!D(w.node)}).forEach(function(w){m.add(w.key)})})}for(var l=new Set,r=k;r>=0;r-=1){var i=X.get(r)||new Set;i.forEach(function(t){var c=t.parent,h=t.node;if(D(h)||!t.parent||l.has(t.parent.key))return;if(D(t.parent.node)){l.add(c.key);return}var A=!0,S=!1;(c.children||[]).filter(function(w){return!D(w.node)}).forEach(function(w){var O=w.key,R=m.has(O);A&&!R&&(A=!1),!S&&(R||v.has(O))&&(S=!0)}),A&&m.add(c.key),S&&v.add(c.key),l.add(c.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Z(v,m))}}function W($,X,k,D,m){for(var v=new Set($),f=new Set(X),o=0;o<=D;o+=1){var l=k.get(o)||new Set;l.forEach(function(c){var h=c.key,A=c.node,S=c.children,w=S===void 0?[]:S;!v.has(h)&&!f.has(h)&&!m(A)&&w.filter(function(O){return!m(O.node)}).forEach(function(O){v.delete(O.key)})})}f=new Set;for(var r=new Set,i=D;i>=0;i-=1){var t=k.get(i)||new Set;t.forEach(function(c){var h=c.parent,A=c.node;if(m(A)||!c.parent||r.has(c.parent.key))return;if(m(c.parent.node)){r.add(h.key);return}var S=!0,w=!1;(h.children||[]).filter(function(O){return!m(O.node)}).forEach(function(O){var R=O.key,b=v.has(R);S&&!b&&(S=!1),!w&&(b||f.has(R))&&(w=!0)}),S||v.delete(h.key),w&&f.add(h.key),r.add(h.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(Z(f,v))}}function M($,X,k,D){var m=[],v;D?v=D:v=U;var f=new Set($.filter(function(i){var t=!!k[i];return t||m.push(i),t})),o=new Map,l=0;Object.keys(k).forEach(function(i){var t=k[i],c=t.level,h=o.get(c);h||(h=new Set,o.set(c,h)),h.add(t),l=Math.max(l,c)}),Object(oe.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var r;return X===!0?r=ee(f,o,l,v):r=W(f,X.halfCheckedKeys,o,l,v),r}},O2Wb:function(Wt,st,z){Wt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(Wt,st,z){"use strict";z.d(st,"b",function(){return D}),z.d(st,"a",function(){return m}),z.d(st,"k",function(){return v}),z.d(st,"h",function(){return f}),z.d(st,"i",function(){return o}),z.d(st,"g",function(){return l}),z.d(st,"c",function(){return r}),z.d(st,"d",function(){return i}),z.d(st,"j",function(){return h}),z.d(st,"e",function(){return A}),z.d(st,"f",function(){return S});var oe=z("KQm4"),Z=z("U8pU"),U=z("Ff2n"),ee=z("q1tI"),W=z.n(ee),M=z("Kwbf"),$=z("WaYH"),X=.25,k=2;function D(w,O){var R=w.slice(),b=R.indexOf(O);return b>=0&&R.splice(b,1),R}function m(w,O){var R=w.slice();return R.indexOf(O)===-1&&R.push(O),R}function v(w){return w.split("-")}function f(w,O){return"".concat(w,"-").concat(O)}function o(w){return w&&w.type&&w.type.isTreeNode}function l(w,O){var R=[w],b=O[w];function _(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(d){var E=d.key,g=d.children;R.push(E),_(g)})}return _(b.children),R}function r(w,O){var R=w.clientY,b=O.selectHandle.getBoundingClientRect(),_=b.top,u=b.bottom,d=b.height,E=Math.max(d*X,k);return R<=_+E?-1:R>=u-E?1:0}function i(w,O){if(!w)return;var R=O.multiple;return R?w.slice():w.length?[w[0]]:w}var t=function(O){return O};function c(w,O){if(!w)return[];var R=O||{},b=R.processProps,_=b===void 0?t:b,u=Array.isArray(w)?w:[w];return u.map(function(d){var E=d.children,g=Object(U.a)(d,["children"]),y=c(E,O);return W.a.createElement($.a,Object.assign({},_(g)),y)})}function h(w){if(!w)return null;var O;if(Array.isArray(w))O={checkedKeys:w,halfCheckedKeys:void 0};else if(Object(Z.a)(w)==="object")O={checkedKeys:w.checked||void 0,halfCheckedKeys:w.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function A(w,O){var R=new Set;function b(_){if(R.has(_))return;var u=O[_];if(!u)return;R.add(_);var d=u.parent,E=u.node;if(E.disabled)return;d&&b(d.key)}return(w||[]).forEach(function(_){b(_)}),Object(oe.a)(R)}function S(w){var O={};return Object.keys(w).forEach(function(R){(R.startsWith("data-")||R.startsWith("aria-"))&&(O[R]=w[R])}),O}},Ot1p:function(Wt,st,z){"use strict";var oe=z("2qtc"),Z=z("kLXV"),U=z("rAM+"),ee=z("miYZ"),W=z("tsqr"),M=z("9og8"),$=z("tJVT"),X=z("jrin"),k=z("WmNS"),D=z.n(k),m=z("q1tI"),v=z.n(m),f=z("VrN/"),o=z.n(f),l=z("bdgK"),r=z("p77/"),i=z("Bd2K"),t=z("ELLl"),c=z("19Vz"),h=z("lZu9"),A=z("+NIl"),S=z("kSUc"),w=z("9Bee"),O=function(Me){var tt=Me.value,bt=tt===void 0?"":tt,Kt=Me.className,Gt=Me.showTextOnly,$t=Me.showLines,ei=Me.style,gn=ei===void 0?{}:ei,an=Object(m.useMemo)(function(){return""},[bt]);return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{dangerouslySetInnerHTML:{__html:an}}))},R=z("0Owb"),b=z("dejd"),_=z("C+DQ"),u=z("1vsH"),d=z("m3rI"),E=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(Me){var tt=Me.onActionCallback,bt=Me.title,Kt=Me.icon,Gt=Me.actionName,$t=Me.className,ei=$t===void 0?"":$t,gn=Me.children;function an(){tt(Gt)}return v.a.createElement("a",{title:bt,className:ei,onClick:an},v.a.createElement("i",{className:"md-iconfont ".concat(Kt)}),gn)}var y=function(Me){var tt=Me.watch,bt=Me.showNullButton,Kt=Me.onActionCallback,Gt=Me.fullScreen,$t=Me.insertTemp,ei=Me.hidetoolBar,gn=Me.uuid,an=Me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(gn,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var dn=[].concat(E,[{title:"".concat(tt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(tt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return v.a.createElement("ul",{className:"markdown-toolbar-container"},!ei&&dn.map(function(zn,pi){return v.a.createElement("li",{key:pi},zn.actionName?v.a.createElement(g,Object(R.a)({},zn,{onActionCallback:Kt})):v.a.createElement("span",{className:"v-line"}))}),bt?v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Kt},v.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,$t&&v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat($t),onActionCallback:Kt},v.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),v.a.createElement("li",{className:"btn-full-screen"},v.a.createElement(g,{icon:"".concat(Gt?"icon-shrink":"icon-enlarge"),title:Gt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Kt})))},F=z("M8RZ"),N=z("+L6B"),H=z("2/Rp"),G=z("y8nQ"),I=z("Vl3Y"),x=z("5NDa"),B=z("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},re=function(Me){var tt=Me.callback,bt=Me.onCancel;function Kt(Gt){tt(Gt)}return v.a.createElement(I.a,Object(R.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Kt}),v.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},v.a.createElement(B.a,null)),v.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},v.a.createElement(B.a,null)),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},de=z("7ahc"),he=z("HmJG"),xe=z("BjJ7"),Pe=I.a.useForm,Ce={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},be=function(Me){var tt=Me.callback,bt=Me.onCancel,Kt=Pe(),Gt=Object($.a)(Kt,1),$t=Gt[0];function ei(dn){tt(dn)}function gn(dn,zn){if(dn.status===-1){W.b.error(dn.message);return}$t.setFieldsValue({src:"/api/attachments/".concat(dn.id),type:zn.type})}function an(dn){var zn=dn.target.files[0];te(zn,gn)}return v.a.createElement(I.a,Object(R.a)({form:$t},Oe,{className:"upload-image-panel",onFinish:ei}),v.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},v.a.createElement("div",{className:"flex-container"},v.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},v.a.createElement(B.a,{style:Ce})),v.a.createElement(ge,{onFileChange:an}))),v.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},v.a.createElement(B.a,{style:{width:264}})),v.a.createElement(I.a.Item,{style:{textAlign:"right"}},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))};function ge(Me){var tt=Me.onFileChange;return v.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",v.a.createElement("input",{type:"file",onChange:tt}))}function te(Me,tt){if(!Me)throw new String("\u6CA1\u6709\u6587\u4EF6");var bt=new FormData;bt.append("editormd-image-file",Me),bt.append("file_param_name","editormd-image-file"),bt.append("byxhr","true");var Kt=new window.XMLHttpRequest;Kt.withCredentials=!0,Kt.addEventListener("load",function(Gt){tt(JSON.parse(Gt.target.responseText),Me)},!1),Kt.addEventListener("error",function(Gt){console.error(Gt)},!1),Kt.open("POST","".concat(xe.a,"/api/attachments.json")),Kt.send(bt)}var fe=z("giR+"),_e=z("fyUT"),Le=z("7Kak"),$e=z("9yH6"),Ue=$e.a.Group,at={margin:"0 8px"},ft=function(Me){var tt=Me.callback,bt=Me.onCancel;function Kt(Gt){tt(Gt)}return v.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Kt},v.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},v.a.createElement("span",{style:at},"\u5355\u5143\u683C\u6570\uFF1A"),v.a.createElement("span",{style:at},"\u884C\u6570"),v.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},v.a.createElement(_e.a,null)),v.a.createElement("span",{style:at},"\u5217\u6570"),v.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},v.a.createElement(_e.a,null))),v.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},v.a.createElement("span",{style:at},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),v.a.createElement(I.a.Item,{name:"align"},v.a.createElement(Ue,null,v.a.createElement($e.a,{value:"default"},v.a.createElement("i",{className:"fa fa-align-justify"})),v.a.createElement($e.a,{value:"left"},v.a.createElement("i",{className:"fa fa-align-left"})),v.a.createElement($e.a,{value:"center"},v.a.createElement("i",{className:"fa fa-align-center"})),v.a.createElement($e.a,{value:"right"},v.a.createElement("i",{className:"fa fa-align-right"}))))),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},Ct=z("ErOA"),yt=z("7Cbv"),_t="link",lt="upload-image",Ft="code-block",Xt="add-table",Jt="------------",rn={default:Jt,left:":".concat(Jt),center:":".concat(Jt,":"),right:"".concat(Jt,":")},En=z("9VGf"),mn,Ye;function Xe(){}var Ot=0,Et=1e4,Je="\u2581",mt=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Be(Me){return/^\d+$/.test(Me)?"".concat(Me,"px"):Me}var Ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=Ie?"Cmd":"Ctrl",me=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ye=(mn={},Object(X.a)(mn,ke+"-B","bold"),Object(X.a)(mn,ke+"-I","italic"),mn),Re=(Ye={},Object(X.a)(Ye,_t,"\u6DFB\u52A0\u94FE\u63A5"),Object(X.a)(Ye,Ft,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(X.a)(Ye,lt,"\u6DFB\u52A0\u6587\u4EF6"),Object(X.a)(Ye,Xt,"\u6DFB\u52A0\u8868\u683C"),Ye),ce=st.a=function(Me){var tt=Me.defaultValue,bt=tt===void 0?"":tt,Kt=Me.onChange,Gt=Me.width,$t=Gt===void 0?"100%":Gt,ei=Me.height,gn=ei===void 0?400:ei,an=Me.miniToolbar,dn=an===void 0?!1:an,zn=Me.isFocus,pi=zn===void 0?!1:zn,mi=Me.watch,ri=Me.insertTemp,_i=Me.mode,Si=_i===void 0?"markdown":_i,At=Me.id,Wn=At===void 0?"markdown-editor-id":At,hi=Me.showResizeBar,ti=hi===void 0?!1:hi,Oi=Me.noStorage,Ai=Oi===void 0?!1:Oi,Ni=Me.showNullButton,wi=Ni===void 0?!1:Ni,ct=Me.hidetoolBar,je=ct===void 0?!1:ct,It=Me.fullScreen,Ne=It===void 0?!1:It,Ee=Me.onBlur,ve=Me.onCMBeforeChange,di=Me.onFullScreen,en=Me.className,De=en===void 0?"":en,ht=Me.disablePaste,we=ht===void 0?!1:ht,un=Me.placeholder,fi=un===void 0?"":un,gi=Me.values,q=gi===void 0?"":gi,C=Object(m.useState)(null),L=Object($.a)(C,2),V=L[0],ae=L[1],Q=Object(m.useState)(bt),Ae=Object($.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(m.useState)(mi),ot=Object($.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(m.useState)(Ne),Xn=Object($.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(m.useState)(""),nn=Object($.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(m.useState)(0),Un=Object($.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(m.useState)(gn),Tn=Object($.a)(hn,2),sn=Tn[0],Mn=Tn[1],Vn=Object(m.useState)(!1),ni=Object($.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(m.useRef)(Object(yt.a)()),vn=Object(m.useRef)(!1),Ln=Object(m.useRef)(),Cn=Object(m.useRef)(),Qn=Object(m.useRef)(),_n=Object(m.useRef)(),Gn=Object(m.useRef)(),qn=function(){var gt=Object(M.a)(D.a.mark(function it(){var Ve,qe;return D.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(Ct.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tn.current}});case 2:qe=dt.sent,qe!=null&&(Ve=qe.attachments)!==null&&Ve!==void 0&&Ve.length&&(console.log("cm:",V,Cn),qe.attachments.map(function(Ze){Ze.content_type.indexOf("image")>-1?V.replaceSelection(".concat(Ze.content_type,")")):Ze.content_type.indexOf("video")>-1?V.replaceSelection('')):Ze.content_type.indexOf("pdf")>-1?V.replaceSelection('').concat(Ze.name,"")):V.replaceSelection("[".concat(Ze.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Ze.id,"?type=").concat(Ze.content_type,")"))}));case 4:case"end":return dt.stop()}},it)}));return function(){return gt.apply(this,arguments)}}();Object(m.useEffect)(function(){xt(q),V==null||V.setValue(q)},[q]),Object(m.useEffect)(function(){di==null||di(jn)},[jn]),Object(m.useEffect)(function(){if(Cn.current){var gt=o.a.fromTextArea(Cn.current,{mode:Si,lineNumbers:!dn,lineWrapping:!0,value:bt,autoCloseTags:!0,autoCloseBrackets:!0});pi&>.focus();function it(Ve,qe){if(we){qe.preventDefault();return}var We=qe.clipboardData;if(We){var dt=We.types.toString(),Ze=We.items;if(dt==="Files"||We.types.indexOf("Files")>-1){if(qe.preventDefault(),Si=="stex")return;try{var wt,kt=Ze[1];((wt=Ze[0])===null||wt===void 0?void 0:wt.kind)==="file"&&(kt=Ze[0]);var Tt=kt.getAsFile(),Ht=Tt.name.split(".").pop();te(Tt,function(St){if(St.id){var Pt,bn,on;(Tt==null||((Pt=Tt.type)===null||Pt===void 0)?void 0:Pt.indexOf("image"))>-1?gt.replaceSelection(".concat(St.content_type,")")):(Tt==null||((bn=Tt.type)===null||bn===void 0)?void 0:bn.indexOf("video"))>-1?gt.replaceSelection('')):(Tt==null||((on=Tt.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Tt.name,"")):me.includes(Ht)?gt.replaceSelection('').concat(Tt.name,"")):gt.replaceSelection("[".concat(Tt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,")"))}else(St==null?void 0:St.status)===401&&(document.location.href="/user/login")})}catch(St){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",it),gt.on("dragleave",function(Ve,qe){Qn.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Ve,qe){Qn.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Ve,qe){Qn.current.classList.add("mouse-hover-md");var We;if(We=qe.dataTransfer.files,We.length>0){qe.preventDefault(),qe.stopPropagation();for(var dt=function(kt){var Tt=We[kt],Ht=Tt.name.split(".").pop();te(Tt,function(St){if(St.id){var Pt,bn,on;(Tt==null||((Pt=Tt.type)===null||Pt===void 0)?void 0:Pt.indexOf("image"))>-1?gt.replaceSelection(".concat(St.content_type,")")):(Tt==null||((bn=Tt.type)===null||bn===void 0)?void 0:bn.indexOf("video"))>-1?gt.replaceSelection('')):(Tt==null||((on=Tt.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Tt.name,"")):me.includes(Ht)?gt.replaceSelection('').concat(Tt.name,"")):gt.replaceSelection("[".concat(Tt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,")"))}else(St==null?void 0:St.status)===401&&(document.location.href="/user/login")})},Ze=0;Ze0||Ze.target.offsetWidth>0)&&(In(),V.setSize("100%","100%"),V.refresh())}}catch(wt){We.e(wt)}finally{We.f()}});return Ve.observe(Cn.current.parentElement),Ve}if(V){var it=gt();return function(){it.unobserve(Cn.current.parentElement)}}},[V,In]),Object(m.useEffect)(function(){if(V){for(var gt=[],it=function(){var Ze=qe[Ve];We=Object($.a)(Ze,2);var wt=We[0],kt=We[1],Tt=Object(X.a)({},wt,function(){Dn(kt)});gt.push(Tt),V.addKeyMap(Tt)},Ve=0,qe=Object.entries(ye);Ve0){var gt=new Date().getTime(),it=window.sessionStorage.getItem(Wn);gt>=xn+Et&&(!it||it!==nt)&&(window.sessionStorage.setItem(Wn,nt),Hn(!0))}},Et),Object(m.useEffect)(function(){Lt(mi)},[V,mi]),Object(m.useEffect)(function(){V&&(pi&&V.focus())},[V,pi]),Object(m.useEffect)(function(){if(vt&&V){var gt=V.getScrollerElement();function it(Ve){var qe=Ve.target;if(Gn.current){var We=qe.scrollTop/qe.scrollHeight;Gn.current.scrollTop=Gn.current.scrollHeight*We}}return gt.addEventListener("scroll",it),function(){gt.removeEventListener("scroll",it)}}},[V,vt]),Object(m.useEffect)(function(){if(V&&ve){function gt(it,Ve){ve(it,Ve)}return V.on("beforeChange",gt),function(){V.off("beforeChange",gt)}}},[V,ve]),Object(m.useEffect)(function(){if(V&&Ee){function gt(){Ee(V.getValue())}return V.on("blur",gt),function(){V.off("blur",gt)}}},[V,Ee]),Object(m.useEffect)(function(){if(V){function gt(it){var Ve=it.getValue();xt(Ve),Yn(new Date().getTime()),it.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Kt&&Kt(Ve)}return V.on("change",gt),function(){V.off("change",gt)}}},[V,Kt]),Object(m.useEffect)(function(){V&&(bt==null?(V.setValue(""),xt("")):bt!==V.getValue()&&(V.setValue(bt),xt(bt),V.setCursor(V.lineCount(),0)))},[V,bt]);var Dn=Object(m.useCallback)(function(gt){var it=V.getCursor(),Ve=V.getSelection(),qe=Ve.split(`
`);switch(gt){case"bold":return V.replaceSelection("**"+Ve+"**"),Ve===""&&V.setCursor(it.line,it.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Ve+"*"),Ve===""&&V.setCursor(it.line,it.ch+1),V.focus();case"code":return V.replaceSelection("`"+Ve+"`"),Ve===""&&V.setCursor(it.line,it.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Ve+"$$`"),Ve===""&&V.setCursor(it.line,it.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Ve+"\n```"),V.setCursor(it.line+1,Ve.length+1),V.focus();case"line-break":return V.replaceSelection(`
`),V.focus();case"list-ul":return Ve===""?V.replaceSelection("- "+Ve):V.replaceSelection(qe.map(function(We){return We===""?"":"- ".concat(We)}).join(`
`)),V.focus();case"list-ol":return Ve===""?V.replaceSelection("1. "+Ve):V.replaceSelection(qe.map(function(We,dt){return We===""?"":"".concat(dt+1,". ").concat(We)}).join(`
`)),V.focus();case"add-null-ch":return Ve===""&&V.setCursor(it.line,it.ch+1),V.replaceSelection(Je),V.focus();case"inster-template-1":return Ve===""&&V.setCursor(it.line,it.ch),V.replaceSelection(mt),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return Lt(!vt),V.focus();case"trigger-full-screen":return cn(!jn),V.focus();case _t:Nt(_t);return;case Ft:Nt(Ft);return;case lt:Nt(lt);return;case Xt:Nt(Xt);return;default:throw new Error}},[V,vt,jn]),kn=Object(m.useCallback)(function(gt){Nt("");switch(qt){case _t:var it=gt.title,Ve=gt.link;return V.replaceSelection("[".concat(it,"](").concat(Ve,")")),V.focus();case Ft:var qe=gt.language,We=gt.content;return V.replaceSelection(["```"+qe,We,"```"].join(`
`)),V.focus();case lt:var dt=gt.src,Ze=gt.alt;return Ze?V.replaceSelection(".concat(dt,' "').concat(Ze,'" )')):V.replaceSelection("")),V.focus();case Xt:for(var wt=gt.row,kt=gt.col,Tt=gt.align,Ht=`
`,St=0;St300&&(wt=300);var kt=gn+wt+"px";Mn(kt)}}return gt.addEventListener("mousedown",qe),document.addEventListener("mousemove",dt),document.addEventListener("mouseup",We),function(){gt.removeEventListener("mousedown",qe),document.removeEventListener("mousemove",dt),document.removeEventListener("mouseup",We)}}},[V,_n]),Object(m.useEffect)(function(){Mn(gn)},[gn]);var Mt=Be($t),zt=Be(sn),Vt={width:Mt,height:zt},Bt=Object(m.useMemo)(function(){if(xn){var gt=new Date(xn),it=gt.getHours(),Ve=gt.getMinutes(),qe=gt.getSeconds();return it=it<10?"0"+it:it,Ve=Ve<10?"0"+Ve:Ve,qe=qe<10?"0"+qe:qe,"".concat(it,":").concat(Ve,":").concat(qe)}return 0},[xn]);function Zt(){window.sessionStorage.removeItem(Wn),Hn(!1),Yn(0)}function yn(){Hn(!1),Yn(0),V.setValue(window.sessionStorage.getItem(Wn))}function pn(gt,it){var Ve=V.getValue();Ve=Ve.replace(gt,it),xt(Ve),V==null||V.setValue(Ve)}return v.a.createElement(m.Fragment,null,v.a.createElement("div",{className:"markdown-editor-wrapper",ref:Qn},v.a.createElement("div",{className:"markdown-editor-container ".concat(De," ").concat(vt?"on-preview":""," ").concat(dn?"mini":""," ").concat(jn?"full-screen":""),style:Vt},v.a.createElement(y,{insertTemp:ri,watch:vt,fullScreen:jn,showNullButton:wi,onActionCallback:Dn,hidetoolBar:je,uuid:tn.current,setOpenPhones:function(){vn.current=!0}}),v.a.createElement("div",{className:"markdown-editor-body"},v.a.createElement("div",{className:"codemirror-container"},v.a.createElement("textarea",{ref:Cn,placeholder:fi})),vt?v.a.createElement("div",{ref:Gn,className:"preview-container"},Si==="stex"&&v.a.createElement(O,{value:nt}),Si!=="stex"&&v.a.createElement(w.a,{edit:!0,value:nt,replaces:pn})):null))),ti?v.a.createElement("a",{ref:_n,className:"editor-resize"}):null,v.a.createElement(F.a,null,Re[qt]?v.a.createElement(Z.a,{centered:!0,title:Re[qt],visible:!0,onCancel:ln,footer:null,className:"markdown-popup-form"},An):null))}},Pxm8:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___3O17H",flex_space_between:"flex_space_between___1PCIj",flex_box_vertical_center:"flex_box_vertical_center___3W4zT",flex_box_center_end:"flex_box_center_end___3TSxu",flex_box_column:"flex_box_column___3pTiU",bg:"bg___3XbLP",title:"title___3HsI1",titleLeft:"titleLeft___3MQGG",titleRight:"titleRight___2RPg2",formWrap:"formWrap___3LmMJ"}},RxwV:function(Wt,st,z){"use strict";var oe=z("q1tI"),Z=z("uciX"),U=z("2W6z"),ee=z.n(U),W=z("4IlW"),M=z("uK0f"),$=z.n(M);function X(Ce,Oe){if(Ce===Oe)return!0;if(!Ce||!Oe)return!1;var be=Ce.length;if(Oe.length!==be)return!1;for(var ge=0;ge0;(Xt||fe.isLeaf===!1)&&(lt+=" ".concat($e,"-menu-item-expand"),fe.loading||(Ft=oe.createElement("span",{className:"".concat($e,"-menu-item-expand-icon")},at))),Ue==="hover"&&(Xt||fe.isLeaf===!1)&&(_t={onMouseEnter:this.delayOnSelect.bind(this,Ct),onMouseLeave:this.delayOnSelect.bind(this),onClick:Ct}),this.isActiveOption(fe,_e)&&(lt+=" ".concat($e,"-menu-item-active"),_t.ref=this.saveMenuItem(_e)),fe.disabled&&(lt+=" ".concat($e,"-menu-item-disabled"));var Jt=null;fe.loading&&(lt+=" ".concat($e,"-menu-item-loading"),Jt=ft||null);var rn="";return"title"in fe?rn=fe.title:typeof fe[this.getFieldName("label")]=="string"&&(rn=fe[this.getFieldName("label")]),oe.createElement("li",Object.assign({key:fe[this.getFieldName("value")],className:lt,title:rn},_t,{role:"menuitem",onMouseDown:function(mn){return mn.preventDefault()}}),fe[this.getFieldName("label")],Ft,Jt)}},{key:"getActiveOptions",value:function(fe){var _e=this,Le=this.props.options,$e=fe||this.props.activeValue;return $()(Le,function(Ue,at){return Ue[_e.getFieldName("value")]===$e[at]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var fe=this,_e=this.props.options,Le=this.getActiveOptions().map(function($e){return $e[fe.getFieldName("children")]}).filter(function($e){return!!$e});return Le.unshift(_e),Le}},{key:"delayOnSelect",value:function(fe){for(var _e=this,Le=arguments.length,$e=new Array(Le>1?Le-1:0),Ue=1;Ue=0)continue;if(!Object.prototype.propertyIsEnumerable.call(Ce,ge))continue;be[ge]=Ce[ge]}}return be}function b(Ce,Oe){if(Ce==null)return{};var be={},ge=Object.keys(Ce),te,fe;for(fe=0;fe=0)continue;be[te]=Ce[te]}return be}function _(Ce){return g(Ce)||E(Ce)||d(Ce)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(Ce,Oe){if(!Ce)return;if(typeof Ce=="string")return y(Ce,Oe);var be=Object.prototype.toString.call(Ce).slice(8,-1);if(be==="Object"&&Ce.constructor&&(be=Ce.constructor.name),be==="Map"||be==="Set")return Array.from(Ce);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return y(Ce,Oe)}function E(Ce){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(Ce))return Array.from(Ce)}function g(Ce){if(Array.isArray(Ce))return y(Ce)}function y(Ce,Oe){(Oe==null||Oe>Ce.length)&&(Oe=Ce.length);for(var be=0,ge=new Array(Oe);be=ft.length?0:yt):(yt-=1,yt=yt<0?ft.length-1:yt):yt=0,Ue[at]=ft[yt][fe.getFieldName("value")]}else if(Le.keyCode===W.a.LEFT||Le.keyCode===W.a.BACKSPACE)Le.preventDefault(),Ue.splice(Ue.length-1,1);else if(Le.keyCode===W.a.RIGHT)Le.preventDefault(),ft[Ct]&&ft[Ct][fe.getFieldName("children")]&&Ue.push(ft[Ct][fe.getFieldName("children")][0][fe.getFieldName("value")]);else if(Le.keyCode===W.a.ESC||Le.keyCode===W.a.TAB){fe.setPopupVisible(!1);return}(!Ue||Ue.length===0)&&fe.setPopupVisible(!1);var _t=fe.getActiveOptions(Ue),lt=_t[_t.length-1];fe.handleMenuSelect(lt,_t.length-1,Le),fe.props.onKeyDown&&fe.props.onKeyDown(Le)},fe.saveTrigger=function(Le){fe.trigger=Le};var _e=[];return"value"in te?_e=te.value||[]:"defaultValue"in te&&(_e=te.defaultValue||[]),ee()(!("filedNames"in te),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),fe.state={popupVisible:te.popupVisible,activeValue:_e,value:_e,prevProps:te},fe.defaultFieldNames={label:"label",value:"value",children:"children"},fe}return H(ge,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(fe){var _e=this.defaultFieldNames,Le=this.props,$e=Le.fieldNames,Ue=Le.filedNames;return"filedNames"in this.props?Ue[fe]||_e[fe]:$e[fe]||_e[fe]}},{key:"getFieldNames",value:function(){var fe=this.props,_e=fe.fieldNames,Le=fe.filedNames;return"filedNames"in this.props?Le:_e}},{key:"getCurrentLevelOptions",value:function(){var fe=this,_e=this.props.options,Le=_e===void 0?[]:_e,$e=this.state.activeValue,Ue=$e===void 0?[]:$e,at=$()(Le,function(ft,Ct){return ft[fe.getFieldName("value")]===Ue[Ct]},{childrenKeyName:this.getFieldName("children")});return at[at.length-2]?at[at.length-2][this.getFieldName("children")]:_(Le).filter(function(ft){return!ft.disabled})}},{key:"getActiveOptions",value:function(fe){var _e=this;return $()(this.props.options||[],function(Le,$e){return Le[_e.getFieldName("value")]===fe[$e]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var fe=this.props,_e=fe.prefixCls,Le=fe.transitionName,$e=fe.popupClassName,Ue=fe.options,at=Ue===void 0?[]:Ue,ft=fe.disabled,Ct=fe.builtinPlacements,yt=fe.popupPlacement,_t=fe.children,lt=fe.dropdownRender,Ft=R(fe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Xt=oe.createElement("div",null),Jt="";at&&at.length>0?Xt=oe.createElement(A,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Jt=" ".concat(_e,"-menus-empty");var rn=Xt;return lt&&(rn=lt(Xt)),oe.createElement(Z.a,Object.assign({ref:this.saveTrigger},Ft,{popupPlacement:yt,builtinPlacements:Ct,popupTransitionName:Le,action:ft?[]:["click"],popupVisible:ft?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(_e,"-menus"),popupClassName:$e+Jt,popup:rn}),oe.cloneElement(_t,{onKeyDown:this.handleKeyDown,tabIndex:ft?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(fe,_e){var Le=_e.prevProps,$e=Le===void 0?{}:Le,Ue={prevProps:fe};return"value"in fe&&!X($e.value,fe.value)&&(Ue.value=fe.value||[],"loadData"in fe||(Ue.activeValue=fe.value||[])),"popupVisible"in fe&&(Ue.popupVisible=fe.popupVisible),Ue}}]),ge}(oe.Component);return Ce.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:w,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},Ce}(),xe=he,Pe=st.a=xe},"SA+Z":function(Wt,st,z){var oe=z("wTVA"),Z=z("EbDI"),U=z("ZhPi"),ee=z("wkBT");function W(M){return oe(M)||Z(M)||U(M)||ee()}Wt.exports=W,Wt.exports.__esModule=!0,Wt.exports.default=Wt.exports},SJMd:function(Wt,st){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var z,oe,Z,U=!1,ee,W;window.PR_SHOULD_USE_CONTINUATION=!0;var M,$;(function(){var X=window,k=["break,continue,do,else,for,if,return,while"],D=[k,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[m,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],f=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[m,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",r=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",t=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[k,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],h=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[v,o,f,r,i,t,c,h],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",O="kwd",R="com",b="typ",_="lit",u="pun",d="pln",E="tag",g="dec",y="src",F="atn",N="atv",H="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ue){for(var at=0,ft=!1,Ct=!1,yt=0,_t=Ue.length;yt<_t;++yt){var lt=Ue[yt];if(lt.ignoreCase)Ct=!0;else if(/[a-z]/i.test(lt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ft=!0,Ct=!1;break}}var Ft={b:8,t:9,n:10,v:11,f:12,r:13};function Xt(Ye){var Xe=Ye.charCodeAt(0);if(Xe!==92)return Xe;var Ot=Ye.charAt(1);return Xe=Ft[Ot],Xe||("0"<=Ot&&Ot<="7"?parseInt(Ye.substring(1),8):Ot==="u"||Ot==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function Jt(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Xe=String.fromCharCode(Ye);return Xe==="\\"||Xe==="-"||Xe==="]"||Xe==="^"?"\\"+Xe:Xe}function rn(Ye){var Xe=Ye.substring(1,Ye.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ot=[],Et=Xe[0]==="^",Je=["["];Et&&Je.push("^");for(var mt=Et?1:0,Be=Xe.length;mt122||(me<65||ke>90||Ot.push([Math.max(65,ke)|32,Math.min(me,90)|32]),me<97||ke>122||Ot.push([Math.max(97,ke)&~32,Math.min(me,122)&~32]))}}Ot.sort(function(Me,tt){return Me[0]-tt[0]||tt[1]-Me[1]});for(var ye=[],Re=[],mt=0;mtce[0]&&(ce[1]+1>ce[0]&&Je.push("-"),Je.push(Jt(ce[1])))}return Je.push("]"),Je.join("")}function En(Ye){for(var Xe=Ye.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ot=Xe.length,Et=[],Je=0,mt=0;Je=2&&ke==="["?Xe[Je]=rn(Be):ke!=="\\"&&(Xe[Je]=Be.replace(/[a-zA-Z]/g,function(Re){var ce=Re.charCodeAt(0);return"["+String.fromCharCode(ce&~32,ce|32)+"]"}))}return Xe.join("")}for(var mn=[],yt=0,_t=Ue.length;yt<_t;++yt){var lt=Ue[yt];if(lt.global||lt.multiline)throw new Error(""+lt);mn.push("(?:"+En(lt)+")")}return new RegExp(mn.join("|"),Ct?"gi":"g")}function x(Ue,at){var ft=/(?:^|\s)nocode(?:\s|$)/,Ct=[],yt=0,_t=[],lt=0;function Ft(Xt){var Jt=Xt.nodeType;if(Jt==1){if(ft.test(Xt.className))return;for(var rn=Xt.firstChild;rn;rn=rn.nextSibling)Ft(rn);var En=Xt.nodeName.toLowerCase();(En==="br"||En==="li")&&(Ct[lt]=`
`,_t[lt<<1]=yt++,_t[lt++<<1|1]=Xt)}else if(Jt==3||Jt==4){var mn=Xt.nodeValue;mn.length&&(at?mn=mn.replace(/\r\n?/g,`
`):mn=mn.replace(/[ \t\r\n]+/g," "),Ct[lt]=mn,_t[lt<<1]=yt,yt+=mn.length,_t[lt++<<1|1]=Xt)}}return Ft(Ue),{sourceCode:Ct.join("").replace(/\n$/,""),spans:_t}}function B(Ue,at,ft,Ct,yt){if(!ft)return;var _t={sourceNode:Ue,pre:1,langExtension:null,numberLines:null,sourceCode:ft,spans:null,basePos:at,decorations:null};Ct(_t),yt.push.apply(yt,_t.decorations)}var Y=/\S/;function re(Ue){for(var at=void 0,ft=Ue.firstChild;ft;ft=ft.nextSibling){var Ct=ft.nodeType;at=Ct===1?at?Ue:ft:Ct===3&&Y.test(ft.nodeValue)?Ue:at}return at===Ue?void 0:at}function de(Ue,at){var ft={},Ct;(function(){for(var lt=Ue.concat(at),Ft=[],Xt={},Jt=0,rn=lt.length;Jt=0;)ft[mn.charAt(Ye)]=En;var Xe=En[1],Ot=""+Xe;Xt.hasOwnProperty(Ot)||(Ft.push(Xe),Xt[Ot]=null)}Ft.push(/[\0-\uffff]/),Ct=I(Ft)})();var yt=at.length,_t=function(lt){for(var Ft=lt.sourceCode,Xt=lt.basePos,Jt=lt.sourceNode,rn=[Xt,d],En=0,mn=Ft.match(Ct)||[],Ye={},Xe=0,Ot=mn.length;Xe=5&&Je.substring(0,5)==="lang-",Be&&!(mt&&typeof mt[1]=="string")&&(Be=!1,Je=y),Be||(Ye[Et]=Je)}var me=En;if(En+=Et.length,!Be)rn.push(Xt+me,Je);else{var ye=mt[1],Re=Et.indexOf(ye),ce=Re+ye.length;mt[2]&&(ce=Et.length-mt[2].length,Re=ce-ye.length);var Me=Je.substring(5);B(Jt,Xt+me,Et.substring(0,Re),_t,rn),B(Jt,Xt+me+Re,ye,ge(Me,ye),rn),B(Jt,Xt+me+ce,Et.substring(ce),_t,rn)}}lt.decorations=rn};return _t}function he(Ue){var at=[],ft=[];Ue.tripleQuotedStrings?at.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ue.multiLineStrings?at.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):at.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ue.verbatimStrings&&ft.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ct=Ue.hashComments;Ct&&(Ue.cStyleComments?(Ct>1?at.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):at.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ft.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):at.push([R,/^#[^\r\n]*/,null,"#"])),Ue.cStyleComments&&(ft.push([R,/^\/\/[^\r\n]*/,null]),ft.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var yt=Ue.regexLiterals;if(yt){var _t=yt>1?"":`
\r`,lt=_t?".":"[\\S\\s]",Ft="/(?=[^/*"+_t+"])(?:[^/\\x5B\\x5C"+_t+"]|\\x5C"+lt+"|\\x5B(?:[^\\x5C\\x5D"+_t+"]|\\x5C"+lt+")*(?:\\x5D|$))+/";ft.push(["lang-regex",RegExp("^"+G+"("+Ft+")")])}var Xt=Ue.types;Xt&&ft.push([b,Xt]);var Jt=(""+Ue.keywords).replace(/^ | $/g,"");Jt.length&&ft.push([O,new RegExp("^(?:"+Jt.replace(/[\s,]+/g,"|")+")\\b"),null]),at.push([d,/^\s+/,null,` \r
\xA0`]);var rn="^.[^\\s\\w.$@'\"`/\\\\]*";return Ue.regexLiterals&&(rn+="(?!s*/)"),ft.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[u,new RegExp(rn),null]),de(at,ft)}var xe=he({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(Ue,at,ft){for(var Ct=/(?:^|\s)nocode(?:\s|$)/,yt=/\r\n?|\n/,_t=Ue.ownerDocument,lt=_t.createElement("li");Ue.firstChild;)lt.appendChild(Ue.firstChild);var Ft=[lt];function Xt(Xe){var Ot=Xe.nodeType;if(Ot==1&&!Ct.test(Xe.className))if(Xe.nodeName==="br")Jt(Xe),Xe.parentNode&&Xe.parentNode.removeChild(Xe);else for(var Et=Xe.firstChild;Et;Et=Et.nextSibling)Xt(Et);else if((Ot==3||Ot==4)&&ft){var Je=Xe.nodeValue,mt=Je.match(yt);if(mt){var Be=Je.substring(0,mt.index);Xe.nodeValue=Be;var Ie=Je.substring(mt.index+mt[0].length);if(Ie){var ke=Xe.parentNode;ke.insertBefore(_t.createTextNode(Ie),Xe.nextSibling)}Jt(Xe),Be||Xe.parentNode.removeChild(Xe)}}}function Jt(Xe){for(;!Xe.nextSibling;)if(Xe=Xe.parentNode,!Xe)return;function Ot(mt,Be){var Ie=Be?mt.cloneNode(!1):mt,ke=mt.parentNode;if(ke){var me=Ot(ke,1),ye=mt.nextSibling;me.appendChild(Ie);for(var Re=ye;Re;Re=ye)ye=Re.nextSibling,me.appendChild(Re)}return Ie}for(var Et=Ot(Xe.nextSibling,0),Je;(Je=Et.parentNode)&&Je.nodeType===1;)Et=Je;Ft.push(Et)}for(var rn=0;rn=ke&&(Xt+=2),_t>=me&&(En+=2)}}finally{Je&&(Je.style.display=mt)}}var Oe={};function be(Ue,at){for(var ft=at.length;--ft>=0;){var Ct=at[ft];Oe.hasOwnProperty(Ct)?X.console&&console.warn("cannot override language handler %s",Ct):Oe[Ct]=Ue}}function ge(Ue,at){return Ue&&Oe.hasOwnProperty(Ue)||(Ue=/^\s*]*(?:>|$)/],[R,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^