You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
9.8 KiB
JavaScript

9 months ago
exports.id=223,exports.ids=[223],exports.modules={9127:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r,a,i=n(6413);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}let l=function(e){return i.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:16,height:16,fill:"none"},e),r||(r=i.createElement("defs",null,i.createElement("path",{id:"edit_svg__a",d:"M0 0h16v16H0z"}))),i.createElement("g",null,a||(a=i.createElement("mask",{id:"edit_svg__b",fill:"#fff"},i.createElement("use",{xlinkHref:"#edit_svg__a"}))),i.createElement("g",{mask:"url(#edit_svg__b)"},i.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M2.83 0v3c0 .37-.3.67-.66.67H0",transform:"translate(10.5 11)"}),i.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M10.67 4V.67c0-.37-.3-.67-.67-.67H.67C.3 0 0 .3 0 .67v12c0 .36.3.66.67.66h2",transform:"translate(2.667 1.333)"}),i.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M0 0h4.67",transform:"translate(5.333 5.333)"}),i.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"m0 7 5.67-7",transform:"translate(7.667 7.667)"}),i.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M0 0h2.67",transform:"translate(5.333 8)"}))))}},35223:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PluginPage:()=>E});var r=n(95344),a=n(75499),i=n(11980),s=n.n(i),l=n(1191),c=n(99608),u=n(70580),o=n(99668),d=n(94313),h=n.n(d),m=n(4563),g=n.n(m),x=n(9127),p=n(32263),k=n(26989),f=n(12670),_=n(99992),j=n(30841),v=n(47572),P=n(91969),y=n(6068),b=n(9719),Z=n(17304),w=n(3729),C=n(56815);function E(){let e=(0,Z.s0)(),t=(0,P.RQ)(),n=t.getAll(),[i,d]=(0,w.useState)([]),[m,E]=(0,w.useState)(""),N=m.length>0?i:n,T=e=>{E(e),e.length>0?d(n.filter(t=>t?.title.toLowerCase().includes(e.toLowerCase()))):d(n)},[H,M]=(0,w.useState)(),R=t.get(H),A=P.aN.get(R?.id),L=(0,a.y1)((e,n)=>{let r=n.target.innerText;try{new(s())({definition:l.ZP.load(r)}).init().then(()=>{r!=e.content&&t.updatePlugin(e.id,e=>{e.content=r;let t=P.aN.add(e,!0);e.title=t.api.definition.info.title,e.version=t.api.definition.info.version})}).catch(e=>{console.error(e),(0,y.CF)(b.ZP.Plugin.EditModal.Error)})}catch(e){console.error(e),(0,y.CF)(b.ZP.Plugin.EditModal.Error)}},100).bind(null,R),[O,D]=(0,w.useState)(""),I=e=>fetch(e).catch(t=>{let n=new URL(e);return fetch(`/api/proxy/${n.pathname}?${n.search}`,{headers:{"X-Base-URL":n.origin}})}).then(e=>e.text()).then(e=>{try{return JSON.stringify(JSON.parse(e),null," ")}catch(t){return e}}).then(e=>{t.updatePlugin(R.id,t=>{t.content=e;let n=P.aN.add(t,!0);t.title=n.api.definition.info.title,t.version=n.api.definition.info.version})}).catch(e=>{(0,y.CF)(b.ZP.Plugin.EditModal.Error)});return(0,r.jsxs)(o.S,{children:[(0,r.jsxs)("div",{className:h()["mask-page"],children:[(0,r.jsxs)("div",{className:"window-header",children:[(0,r.jsxs)("div",{className:"window-header-title",children:[r.jsx("div",{className:"window-header-main-title",children:b.ZP.Plugin.Page.Title}),r.jsx("div",{className:"window-header-submai-title",children:b.ZP.Plugin.Page.SubTitle(N.length)})]}),(0,r.jsxs)("div",{className:"window-actions",children:[r.jsx("div",{className:"window-action-button",children:r.jsx("a",{href:c.m9,target:"_blank",rel:"noopener noreferrer",children:r.jsx(u.h,{icon:r.jsx(v.Z,{}),bordered:!0})})}),r.jsx("div",{className:"window-action-button",children:r.jsx(u.h,{icon:r.jsx(k.Z,{}),bordered:!0,onClick:()=>e(-1)})})]})]}),(0,r.jsxs)("div",{className:h()["mask-page-body"],children:[(0,r.jsxs)("div",{className:h()["mask-filter"],children:[r.jsx("input",{type:"text",className:h()["search-bar"],placeholder:b.ZP.Plugin.Page.Sea