"use strict";var or=Object.defineProperty,ir=Object.defineProperties;var ur=Object.getOwnPropertyDescriptors;var Ve=Object.getOwnPropertySymbols;var cr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable;var $e=(f,l,o)=>l in f?or(f,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):f[l]=o,N=(f,l)=>{for(var o in l||(l={}))cr.call(l,o)&&$e(f,o,l[o]);if(Ve)for(var o of Ve(l))lr.call(l,o)&&$e(f,o,l[o]);return f},Fe=(f,l)=>ir(f,ur(l));(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[398],{25367:function(f,l,o){var V=o(68243),R=o(86981),I=o(11527),G=function(){return(0,I.jsxs)(V.Z,{size:"middle",children:[(0,I.jsx)(R.Z,{size:"small"}),(0,I.jsx)(R.Z,{}),(0,I.jsx)(R.Z,{size:"large"})]})};l.Z=G},34316:function(f,l,o){var V=o(86195),R=o(21362),I=function(){R.ZP.warning("\u767B\u5F55\u5931\u6548\uFF01",2);var L=new URL(window.location.href).searchParams,$=L.get("redirect");window.location.pathname!=="/user/login"&&!$&&V.history.replace({pathname:"/user/login"})};l.Z=I},83187:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var _Users_cdle_Desktop_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(54689),_Users_cdle_Desktop_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Users_cdle_Desktop_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(81308),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(48989),antd__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(79112),lodash__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(32699),lodash__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(50959),_submit__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(87474),_umijs_max__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(86195),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(11527);__webpack_exports__.Z=function(props){for(var _props$data$script,content=(_props$data$script=props.data.script)!==null&&_props$data$script!==void 0?_props$data$script:props.editorRef.current?props.editorRef.current.getValue().replace(/\r\n/g,`
`):"",formRef=(0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(),result=[],keys=[],_i=0,_arr=[/@form\s+({[^*]+?})/g,/Form\(([\s\S]+?)\)/g];_i<_arr.length;_i++){var pattern=_arr[_i],matches=content.matchAll(pattern),_iterator=_Users_cdle_Desktop_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default()(matches),_step;try{var _loop=function _loop(){var match=_step.value;try{var _a=function(l){for(var o in l)l[o].dataIndex&&(l[o].key=l[o].dataIndex),l[o].key&&keys.push(l[o].key),l[o].required&&!l[o].formItemProps&&(l[o].formItemProps={rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}),l[o].columns&&(l[o].columns=_a(l[o].columns));return l},formObject=eval("(".concat(match[1],")"));(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isArray)(formObject)||(formObject=[formObject]),result=result.concat(formObject),keys=[],result=_a(result)}catch(f){console.log("form\u8868\u5355\u89E3\u6790\u9519\u8BEF",f)}};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(f){_iterator.e(f)}finally{_iterator.f()}}return(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function(){(0,_umijs_max__WEBPACK_IMPORTED_MODULE_4__.request)("/api/storage",{params:{keys:keys.join(",")}}).then(function(f){if(f&&f.data){var l;for(var o in f.data)f.data[o]=="false"&&(f.data[o]=!1),f.data[o]==""&&delete f.data[o];(l=formRef.current)===null||l===void 0||l.setFieldsValue(f.data)}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__.Z,{title:"\u53C2\u6570\u914D\u7F6E",open:props.open,onCancel:props.onCancel,onOk:function f(){var l,o=formRef==null||(l=formRef.current)===null||l===void 0?void 0:l.getFieldsValue();(0,_submit__WEBPACK_IMPORTED_MODULE_3__.Z)(o).finally(function(){props.onCancel()})},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_7__.A,{formRef,submitter:!1,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__.Z,{layoutType:"Embed",columns:result})})})}},58160:function(f,l,o){o.r(l),o.d(l,{default:function(){return nr}});var V=o(25359),R=o.n(V),I=o(49811),G=o.n(I),L=o(54306),$=o.n(L),Ee=o(25367),Pe=o(34316),fe=o(87474);function pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oe(Object(r),!0).forEach(function(n){pe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ge(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function C(e,t){if(e==null)return{};var r=ge(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ce(e,t){return Y(e)||Me(e,t)||A(e,t)||be()}function Y(e){if(Array.isArray(e))return e}function Me(e,t){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var d=e[Symbol.iterator](),P;!(n=(P=d.next()).done)&&(r.push(P.value),!(t&&r.length===t));n=!0);}catch(h){a=!0,i=h}finally{try{!n&&d.return!=null&&d.return()}finally{if(a)throw i}}return r}}function A(e,t){if(e){if(typeof e=="string")return J(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(e,t)}}function J(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ie(Object(r),!0).forEach(function(n){ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ze(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(a,i){return i(a)},n)}}function ie(e){return function t(){for(var r=this,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var d=arguments.length,P=new Array(d),h=0;h<d;h++)P[h]=arguments[h];return t.apply(r,[].concat(a,P))}}}function ve(e){return{}.toString.call(e).includes("Object")}function He(e){return!Object.keys(e).length}function ue(e){return typeof e=="function"}function Ne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ge(e,t){return ve(t)||W("changeType"),Object.keys(t).some(function(r){return!Ne(e,r)})&&W("changeField"),t}function qe(e){ue(e)||W("selectorType")}function Ye(e){ue(e)||ve(e)||W("handlerType"),ve(e)&&Object.values(e).some(function(t){return!ue(t)})&&W("handlersType")}function Je(e){e||W("initialIsRequired"),ve(e)||W("initialType"),He(e)&&W("initialContent")}function Qe(e,t){throw new Error(e[t]||e.default)}var Xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},W=ie(Qe)(Xe),me={changes:Ge,selector:qe,handler:Ye,initial:Je};function et(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};me.initial(e),me.handler(t);var r={current:e},n=ie(nt)(r,t),a=ie(rt)(r),i=ie(me.changes)(e),d=ie(tt)(r);function P(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(U){return U};return me.selector(b),b(r.current)}function h(b){ze(n,a,i,d)(b)}return[P,h]}function tt(e,t){return ue(t)?t(e.current):t}function rt(e,t){return e.current=Le(Le({},e.current),t),t}function nt(e,t,r){return ue(t)?t(e.current):Object.keys(r).forEach(function(n){var a;return(a=t[n])===null||a===void 0?void 0:a.call(t,e.current[n])}),r}var at={create:et},ot=at,it={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.36.1/min/vs"}},ut=it;function lt(e){return function t(){for(var r=this,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var d=arguments.length,P=new Array(d),h=0;h<d;h++)P[h]=arguments[h];return t.apply(r,[].concat(a,P))}}}var st=lt;function _t(e){return{}.toString.call(e).includes("Object")}var dt=_t;function ft(e){return e||Ae("configIsRequired"),dt(e)||Ae("configType"),e.urls?(pt(),{paths:{vs:e.urls.monacoBase}}):e}function pt(){console.warn(Te.deprecation)}function gt(e,t){throw new Error(e[t]||e.default)}var Te={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `},Ae=st(gt)(Te),vt={config:ft},mt=vt,ht=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(a){return r.reduceRight(function(i,d){return d(i)},a)}},Ot=ht;function Ue(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],Ue(e[r],t[r]))}),q(q({},e),t)}var Et=Ue,Pt={type:"cancelation",msg:"operation is manually canceled"};function Mt(e){var t=!1,r=new Promise(function(n,a){e.then(function(i){return t?a(Pt):n(i)}),e.catch(a)});return r.cancel=function(){return t=!0},r}var we=Mt,bt=ot.create({config:ut,isInitialized:!1,resolve:null,reject:null,monaco:null}),Se=Ce(bt,2),ce=Se[0],he=Se[1];function yt(e){var t=mt.config(e),r=t.monaco,n=C(t,["monaco"]);he(function(a){return{config:Et(a.config,n),monaco:r}})}function wt(){var e=ce(function(t){var r=t.monaco,n=t.isInitialized,a=t.resolve;return{monaco:r,isInitialized:n,resolve:a}});if(!e.isInitialized){if(he({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),we(De);if(window.monaco&&window.monaco.editor)return xe(window.monaco),e.resolve(window.monaco),we(De);Ot(Dt,Rt)(Ct)}return we(De)}function Dt(e){return document.body.appendChild(e)}function jt(e){var t=document.createElement("script");return e&&(t.src=e),t}function Rt(e){var t=ce(function(n){var a=n.config,i=n.reject;return{config:a,reject:i}}),r=jt("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Ct(){var e=ce(function(r){var n=r.config,a=r.resolve,i=r.reject;return{config:n,resolve:a,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){xe(r),e.resolve(r)},function(r){e.reject(r)})}function xe(e){ce().monaco||he({monaco:e})}function Lt(){return ce(function(e){var t=e.monaco;return t})}var De=new Promise(function(e,t){return he({resolve:e,reject:t})}),Tt={config:yt,init:wt,__getMonacoInstance:Lt},Ke=Tt,c=o(50959),At={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},je=At,Ut={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},St=Ut;function xt({children:e}){return c.createElement("div",{style:St.container},e)}var Kt=xt,Wt=Kt;function Bt({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:i,wrapperProps:d}){return c.createElement("section",N({style:Fe(N({},je.wrapper),{width:e,height:t})},d),!r&&c.createElement(Wt,null,n),c.createElement("div",{ref:a,style:N(N({},je.fullWidth),!r&&je.hide),className:i}))}var kt=Bt,We=(0,c.memo)(kt);function Zt(e){(0,c.useEffect)(e,[])}var Re=Zt;function Vt(e,t,r=!0){let n=(0,c.useRef)(!0);(0,c.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)}var y=Vt;function le(){}function Q(e,t,r,n){return $t(e,n)||Ft(e,t,r,n)}function $t(e,t){return e.editor.getModel(Be(e,t))}function Ft(e,t,r,n){return e.editor.createModel(t,r,n?Be(e,n):void 0)}function Be(e,t){return e.Uri.parse(t)}function zt({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:d,keepCurrentOriginalModel:P=!1,keepCurrentModifiedModel:h=!1,theme:b="light",loading:U="Loading...",options:j={},height:X="100%",width:F="100%",className:ee,wrapperProps:k={},beforeMount:te=le,onMount:z=le}){let[M,H]=(0,c.useState)(!1),[S,O]=(0,c.useState)(!0),E=(0,c.useRef)(null),m=(0,c.useRef)(null),w=(0,c.useRef)(null),p=(0,c.useRef)(z),s=(0,c.useRef)(te),T=(0,c.useRef)(!1);Re(()=>{let u=Ke.init();return u.then(g=>(m.current=g)&&O(!1)).catch(g=>(g==null?void 0:g.type)!=="cancelation"&&console.error("Monaco initialization: error:",g)),()=>E.current?re():u.cancel()}),y(()=>{let u=E.current.getModifiedEditor();u.getOption(m.current.editor.EditorOption.readOnly)?u.setValue(t||""):t!==u.getValue()&&(u.executeEdits("",[{range:u.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),u.pushUndoStop())},[t],M),y(()=>{var u,g;(g=(u=E.current)==null?void 0:u.getModel())==null||g.original.setValue(e||"")},[e],M),y(()=>{let{original:u,modified:g}=E.current.getModel();m.current.editor.setModelLanguage(u,n||r||"text"),m.current.editor.setModelLanguage(g,a||r||"text")},[r,n,a],M),y(()=>{var u;(u=m.current)==null||u.editor.setTheme(b)},[b],M),y(()=>{var u;(u=E.current)==null||u.updateOptions(j)},[j],M);let x=(0,c.useCallback)(()=>{var Z;if(!m.current)return;s.current(m.current);let u=Q(m.current,e||"",n||r||"text",i||""),g=Q(m.current,t||"",a||r||"text",d||"");(Z=E.current)==null||Z.setModel({original:u,modified:g})},[r,t,a,e,n,i,d]),K=(0,c.useCallback)(()=>{var u;!T.current&&w.current&&(E.current=m.current.editor.createDiffEditor(w.current,N({automaticLayout:!0},j)),x(),(u=m.current)==null||u.editor.setTheme(b),H(!0),T.current=!0)},[j,b,x]);(0,c.useEffect)(()=>{M&&p.current(E.current,m.current)},[M]),(0,c.useEffect)(()=>{!S&&!M&&K()},[S,M,K]),y(()=>{if(E.current&&m.current){let u=E.current.getOriginalEditor(),g=Q(m.current,e||"",n||r||"text",i||"");g!==u.getModel()&&u.setModel(g)}},[i],M),y(()=>{if(E.current&&m.current){let u=E.current.getModifiedEditor(),g=Q(m.current,t||"",a||r||"text",d||"");g!==u.getModel()&&u.setModel(g)}},[d],M);function re(){var g,Z,ne,_e;let u=(g=E.current)==null?void 0:g.getModel();P||((Z=u==null?void 0:u.original)==null||Z.dispose()),h||((ne=u==null?void 0:u.modified)==null||ne.dispose()),(_e=E.current)==null||_e.dispose()}return c.createElement(We,{width:F,height:X,isEditorReady:M,loading:U,_ref:w,className:ee,wrapperProps:k})}var Ht=zt,sr=(0,c.memo)(Ht);function _r(){let[e,t]=It(ct.__getMonacoInstance());return Re(()=>{let r;return e||(r=ct.init(),r.then(n=>{t(n)})),()=>r==null?void 0:r.cancel()}),e}var dr=null;function Nt(e){let t=(0,c.useRef)();return(0,c.useEffect)(()=>{t.current=e},[e]),t.current}var Gt=Nt,Oe=new Map;function qt({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:d="light",line:P,loading:h="Loading...",options:b={},overrideServices:U={},saveViewState:j=!0,keepCurrentModel:X=!1,width:F="100%",height:ee="100%",className:k,wrapperProps:te={},beforeMount:z=le,onMount:M=le,onChange:H,onValidate:S=le}){let[O,E]=(0,c.useState)(!1),[m,w]=(0,c.useState)(!0),p=(0,c.useRef)(null),s=(0,c.useRef)(null),T=(0,c.useRef)(null),x=(0,c.useRef)(M),K=(0,c.useRef)(z),re=(0,c.useRef)(),u=(0,c.useRef)(n),g=Gt(i),Z=(0,c.useRef)(!1),ne=(0,c.useRef)(!1);Re(()=>{let _=Ke.init();return _.then(v=>(p.current=v)&&w(!1)).catch(v=>(v==null?void 0:v.type)!=="cancelation"&&console.error("Monaco initialization: error:",v)),()=>s.current?ar():_.cancel()}),y(()=>{var v,D,de,ae;let _=Q(p.current,e||n||"",t||a||"",i||r||"");_!==((v=s.current)==null?void 0:v.getModel())&&(j&&Oe.set(g,(D=s.current)==null?void 0:D.saveViewState()),(de=s.current)==null||de.setModel(_),j&&((ae=s.current)==null||ae.restoreViewState(Oe.get(i))))},[i],O),y(()=>{var _;(_=s.current)==null||_.updateOptions(b)},[b],O),y(()=>{!s.current||n===void 0||(s.current.getOption(p.current.editor.EditorOption.readOnly)?s.current.setValue(n):n!==s.current.getValue()&&(ne.current=!0,s.current.executeEdits("",[{range:s.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),s.current.pushUndoStop(),ne.current=!1))},[n],O),y(()=>{var v,D;let _=(v=s.current)==null?void 0:v.getModel();_&&a&&((D=p.current)==null||D.editor.setModelLanguage(_,a))},[a],O),y(()=>{var _;P!==void 0&&((_=s.current)==null||_.revealLine(P))},[P],O),y(()=>{var _;(_=p.current)==null||_.editor.setTheme(d)},[d],O);let _e=(0,c.useCallback)(()=>{var _;if(!(!T.current||!p.current)&&!Z.current){K.current(p.current);let v=i||r,D=Q(p.current,n||e||"",t||a||"",v||"");s.current=(_=p.current)==null?void 0:_.editor.create(T.current,N({model:D,automaticLayout:!0},b),U),j&&s.current.restoreViewState(Oe.get(v)),p.current.editor.setTheme(d),E(!0),Z.current=!0}},[e,t,r,n,a,i,b,U,j,d]);(0,c.useEffect)(()=>{O&&x.current(s.current,p.current)},[O]),(0,c.useEffect)(()=>{!m&&!O&&_e()},[m,O,_e]),u.current=n,(0,c.useEffect)(()=>{var _,v;O&&H&&((_=re.current)==null||_.dispose(),re.current=(v=s.current)==null?void 0:v.onDidChangeModelContent(D=>{ne.current||H(s.current.getValue(),D)}))},[O,H]),(0,c.useEffect)(()=>{if(O){let _=p.current.editor.onDidChangeMarkers(v=>{var de;let D=(de=s.current.getModel())==null?void 0:de.uri;if(D&&v.find(ae=>ae.path===D.path)){let ae=p.current.editor.getModelMarkers({resource:D});S==null||S(ae)}});return()=>{_==null||_.dispose()}}return()=>{}},[O,S]);function ar(){var _,v;(_=re.current)==null||_.dispose(),X?j&&Oe.set(i,s.current.saveViewState()):(v=s.current.getModel())==null||v.dispose(),s.current.dispose()}return c.createElement(We,{width:F,height:ee,isEditorReady:O,loading:h,_ref:T,className:k,wrapperProps:te})}var Yt=qt,Jt=(0,c.memo)(Yt),Qt=Jt,Xt=o(12472),se=o(86195),ke=o(26572),er=o(83187),B=o(11527),Ze="???xxxooxox",tr=`/**
 * @title \u65E0\u540D\u811A\u672C
 */`,rr=function(t){var r,n,a=(0,se.useModel)("@@initialState"),i=a.initialState,d=a.refresh,P=(0,c.useState)(!1),h=$()(P,2),b=h[0],U=h[1],j=(0,c.useState)(Ze),X=$()(j,2),F=X[0],ee=X[1],k=(0,c.useRef)(null),te=i==null||(r=i.currentUser)===null||r===void 0?void 0:r.plugins[(i==null||(n=i.currentUser)===null||n===void 0?void 0:n.plugins.length)-1].path,z=te.indexOf(t.id)!=-1,M=(0,se.useRequest)(function(){return z?new Promise(function(w){var p={success:!0};p["plugins."+t.id]="",w(p)}):(0,se.request)("/api/storage",{params:{keys:["plugins."+t.id].join(",")}})}),H=M.data,S=M.error,O=M.loading;if(O)return(0,B.jsx)(Ee.Z,{});if(S)return(0,Pe.Z)(),null;F==Ze&&ee(z?tr:H["plugins."+t.id]);var E=function(){var w=G()(R()().mark(function p(){var s,T,x,K;return R()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=k.current?k.current.getValue().replace(/\r\n/g,`
`):F,T={},T["plugins."+t.id]=s,u.next=5,(0,fe.Z)(T);case 5:x=u.sent,K=x==null?void 0:x.messages["plugins."+t.id],K?K=="\u6807\u9898\u53D8\u66F4\u3002"?d():ee(K):z?d():s==""&&(se.history.push(te),d());case 8:case"end":return u.stop()}},p)}));return function(){return w.apply(this,arguments)}}(),m=function(p){p.key==="s"&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),E())};return(0,B.jsxs)(Xt._z,{extra:[(0,B.jsx)(ke.ZP,{type:"primary",onClick:function(){U(!0)},children:"\u8868\u5355"},"2"),(0,B.jsx)(ke.ZP,{type:"primary",onClick:E,children:"\u4FDD\u5B58"},"1")],children:[(0,B.jsx)("div",{onKeyDown:m,children:(0,B.jsx)(Qt,{defaultLanguage:"javascript",value:F,height:"1000px",options:{fontSize:12,lineNumbersMinChars:3,folding:!1,glyphMargin:!1},onMount:function(p){k.current=p}})}),b&&(0,B.jsx)(er.Z,{data:{id:t.id},open:b,onCancel:function(){U(!1)},editorRef:k})]})},nr=function(){var e=(0,se.useParams)();return(0,B.jsx)(rr,{id:e.id},e.id)}},87474:function(f,l,o){var V=o(25359),R=o.n(V),I=o(49811),G=o.n(I),L=o(21362),$=o(86195),Ee=function(){var Pe=G()(R()().mark(function fe(pe){var oe,q,ge,C=arguments;return R()().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return oe=C.length>1&&C[1]!==void 0?C[1]:"\u6B63\u5728\u63D0\u4EA4\u66F4\u6539..",q=C.length>2&&C[2]!==void 0?C[2]:"\u63D0\u4EA4\u6210\u529F\uFF01",ge=C.length>3&&C[3]!==void 0?C[3]:"\u63D0\u4EA4\u5931\u8D25",oe&&L.ZP.loading("\u6B63\u5728\u63D0\u4EA4\u66F4\u6539..",2e4),Y.abrupt("return",new Promise(function(Me){(0,$.request)("/api/storage",{method:"put",data:pe}).then(function(A){var J;if(L.ZP.destroy(),(A==null||(J=A.data)===null||J===void 0?void 0:J.isLogin)==!1){L.ZP.warning("\u767B\u5F55\u5931\u6548\uFF01",2);var be=new URL(window.location.href).searchParams,ye=be.get("redirect");window.location.pathname!=="/user/login"&&!ye&&$.history.replace({pathname:"/user/login"});return}A!=null&&A.success?q&&L.ZP.success(q,1):ge&&L.ZP.warning("\u63D0\u4EA4\u5931\u8D25\uFF01",2),Me(A)})}));case 5:case"end":return Y.stop()}},fe)}));return function(pe){return Pe.apply(this,arguments)}}();l.Z=Ee}}]);
