(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{"5oB3":function(Q,A,a){Q.exports={flex_box_center:"flex_box_center___2WENa",flex_space_between:"flex_space_between___32o_C",flex_box_vertical_center:"flex_box_vertical_center___VReNJ",flex_box_center_end:"flex_box_center_end___VidHP",flex_box_column:"flex_box_column___7bh0_",guidance:"guidance___1zlCK",title:"title___TLK56",u:"u___1YcNG",active:"active___2cPfY",content:"content___3PW9_",btn:"btn___26Rnl"}},"9Bee":function(Q,A,a){"use strict";var C=a("q1tI"),Z=a.n(C),ue=a("vg9a"),q=a("tJVT"),ee=a("DlQD"),h=a.n(ee),H=a("rUJ1");function E(e,t){var n=e.match(/^(\s+)(?:```)/);if(n===null)return t;var r=n[1];return t.split(`
`).map(function(s){var l=s.match(/^\s+/);if(l===null)return s;var i=Object(q.a)(l,1),d=i[0];return d.length>=r.length?s.slice(r.length):s}).join(`
`)}var I=[],_=["<ul>"],o=new h.a.Renderer,te=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function k(){I.length=0,_=["<ul>"]}function N(e,t,n,r){if(t>=e.length||e[t].level<=n)return t;var s=e[t];r.push("<li><a href='#"+s.anchor+"'>"+s.text+"</a>"),t++;var l=[];return t=N(e,t,s.level,l),l.length>0&&(r.push("<ul>"),l.forEach(function(i){r.push(i)}),r.push("</ul>")),r.push("</li>"),t=N(e,t,n,r),t}function ae(){return N(I,0,0,_),_.push("</ul>"),_.join("")}var m={heading:function(t){var n=te.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[1].length,text:n[2]}},fences:function(t){var n=this.rules.block.fences.exec(t);if(n){var r=n[0],s=E(r,n[3]||""),l=n[2]?n[2].trim():n[2];if(["latex","katex","math"].indexOf(l)>=0){var i=B(),d=s;s=i,x[i]={type:"block",expression:d}}return{type:"code",raw:r,lang:l,text:s}}}},ne=/(?:\${2})([^\n`]+?)(?:\${2})/gi,J=0,B=function(){return"__special_katext_id_".concat(J++,"__")},x={};function w(){return x}function O(){J=0,x={}}function y(e){return e=e.replace(ne,function(t,n){var r=B();return x[r]={type:"inline",expression:n},r}),e}var S=o.listitem;o.listitem=function(e){return S(y(e))};var W=o.paragraph;o.paragraph=function(e){return W(y(e))};var c=o.tablecell;o.tablecell=function(e,t){return c(y(e),t)},o.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:Object(H.escape)(e,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(n?e:Object(H.escape)(e,!0))+"</code></pre>"},o.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return I.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},h.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:m,renderer:o});var _e=h.a,ie=a("SJMd"),b=a("m3rI"),P=a("Oy/b"),K=/<pre[^>]*>/g;function re(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes.length===0?"":t.childNodes[0].nodeValue}var oe=A.a=function(e){var t=e.value,n=t===void 0?"":t,r=e.className,s=e.style,l=s===void 0?{}:s,i=String(n),d=Object(C.useMemo)(function(){try{var U=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,g=/\"\/api\/attachments\/|\"\/attachments\/download\//g,M=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;i=i.replace(U,"("+b.a.API_SERVER+"/api/attachments/").replace(g,'"'+b.a.API_SERVER+"/api/attachments/").replace(M,'"'+b.a.API_SERVER+"/files/uploads/")}catch(G){}var u=_e(i),se=w();return i.match(/\[TOC\]/)&&(u=u.replace("<p>[TOC]</p>",ae()),k()),u=u.replace(/(__special_katext_id_\d+__)/g,function(G,L){var F=se[L],Y=F.type,j=F.expression;return Object(P.renderToString)(re(j)||"",{displayMode:Y==="block",throwOnError:!1,output:"html"})}),u=u.replace(/▁/g,"\u2581\u2581\u2581"),O(),u},[i]),f=Object(C.useRef)();function T(U){var g=U.target;if(g.tagName.toUpperCase()==="A"){var M=g.getAttribute("href");if(M.startsWith("#")){U.preventDefault();var u=document.getElementById(M.replace("#",""));u&&u.scrollIntoView(!0)}}}return Object(C.useEffect)(function(){if(f.current&&d&&(d.match(K)&&window.PR.prettyPrint()),f.current)return f.current.addEventListener("click",T),function(){f.current.removeEventListener("click",T),O(),k()}},[d,f.current,T]),Z.a.createElement("div",{ref:f,style:l,className:"".concat(r||""," markdown-body"),dangerouslySetInnerHTML:{__html:d}})}},ObO0:function(Q,A,a){"use strict";a.r(A);var C=a("cWXX"),Z=a("/ezw"),ue=a("+L6B"),q=a("2/Rp"),ee=a("WmNS"),h=a.n(ee),H=a("9og8"),E=a("tJVT"),I=a("PpiC"),_=a("q1tI"),o=a.n(_),te=a("Ty5D"),k=a("9kvl"),N=a("1vsH"),ae=a("5oB3"),m=a.n(ae),ne=a("ErOA"),J=a("m3rI"),B=a("9Bee"),x=function(O){var y,S,W,c=O.user,_e=Object(I.a)(O,["user"]),ie=Object(_.useState)(1),b=Object(E.a)(ie,2),P=b[0],K=b[1],re=Object(_.useState)(!1),oe=Object(E.a)(re,2),e=oe[0],t=oe[1],n=Object(_.useState)(!1),r=Object(E.a)(n,2),s=r[0],l=r[1],i=Object(_.useState)(""),d=Object(E.a)(i,2),f=d[0],T=d[1],U=Object(_.useState)(!0),g=Object(E.a)(U,2),M=g[0],u=g[1],se=Object(_.useState)([{},{}]),G=Object(E.a)(se,2),L=G[0],F=G[1],Y=Object(te.l)(),j=Y.pathname;console.log(Y,"location"),Object(_.useEffect)(function(){var p;(c==null||((p=c.userInfo)===null||p===void 0)?void 0:p.identity)&&ce()},[c==null||((y=c.userInfo)===null||y===void 0)?void 0:y.identity]),Object(_.useEffect)(function(){de()},[]);var ce=function(){if(j.includes("classrooms")){var v;(c==null||((v=c.userInfo)===null||v===void 0)?void 0:v.identity)==="student"&&(t(!0),K(2));return}if(j.includes("paths")){l(!0);return}},de=function(){var p=Object(H.a)(h.a.mark(function v(z){var R,$,D,le;return h.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(ne.a)("/api/introductions.json",{method:"get"});case 2:R=V.sent,(R==null?void 0:R.introductions)&&($=null,j.includes("classrooms")&&($="course",T("\u6559\u5B66\u8BFE\u5802")),j.includes("paths")&&($="subject",T("\u5B9E\u8DF5\u8BFE\u7A0B")),D=R.introductions,le=[D==null?void 0:D.find(function(X){return X.clazz==="teacher"&&X.page_type===$}),D==null?void 0:D.find(function(X){return X.clazz==="student"&&X.page_type===$})],F(le)),u(!1);case 5:case"end":return V.stop()}},v)}));return function(z){return p.apply(this,arguments)}}(),me=function(){var v,z,R=J.a.API_SERVER+"/api/attachments/"+(P===1?(v=L[0])===null||v===void 0?void 0:v.attachment_id:(z=L[1])===null||z===void 0?void 0:z.attachment_id);Object(N.o)("",R)};return o.a.createElement("section",{className:m.a.guidance},o.a.createElement(Z.a,{loading:M,active:!0,paragraph:{rows:5}},o.a.createElement("div",{className:m.a.title},f,"\u65B0\u624B\u6307\u5F15"),o.a.createElement("ul",{className:m.a.u},!e&&o.a.createElement("li",{onClick:function(){return K(1)},className:P===1?m.a.active:""},"\u6559\u5E08\u7248"),!s&&o.a.createElement("li",{onClick:function(){return K(2)},className:P===2?m.a.active:""},"\u5B66\u751F\u7248")),P===1&&o.a.createElement("div",{className:m.a.content},o.a.createElement(B.a,{value:((S=L[0])===null||S===void 0?void 0:S.content)||""})),P===2&&o.a.createElement("div",{className:m.a.content},o.a.createElement(B.a,{value:((W=L[1])===null||W===void 0?void 0:W.content)||""})),o.a.createElement("div",{className:m.a.btn},o.a.createElement(q.a,{type:"primary",onClick:me},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};A.default=Object(k.a)(function(w){var O=w.user;return{user:O}})(x)}}]);
