(this["webpackJsonpcloudreve-frontend-plus"]=this["webpackJsonpcloudreve-frontend-plus"]||[]).push([[13],{8131:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return j}));var r=a(7),o=a(6),n=a(0),c=a.n(n),i=a(83),l=a(47),d=a(7058),p=a(56),f=a(129),u=a(102),m=a(121),s=a(11),b=a(5),g=a(402),h=a.n(g),k=a(2),v=a(84),w=Object(i.a)((function(e){return{readMeContainer:Object(o.a)({marginTop:30},e.breakpoints.down("sm"),{marginTop:e.spacing(2)}),readMeHeader:{padding:"10px 16px",display:"flex",color:e.palette.text.secondary},readMeIcon:{marginRight:8},content:{},"@global":{".for-container":{border:"none!important"},".for-container .for-editor .for-editor-edit":{height:"0!important"},".for-container > div:first-child":{borderTopLeftRadius:"0!important",borderTopRightRadius:"0!important"},".for-container .for-editor .for-panel .for-preview":{backgroundColor:e.palette.background.paper+"!important",color:e.palette.text.primary+"!important"},".for-container .for-markdown-preview pre":{backgroundColor:e.palette.background.default+"!important",color:"dark"===e.palette.type?"#fff !important":"rgba(0, 0, 0, 0.87);!important"},".for-container .for-markdown-preview code":{backgroundColor:e.palette.background.default+"!important"},".for-container .for-markdown-preview a":{color:"dark"===e.palette.type?"#67aeff !important":"#0366d6 !important"},".for-container .for-markdown-preview table th":{backgroundColor:e.palette.background.default+"!important"}}}}));function j(e){var t=Object(v.a)().t,a=w(),o=Object(l.a)(),i=Object(n.useState)(!0),g=Object(r.a)(i,2),j=g[0],O=g[1],C=Object(n.useState)(""),E=Object(r.a)(C,2),R=E[0],y=E[1],x=Object(b.d)(),M=Object(n.useCallback)((function(e,t,a,r){return x(Object(k.U)(e,t,a,r))}),[x]),N=c.a.createRef();return Object(n.useEffect)((function(){O(!0);var a="/"===e.file.path?e.file.path+e.file.name:e.file.path+"/"+e.file.name;s.c.get("/share/readme/"+e.share.key+"?path="+encodeURIComponent(a)).then((function(e){y(e.rawData.toString())})).catch((function(e){M("top","right",t("share.readmeError",{msg:e.message}),"error")})).then((function(){O(!1)}))}),[e.share,e.file]),c.a.createElement(u.a,{className:a.readMeContainer},c.a.createElement("div",{className:a.readMeHeader},c.a.createElement(d.a,{className:a.readMeIcon}),c.a.createElement(p.a,null,e.file.name)),c.a.createElement(f.a,null),c.a.createElement("div",{className:a.content},j&&c.a.createElement(m.a,null),!j&&c.a.createElement(h.a,{ref:N,style:{boxShadow:"none",borderRadius:o.shape.borderRadius,backgroundColor:o.palette.background.paper},height:"100%",value:R,onChange:function(e){return y(e)},preview:!0,toolbar:{}})))}}}]);
//# sourceMappingURL=13.7127ae38.chunk.js.map