You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Forums__New.9b212fa9.asy...

14 lines
64 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[116,6],{"500L":function(Me,te,t){"use strict";t.d(te,"a",function(){return ce});var ge=t("DZo9"),Ee=t("8z0m"),Le=t("+L6B"),ue=t("2/Rp"),ve=t("2qtc"),U=t("kLXV"),d=t("9og8"),le=t("k1fw"),ne=t("oBTY"),P=t("miYZ"),A=t("tsqr"),I=t("tJVT"),oe=t("q1tI"),J=t.n(oe),Re=t("m3rI"),Pe=t("wzkS"),j=t("y5JW");function L(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */L=function(){return C};var C={},de=Object.prototype,F=de.hasOwnProperty,q=typeof Symbol=="function"?Symbol:{},X=q.iterator||"@@iterator",_e=q.asyncIterator||"@@asyncIterator",K=q.toStringTag||"@@toStringTag";function N(r,e,u){return Object.defineProperty(r,e,{value:u,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{N({},"")}catch(r){N=function(u,m,p){return u[m]=p}}function Q(r,e,u,m){var p=e&&e.prototype instanceof T?e:T,g=Object.create(p.prototype),b=new c(m||[]);return g._invoke=function(B,ee,H){var l="suspendedStart";return function(o,v){if(l==="executing")throw new Error("Generator is already running");if(l==="completed"){if(o==="throw")throw v;return s()}for(H.method=o,H.arg=v;;){var S=H.delegate;if(S){var W=f(S,H);if(W){if(W===R)continue;return W}}if(H.method==="next")H.sent=H._sent=H.arg;else if(H.method==="throw"){if(l==="suspendedStart")throw l="completed",H.arg;H.dispatchException(H.arg)}else H.method==="return"&&H.abrupt("return",H.arg);l="executing";var x=me(B,ee,H);if(x.type==="normal"){if(l=H.done?"completed":"suspendedYield",x.arg===R)continue;return{value:x.arg,done:H.done}}x.type==="throw"&&(l="completed",H.method="throw",H.arg=x.arg)}}}(r,u,b),g}function me(r,e,u){try{return{type:"normal",arg:r.call(e,u)}}catch(m){return{type:"throw",arg:m}}}C.wrap=Q;var R={};function T(){}function k(){}function w(){}var O={};N(O,X,function(){return this});var M=Object.getPrototypeOf,i=M&&M(M(a([])));i&&i!==de&&F.call(i,X)&&(O=i);var n=w.prototype=T.prototype=Object.create(O);function _(r){["next","throw","return"].forEach(function(e){N(r,e,function(u){return this._invoke(e,u)})})}function E(r,e){function u(p,g,b,B){var ee=me(r[p],r,g);if(ee.type!=="throw"){var H=ee.arg,l=H.value;return l&&typeof l=="object"&&F.call(l,"__await")?e.resolve(l.__await).then(function(o){u("next",o,b,B)},function(o){u("throw",o,b,B)}):e.resolve(l).then(function(o){H.value=o,b(H)},function(o){return u("throw",o,b,B)})}B(ee.arg)}var m;this._invoke=function(p,g){function b(){return new e(function(B,ee){u(p,g,B,ee)})}return m=m?m.then(b,b):b()}}function f(r,e){var u=r.iterator[e.method];if(u===void 0){if(e.delegate=null,e.method==="throw"){if(r.iterator.return&&(e.method="return",e.arg=void 0,f(r,e),e.method==="throw"))return R;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var m=me(u,r.iterator,e.arg);if(m.type==="throw")return e.method="throw",e.arg=m.arg,e.delegate=null,R;var p=m.arg;return p?p.done?(e[r.resultName]=p.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,R):p:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,R)}function D(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function G(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function c(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(D,this),this.reset(!0)}function a(r){if(r){var e=r[X];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var u=-1,m=function p(){for(;++u<r.length;)if(F.call(r,u))return p.value=r[u],p.done=!1,p;return p.value=void 0,p.done=!0,p};return m.next=m}}return{next:s}}function s(){return{value:void 0,done:!0}}return k.prototype=w,N(n,"constructor",w),N(w,"constructor",k),k.displayName=N(w,K,"GeneratorFunction"),C.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return!!e&&(e===k||(e.displayName||e.name)==="GeneratorFunction")},C.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,N(r,K,"GeneratorFunction")),r.prototype=Object.create(n),r},C.awrap=function(r){return{__await:r}},_(E.prototype),N(E.prototype,_e,function(){return this}),C.AsyncIterator=E,C.async=function(r,e,u,m,p){p===void 0&&(p=Promise);var g=new E(Q(r,e,u,m),p);return C.isGeneratorFunction(e)?g:g.next().then(function(b){return b.done?b.value:g.next()})},_(n),N(n,K,"Generator"),N(n,X,function(){return this}),N(n,"toString",function(){return"[object Generator]"}),C.keys=function(r){var e=[];for(var u in r)e.push(u);return e.reverse(),function m(){for(;e.length;){var p=e.pop();if(p in r)return m.value=p,m.done=!1,m}return m.done=!0,m}},C.values=a,c.prototype={constructor:c,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(G),!e)for(var u in this)u.charAt(0)==="t"&&F.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var u=this;function m(H,l){return b.type="throw",b.arg=e,u.next=H,l&&(u.method="next",u.arg=void 0),!!l}for(var p=this.tryEntries.length-1;p>=0;--p){var g=this.tryEntries[p],b=g.completion;if(g.tryLoc==="root")return m("end");if(g.tryLoc<=this.prev){var B=F.call(g,"catchLoc"),ee=F.call(g,"finallyLoc");if(B&&ee){if(this.prev<g.catchLoc)return m(g.catchLoc,!0);if(this.prev<g.finallyLoc)return m(g.finallyLoc)}else if(B){if(this.prev<g.catchLoc)return m(g.catchLoc,!0)}else{if(!ee)throw new Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return m(g.finallyLoc)}}}},abrupt:function(e,u){for(var m=this.tryEntries.length-1;m>=0;--m){var p=this.tryEntries[m];if(p.tryLoc<=this.prev&&F.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var g=p;break}}g&&(e==="break"||e==="continue")&&g.tryLoc<=u&&u<=g.finallyLoc&&(g=null);var b=g?g.completion:{};return b.type=e,b.arg=u,g?(this.method="next",this.next=g.finallyLoc,R):this.complete(b)},complete:function(e,u){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&u&&(this.next=u),R},finish:function(e){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===e)return this.complete(m.completion,m.afterLoc),G(m),R}},catch:function(e){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===e){var p=m.completion;if(p.type==="throw"){var g=p.arg;G(m)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(e,u,m){return this.delegate={iterator:a(e),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),R}},C}function ce(C){var de=[];return C&&C.length>0&&(de=C.map(function(F){return{uid:F.id,id:F.id,name:F.title+j.c+F.filesize,url:F.url,filesize:F.filesize,status:"done",response:{id:F.id}}})),de}te.b=function(C){var de=C.value,F=C.onChange,q=C.className,X=C.maxSize,_e=X===void 0?300:X,K=C.title,N=K===void 0?"\u4E0A\u4F20\u9644\u4EF6":K,Q=C.showRemoveModal,me=Q===void 0?!1:Q,R=C.accept,T=R===void 0?"":R,k=C.number,w=k===void 0?1e3:k,O=Object(oe.useState)(!1),M=Object(I.a)(O,2),i=M[0],n=M[1],_=Object(oe.useState)([]),E=Object(I.a)(_,2),f=E[0],D=E[1],G={multiple:!0,disabled:i,accept:T,withCredentials:!0,fileList:de,beforeUpload:function(s,r){var e=s.size/1024/1024;return f.concat(r).length>w?(A.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(w,"\u4E2A\u6587\u4EF6")),!1):e<_e?!0:(A.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(_e,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},action:"".concat(Re.a.API_SERVER,"/api/attachments.json"),onChange:function(s){var r=Object(ne.a)(s.fileList);r.length>=w?n(!0):n(!1),D(Object(ne.a)(r)),r=r.map(function(e){var u;if(e==null||((u=e.response)===null||u===void 0)?void 0:u.id){var m;e.url="/api/attachments/".concat(e==null||((m=e.response)===null||m===void 0)?void 0:m.id)}return e.name.indexOf(j.c)===-1&&(e.name="".concat(e.name).concat(j.c).concat(Object(j.a)(e.size))),Object(le.a)({},e)}),console.log("info:",s),F(r)},onRemove:function(){var a=Object(d.a)(L().mark(function r(e){var u;return L().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u=function(){var g=Object(d.a)(L().mark(function b(){var B,ee;return L().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(B=e.response?e.response.id:e.id,!B){l.next=8;break}return l.next=4,Object(Pe.d)(e.response?e.response.id:e.uid);case 4:return ee=l.sent,l.abrupt("return",ee);case 8:return l.abrupt("return",!0);case 9:case"end":return l.stop()}},b)}));return function(){return g.apply(this,arguments)}}(),!me){p.next=5;break}return p.abrupt("return",new Promise(function(g,b){U.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:J.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var B=Object(d.a)(L().mark(function H(){var l;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,u();case 2:l=v.sent,A.b.success("\u5220\u9664\u6210\u529F"),g(!0);case 5:case"end":return v.stop()}},H)}));function ee(){return B.apply(this,arguments)}return ee}(),onCancel:function(){return g(!1)}})}));case 5:return p.next=7,u();case 7:return p.abrupt("return",p.sent);case 8:case"end":return p.stop()}},r)}));function s(r){return a.apply(this,arguments)}return s}()};function c(a){a.preventDefault(),a.stopPropagation()}return J.a.createElement("div",{className:"multi-upload ".concat(q||"")},J.a.createElement(Ee.a,G,J.a.createElement(ue.a,{disabled:i,type:"primary",ghost:!0},N),J.a.createElement("span",{onClick:c,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",_e,"M) ")))}},"7/Dv":function(Me,te,t){Me.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"7ahc":function(Me,te,t){"use strict";t.d(te,"a",function(){return de});var ge=t("k1fw"),Ee=t("0Owb"),Le=t("+L6B"),ue=t("2/Rp"),ve=t("y8nQ"),U=t("Vl3Y"),d=t("tJVT"),le=t("OaEy"),ne=t("2fM7"),P=t("q1tI"),A=t.n(P),I=t("VrN/"),oe=t.n(I),J=t("p77/"),Re=t.n(J),Pe=t("c5Ni"),j=t.n(Pe),L=ne.a.Option,ce={labelCol:{span:4},wrapperCol:{span:20}},C={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"]};te.b=function(F){var q=F.callback,X=F.onCancel,_e=Object(P.useState)("python"),K=Object(d.a)(_e,2),N=K[0],Q=K[1];function me(T){Q(C[T][1])}function R(T){q(T)}return A.a.createElement(U.a,Object(Ee.a)({},ce,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:R}),A.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},A.a.createElement(ne.a,{onChange:me},Object.keys(C).map(function(T){return A.a.createElement(L,{key:T,value:T},C[T][0])}))),A.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},A.a.createElement(de,{mode:N})),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(ue.a,{type:"ghost",onClick:X},"\u53D6\u6D88")))};function de(F){var q=F.value,X=F.onChange,_e=F.mode,K=F.options,N=K===void 0?{}:K,Q=Object(P.useRef)(),me=Object(P.useState)(),R=Object(d.a)(me,2),T=R[0],k=R[1];return Object(P.useEffect)(function(){if(T){var w=function(M){var i=M.getValue();X&&X(i)};return T.on("change",w),function(){T.off("change",w)}}},[T,X]),Object(P.useEffect)(function(){T&&T.setOption("mode",_e)},[T,_e]),Object(P.useEffect)(function(){T&&((q!==T.getValue()||q==="")&&setTimeout(function(){T.setValue(q||" ")},300))},[T,q]),Object(P.useEffect)(function(){if(Q.current&&!T){var w=oe.a.fromTextArea(Q.current,Object(ge.a)({mode:_e,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},N));k(w)}},[Q.current,T]),A.a.createElement("div",{className:"my-codemirror-container"},A.a.createElement("textarea",{ref:Q}))}},"9Bee":function(Me,te,t){"use strict";var ge=t("q1tI"),Ee=t.n(ge),Le=t("vg9a"),ue=t("tJVT"),ve=t("DlQD"),U=t.n(ve),d=t("rUJ1");function le(O,M){var i=O.match(/^(\s+)(?:```)/);if(i===null)return M;var n=i[1];return M.split(`
`).map(function(_){var E=_.match(/^\s+/);if(E===null)return _;var f=Object(ue.a)(E,1),D=f[0];return D.length>=n.length?_.slice(n.length):_}).join(`
`)}var ne=[],P=["<ul>"],A=new U.a.Renderer,I=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function oe(){ne.length=0,P=["<ul>"]}function J(O,M,i,n){if(M>=O.length||O[M].level<=i)return M;var _=O[M];n.push("<li><a href='#"+_.anchor+"'>"+_.text+"</a>"),M++;var E=[];return M=J(O,M,_.level,E),E.length>0&&(n.push("<ul>"),E.forEach(function(f){n.push(f)}),n.push("</ul>")),n.push("</li>"),M=J(O,M,i,n),M}function Re(){return J(ne,0,0,P),P.push("</ul>"),P.join("")}var Pe={heading:function(M){var i=I.exec(M);if(i)return{type:"heading",raw:i[0],depth:i[1].length,text:i[2]}},fences:function(M){var i=this.rules.block.fences.exec(M);if(i){var n=i[0],_=le(n,i[3]||""),E=i[2]?i[2].trim():i[2];if(["latex","katex","math"].indexOf(E)>=0){var f=ce(),D=_;_=f,C[f]={type:"block",expression:D}}return{type:"code",raw:n,lang:E,text:_}}}},j=/(?:\${2})([^\n`]+?)(?:\${2})/gi,L=0,ce=function(){return"__special_katext_id_".concat(L++,"__")},C={};function de(){return C}function F(){L=0,C={}}function q(O){return O=O.replace(j,function(M,i){var n=ce();return C[n]={type:"inline",expression:i},n}),O}var X=A.listitem;A.listitem=function(O){return X(q(O))};var _e=A.paragraph;A.paragraph=function(O){return _e(q(O))};var K=A.tablecell;A.tablecell=function(O,M){return K(q(O),M)},A.code=function(O,M,i){var n=(M||"").match(/\S*/)[0];return n?["latex","katex","math"].indexOf(n)>=0?"<p class='editormd-tex'>".concat(O,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(M,'">').concat(i?O:Object(d.escape)(O,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(i?O:Object(d.escape)(O,!0))+"</code></pre>"},A.heading=function(O,M,i){var n=this.options.headerPrefix+i.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ne.push({anchor:n,level:M,text:O}),"<h"+M+' id="'+n+'">'+O+"</h"+M+">"},U.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),U.a.use({tokenizer:Pe,renderer:A});var N=U.a,Q=t("SJMd"),me=t("m3rI"),R=t("Oy/b"),T=/<pre[^>]*>/g;function k(O){var M=document.createElement("div");return M.innerHTML=O,M.childNodes.length===0?"":M.childNodes[0].nodeValue}var w=te.a=function(O){var M=O.value,i=M===void 0?"":M,n=O.className,_=O.style,E=_===void 0?{}:_,f=String(i),D=Object(ge.useMemo)(function(){try{var a=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,s=/\"\/api\/attachments\/|\"\/attachments\/download\//g,r=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;f=f.replace(a,"("+me.a.API_SERVER+"/api/attachments/").replace(s,'"'+me.a.API_SERVER+"/api/attachments/").replace(r,'"'+me.a.API_SERVER+"/files/uploads/")}catch(m){}var e=N(f),u=de();return f.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",Re()),oe()),e=e.replace(/(__special_katext_id_\d+__)/g,function(m,p){var g=u[p],b=g.type,B=g.expression;return Object(R.renderToString)(k(B)||"",{displayMode:b==="block",throwOnError:!1,output:"html"})}),e=e.replace(/▁/g,"\u2581\u2581\u2581"),F(),e},[f]),G=Object(ge.useRef)();function c(a){var s=a.target;if(s.tagName.toUpperCase()==="A"){var r=s.getAttribute("href");if(r.startsWith("#")){a.preventDefault();var e=document.getElementById(r.replace("#",""));e&&e.scrollIntoView(!0)}}}return Object(ge.useEffect)(function(){if(G.current&&D&&(D.match(T)&&window.PR.prettyPrint()),G.current)return G.current.addEventListener("click",c),function(){G.current.removeEventListener("click",c),F(),oe()}},[D,G.current,c]),Ee.a.createElement("div",{ref:G,style:E,className:"".concat(n||""," markdown-body"),dangerouslySetInnerHTML:{__html:D}})}},"9VGf":function(Me,te,t){"use strict";t.d(te,"a",function(){return Le});var ge=t("q1tI"),Ee=t.n(ge);function Le(ue,ve){var U=Object(ge.useRef)();Object(ge.useEffect)(function(){U.current=ue}),Object(ge.useEffect)(function(){function d(){U.current()}if(ve!==null){var le=setInterval(d,ve);return function(){return clearInterval(le)}}},[ve])}},BjJ7:function(Me,te,t){"use strict";t.d(te,"d",function(){return Ee}),t.d(te,"c",function(){return Le}),t.d(te,"e",function(){return ue}),t.d(te,"b",function(){return ve}),t.d(te,"a",function(){return d});var ge=t("m3rI");function Ee(le){var ne=!0;if(le.length>0){for(var P=0;P<le.length;P++)if(le[P].compile_success==0||!le[P].compile_success){ne=!1;break}}else ne=!1;return ne}function Le(le){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],A=0;A<le.length;A++){var I=le[A],oe=ne?"".concat(ne,"/").concat(I.name):"".concat(I.name);P.push({title:I.name,isLeaf:!(I.type==="tree"),key:oe})}return P}function ue(le,ne,P){for(var A=0;A<le.length;A++){var I=le[A];if(I.key===ne){I.children=P;break}I.children&&ue(I.children,ne,P)}return le}function ve(le,ne,P){var A;return function(){var I=this,oe=arguments,J=function(){A=null,P||le.apply(I,oe)},Re=P&&!A;clearTimeout(A),A=setTimeout(J,ne),Re&&le.apply(I,oe)}}var U=!0,d=ge.a.API_SERVER},"C+DQ":function(Me,te,t){},CKgm:function(Me,te,t){"use strict";t.r(te);var ge=t("+L6B"),Ee=t("2/Rp"),Le=t("5NDa"),ue=t("5rEg"),ve=t("sPJy"),U=t("bE4q"),d=t("miYZ"),le=t("tsqr"),ne=t("9og8"),P=t("k1fw"),A=t("y8nQ"),I=t("Vl3Y"),oe=t("tJVT"),J=t("PpiC"),Re=t("OaEy"),Pe=t("2fM7"),j=t("q1tI"),L=t.n(j),ce=t("Ty5D"),C=t("9kvl"),de=t("55Ip"),F=t("Ot1p"),q=t("500L"),X=t("h+Ho"),_e=t("7/Dv"),K=t.n(_e);function N(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function(){return R};var R={},T=Object.prototype,k=T.hasOwnProperty,w=typeof Symbol=="function"?Symbol:{},O=w.iterator||"@@iterator",M=w.asyncIterator||"@@asyncIterator",i=w.toStringTag||"@@toStringTag";function n(l,o,v){return Object.defineProperty(l,o,{value:v,enumerable:!0,configurable:!0,writable:!0}),l[o]}try{n({},"")}catch(l){n=function(v,S,W){return v[S]=W}}function _(l,o,v,S){var W=o&&o.prototype instanceof D?o:D,x=Object.create(W.prototype),he=new B(S||[]);return x._invoke=function(Ce,Ae,se){var ye="suspendedStart";return function(we,y){if(ye==="executing")throw new Error("Generator is already running");if(ye==="completed"){if(we==="throw")throw y;return H()}for(se.method=we,se.arg=y;;){var ae=se.delegate;if(ae){var Y=p(ae,se);if(Y){if(Y===f)continue;return Y}}if(se.method==="next")se.sent=se._sent=se.arg;else if(se.method==="throw"){if(ye==="suspendedStart")throw ye="completed",se.arg;se.dispatchException(se.arg)}else se.method==="return"&&se.abrupt("return",se.arg);ye="executing";var Z=E(Ce,Ae,se);if(Z.type==="normal"){if(ye=se.done?"completed":"suspendedYield",Z.arg===f)continue;return{value:Z.arg,done:se.done}}Z.type==="throw"&&(ye="completed",se.method="throw",se.arg=Z.arg)}}}(l,v,he),x}function E(l,o,v){try{return{type:"normal",arg:l.call(o,v)}}catch(S){return{type:"throw",arg:S}}}R.wrap=_;var f={};function D(){}function G(){}function c(){}var a={};n(a,O,function(){return this});var s=Object.getPrototypeOf,r=s&&s(s(ee([])));r&&r!==T&&k.call(r,O)&&(a=r);var e=c.prototype=D.prototype=Object.create(a);function u(l){["next","throw","return"].forEach(function(o){n(l,o,function(v){return this._invoke(o,v)})})}function m(l,o){function v(W,x,he,Ce){var Ae=E(l[W],l,x);if(Ae.type!=="throw"){var se=Ae.arg,ye=se.value;return ye&&typeof ye=="object"&&k.call(ye,"__await")?o.resolve(ye.__await).then(function(we){v("next",we,he,Ce)},function(we){v("throw",we,he,Ce)}):o.resolve(ye).then(function(we){se.value=we,he(se)},function(we){return v("throw",we,he,Ce)})}Ce(Ae.arg)}var S;this._invoke=function(W,x){function he(){return new o(function(Ce,Ae){v(W,x,Ce,Ae)})}return S=S?S.then(he,he):he()}}function p(l,o){var v=l.iterator[o.method];if(v===void 0){if(o.delegate=null,o.method==="throw"){if(l.iterator.return&&(o.method="return",o.arg=void 0,p(l,o),o.method==="throw"))return f;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var S=E(v,l.iterator,o.arg);if(S.type==="throw")return o.method="throw",o.arg=S.arg,o.delegate=null,f;var W=S.arg;return W?W.done?(o[l.resultName]=W.value,o.next=l.nextLoc,o.method!=="return"&&(o.method="next",o.arg=void 0),o.delegate=null,f):W:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,f)}function g(l){var o={tryLoc:l[0]};1 in l&&(o.catchLoc=l[1]),2 in l&&(o.finallyLoc=l[2],o.afterLoc=l[3]),this.tryEntries.push(o)}function b(l){var o=l.completion||{};o.type="normal",delete o.arg,l.completion=o}function B(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(g,this),this.reset(!0)}function ee(l){if(l){var o=l[O];if(o)return o.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var v=-1,S=function W(){for(;++v<l.length;)if(k.call(l,v))return W.value=l[v],W.done=!1,W;return W.value=void 0,W.done=!0,W};return S.next=S}}return{next:H}}function H(){return{value:void 0,done:!0}}return G.prototype=c,n(e,"constructor",c),n(c,"constructor",G),G.displayName=n(c,i,"GeneratorFunction"),R.isGeneratorFunction=function(l){var o=typeof l=="function"&&l.constructor;return!!o&&(o===G||(o.displayName||o.name)==="GeneratorFunction")},R.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,c):(l.__proto__=c,n(l,i,"GeneratorFunction")),l.prototype=Object.create(e),l},R.awrap=function(l){return{__await:l}},u(m.prototype),n(m.prototype,M,function(){return this}),R.AsyncIterator=m,R.async=function(l,o,v,S,W){W===void 0&&(W=Promise);var x=new m(_(l,o,v,S),W);return R.isGeneratorFunction(o)?x:x.next().then(function(he){return he.done?he.value:x.next()})},u(e),n(e,i,"Generator"),n(e,O,function(){return this}),n(e,"toString",function(){return"[object Generator]"}),R.keys=function(l){var o=[];for(var v in l)o.push(v);return o.reverse(),function S(){for(;o.length;){var W=o.pop();if(W in l)return S.value=W,S.done=!1,S}return S.done=!0,S}},R.values=ee,B.prototype={constructor:B,reset:function(o){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!o)for(var v in this)v.charAt(0)==="t"&&k.call(this,v)&&!isNaN(+v.slice(1))&&(this[v]=void 0)},stop:function(){this.done=!0;var o=this.tryEntries[0].completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(o){if(this.done)throw o;var v=this;function S(se,ye){return he.type="throw",he.arg=o,v.next=se,ye&&(v.method="next",v.arg=void 0),!!ye}for(var W=this.tryEntries.length-1;W>=0;--W){var x=this.tryEntries[W],he=x.completion;if(x.tryLoc==="root")return S("end");if(x.tryLoc<=this.prev){var Ce=k.call(x,"catchLoc"),Ae=k.call(x,"finallyLoc");if(Ce&&Ae){if(this.prev<x.catchLoc)return S(x.catchLoc,!0);if(this.prev<x.finallyLoc)return S(x.finallyLoc)}else if(Ce){if(this.prev<x.catchLoc)return S(x.catchLoc,!0)}else{if(!Ae)throw new Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return S(x.finallyLoc)}}}},abrupt:function(o,v){for(var S=this.tryEntries.length-1;S>=0;--S){var W=this.tryEntries[S];if(W.tryLoc<=this.prev&&k.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var x=W;break}}x&&(o==="break"||o==="continue")&&x.tryLoc<=v&&v<=x.finallyLoc&&(x=null);var he=x?x.completion:{};return he.type=o,he.arg=v,x?(this.method="next",this.next=x.finallyLoc,f):this.complete(he)},complete:function(o,v){if(o.type==="throw")throw o.arg;return o.type==="break"||o.type==="continue"?this.next=o.arg:o.type==="return"?(this.rval=this.arg=o.arg,this.method="return",this.next="end"):o.type==="normal"&&v&&(this.next=v),f},finish:function(o){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.finallyLoc===o)return this.complete(S.completion,S.afterLoc),b(S),f}},catch:function(o){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.tryLoc===o){var W=S.completion;if(W.type==="throw"){var x=W.arg;b(S)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(o,v,S){return this.delegate={iterator:ee(o),resultName:v,nextLoc:S},this.method==="next"&&(this.arg=void 0),f}},R}var Q=Pe.a.Option,me=function(T){var k,w,O,M=T.forumsDetail,i=T.globalSetting,n=T.loading,_=T.dispatch,E=Object(J.a)(T,["forumsDetail","globalSetting","loading","dispatch"]),f=Object(ce.m)(),D=I.a.useForm(),G=Object(oe.a)(D,1),c=G[0],a=Object(j.useState)({}),s=Object(oe.a)(a,2),r=s[0],e=s[1],u=Object(j.useState)(0),m=Object(oe.a)(u,2),p=m[0],g=m[1],b=Object(j.useState)(!1),B=Object(oe.a)(b,2),ee=B[0],H=B[1],l=Object(j.useState)({}),o=Object(oe.a)(l,2),v=o[0],S=o[1],W=Object(j.useState)(1),x=Object(oe.a)(W,2),he=x[0],Ce=x[1];Object(j.useEffect)(function(){if(Ae(),f.memoId)H(!0),se();else{H(!1);var y={forum_id:5};e(Object(P.a)({},y)),c.setFieldsValue(Object(P.a)({},y))}},[f.memoId]);var Ae=function(){var y=Object(ne.a)(N().mark(function ae(){var Y;return N().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(X.f)({});case 2:Y=ie.sent,S(Y||{});case 4:case"end":return ie.stop()}},ae)}));return function(){return y.apply(this,arguments)}}(),se=function(){var y=Object(ne.a)(N().mark(function ae(){var Y,Z,ie;return N().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(X.e)({id:f.memoId});case 2:if(re.t0=re.sent,re.t0){re.next=5;break}re.t0={};case 5:Z=re.t0,ie={subject:Z.subject,content:Z.content,attachments:Object(q.a)(Z.attachments),forum_id:Z.forum_id,memo_tags:(Y=Z.memo_tags)===null||Y===void 0?void 0:Y.map(function(Se){return Se.id})},e(Object(P.a)({},ie)),c.setFieldsValue(Object(P.a)({},ie));case 9:case"end":return re.stop()}},ae)}));return function(){return y.apply(this,arguments)}}(),ye=function(){var y=Object(ne.a)(N().mark(function ae(Y){var Z,ie,Te,re;return N().wrap(function(be){for(;;)switch(be.prev=be.next){case 0:if(Te=Object(P.a)(Object(P.a)({id:ee?f.memoId:null},r),{},{attachment_ids:(Z=r.attachments)===null||Z===void 0||((ie=Z.filter(function(Ne){var Ie;return(Ie=Ne.response)===null||Ie===void 0?void 0:Ie.id}))===null||ie===void 0)?void 0:ie.map(function(Ne){var Ie;return(Ie=Ne.response)===null||Ie===void 0?void 0:Ie.id}),tags:r.memo_tags}),!ee){be.next=7;break}return be.next=4,Object(X.n)(Te);case 4:be.t0=be.sent,be.next=10;break;case 7:return be.next=9,Object(X.j)(Te);case 9:be.t0=be.sent;case 10:re=be.t0,g(0),(re==null?void 0:re.status)===0&&(le.b.success(re==null?void 0:re.message),he===1?C.c.push("/forums/".concat(ee?f==null?void 0:f.memoId:re==null?void 0:re.memo_id)):C.c.push("/forums/".concat(ee?f==null?void 0:f.memoId:re==null?void 0:re.memo_id,"/edit")));case 13:case"end":return be.stop()}},ae)}));return function(Y){return y.apply(this,arguments)}}(),we=function(){document.body.scrollIntoView(),window.location.href.includes("new")?C.c.goBack():C.c.push("/forums/".concat(f.memoId))};return L.a.createElement("section",{className:K.a.bg},L.a.createElement("section",{className:"animated fadeIn mb10"},L.a.createElement("aside",{className:"mt10"},L.a.createElement(U.a,{separator:"/"},L.a.createElement(U.a.Item,null,L.a.createElement(de.Link,{to:"/forums"},"\u4EA4\u6D41\u95EE\u7B54")),L.a.createElement(U.a.Item,null,"\u8BE6\u60C5")))),L.a.createElement("aside",{className:"bg-white font16 pt20 pb20 pl20"},ee?"\u7F16\u8F91\u8BDD\u9898":"\u53D1\u5E03\u8BDD\u9898"),L.a.createElement(I.a,{form:c,className:K.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(ae,Y){console.log(Y,"values"),e(Object(P.a)(Object(P.a)({},r),ae))},onFinish:ye,onFinishFailed:function(){g(0)}},L.a.createElement("div",{className:K.a.fieldWrap},L.a.createElement(I.a.Item,{name:"subject",label:L.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u540D\u79F0: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u540D\u79F0"}]},L.a.createElement(ue.a,{maxLength:50,suffix:"".concat(((k=r.subject)===null||k===void 0?void 0:k.length)||0,"/50")}))),L.a.createElement("div",{className:K.a.mdWrap},L.a.createElement(I.a.Item,{name:"content",label:L.a.createElement("span",{className:"font16"},"\u5185\u5BB9: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u5185\u5BB9"}]},L.a.createElement(F.a,{height:600,id:"forums-new-content",watch:!0,defaultValue:r.content})),L.a.createElement("div",null,L.a.createElement(I.a.Item,{name:"attachments",style:{width:350}},L.a.createElement(q.b,{showRemoveModal:!0})))),L.a.createElement("div",{className:K.a.mdWrap},L.a.createElement(I.a.Item,{name:"forum_id",label:L.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u7C7B\u578B: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u8BDD\u9898\u7C7B\u578B"}]},L.a.createElement(Pe.a,{style:{width:300}},v==null||((w=v.forums)===null||w===void 0)?void 0:w.map(function(y){return L.a.createElement(Q,{key:y.id,value:y.id},y.name)})))),r.forum_id===5&&L.a.createElement("div",{className:K.a.mdWrap},L.a.createElement(I.a.Item,{name:"memo_tags",label:L.a.createElement("span",{className:"font16"},"\u6280\u672F\u6807\u7B7E: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u6280\u672F\u6807\u7B7E"}]},L.a.createElement(Pe.a,{style:{width:300},placeholder:"\u8BF7\u9009\u62E9\u6280\u672F\u6807\u7B7E",mode:"multiple",tokenSeparators:[";"],filterOption:function(ae,Y){return Y.props.children.toLocaleLowerCase().indexOf(ae.toLocaleLowerCase())!=-1}},v==null||((O=v.tag_list)===null||O===void 0)?void 0:O.map(function(y){return L.a.createElement(Q,{key:y.id,value:y.id},y.name)})))),L.a.createElement("div",{className:K.a.backgroundFa},L.a.createElement("div",{className:"pt40 mb30"},L.a.createElement(I.a.Item,null,L.a.createElement(Ee.a,{size:"large",type:"primary",className:"".concat(K.a.button," mr20"),htmlType:"submit",loading:p===1,onClick:function(){Ce(1),g(1)}},"\u63D0\u4EA4"),L.a.createElement(Ee.a,{size:"large",type:"primary",className:"".concat(K.a.button," mr20"),htmlType:"submit",loading:p===2,onClick:function(){Ce(2),g(2)}},"\u4FDD\u5B58"),L.a.createElement(Ee.a,{size:"large",type:"primary",ghost:!0,className:"".concat(K.a.button," mr20"),onClick:we},"\u53D6\u6D88"))))))};te.default=Object(C.a)(function(R){var T=R.forumsDetail,k=R.loading,w=R.globalSetting;return{forumsDetail:T,globalSetting:w,loading:k.models.forumsDetail}})(me)},HmJG:function(Me,te,t){},M8RZ:function(Me,te,t){"use strict";t.d(te,"a",function(){return ne});var ge=t("fWQN"),Ee=t("mtLc"),Le=t("yKVA"),ue=t("879j"),ve=t("q1tI"),U=t.n(ve),d=t("i8i4"),le=t.n(d),ne=function(P){Object(Le.a)(I,P);var A=Object(ue.a)(I);function I(oe){var J;Object(ge.a)(this,I),J=A.call(this,oe);var Re=window.document;return J.node=Re.createElement("div"),Re.body.appendChild(J.node),J}return Object(Ee.a)(I,[{key:"render",value:function(){var J=this.props.children;return Object(d.createPortal)(J,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),I}(U.a.Component)},Ot1p:function(Me,te,t){"use strict";var ge=t("2qtc"),Ee=t("kLXV"),Le=t("rAM+"),ue=t("tJVT"),ve=t("jrin"),U=t("q1tI"),d=t.n(U),le=t("VrN/"),ne=t.n(le),P=t("bdgK"),A=t("p77/"),I=t("Bd2K"),oe=t("ELLl"),J=t("19Vz"),Re=t("lZu9"),Pe=t("kSUc"),j=t("9Bee"),L=t("0Owb"),ce=t("dejd"),C=t("C+DQ"),de=[{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 F(y){var ae=y.onActionCallback,Y=y.title,Z=y.icon,ie=y.actionName,Te=y.className,re=Te===void 0?"":Te,Se=y.children;function be(){ae(ie)}return d.a.createElement("a",{title:Y,className:re,onClick:be},d.a.createElement("i",{className:"md-iconfont ".concat(Z)}),Se)}var q=function(y){var ae=y.watch,Y=y.showNullButton,Z=y.onActionCallback,ie=y.fullScreen,Te=[].concat(de,[{title:"".concat(ae?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ae?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},Te.map(function(re,Se){return d.a.createElement("li",{key:Se},re.actionName?d.a.createElement(F,Object(L.a)({},re,{onActionCallback:Z})):d.a.createElement("span",{className:"v-line"}))}),Y?d.a.createElement("li",null,d.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Z},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(F,{icon:"".concat(ie?"icon-shrink":"icon-enlarge"),title:ie?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Z})))},X=t("M8RZ"),_e=t("+L6B"),K=t("2/Rp"),N=t("y8nQ"),Q=t("Vl3Y"),me=t("5NDa"),R=t("5rEg"),T={labelCol:{span:4},wrapperCol:{span:20}},k=function(y){var ae=y.callback,Y=y.onCancel;function Z(ie){ae(ie)}return d.a.createElement(Q.a,Object(L.a)({},T,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Z}),d.a.createElement(Q.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(R.a,null)),d.a.createElement(Q.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(R.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(K.a,{type:"ghost",onClick:Y},"\u53D6\u6D88")))},w=t("7ahc"),O=t("HmJG"),M=t("BjJ7"),i=Q.a.useForm,n={width:280,marginRight:10},_={labelCol:{span:5},wrapperCol:{span:19}},E=function(y){var ae=y.callback,Y=y.onCancel,Z=i(),ie=Object(ue.a)(Z,1),Te=ie[0];function re(Ne){ae(Ne)}function Se(Ne){Te.setFieldsValue({src:"/api/attachments/".concat(Ne.id)})}function be(Ne){var Ie=Ne.target.files[0];D(Ie,Se)}return d.a.createElement(Q.a,Object(L.a)({form:Te},_,{className:"upload-image-panel",onFinish:re}),d.a.createElement(Q.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(Q.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(R.a,{style:n})),d.a.createElement(f,{onFileChange:be}))),d.a.createElement(Q.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},d.a.createElement(R.a,{style:{width:264}})),d.a.createElement(Q.a.Item,{style:{textAlign:"right"}},d.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(K.a,{type:"ghost",onClick:Y},"\u53D6\u6D88")))};function f(y){var ae=y.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",accept:"image/*",onChange:ae}))}function D(y,ae){if(!y)throw new String("\u6CA1\u6709\u6587\u4EF6");var Y=new FormData;Y.append("editormd-image-file",y),Y.append("file_param_name","editormd-image-file"),Y.append("byxhr","true");var Z=new window.XMLHttpRequest;Z.withCredentials=!0,Z.addEventListener("load",function(ie){ae(JSON.parse(ie.target.responseText))},!1),Z.addEventListener("error",function(ie){console.error(ie)},!1),Z.open("POST","".concat(M.a,"/api/attachments.json")),Z.send(Y)}var G=t("giR+"),c=t("fyUT"),a=t("7Kak"),s=t("9yH6"),r=s.a.Group,e={margin:"0 8px"},u=function(y){var ae=y.callback,Y=y.onCancel;function Z(ie){ae(ie)}return d.a.createElement(Q.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Z},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:e},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:e},"\u884C\u6570"),d.a.createElement(Q.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(c.a,null)),d.a.createElement("span",{style:e},"\u5217\u6570"),d.a.createElement(Q.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(c.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(Q.a.Item,{name:"align"},d.a.createElement(r,null,d.a.createElement(s.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(s.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(s.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(s.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(K.a,{type:"ghost",onClick:Y},"\u53D6\u6D88")))},m="link",p="upload-image",g="code-block",b="add-table",B="------------",ee={default:B,left:":".concat(B),center:":".concat(B,":"),right:"".concat(B,":")},H=t("9VGf"),l,o;function v(){}var S=0,W=1e4,x="\u2581";function he(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ae=Ce?"Cmd":"Ctrl",se=(l={},Object(ve.a)(l,Ae+"-B","bold"),Object(ve.a)(l,Ae+"-I","italic"),l),ye=(o={},Object(ve.a)(o,m,"\u6DFB\u52A0\u94FE\u63A5"),Object(ve.a)(o,g,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(ve.a)(o,p,"\u6DFB\u52A0\u56FE\u7247"),Object(ve.a)(o,b,"\u6DFB\u52A0\u8868\u683C"),o),we=te.a=function(y){var ae=y.defaultValue,Y=ae===void 0?"":ae,Z=y.onChange,ie=y.width,Te=ie===void 0?"100%":ie,re=y.height,Se=re===void 0?400:re,be=y.miniToolbar,Ne=be===void 0?!1:be,Ie=y.isFocus,st=Ie===void 0?!1:Ie,qe=y.watch,lt=y.id,ze=lt===void 0?"markdown-editor-id":lt,ct=y.showResizeBar,wt=ct===void 0?!1:ct,dt=y.noStorage,St=dt===void 0?!1:dt,mt=y.showNullButton,Nt=mt===void 0?!1:mt,ft=y.fullScreen,Xe=ft===void 0?!1:ft,et=y.onBlur,tt=y.onCMBeforeChange,_t=y.className,It=_t===void 0?"":_t,ht=y.placeholder,Bt=ht===void 0?"":ht,pt=y.values,rt=pt===void 0?"":pt,Wt=Object(U.useState)(null),Et=Object(ue.a)(Wt,2),h=Et[0],xt=Et[1],Ft=Object(U.useState)(Y),vt=Object(ue.a)(Ft,2),nt=vt[0],He=vt[1],Kt=Object(U.useState)(qe),gt=Object(ue.a)(Kt,2),We=gt[0],yt=gt[1],kt=Object(U.useState)(Xe),Ot=Object(ue.a)(kt,2),xe=Ot[0],bt=Ot[1],Gt=Object(U.useState)(""),Pt=Object(ue.a)(Gt,2),Fe=Pt[0],Ke=Pt[1],Vt=Object(U.useState)(0),Lt=Object(ue.a)(Vt,2),ke=Lt[0],at=Lt[1],$t=Object(U.useState)(Se),Rt=Object(ue.a)($t,2),ot=Rt[0],Dt=Rt[1],zt=Object(U.useState)(!1),Ut=Object(ue.a)(zt,2),Qt=Ut[0],it=Ut[1],Ge=Object(U.useRef)(),Ve=Object(U.useRef)(),Ye=Object(U.useRef)(),Je=Object(U.useRef)();Object(U.useEffect)(function(){He(rt),h==null||h.setValue(rt)},[rt]),Object(U.useEffect)(function(){if(Ge.current){var V=function(fe,pe){var Oe=pe.clipboardData;if(Oe){var De=Oe.types.toString(),je=Oe.items;if(De==="text/html,Files"||De==="Files"){var Ue=je[1];De==="Files"&&(Ue=je[0]),Ue.kind==="file"&&Ue.type.match(/^image\//i)&&D(Ue.getAsFile(),function(Be){Be.id?$.replaceSelection("![,](/api/attachments/".concat(Be.id,")")):(Be==null?void 0:Be.status)===401&&(document.location.href="/user/login")})}else return!0}return!0},$=ne.a.fromTextArea(Ge.current,{mode:"markdown",inputStyle:"contenteditable",lineNumbers:!Ne,lineWrapping:!0,value:Y,autoCloseTags:!0,autoCloseBrackets:!0});return $.on("paste",V),xt($),function(){$.off("paste",V)}}},[]);var Ct=Object(U.useCallback)(function(){if(Ve.current)try{var V=Ve.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,$=Ve.current.getElementsByClassName("markdown-editor-body")[0];xe?$.style.height="calc(100vh - ".concat(V,"px)"):$.style.height="".concat(ot-V,"px")}catch(z){console.log(z,"---- to set md editor body height")}},[ot,Ve,xe]);Object(U.useEffect)(function(){function V(){var z=new P.default(function(fe){var pe=Object(Le.a)(fe),Oe;try{for(pe.s();!(Oe=pe.n()).done;){var De=Oe.value;(De.target.offsetHeight>0||De.target.offsetWidth>0)&&(Ct(),h.setSize("100%","100%"),h.refresh())}}catch(je){pe.e(je)}finally{pe.f()}});return z.observe(Ge.current.parentElement),z}if(h){var $=V();return function(){$.unobserve(Ge.current.parentElement)}}},[h,Ct]),Object(U.useEffect)(function(){if(h){for(var V=[],$=function(){var De=fe[z];pe=Object(ue.a)(De,2);var je=pe[0],Ue=pe[1],Be=Object(ve.a)({},je,function(){Mt(Ue)});V.push(Be),h.addKeyMap(Be)},z=0,fe=Object.entries(se);z<fe.length;z++){var pe;$()}return function(){var Oe=Object(Le.a)(V),De;try{for(Oe.s();!(De=Oe.n()).done;){var je=De.value;h.removeKeyMap(je)}}catch(Ue){Oe.e(Ue)}finally{Oe.f()}}}},[h]),Object(U.useEffect)(function(){Xe!==xe&&bt(Xe)},[Xe]),Object(H.a)(function(){if(!St&&ke>0){var V=new Date().getTime(),$=window.sessionStorage.getItem(ze);V>=ke+W&&(!$||$!==nt)&&(window.sessionStorage.setItem(ze,nt),it(!0))}},W),Object(U.useEffect)(function(){yt(qe)},[h,qe]),Object(U.useEffect)(function(){h&&(st&&h.focus())},[h,st]),Object(U.useEffect)(function(){if(We&&h){var V=function(fe){var pe=fe.target;if(Je.current){var Oe=pe.scrollTop/pe.scrollHeight;Je.current.scrollTop=Je.current.scrollHeight*Oe}},$=h.getScrollerElement();return $.addEventListener("scroll",V),function(){$.removeEventListener("scroll",V)}}},[h,We]),Object(U.useEffect)(function(){if(h&&tt){var V=function(z,fe){tt(z,fe)};return h.on("beforeChange",V),function(){h.off("beforeChange",V)}}},[h,tt]),Object(U.useEffect)(function(){if(h&&et){var V=function(){et(h.getValue())};return h.on("blur",V),function(){h.off("blur",V)}}},[h,et]),Object(U.useEffect)(function(){if(h){var V=function(z){var fe=z.getValue();He(fe),at(new Date().getTime()),z.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Z&&Z(fe)};return h.on("change",V),function(){h.off("change",V)}}},[h,Z]),Object(U.useEffect)(function(){h&&(Y==null?(h.setValue(""),He("")):Y!==h.getValue()&&(h.setValue(Y),He(Y)))},[h,Y]);var Mt=Object(U.useCallback)(function(V){var $=h.getCursor(),z=h.getSelection(),fe=z.split(`
`);switch(V){case"bold":return h.replaceSelection("**"+z+"**"),z===""&&h.setCursor($.line,$.ch+2),h.focus();case"italic":return h.replaceSelection("*"+z+"*"),z===""&&h.setCursor($.line,$.ch+1),h.focus();case"code":return h.replaceSelection("`"+z+"`"),z===""&&h.setCursor($.line,$.ch+1),h.focus();case"inline-latex":return h.replaceSelection("`$$"+z+"$$`"),z===""&&h.setCursor($.line,$.ch+3),h.focus();case"latex":return h.replaceSelection("```latex\n"+z+"\n```"),h.setCursor($.line+1,z.length+1),h.focus();case"line-break":return h.replaceSelection(`<br/>
`),h.focus();case"list-ul":return z===""?h.replaceSelection("- "+z):h.replaceSelection(fe.map(function(pe){return pe===""?"":"- ".concat(pe)}).join(`
`)),h.focus();case"list-ol":return z===""?h.replaceSelection("1. "+z):h.replaceSelection(fe.map(function(pe,Oe){return pe===""?"":"".concat(Oe+1,". ").concat(pe)}).join(`
`)),h.focus();case"add-null-ch":return z===""&&h.setCursor($.line,$.ch+1),h.replaceSelection(x),h.focus();case"eraser":return h.setValue(""),h.focus();case"trigger-watch":return yt(!We),h.focus();case"trigger-full-screen":return bt(!xe),h.focus();case m:Ke(m);return;case g:Ke(g);return;case p:Ke(p);return;case b:Ke(b);return;default:throw new Error}},[h,We,xe]),Qe=Object(U.useCallback)(function(V){Ke("");switch(Fe){case m:var $=V.title,z=V.link;return h.replaceSelection("[".concat($,"](").concat(z,")")),h.focus();case g:var fe=V.language,pe=V.content;return h.replaceSelection(["```"+fe,pe,"```"].join(`
`)),h.focus();case p:var Oe=V.src,De=V.alt;return h.replaceSelection("![ ".concat(De," ]( ").concat(Oe,' "').concat(De,'" )')),h.focus();case b:for(var je=V.row,Ue=V.col,Be=V.align,ut=`
`,Ze=0;Ze<je;Ze++){for(var At=[],Tt=[],jt=0;jt<Ue;jt++)Ze===1&&Tt.push(ee[Be]),At.push(" ");Ze===1&&(ut+="| ".concat(Tt.join(" | "),` |
`)),ut+="| ".concat(At.join(Ue===1?"":" | "),` |
`)}return h.replaceSelection(ut+`
`),h.focus();default:throw new Error}},[h,Fe]),Xt=Object(U.useMemo)(function(){switch(Fe){case m:return d.a.createElement(k,{callback:Qe,onCancel:$e});case g:return d.a.createElement(w.b,{callback:Qe,onCancel:$e});case p:return d.a.createElement(E,{callback:Qe,onCancel:$e});case b:return d.a.createElement(u,{callback:Qe,onCancel:$e});default:return null}},[Fe]);function $e(){Ke("")}Object(U.useEffect)(function(){if(Ye.current){var V=function(je){pe=!0,Oe=je.pageY},$=function(){pe=!1},z=function(je){if(pe){var Ue=je.pageY-Oe;Ue<0&&(Ue=0),Ue>300&&(Ue=300);var Be=Se+Ue+"px";Dt(Be)}},fe=Ye.current,pe=!1,Oe=0;return fe.addEventListener("mousedown",V),document.addEventListener("mousemove",z),document.addEventListener("mouseup",$),function(){fe.removeEventListener("mousedown",V),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",$)}}},[h,Ye]),Object(U.useEffect)(function(){Dt(Se)},[Se]);var Ht=he(Te),Yt=he(ot),Jt={width:Ht,height:Yt},Zt=Object(U.useMemo)(function(){if(ke){var V=new Date(ke),$=V.getHours(),z=V.getMinutes(),fe=V.getSeconds();return $=$<10?"0"+$:$,z=z<10?"0"+z:z,fe=fe<10?"0"+fe:fe,"".concat($,":").concat(z,":").concat(fe)}return 0},[ke]);function qt(){window.sessionStorage.removeItem(ze),it(!1),at(0)}function er(){it(!1),at(0),h.setValue(window.sessionStorage.getItem(ze))}return d.a.createElement(U.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ve},d.a.createElement("div",{className:"markdown-editor-container ".concat(It," ").concat(We?"on-preview":""," ").concat(Ne?"mini":""," ").concat(xe?"full-screen":""),style:Jt},d.a.createElement(q,{watch:We,fullScreen:xe,showNullButton:Nt,onActionCallback:Mt}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Ge,placeholder:Bt})),We?d.a.createElement("div",{ref:Je,className:"preview-container"},d.a.createElement(j.a,{value:nt})):null))),wt?d.a.createElement("a",{ref:Ye,className:"editor-resize"}):null,d.a.createElement(X.a,null,ye[Fe]?d.a.createElement(Ee.a,{centered:!0,title:ye[Fe],visible:!0,onCancel:$e,footer:null},Xt):null))}},dejd:function(Me,te,t){},kSUc:function(Me,te,t){},wzkS:function(Me,te,t){"use strict";t.d(te,"c",function(){return ue}),t.d(te,"b",function(){return ve}),t.d(te,"d",function(){return U}),t.d(te,"a",function(){return le}),t.d(te,"e",function(){return ne});var ge=t("9og8"),Ee=t("ErOA");function Le(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Le=function(){return P};var P={},A=Object.prototype,I=A.hasOwnProperty,oe=typeof Symbol=="function"?Symbol:{},J=oe.iterator||"@@iterator",Re=oe.asyncIterator||"@@asyncIterator",Pe=oe.toStringTag||"@@toStringTag";function j(i,n,_){return Object.defineProperty(i,n,{value:_,enumerable:!0,configurable:!0,writable:!0}),i[n]}try{j({},"")}catch(i){j=function(_,E,f){return _[E]=f}}function L(i,n,_,E){var f=n&&n.prototype instanceof de?n:de,D=Object.create(f.prototype),G=new w(E||[]);return D._invoke=function(c,a,s){var r="suspendedStart";return function(e,u){if(r==="executing")throw new Error("Generator is already running");if(r==="completed"){if(e==="throw")throw u;return M()}for(s.method=e,s.arg=u;;){var m=s.delegate;if(m){var p=R(m,s);if(p){if(p===C)continue;return p}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(r==="suspendedStart")throw r="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);r="executing";var g=ce(c,a,s);if(g.type==="normal"){if(r=s.done?"completed":"suspendedYield",g.arg===C)continue;return{value:g.arg,done:s.done}}g.type==="throw"&&(r="completed",s.method="throw",s.arg=g.arg)}}}(i,_,G),D}function ce(i,n,_){try{return{type:"normal",arg:i.call(n,_)}}catch(E){return{type:"throw",arg:E}}}P.wrap=L;var C={};function de(){}function F(){}function q(){}var X={};j(X,J,function(){return this});var _e=Object.getPrototypeOf,K=_e&&_e(_e(O([])));K&&K!==A&&I.call(K,J)&&(X=K);var N=q.prototype=de.prototype=Object.create(X);function Q(i){["next","throw","return"].forEach(function(n){j(i,n,function(_){return this._invoke(n,_)})})}function me(i,n){function _(f,D,G,c){var a=ce(i[f],i,D);if(a.type!=="throw"){var s=a.arg,r=s.value;return r&&typeof r=="object"&&I.call(r,"__await")?n.resolve(r.__await).then(function(e){_("next",e,G,c)},function(e){_("throw",e,G,c)}):n.resolve(r).then(function(e){s.value=e,G(s)},function(e){return _("throw",e,G,c)})}c(a.arg)}var E;this._invoke=function(f,D){function G(){return new n(function(c,a){_(f,D,c,a)})}return E=E?E.then(G,G):G()}}function R(i,n){var _=i.iterator[n.method];if(_===void 0){if(n.delegate=null,n.method==="throw"){if(i.iterator.return&&(n.method="return",n.arg=void 0,R(i,n),n.method==="throw"))return C;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return C}var E=ce(_,i.iterator,n.arg);if(E.type==="throw")return n.method="throw",n.arg=E.arg,n.delegate=null,C;var f=E.arg;return f?f.done?(n[i.resultName]=f.value,n.next=i.nextLoc,n.method!=="return"&&(n.method="next",n.arg=void 0),n.delegate=null,C):f:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,C)}function T(i){var n={tryLoc:i[0]};1 in i&&(n.catchLoc=i[1]),2 in i&&(n.finallyLoc=i[2],n.afterLoc=i[3]),this.tryEntries.push(n)}function k(i){var n=i.completion||{};n.type="normal",delete n.arg,i.completion=n}function w(i){this.tryEntries=[{tryLoc:"root"}],i.forEach(T,this),this.reset(!0)}function O(i){if(i){var n=i[J];if(n)return n.call(i);if(typeof i.next=="function")return i;if(!isNaN(i.length)){var _=-1,E=function f(){for(;++_<i.length;)if(I.call(i,_))return f.value=i[_],f.done=!1,f;return f.value=void 0,f.done=!0,f};return E.next=E}}return{next:M}}function M(){return{value:void 0,done:!0}}return F.prototype=q,j(N,"constructor",q),j(q,"constructor",F),F.displayName=j(q,Pe,"GeneratorFunction"),P.isGeneratorFunction=function(i){var n=typeof i=="function"&&i.constructor;return!!n&&(n===F||(n.displayName||n.name)==="GeneratorFunction")},P.mark=function(i){return Object.setPrototypeOf?Object.setPrototypeOf(i,q):(i.__proto__=q,j(i,Pe,"GeneratorFunction")),i.prototype=Object.create(N),i},P.awrap=function(i){return{__await:i}},Q(me.prototype),j(me.prototype,Re,function(){return this}),P.AsyncIterator=me,P.async=function(i,n,_,E,f){f===void 0&&(f=Promise);var D=new me(L(i,n,_,E),f);return P.isGeneratorFunction(n)?D:D.next().then(function(G){return G.done?G.value:D.next()})},Q(N),j(N,Pe,"Generator"),j(N,J,function(){return this}),j(N,"toString",function(){return"[object Generator]"}),P.keys=function(i){var n=[];for(var _ in i)n.push(_);return n.reverse(),function E(){for(;n.length;){var f=n.pop();if(f in i)return E.value=f,E.done=!1,E}return E.done=!0,E}},P.values=O,w.prototype={constructor:w,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!n)for(var _ in this)_.charAt(0)==="t"&&I.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=void 0)},stop:function(){this.done=!0;var n=this.tryEntries[0].completion;if(n.type==="throw")throw n.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var _=this;function E(s,r){return G.type="throw",G.arg=n,_.next=s,r&&(_.method="next",_.arg=void 0),!!r}for(var f=this.tryEntries.length-1;f>=0;--f){var D=this.tryEntries[f],G=D.completion;if(D.tryLoc==="root")return E("end");if(D.tryLoc<=this.prev){var c=I.call(D,"catchLoc"),a=I.call(D,"finallyLoc");if(c&&a){if(this.prev<D.catchLoc)return E(D.catchLoc,!0);if(this.prev<D.finallyLoc)return E(D.finallyLoc)}else if(c){if(this.prev<D.catchLoc)return E(D.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return E(D.finallyLoc)}}}},abrupt:function(n,_){for(var E=this.tryEntries.length-1;E>=0;--E){var f=this.tryEntries[E];if(f.tryLoc<=this.prev&&I.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var D=f;break}}D&&(n==="break"||n==="continue")&&D.tryLoc<=_&&_<=D.finallyLoc&&(D=null);var G=D?D.completion:{};return G.type=n,G.arg=_,D?(this.method="next",this.next=D.finallyLoc,C):this.complete(G)},complete:function(n,_){if(n.type==="throw")throw n.arg;return n.type==="break"||n.type==="continue"?this.next=n.arg:n.type==="return"?(this.rval=this.arg=n.arg,this.method="return",this.next="end"):n.type==="normal"&&_&&(this.next=_),C},finish:function(n){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.finallyLoc===n)return this.complete(E.completion,E.afterLoc),k(E),C}},catch:function(n){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc===n){var f=E.completion;if(f.type==="throw"){var D=f.arg;k(E)}return D}}throw new Error("illegal catch attempt")},delegateYield:function(n,_,E){return this.delegate={iterator:O(n),resultName:_,nextLoc:E},this.method==="next"&&(this.arg=void 0),C}},P}function ue(P){return Object(Ee.c)("libraries/".concat(P,".json"))}function ve(){return Object(Ee.c)("library_tags.json")}function U(P){return d.apply(this,arguments)}function d(){return d=Object(ge.a)(Le().mark(function P(A){var I;return Le().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(Ee.b)("attachments/".concat(A,".json"));case 2:return I=J.sent,J.abrupt("return",I.status===0);case 4:case"end":return J.stop()}},P)})),d.apply(this,arguments)}function le(P){return Object(Ee.f)("libraries.json",P)}function ne(P,A){return Object(Ee.g)("libraries/".concat(P,".json"),A)}},y5JW:function(Me,te,t){"use strict";t.d(te,"c",function(){return Re}),t.d(te,"a",function(){return Pe});var ge=t("DZo9"),Ee=t("8z0m"),Le=t("+L6B"),ue=t("2/Rp"),ve=t("9og8"),U=t("k1fw"),d=t("oBTY"),le=t("miYZ"),ne=t("tsqr"),P=t("q1tI"),A=t.n(P),I=t("m3rI"),oe=t("wzkS");function J(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */J=function(){return j};var j={},L=Object.prototype,ce=L.hasOwnProperty,C=typeof Symbol=="function"?Symbol:{},de=C.iterator||"@@iterator",F=C.asyncIterator||"@@asyncIterator",q=C.toStringTag||"@@toStringTag";function X(c,a,s){return Object.defineProperty(c,a,{value:s,enumerable:!0,configurable:!0,writable:!0}),c[a]}try{X({},"")}catch(c){X=function(s,r,e){return s[r]=e}}function _e(c,a,s,r){var e=a&&a.prototype instanceof Q?a:Q,u=Object.create(e.prototype),m=new f(r||[]);return u._invoke=function(p,g,b){var B="suspendedStart";return function(ee,H){if(B==="executing")throw new Error("Generator is already running");if(B==="completed"){if(ee==="throw")throw H;return G()}for(b.method=ee,b.arg=H;;){var l=b.delegate;if(l){var o=n(l,b);if(o){if(o===N)continue;return o}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(B==="suspendedStart")throw B="completed",b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);B="executing";var v=K(p,g,b);if(v.type==="normal"){if(B=b.done?"completed":"suspendedYield",v.arg===N)continue;return{value:v.arg,done:b.done}}v.type==="throw"&&(B="completed",b.method="throw",b.arg=v.arg)}}}(c,s,m),u}function K(c,a,s){try{return{type:"normal",arg:c.call(a,s)}}catch(r){return{type:"throw",arg:r}}}j.wrap=_e;var N={};function Q(){}function me(){}function R(){}var T={};X(T,de,function(){return this});var k=Object.getPrototypeOf,w=k&&k(k(D([])));w&&w!==L&&ce.call(w,de)&&(T=w);var O=R.prototype=Q.prototype=Object.create(T);function M(c){["next","throw","return"].forEach(function(a){X(c,a,function(s){return this._invoke(a,s)})})}function i(c,a){function s(e,u,m,p){var g=K(c[e],c,u);if(g.type!=="throw"){var b=g.arg,B=b.value;return B&&typeof B=="object"&&ce.call(B,"__await")?a.resolve(B.__await).then(function(ee){s("next",ee,m,p)},function(ee){s("throw",ee,m,p)}):a.resolve(B).then(function(ee){b.value=ee,m(b)},function(ee){return s("throw",ee,m,p)})}p(g.arg)}var r;this._invoke=function(e,u){function m(){return new a(function(p,g){s(e,u,p,g)})}return r=r?r.then(m,m):m()}}function n(c,a){var s=c.iterator[a.method];if(s===void 0){if(a.delegate=null,a.method==="throw"){if(c.iterator.return&&(a.method="return",a.arg=void 0,n(c,a),a.method==="throw"))return N;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var r=K(s,c.iterator,a.arg);if(r.type==="throw")return a.method="throw",a.arg=r.arg,a.delegate=null,N;var e=r.arg;return e?e.done?(a[c.resultName]=e.value,a.next=c.nextLoc,a.method!=="return"&&(a.method="next",a.arg=void 0),a.delegate=null,N):e:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,N)}function _(c){var a={tryLoc:c[0]};1 in c&&(a.catchLoc=c[1]),2 in c&&(a.finallyLoc=c[2],a.afterLoc=c[3]),this.tryEntries.push(a)}function E(c){var a=c.completion||{};a.type="normal",delete a.arg,c.completion=a}function f(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(_,this),this.reset(!0)}function D(c){if(c){var a=c[de];if(a)return a.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var s=-1,r=function e(){for(;++s<c.length;)if(ce.call(c,s))return e.value=c[s],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:G}}function G(){return{value:void 0,done:!0}}return me.prototype=R,X(O,"constructor",R),X(R,"constructor",me),me.displayName=X(R,q,"GeneratorFunction"),j.isGeneratorFunction=function(c){var a=typeof c=="function"&&c.constructor;return!!a&&(a===me||(a.displayName||a.name)==="GeneratorFunction")},j.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,R):(c.__proto__=R,X(c,q,"GeneratorFunction")),c.prototype=Object.create(O),c},j.awrap=function(c){return{__await:c}},M(i.prototype),X(i.prototype,F,function(){return this}),j.AsyncIterator=i,j.async=function(c,a,s,r,e){e===void 0&&(e=Promise);var u=new i(_e(c,a,s,r),e);return j.isGeneratorFunction(a)?u:u.next().then(function(m){return m.done?m.value:u.next()})},M(O),X(O,q,"Generator"),X(O,de,function(){return this}),X(O,"toString",function(){return"[object Generator]"}),j.keys=function(c){var a=[];for(var s in c)a.push(s);return a.reverse(),function r(){for(;a.length;){var e=a.pop();if(e in c)return r.value=e,r.done=!1,r}return r.done=!0,r}},j.values=D,f.prototype={constructor:f,reset:function(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!a)for(var s in this)s.charAt(0)==="t"&&ce.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if(a.type==="throw")throw a.arg;return this.rval},dispatchException:function(a){if(this.done)throw a;var s=this;function r(b,B){return m.type="throw",m.arg=a,s.next=b,B&&(s.method="next",s.arg=void 0),!!B}for(var e=this.tryEntries.length-1;e>=0;--e){var u=this.tryEntries[e],m=u.completion;if(u.tryLoc==="root")return r("end");if(u.tryLoc<=this.prev){var p=ce.call(u,"catchLoc"),g=ce.call(u,"finallyLoc");if(p&&g){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(p){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!g)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(a,s){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&ce.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var u=e;break}}u&&(a==="break"||a==="continue")&&u.tryLoc<=s&&s<=u.finallyLoc&&(u=null);var m=u?u.completion:{};return m.type=a,m.arg=s,u?(this.method="next",this.next=u.finallyLoc,N):this.complete(m)},complete:function(a,s){if(a.type==="throw")throw a.arg;return a.type==="break"||a.type==="continue"?this.next=a.arg:a.type==="return"?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):a.type==="normal"&&s&&(this.next=s),N},finish:function(a){for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s];if(r.finallyLoc===a)return this.complete(r.completion,r.afterLoc),E(r),N}},catch:function(a){for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s];if(r.tryLoc===a){var e=r.completion;if(e.type==="throw"){var u=e.arg;E(r)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(a,s,r){return this.delegate={iterator:D(a),resultName:s,nextLoc:r},this.method==="next"&&(this.arg=void 0),N}},j}var Re="\u3000\u3000";function Pe(j){var L=["Bytes","KB","MB","GB","TB"];if(j==0)return"0 Byte";var ce=parseInt(""+Math.floor(Math.log(j)/Math.log(1024)),10);return(j/Math.pow(1024,ce)).toFixed(1)+" "+L[ce]}te.b=function(j){var L=j.value,ce=L===void 0?[]:L,C=j.onChange,de=j.className,F=j.maxSize,q=F===void 0?150:F,X=j.title,_e=X===void 0?"\u6587\u4EF6\u4E0A\u4F20":X,K=j.accept,N=K===void 0?null:K,Q={multiple:!1,fileList:ce,accept:N,withCredentials:!0,beforeUpload:function(T){var k=T.size/1024/1024;return k<q?!0:(ne.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(q,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},action:"".concat(I.a.API_SERVER,"/api/attachments.json"),onChange:function(T){var k=Object(d.a)(T.fileList);k=k.map(function(w){return w.name.indexOf(Re)===-1&&(w.name="".concat(w.name).concat(Re).concat(Pe(w.size))),Object(U.a)({},w)}),C(k)},onRemove:function(){var R=Object(ve.a)(J().mark(function k(w){var O,M;return J().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(O=w.response?w.response.id:w.uid,!O){n.next=8;break}return n.next=4,Object(oe.d)(w.response?w.response.id:w.id);case 4:return M=n.sent,n.abrupt("return",M);case 8:return n.abrupt("return",!0);case 9:case"end":return n.stop()}},k)}));function T(k){return R.apply(this,arguments)}return T}()};function me(R){R.preventDefault(),R.stopPropagation()}return A.a.createElement("div",{className:"single-upload ".concat(de||"")},A.a.createElement(Ee.a,Q,A.a.createElement(ue.a,{type:"primary",title:ce.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:ce.length>0,ghost:!0},_e),A.a.createElement("span",{onClick:me,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",q,"M) ")))}}}]);