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.
5 lines
14 KiB
5 lines
14 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{"5oB3":function(le,Q,l){le.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(le,Q,l){"use strict";var oe=l("k1fw"),z=l("q1tI"),ie=l.n(z),ce=l("vg9a"),de=l("tJVT"),k=l("DlQD"),J=l.n(k),j=l("rUJ1");function y(i,u){var s=i.match(/^(\s+)(?:```)/);if(s===null)return u;var c=s[1];return u.split(`
|
|
`).map(function(_){var O=_.match(/^\s+/);if(O===null)return _;var L=Object(de.a)(O,1),A=L[0];return A.length>=c.length?_.slice(c.length):_}).join(`
|
|
`)}var Z=[],Y=["<ul>"],U=new J.a.Renderer,_e=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){Z.length=0,Y=["<ul>"]}var ue={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function q(i,u,s,c){if(u>=i.length||i[u].level<=s)return u;var _=i[u];c.push("<li><a href='#"+_.anchor+"'>"+_.text+"</a>"),u++;var O=[];return u=q(i,u,_.level,O),O.length>0&&(c.push("<ul>"),O.forEach(function(L){c.push(L)}),c.push("</ul>")),c.push("</li>"),u=q(i,u,s,c),u}function se(){return q(Z,0,0,Y),Y.push("</ul>"),Y.join("")}var ee={heading:function(u){var s=_e.exec(u);if(s)return{type:"heading",raw:s[0],depth:s[1].length,text:s[2]}},fences:function(u){var s=this.rules.block.fences.exec(u);if(s){var c=s[0],_=y(c,s[3]||""),O=s[2]?s[2].trim():s[2];if(["latex","katex","math"].indexOf(O)>=0){var L=C(),A=_;_=L,g[L]={type:"block",expression:A}}return{type:"code",raw:c,lang:O,text:_}}}},fe=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,C=function(){return"__special_katext_id_".concat(E++,"__")},g={};function I(){return g}function S(){E=0,g={}}function w(i){return i=i.replace(fe,function(u,s){var c=C();return g[c]={type:"inline",expression:s},c}),i}var G=U.listitem;U.listitem=function(i){return G(w(i))};var b=U.paragraph;U.paragraph=function(i){return b(w(i))};var P=U.tablecell;U.tablecell=function(i,u){return P(w(i),u)},U.code=function(i,u,s){var c=(u||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(i,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(u,'">').concat(s?i:Object(j.escape)(i,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(s?i:Object(j.escape)(i,!0))+"</code></pre>"},U.heading=function(i,u,s){var c=this.options.headerPrefix+s.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Z.push({anchor:c,level:u,text:i}),"<h"+u+' id="'+c+'">'+i+"</h"+u+">"},J.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),J.a.use({tokenizer:ee,renderer:U});var F=J.a,$=l("SJMd"),f=l("m3rI"),B=l("Oy/b"),W=/<pre[^>]*>/g;function M(i){var u=document.createElement("div");return u.innerHTML=i,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var H=Q.a=function(i){var u=i.value,s=u===void 0?"":u,c=i.className,_=i.showTextOnly,O=i.showLines,L=i.style,A=L===void 0?{}:L,x=String(s),N=Object(z.useMemo)(function(){try{var e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,t=/\"\/api\/attachments\/|\"\/attachments\/download\//g,n=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;x=x.replace(e,"("+f.a.API_SERVER+"/api/attachments/").replace(t,'"'+f.a.API_SERVER+"/api/attachments/").replace(n,'"'+f.a.API_SERVER+"/files/uploads/")}catch(p){}var a=F(x);setTimeout(function(){return r()},300);var o=I();if(x.match(/\[TOC\]/)&&(a=a.replace("<p>[TOC]</p>",se()),D()),a=a.replace(/(__special_katext_id_\d+__)/g,function(p,v){var T=o[v],h=T.type,m=T.expression;return Object(B.renderToString)(M(m)||"",{displayMode:h==="block",throwOnError:!1,output:"html"})}),a=a.replace(/▁/g,"\u2581\u2581\u2581"),S(),_){var d=document.createElement("div");return d.innerHTML=a,d.innerText}return a},[x]),R=Object(z.useRef)();ue.WebkitLineClamp=O,O&&(A=Object(oe.a)(Object(oe.a)({},A),ue));function K(e){var t=e.target;if(t.tagName.toUpperCase()==="A"){var n=t.getAttribute("href");if(n.startsWith("#")){e.preventDefault();var a=document.getElementById(n.replace("#",""));a&&a.scrollIntoView(!0)}}}var r=function(){};return Object(z.useEffect)(function(){if(R.current&&N&&(N.match(W)&&window.PR.prettyPrint()),R.current)return R.current.addEventListener("click",K),function(){R.current.removeEventListener("click",K),S(),D()}},[N,R.current,K]),ie.a.createElement(ie.a.Fragment,null,ie.a.createElement("div",{ref:R,style:Object(oe.a)({},A),className:"".concat(c||""," markdown-body "),dangerouslySetInnerHTML:{__html:N}}))}},ObO0:function(le,Q,l){"use strict";l.r(Q);var oe=l("cWXX"),z=l("/ezw"),ie=l("+L6B"),ce=l("2/Rp"),de=l("9og8"),k=l("tJVT"),J=l("PpiC"),j=l("q1tI"),y=l.n(j),Z=l("Ty5D"),Y=l("9kvl"),U=l("1vsH"),_e=l("5oB3"),D=l.n(_e),ue=l("ErOA"),q=l("m3rI"),se=l("9Bee");function ee(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ee=function(){return E};var E={},C=Object.prototype,g=C.hasOwnProperty,I=Object.defineProperty||function(r,e,t){r[e]=t.value},S=typeof Symbol=="function"?Symbol:{},w=S.iterator||"@@iterator",G=S.asyncIterator||"@@asyncIterator",b=S.toStringTag||"@@toStringTag";function P(r,e,t){return Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{P({},"")}catch(r){P=function(t,n,a){return t[n]=a}}function F(r,e,t,n){var a=e&&e.prototype instanceof B?e:B,o=Object.create(a.prototype),d=new N(n||[]);return I(o,"_invoke",{value:O(r,t,d)}),o}function $(r,e,t){try{return{type:"normal",arg:r.call(e,t)}}catch(n){return{type:"throw",arg:n}}}E.wrap=F;var f={};function B(){}function W(){}function M(){}var H={};P(H,w,function(){return this});var i=Object.getPrototypeOf,u=i&&i(i(R([])));u&&u!==C&&g.call(u,w)&&(H=u);var s=M.prototype=B.prototype=Object.create(H);function c(r){["next","throw","return"].forEach(function(e){P(r,e,function(t){return this._invoke(e,t)})})}function _(r,e){function t(a,o,d,p){var v=$(r[a],r,o);if(v.type!=="throw"){var T=v.arg,h=T.value;return h&&typeof h=="object"&&g.call(h,"__await")?e.resolve(h.__await).then(function(m){t("next",m,d,p)},function(m){t("throw",m,d,p)}):e.resolve(h).then(function(m){T.value=m,d(T)},function(m){return t("throw",m,d,p)})}p(v.arg)}var n;I(this,"_invoke",{value:function(o,d){function p(){return new e(function(v,T){t(o,d,v,T)})}return n=n?n.then(p,p):p()}})}function O(r,e,t){var n="suspendedStart";return function(a,o){if(n==="executing")throw new Error("Generator is already running");if(n==="completed"){if(a==="throw")throw o;return K()}for(t.method=a,t.arg=o;;){var d=t.delegate;if(d){var p=L(d,t);if(p){if(p===f)continue;return p}}if(t.method==="next")t.sent=t._sent=t.arg;else if(t.method==="throw"){if(n==="suspendedStart")throw n="completed",t.arg;t.dispatchException(t.arg)}else t.method==="return"&&t.abrupt("return",t.arg);n="executing";var v=$(r,e,t);if(v.type==="normal"){if(n=t.done?"completed":"suspendedYield",v.arg===f)continue;return{value:v.arg,done:t.done}}v.type==="throw"&&(n="completed",t.method="throw",t.arg=v.arg)}}}function L(r,e){var t=e.method,n=r.iterator[t];if(n===void 0)return e.delegate=null,t==="throw"&&r.iterator.return&&(e.method="return",e.arg=void 0,L(r,e),e.method==="throw")||t!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+t+"' method")),f;var a=$(n,r.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,f;var o=a.arg;return o?o.done?(e[r.resultName]=o.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function A(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 x(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function N(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(A,this),this.reset(!0)}function R(r){if(r){var e=r[w];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var t=-1,n=function a(){for(;++t<r.length;)if(g.call(r,t))return a.value=r[t],a.done=!1,a;return a.value=void 0,a.done=!0,a};return n.next=n}}return{next:K}}function K(){return{value:void 0,done:!0}}return W.prototype=M,I(s,"constructor",{value:M,configurable:!0}),I(M,"constructor",{value:W,configurable:!0}),W.displayName=P(M,b,"GeneratorFunction"),E.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return!!e&&(e===W||(e.displayName||e.name)==="GeneratorFunction")},E.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,M):(r.__proto__=M,P(r,b,"GeneratorFunction")),r.prototype=Object.create(s),r},E.awrap=function(r){return{__await:r}},c(_.prototype),P(_.prototype,G,function(){return this}),E.AsyncIterator=_,E.async=function(r,e,t,n,a){a===void 0&&(a=Promise);var o=new _(F(r,e,t,n),a);return E.isGeneratorFunction(e)?o:o.next().then(function(d){return d.done?d.value:o.next()})},c(s),P(s,b,"Generator"),P(s,w,function(){return this}),P(s,"toString",function(){return"[object Generator]"}),E.keys=function(r){var e=Object(r),t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var o=t.pop();if(o in e)return a.value=o,a.done=!1,a}return a.done=!0,a}},E.values=R,N.prototype={constructor:N,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(x),!e)for(var t in this)t.charAt(0)==="t"&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=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 t=this;function n(T,h){return d.type="throw",d.arg=e,t.next=T,h&&(t.method="next",t.arg=void 0),!!h}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],d=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var p=g.call(o,"catchLoc"),v=g.call(o,"finallyLoc");if(p&&v){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(p){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!v)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&g.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var d=o?o.completion:{};return d.type=e,d.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(d)},complete:function(e,t){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"&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if(a.type==="throw"){var o=a.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=void 0),f}},E}var fe=function(C){var g,I,S,w,G,b=C.user,P=Object(J.a)(C,["user"]),F=Object(j.useState)(1),$=Object(k.a)(F,2),f=$[0],B=$[1],W=Object(j.useState)(!1),M=Object(k.a)(W,2),H=M[0],i=M[1],u=Object(j.useState)(!1),s=Object(k.a)(u,2),c=s[0],_=s[1],O=Object(j.useState)(""),L=Object(k.a)(O,2),A=L[0],x=L[1],N=Object(j.useState)(!0),R=Object(k.a)(N,2),K=R[0],r=R[1],e=Object(j.useState)([{},{}]),t=Object(k.a)(e,2),n=t[0],a=t[1],o=Object(Z.l)(),d=o.pathname;console.log(o,"location"),Object(j.useEffect)(function(){var h;(b==null||((h=b.userInfo)===null||h===void 0)?void 0:h.identity)&&p()},[b==null||((g=b.userInfo)===null||g===void 0)?void 0:g.identity]),Object(j.useEffect)(function(){v()},[]);var p=function(){if(d.includes("classrooms")){var m;(b==null||((m=b.userInfo)===null||m===void 0)?void 0:m.identity)==="student"&&(i(!0),B(2));return}if(d.includes("paths")){_(!0);return}},v=function(){var h=Object(de.a)(ee().mark(function m(te){var X,re,V,he;return ee().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return ne.next=2,Object(ue.a)("/api/introductions.json",{method:"get"});case 2:X=ne.sent,(X==null?void 0:X.introductions)&&(re=null,d.includes("classrooms")&&(re="course",x("\u6559\u5B66\u8BFE\u5802")),d.includes("paths")&&(re="subject",x("\u5B9E\u8DF5\u8BFE\u7A0B")),V=X.introductions,he=[V==null?void 0:V.find(function(ae){return ae.clazz==="teacher"&&ae.page_type===re}),V==null?void 0:V.find(function(ae){return ae.clazz==="student"&&ae.page_type===re})],a(he)),r(!1);case 5:case"end":return ne.stop()}},m)}));return function(te){return h.apply(this,arguments)}}(),T=function(){var m,te,X=q.a.API_SERVER+"/api/attachments/"+(f===1?(m=n[0])===null||m===void 0?void 0:m.attachment_id:(te=n[1])===null||te===void 0?void 0:te.attachment_id);Object(U.r)("",X)};return y.a.createElement("section",{className:D.a.guidance},y.a.createElement(z.a,{loading:K,active:!0,paragraph:{rows:5}},y.a.createElement("div",{className:D.a.title},A,"\u65B0\u624B\u6307\u5F15"),y.a.createElement("ul",{className:D.a.u},!H&&y.a.createElement("li",{onClick:function(){return B(1)},className:f===1?D.a.active:""},"\u6559\u5E08\u7248"),!c&&y.a.createElement("li",{onClick:function(){return B(2)},className:f===2?D.a.active:""},"\u5B66\u751F\u7248")),f===1&&y.a.createElement("div",{className:D.a.content},y.a.createElement(se.a,{value:((I=n[0])===null||I===void 0?void 0:I.content)||""})),f===2&&y.a.createElement("div",{className:D.a.content},y.a.createElement(se.a,{value:((S=n[1])===null||S===void 0?void 0:S.content)||""})),!H&&((w=n[0])===null||w===void 0?void 0:w.attachment_id)&&y.a.createElement("div",{className:D.a.btn},y.a.createElement(ce.a,{type:"primary",onClick:T},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C")),!c&&((G=n[1])===null||G===void 0?void 0:G.attachment_id)&&y.a.createElement("div",{className:D.a.btn},y.a.createElement(ce.a,{type:"primary",onClick:T},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};Q.default=Object(Y.a)(function(E){var C=E.user;return{user:C}})(fe)}}]);
|