rssany 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/plugins/builtin/xiaohongshu.rssany.js +59 -2
- package/app/webui/build/200.html +6 -6
- package/app/webui/build/_app/immutable/assets/0.BLOTwIuF.css +1 -0
- package/app/webui/build/_app/immutable/chunks/{DkamXS6W.js → BXTsojX2.js} +1 -1
- package/app/webui/build/_app/immutable/chunks/Brun6sCr.js +36 -0
- package/app/webui/build/_app/immutable/chunks/{_qj9U-za.js → DAV9bzjw.js} +1 -1
- package/app/webui/build/_app/immutable/chunks/{CqYSO3Dx.js → DXDBlEGf.js} +1 -1
- package/app/webui/build/_app/immutable/chunks/Dr67pd7v.js +1 -0
- package/app/webui/build/_app/immutable/entry/{app.RFfWi3_i.js → app.dq7-6soi.js} +2 -2
- package/app/webui/build/_app/immutable/entry/start.BnoTfBrB.js +1 -0
- package/app/webui/build/_app/immutable/nodes/{0.DK_mcVDm.js → 0.CQDkqUeN.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{1.0PRrU2uQ.js → 1.BUa24rXB.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{10.CsxzlUER.js → 10.MZgVhpGF.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{11.D-PkhIRW.js → 11.B39IbrZ0.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/12.B5B81dLQ.js +1 -0
- package/app/webui/build/_app/immutable/nodes/{14.COwSLwDN.js → 14.Db6eOPqq.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{15.nDN_AHrs.js → 15.B2jiP2VJ.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{16.zfSe93Ab.js → 16.p6WfP435.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{3.CEVEHuaH.js → 3.BZQeL-vz.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{5.BZScQ2CH.js → 5.Bo_ftyqW.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{6.CkFk8X--.js → 6.vOowdQUr.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{7.CuQJk7te.js → 7.BfVbBKZu.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{8.DIavWJnU.js → 8.BslYG5f2.js} +1 -1
- package/app/webui/build/_app/immutable/nodes/{9.Db30M8x0.js → 9.DAgT-df2.js} +1 -1
- package/app/webui/build/_app/version.json +1 -1
- package/dist/index.js +47 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/scripts/dev.mjs +5 -1
- package/app/webui/build/_app/immutable/assets/0.DsKls1SN.css +0 -1
- package/app/webui/build/_app/immutable/chunks/CVW0ymE1.js +0 -1
- package/app/webui/build/_app/immutable/chunks/DJ2e04vK.js +0 -36
- package/app/webui/build/_app/immutable/entry/start.DU_kyeGS.js +0 -1
- package/app/webui/build/_app/immutable/nodes/12.GGf-JLUY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,f as d}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as we}from"../chunks/Dyvi1wBH.js";import{v as ke,at as Ce,f as Te,az as E,i as s,au as Le,d as Ee,av as n,a5 as a,z as k,aw as i,$ as $e,ax as r,u as Me}from"../chunks/vtBo8kBV.js";import{e as f,s as S}from"../chunks/B2cyTHdf.js";import{i as O}from"../chunks/BkD3yAYe.js";import{e as se,i as ae}from"../chunks/CFwxUBGi.js";import{h as Pe}from"../chunks/DL3Q5sfb.js";import{P as Se,r as Oe,c as Fe,s as re}from"../chunks/DoRPmqLn.js";import{b as Je}from"../chunks/C8umpVpB.js";import{s as X}from"../chunks/Bfc47y5P.js";import{i as Ne}from"../chunks/DVa8Y-mQ.js";import{B as je}from"../chunks/DAV9bzjw.js";import{b as Y}from"../chunks/CBY2biv-.js";import{s as F}from"../chunks/CGCMIfh3.js";function ze(z,$){var C;var o=(C=z.$$events)==null?void 0:C[$.type],p=ke(o)?o.slice():o==null?[]:[o];for(var m of p)m.call(this,$)}var Be=d('<div class="state svelte-1s5glru">加载中…</div>'),De=d('<p class="empty-hint svelte-1s5glru">暂无标签。添加后,pipeline 会对新入库条目自动打标签。</p>'),Ie=d('<span class="tag-meta svelte-1s5glru"> </span>'),Re=d('<div class="tag-badge svelte-1s5glru" role="button" tabindex="0"><span class="tag-name svelte-1s5glru"> </span> <!> <button type="button" class="tag-remove svelte-1s5glru" title="从系统标签中删除">×</button></div>'),Ue=d('<div class="tag-list svelte-1s5glru"></div>'),qe=d('<div class="tag-badge suggested svelte-1s5glru" role="button" tabindex="0"><span class="tag-name svelte-1s5glru"> </span> <span class="tag-meta svelte-1s5glru"> </span> <button type="button" class="tag-add svelte-1s5glru" title="添加到系统标签">+</button></div>'),Ae=d('<div class="suggested-section svelte-1s5glru"><h3 class="section-title svelte-1s5glru">建议添加(文章中出现但未在系统标签库中)</h3> <div class="tag-list svelte-1s5glru"></div></div>'),Xe=d('<div class="body svelte-1s5glru"><div class="tags-section svelte-1s5glru"><h3 class="section-title svelte-1s5glru"> </h3> <!></div> <!></div>'),Ye=d('<div class="context-menu svelte-1s5glru" role="menu" tabindex="-1"><button type="button" class="context-menu-item svelte-1s5glru">从所有文章中移除该标签</button></div>'),Ge=d('<div class="feed-wrap svelte-1s5glru"><div class="feed-col svelte-1s5glru"><div class="feed-toolbar-block svelte-1s5glru"><!> <div class="admin-feed-header"><div class="admin-feed-header__left"><h2>系统标签</h2> <p class="admin-feed-header__desc">系统标签库,新入库条目会由 LLM 自动匹配打标签。</p></div> <div class="admin-feed-header__actions"><input type="text" class="admin-toolbar-input" placeholder="输入新标签,回车添加"/> <button type="button" class="admin-toolbar-btn admin-toolbar-btn--primary">添加</button></div></div></div> <div class="feed-body-scroll"><!></div></div></div> <!>',1);function vt(z,$){Ce($,!1);let o=k([]),p=[],m=k([]),C=k(!0),_=k(!1),M=k(""),b=k(null),J=k(!1);async function oe(){a(C,!0);try{const t=await Y("/api/tags");a(o,(t==null?void 0:t.tags)??[]),p=(t==null?void 0:t.stats)??[],a(m,(t==null?void 0:t.suggestedTags)??[])}catch{a(o,[]),p=[],a(m,[])}finally{a(C,!1)}}function ne(t){return p.find(e=>e.name.toLowerCase()===t.toLowerCase())}async function B(t){a(_,!0);try{const e=await Y("/api/tags",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:t})});if(!(e!=null&&e.ok))throw new Error((e==null?void 0:e.message)??"保存失败");a(o,(e==null?void 0:e.tags)??t),p=(e==null?void 0:e.stats)??[],a(m,(e==null?void 0:e.suggestedTags)??[]),F("已保存","success")}catch(e){F("保存失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{a(_,!1)}}function G(){const t=s(M).trim();if(!(!t||s(_))){if(s(o).some(e=>e.toLowerCase()===t.toLowerCase())){F("标签已存在","error");return}a(M,""),B([...s(o),t])}}function ie(t){s(_)||B(s(o).filter(e=>e!==t))}function le(t){s(_)||s(o).some(e=>e.toLowerCase()===t.toLowerCase())||B([...s(o),t])}function H(t,e){t.preventDefault(),t.stopPropagation(),a(b,{x:t.clientX,y:t.clientY,tag:e})}function D(){a(b,null)}async function ve(t){if(!s(J)){a(J,!0),a(b,null);try{const e=await Y("/api/tags/remove-from-items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:t})});if(!(e!=null&&e.ok))throw new Error((e==null?void 0:e.message)??"操作失败");a(o,(e==null?void 0:e.tags)??s(o)),p=(e==null?void 0:e.stats)??p,a(m,(e==null?void 0:e.suggestedTags)??s(m)),F(`已从 ${(e==null?void 0:e.removedCount)??0} 篇文章中移除该标签`,"success")}catch(e){F("操作失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{a(J,!1)}}}we(()=>{oe();const t=()=>D(),e=()=>D();return document.addEventListener("click",t),document.addEventListener("contextmenu",e),()=>{document.removeEventListener("click",t),document.removeEventListener("contextmenu",e)}}),Ne();var K=Ge();Pe("1s5glru",t=>{Ee(()=>{$e.title=`标签 - ${Se}`})});var I=Te(K),Q=n(I),R=n(Q),V=n(R);je(V,{});var W=i(V,2),Z=i(n(W),2),N=n(Z);Oe(N);var ee=i(N,2);r(Z),r(W),r(R);var te=i(R,2),ce=n(te);{var ue=t=>{var e=Be();u(t,e)},de=t=>{var e=Xe(),T=n(e),h=n(T),fe=n(h);r(h);var pe=i(h,2);{var _e=v=>{var g=De();u(v,g)},be=v=>{var g=Ue();se(g,5,()=>s(o),ae,(j,y)=>{const c=Me(()=>ne(s(y)));var l=Re(),x=n(l),U=n(x,!0);r(x);var L=i(x,2);{var q=w=>{var A=Ie(),xe=n(A);r(A),E(()=>S(xe,`${s(c).count??""} 篇 · 热度 ${s(c).hotness??""}`)),u(w,A)};O(L,w=>{s(c)&&w(q)})}var P=i(L,2);r(l),E(()=>{re(l,"aria-label",`标签 ${s(y)},右键打开菜单`),S(U,s(y)),P.disabled=s(_)}),f("click",P,X(()=>ie(s(y)))),f("contextmenu",l,w=>H(w,s(y))),u(j,l)}),r(g),u(v,g)};O(pe,v=>{s(o).length===0?v(_e):v(be,-1)})}r(T);var he=i(T,2);{var ye=v=>{var g=Ae(),j=i(n(g),2);se(j,5,()=>s(m),ae,(y,c)=>{var l=qe(),x=n(l),U=n(x,!0);r(x);var L=i(x,2),q=n(L);r(L);var P=i(L,2);r(l),E(()=>{re(l,"aria-label",`建议标签 ${s(c).name},右键打开菜单`),S(U,s(c).name),S(q,`${s(c).count??""} 篇 · 热度 ${s(c).hotness??""}`),P.disabled=s(_)}),f("click",P,X(()=>le(s(c).name))),f("contextmenu",l,w=>H(w,s(c).name)),u(y,l)}),r(j),r(g),u(v,g)};O(he,v=>{s(m).length>0&&v(ye)})}r(e),E(()=>S(fe,`当前标签 (${s(o).length??""})`)),u(t,e)};O(ce,t=>{s(C)?t(ue):t(de,-1)})}r(te),r(Q),r(I);var me=i(I,2);{var ge=t=>{var e=Ye(),T=n(e);r(e),E(()=>{Fe(e,`left: ${s(b).x??""}px; top: ${s(b).y??""}px`),T.disabled=s(J)}),f("click",T,()=>ve(s(b).tag)),f("click",e,X(function(h){ze.call(this,$,h)})),f("keydown",e,h=>h.key==="Escape"&&D()),u(t,e)};O(me,t=>{s(b)&&t(ge)})}E(t=>ee.disabled=t,[()=>!s(M).trim()||s(_)]),Je(N,()=>s(M),t=>a(M,t)),f("keydown",N,t=>t.key==="Enter"&&G()),f("click",ee,G),u(z,K),Le()}export{vt as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,t as st,f as p}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as Tt}from"../chunks/Dyvi1wBH.js";import{at as Et,aC as ht,aD as Lt,f as rt,i as t,au as Ot,d as Nt,av as l,az as lt,a5 as o,aw as c,z as h,$ as zt,ax as s,U as b,ay as K}from"../chunks/vtBo8kBV.js";import{d as Jt,a as D,e as Mt,s as Q}from"../chunks/B2cyTHdf.js";import{g as Bt}from"../chunks/ClknbeNl.js";import{i as q}from"../chunks/BkD3yAYe.js";import{e as Ft}from"../chunks/CFwxUBGi.js";import{h as Ht}from"../chunks/DL3Q5sfb.js";import{s as O,P as Kt,r as ot}from"../chunks/DoRPmqLn.js";import{b as it}from"../chunks/C8umpVpB.js";import{i as Qt}from"../chunks/DVa8Y-mQ.js";import{a as G}from"../chunks/CBY2biv-.js";import{p as qt}from"../chunks/
|
|
1
|
+
import{a as u,t as st,f as p}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as Tt}from"../chunks/Dyvi1wBH.js";import{at as Et,aC as ht,aD as Lt,f as rt,i as t,au as Ot,d as Nt,av as l,az as lt,a5 as o,aw as c,z as h,$ as zt,ax as s,U as b,ay as K}from"../chunks/vtBo8kBV.js";import{d as Jt,a as D,e as Mt,s as Q}from"../chunks/B2cyTHdf.js";import{g as Bt}from"../chunks/ClknbeNl.js";import{i as q}from"../chunks/BkD3yAYe.js";import{e as Ft}from"../chunks/CFwxUBGi.js";import{h as Ht}from"../chunks/DL3Q5sfb.js";import{s as O,P as Kt,r as ot}from"../chunks/DoRPmqLn.js";import{b as it}from"../chunks/C8umpVpB.js";import{i as Qt}from"../chunks/DVa8Y-mQ.js";import{a as G}from"../chunks/CBY2biv-.js";import{p as qt}from"../chunks/DXDBlEGf.js";import{g as nt}from"../chunks/Dr67pd7v.js";import{s as m}from"../chunks/CGCMIfh3.js";import{P as Gt}from"../chunks/D6kzEN_P.js";import{D as Vt,a as Wt,b as Xt,c as Yt,d as bt}from"../chunks/DAdOEnFb.js";import{P as Zt}from"../chunks/DsxvjlCC.js";var te=p('<div class="state svelte-1nj0iur">加载中…</div>'),ee=p('<div class="state error svelte-1nj0iur"> </div>'),ae=p('<div class="state svelte-1nj0iur">暂无已加载插件。可 <button type="button" class="link-btn svelte-1nj0iur">添加插件</button> 从模板创建,或在 <code>app/plugins/builtin/</code>、<code>.rssany/plugins/</code> 放置 *.rssany.js / *.rssany.ts</div>'),se=p('<div class="state svelte-1nj0iur">无匹配结果</div>'),re=p('<span class="kind-badge svelte-1nj0iur">Source</span>'),le=p('<button type="button" class="cell-btn cell-btn--primary svelte-1nj0iur">登录</button>'),oe=p('<span class="cell-dash svelte-1nj0iur" title="未声明站点登录">—</span>'),ie=p('<button type="button" class="cell-btn cell-btn--secondary svelte-1nj0iur">检查登录</button>'),ne=p('<span class="cell-dash svelte-1nj0iur" title="未声明站点登录">—</span>'),de=p('<tr class="plugin-row svelte-1nj0iur" tabindex="0"><td class="td-name svelte-1nj0iur"><div class="name-cell svelte-1nj0iur"><span class="plugin-id-text svelte-1nj0iur"> </span> <!></div></td><td class="td-pattern svelte-1nj0iur"><span class="pattern-text svelte-1nj0iur"> </span></td><td class="td-login svelte-1nj0iur"><!></td><td class="td-check svelte-1nj0iur"><!></td></tr>'),ce=p('<div class="plugin-table-wrap svelte-1nj0iur"><table class="plugin-table svelte-1nj0iur"><thead class="svelte-1nj0iur"><tr><th class="th-name svelte-1nj0iur" scope="col">插件名</th><th class="th-pattern svelte-1nj0iur" scope="col">匹配规则</th><th class="th-login svelte-1nj0iur" scope="col">登录</th><th class="th-check svelte-1nj0iur" scope="col">检查登录</th></tr></thead><tbody class="svelte-1nj0iur"></tbody></table></div>'),ve=p('<div class="modal-header svelte-1nj0iur"><!> <!></div> <form class="modal-body svelte-1nj0iur"><p class="add-hint svelte-1nj0iur">对于不支持RSS的站点,添加插件可以覆盖特定站点的解析规则</p> <div class="field svelte-1nj0iur"><span class="field-label svelte-1nj0iur">站点匹配规则</span> <input class="field-input svelte-1nj0iur" type="text" name="listUrlPattern" placeholder="例如 https://www.example.com/* 或 https://example.com/list/{segment}" autocomplete="off"/></div> <div class="field svelte-1nj0iur"><span class="field-label svelte-1nj0iur">插件 id</span> <input class="field-input svelte-1nj0iur" type="text" name="pluginId" placeholder="例如 my-site" autocomplete="off"/></div> <div class="modal-footer svelte-1nj0iur"><div class="modal-footer-right svelte-1nj0iur"><!> <button type="submit" class="btn-save svelte-1nj0iur"> </button></div></div></form>',1),ue=p("<!> <!>",1),pe=p('<div class="feed-wrap svelte-1nj0iur"><div class="feed-col svelte-1nj0iur"><div class="plugins-toolbar-block svelte-1nj0iur"><div class="admin-feed-header"><div class="admin-feed-header__left"><h2>插件</h2> <p class="admin-feed-header__desc">管理站点解析插件与登录检查</p></div> <div class="admin-feed-header__actions"><input class="admin-toolbar-input" type="search" placeholder="过滤…" autocomplete="off"/> <button type="button" class="btn-add svelte-1nj0iur" title="添加插件" aria-label="添加插件"><!></button></div></div></div> <div class="plugins-body-scroll svelte-1nj0iur"><!></div></div></div> <!>',1);function Re(gt,jt){Et(jt,!1);const U=h(),N=h();let $=h([]),z=h(""),V=h(!0),C=h(!1),j=h(""),y=h(""),S=h(!1),J=h("");function dt(){o(j,""),o(y,""),o(C,!0)}function yt(e){o(C,e),e||(o(j,""),o(y,""))}async function wt(e){e.preventDefault();const a=t(j).trim(),i=t(y).trim();if(!a){m("请填写插件 id","error");return}if(!i){m("请填写支持的站点(URL 或匹配规则)","error");return}o(S,!0);try{const n=await G("/api/plugins",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,listUrlPattern:i})}),_=await n.text();let r={};try{r=_?JSON.parse(_):{}}catch{r={}}if(!n.ok){m(r.error||_||`HTTP ${n.status}`,"error");return}r.ok&&(m("已创建插件文件","success"),o(C,!1),o(j,""),o(y,""),await ct(),await nt("/plugins/"+encodeURIComponent(a)))}catch(n){m("请求失败: "+(n instanceof Error?n.message:String(n)),"error")}finally{o(S,!1)}}async function ct(){o(V,!0),o(z,"");try{const a=await(await G("/api/plugins")).json();o($,[...a].sort((i,n)=>(n.hasAuth?1:0)-(i.hasAuth?1:0)))}catch(e){o(z,"加载失败: "+(e instanceof Error?e.message:String(e)))}finally{o(V,!1)}}async function Pt(e,a){a.preventDefault(),a.stopPropagation();try{const n=await(await G(`/auth/check?siteId=${encodeURIComponent(e.id)}`)).json();n.ok?m(`${e.id}:${n.authenticated?"✓ 已登录":"✗ 未登录"}`,n.authenticated?"success":"error"):m(n.message||"检查失败","error")}catch(i){m("请求失败: "+(i instanceof Error?i.message:String(i)),"error")}}function vt(e){nt("/plugins/"+encodeURIComponent(e.id))}function kt(e,a){(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),vt(e))}async function $t(e,a){a.preventDefault(),a.stopPropagation();try{const n=await(await G(`/auth/open?siteId=${encodeURIComponent(e.id)}`,{method:"POST"})).json();n.ok?m(n.message||"已打开登录页面","success"):m(n.message||"打开失败","error")}catch(i){m("请求失败: "+(i instanceof Error?i.message:String(i)),"error")}}Tt(()=>{ct(),Bt(qt).url.searchParams.get("openAdd")==="1"&&(o(j,""),o(y,""),o(C,!0),nt("/plugins",{replaceState:!0}))}),ht(()=>t(J),()=>{o(U,t(J).trim().toLowerCase())}),ht(()=>(t(U),t($)),()=>{o(N,t(U)?t($).filter(e=>e.id.toLowerCase().includes(t(U))||e.listUrlPattern.toLowerCase().includes(t(U))):t($))}),Lt(),Qt();var ut=pe();Ht("1nj0iur",e=>{Nt(()=>{zt.title=`插件 - ${Kt}`})});var W=rt(ut),pt=l(W),X=l(pt),ft=l(X),mt=c(l(ft),2),M=l(mt);ot(M),O(M,"spellcheck",!1);var Y=c(M,2),xt=l(Y);Gt(xt,{size:16,"aria-hidden":"true"}),s(Y),s(mt),s(ft),s(X);var _t=c(X,2),Dt=l(_t);{var Ut=e=>{var a=te();u(e,a)},Ct=e=>{var a=ee(),i=l(a,!0);s(a),lt(()=>Q(i,t(z))),u(e,a)},St=e=>{var a=ae(),i=c(l(a));K(5),s(a),D("click",i,dt),u(e,a)},At=e=>{var a=se();u(e,a)},It=e=>{var a=ce(),i=l(a),n=c(l(i));Ft(n,5,()=>t(N),_=>_.id,(_,r)=>{var g=de(),A=l(g),Z=l(A),x=l(Z),I=l(x,!0);s(x);var B=c(x,2);{var tt=d=>{var v=re();u(d,v)};q(B,d=>{t(r),b(()=>t(r).kind==="source")&&d(tt)})}s(Z),s(A);var w=c(A),P=l(w),R=l(P,!0);s(P),s(w);var k=c(w),T=l(k);{var F=d=>{var v=le();D("click",v,at=>$t(t(r),at)),u(d,v)},H=d=>{var v=oe();u(d,v)};q(T,d=>{t(r),b(()=>t(r).hasAuth)?d(F):d(H,-1)})}s(k);var E=c(k),L=l(E);{var et=d=>{var v=ie();D("click",v,at=>Pt(t(r),at)),u(d,v)},f=d=>{var v=ne();u(d,v)};q(L,d=>{t(r),b(()=>t(r).hasAuth)?d(et):d(f,-1)})}s(E),s(g),lt(()=>{O(g,"aria-label",`打开插件 ${t(r),b(()=>t(r).id)??""}`),Q(I,(t(r),b(()=>t(r).id))),O(P,"title",(t(r),b(()=>t(r).listUrlPattern))),Q(R,(t(r),b(()=>t(r).listUrlPattern)))}),D("click",g,()=>vt(t(r))),D("keydown",g,d=>kt(t(r),d)),u(_,g)}),s(n),s(i),s(a),u(e,a)};q(Dt,e=>{t(V)?e(Ut):t(z)?e(Ct,1):(t($),b(()=>t($).length===0)?e(St,2):(t(N),b(()=>t(N).length===0)?e(At,3):e(It,-1)))})}s(_t),s(pt),s(W);var Rt=c(W,2);Vt(Rt,{get open(){return t(C)},onOpenChange:yt,children:(e,a)=>{Zt(e,{children:(i,n)=>{var _=ue(),r=rt(_);Wt(r,{class:"modal-overlay"});var g=c(r,2);Xt(g,{class:"modal","aria-describedby":void 0,children:(A,Z)=>{var x=ve(),I=rt(x),B=l(I);Yt(B,{class:"modal-title",children:(f,d)=>{K();var v=st("添加插件");u(f,v)},$$slots:{default:!0}});var tt=c(B,2);bt(tt,{class:"modal-close","aria-label":"关闭",children:(f,d)=>{K();var v=st("✕");u(f,v)},$$slots:{default:!0}}),s(I);var w=c(I,2),P=c(l(w),2),R=c(l(P),2);ot(R),O(R,"spellcheck",!1),s(P);var k=c(P,2),T=c(l(k),2);ot(T),O(T,"spellcheck",!1),s(k);var F=c(k,2),H=l(F),E=l(H);bt(E,{class:"btn-cancel",get disabled(){return t(S)},type:"button",children:(f,d)=>{K();var v=st("取消");u(f,v)},$$slots:{default:!0}});var L=c(E,2),et=l(L,!0);s(L),s(H),s(F),s(w),lt(()=>{L.disabled=t(S),Q(et,t(S)?"创建中…":"创建并打开编辑")}),Mt("submit",w,wt),it(R,()=>t(y),f=>o(y,f)),it(T,()=>t(j),f=>o(j,f)),u(A,x)},$$slots:{default:!0}}),u(i,_)},$$slots:{default:!0}})},$$slots:{default:!0}}),it(M,()=>t(J),e=>o(J,e)),D("click",Y,dt),u(gt,ut),Ot()}Jt(["click","keydown"]);export{Re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,f as p}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as m}from"../chunks/Dyvi1wBH.js";import{at as e,au as s,X as i,$ as f}from"../chunks/vtBo8kBV.js";import{h as n}from"../chunks/DL3Q5sfb.js";import{i as c}from"../chunks/DVa8Y-mQ.js";import{g as d}from"../chunks/
|
|
1
|
+
import{a,f as p}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as m}from"../chunks/Dyvi1wBH.js";import{at as e,au as s,X as i,$ as f}from"../chunks/vtBo8kBV.js";import{h as n}from"../chunks/DL3Q5sfb.js";import{i as c}from"../chunks/DVa8Y-mQ.js";import{g as d}from"../chunks/Dr67pd7v.js";var h=p('<p class="redirect-msg svelte-1b0rhdm">正在打开添加插件…</p>');function A(o,r){e(r,!1),m(()=>{d("/plugins?openAdd=1",{replaceState:!0})}),c();var t=h();n("1b0rhdm",l=>{i(()=>{f.title="插件"})}),a(o,t),s()}export{A as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ye,f as Kt,t as wi}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{at as fh,au as uh,aC as al,aD as wu,az as vi,i as B,d as vu,z as Dt,a5 as xe,$ as $u,av as Xe,ax as Le,aw as gn,u as Pu,U as Tu}from"../chunks/vtBo8kBV.js";import{s as Cu,a as Zu}from"../chunks/B6WG2Sd3.js";import{s as $i,e as Au}from"../chunks/B2cyTHdf.js";import{i as yn}from"../chunks/BkD3yAYe.js";import{k as Mu}from"../chunks/DCEayuDt.js";import{h as Ru}from"../chunks/DL3Q5sfb.js";import{i as Xu}from"../chunks/DVa8Y-mQ.js";import{P as Lu}from"../chunks/DoRPmqLn.js";import{a as hl}from"../chunks/CBY2biv-.js";import{p as Du}from"../chunks/
|
|
1
|
+
import{a as Ye,f as Kt,t as wi}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{at as fh,au as uh,aC as al,aD as wu,az as vi,i as B,d as vu,z as Dt,a5 as xe,$ as $u,av as Xe,ax as Le,aw as gn,u as Pu,U as Tu}from"../chunks/vtBo8kBV.js";import{s as Cu,a as Zu}from"../chunks/B6WG2Sd3.js";import{s as $i,e as Au}from"../chunks/B2cyTHdf.js";import{i as yn}from"../chunks/BkD3yAYe.js";import{k as Mu}from"../chunks/DCEayuDt.js";import{h as Ru}from"../chunks/DL3Q5sfb.js";import{i as Xu}from"../chunks/DVa8Y-mQ.js";import{P as Lu}from"../chunks/DoRPmqLn.js";import{a as hl}from"../chunks/CBY2biv-.js";import{p as Du}from"../chunks/DXDBlEGf.js";import{s as cl}from"../chunks/CGCMIfh3.js";import{o as Wu}from"../chunks/Dyvi1wBH.js";import{b as Eu}from"../chunks/B-CeeY89.js";import{p as fl}from"../chunks/BAJAS8BI.js";import{B as _u}from"../chunks/DAV9bzjw.js";let kr=[],dh=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?dh:kr).push(t=t+n[e])})();function zu(n){if(n<768)return!1;for(let e=0,t=kr.length;;){let i=e+t>>1;if(n<kr[i])t=i;else if(n>=dh[i])e=i+1;else return!0;if(e==t)return!1}}function ul(n){return n>=127462&&n<=127487}const dl=8205;function Yu(n,e,t=!0,i=!0){return(t?Oh:Bu)(n,e,i)}function Oh(n,e,t){if(e==n.length)return e;e&&ph(n.charCodeAt(e))&&mh(n.charCodeAt(e-1))&&e--;let i=qs(n,e);for(e+=Ol(i);e<n.length;){let s=qs(n,e);if(i==dl||s==dl||t&&zu(s))e+=Ol(s),i=s;else if(ul(s)){let r=0,o=e-2;for(;o>=0&&ul(qs(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Bu(n,e,t){for(;e>0;){let i=Oh(n,e-2,t);if(i<e)return i;e--}return 0}function qs(n,e){let t=n.charCodeAt(e);if(!mh(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return ph(i)?(t-55296<<10)+(i-56320)+65536:t}function ph(n){return n>=56320&&n<57344}function mh(n){return n>=55296&&n<56320}function Ol(n){return n<65536?1:2}class Y{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=di(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),rt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=di(this,e,t);let i=[];return this.decompose(e,t,i,0),rt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Wi(this),r=new Wi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Wi(this,e)}iterRange(e,t=this.length){return new gh(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new yh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Y.empty:e.length<=32?new ee(e):rt.from(ee.split(e,[]))}}class ee extends Y{constructor(e,t=qu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Vu(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new ee(pl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Bn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new ee(l,o.length+r.length));else{let a=l.length>>1;i.push(new ee(l.slice(0,a)),new ee(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof ee))return super.replace(e,t,i);[e,t]=di(this,e,t);let s=Bn(this.text,Bn(i.text,pl(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new ee(s,r):rt.from(ee.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
|
2
2
|
`){[e,t]=di(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new ee(i,s)),i=[],s=-1);return s>-1&&t.push(new ee(i,s)),t}}class rt extends Y{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=di(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new rt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
3
|
`){[e,t]=di(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof rt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let O of e)O.flatten(d);return new ee(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let O;if(d.lines>r&&d instanceof rt)for(let p of d.children)f(p);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof ee&&a&&(O=c[c.length-1])instanceof ee&&d.lines+O.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new ee(O.text.concat(d.text),O.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:rt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new rt(l,t)}}Y.empty=new ee([""],0);function qu(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Bn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function pl(n,e,t){return Bn(n,[""],e,t)}class Wi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ee?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof ee?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(s instanceof ee){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ee?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class gh{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Wi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class yh{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Y.prototype[Symbol.iterator]=function(){return this.iter()},Wi.prototype[Symbol.iterator]=gh.prototype[Symbol.iterator]=yh.prototype[Symbol.iterator]=function(){return this});class Vu{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function di(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function he(n,e,t=!0,i=!0){return Yu(n,e,t,i)}function Iu(n){return n>=56320&&n<57344}function ju(n){return n>=55296&&n<56320}function ve(n,e){let t=n.charCodeAt(e);if(!ju(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Iu(i)?(t-55296<<10)+(i-56320)+65536:t}function bo(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ot(n){return n<65536?1:2}const wr=/\r\n?|\n/;var de=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(de||(de={}));class ut{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){vr(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new ut(e)}composeDesc(e){return this.empty?e:e.empty?this:xh(this,e)}mapDesc(e,t=!1){return e.empty?this:$r(this,e,t)}mapPos(e,t=-1,i=de.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=de.Simple&&h>=e&&(i==de.TrackDel&&s<e&&h>e||i==de.TrackBefore&&s<e||i==de.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ut(e)}static create(e){return new ut(e)}}class oe extends ut{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return vr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return $r(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(Y.empty);i.push(o?e.slice(r,r+o):Y.empty)}r+=o}return new oe(t,i)}compose(e){return this.empty?e:e.empty?this:xh(this,e,!0)}map(e,t=!1){return e.empty?this:$r(this,e,t,!0)}iterChanges(e,t=!1){vr(this,e,t)}get desc(){return ut.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Vi(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);me(s,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;me(t,c,f),f>0&&vt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);me(t,c,-1),me(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new oe(t,i),filtered:ut.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&me(s,t-o,-1);let f=new oe(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof oe){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let O=d?typeof d=="string"?Y.of(d.split(i||wr)):d:Y.empty,p=O.length;if(f==u&&p==0)return;f<o&&a(),f>o&&me(s,f-o,-1),me(s,u-f,p),vt(r,s,O),o=u}}return h(e),a(!l),l}static empty(e){return new oe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(Y.empty);i[s]=Y.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new oe(t,i)}static createSet(e,t){return new oe(e,t)}}function me(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function vt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Y.empty);n.push(t)}}function vr(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,f=Y.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function $r(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Vi(n),l=new Vi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);me(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(me(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(me(s,0,o.ins),r&&vt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;me(s,h,a<o.i?o.ins:0),r&&a<o.i&&vt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?oe.createSet(s,r):ut.create(s);throw new Error("Mismatched change set lengths")}}}function xh(n,e,t=!1){let i=[],s=t?[]:null,r=new Vi(n),o=new Vi(e);for(let l=!1;;){if(r.done&&o.done)return s?oe.createSet(i,s):ut.create(i);if(r.ins==0)me(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)me(i,0,o.ins,l),s&&vt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;me(i,a,c,l),s&&c&&vt(s,i,o.text)}else o.ins==-1?(me(i,r.off?0:r.len,a,l),s&&vt(s,i,r.textBit(a))):(me(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&vt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Vi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Y.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Y.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Yt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Yt(i,s,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t,void 0,void 0,i);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,s,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(e.anchor,e.head)}static create(e,t,i){return new Yt(e,t,i)}}class x{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:x.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new x([this.main],0)}addRange(e,t=!0){return x.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,x.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new x(e.ranges.map(t=>Yt.fromJSON(t)),e.main)}static single(e,t=e){return new x([x.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return x.normalized(e.slice(),t);i=r.to}return new x(e,t)}static cursor(e,t=0,i,s){return Yt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(e,t,i,s,r){let o=(i??16777215)<<6|(s==null?7:Math.min(6,s));return!r&&e!=t&&(r=t<e?1:-1),t<e?Yt.create(t,e,48|o):Yt.create(e,t,(r?r<0?8:16:0)|o)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?x.range(a,l):x.range(l,a))}}return new x(e,t)}}function bh(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let So=0;class P{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=So++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new P(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Qo),!!e.static,e.enables)}of(e){return new qn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new qn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new qn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Qo(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class qn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=So++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Pr(f,c)){let d=i(f);if(l?!ml(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,O=u.config.address[r];if(O!=null){let p=Jn(u,O);if(this.dependencies.every(g=>g instanceof P?u.facet(g)===f.facet(g):g instanceof pe?u.field(g,!1)==f.field(g,!1):!0)||(l?ml(d=i(f),p,s):s(d=i(f),p)))return f.values[o]=p,0}else d=i(f);return f.values[o]=d,1}}}}function ml(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Pr(n,e){let t=!1;for(let i of e)Ei(n,i)&1&&(t=!0);return t}function Nu(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=Jn(a,i[c]);if(s[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)Ei(a,h);return a.values[o]=l(a),1},update(a,h){if(!Pr(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=Pr(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Qo(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const xn=P.define({static:!0});class pe{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new pe(So++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(xn).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(xn),o=s.facet(xn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,xn.of({field:this,create:e})]}get extension(){return this}}const _t={lowest:4,low:3,default:2,high:1,highest:0};function Pi(n){return e=>new Sh(e,n)}const Xt={highest:Pi(_t.highest),high:Pi(_t.high),default:Pi(_t.default),low:Pi(_t.low),lowest:Pi(_t.lowest)};class Sh{constructor(e,t){this.inner=e,this.prec=t}}class Ps{of(e){return new Tr(this,e)}reconfigure(e){return Ps.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Tr{constructor(e,t){this.compartment=e,this.inner=t}}class Kn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Gu(e,t,o))u instanceof pe?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],O=d[0].facet,p=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[O.id]=a.length<<1|1,Qo(p,d))a.push(i.facet(O));else{let g=O.combine(d.map(y=>y.value));a.push(i&&O.compare(g,i.facet(O))?i.facet(O):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[O.id]=h.length<<1,h.push(g=>Nu(g,O,d))}}let f=h.map(u=>u(l));return new Kn(e,o,f,l,a,r)}}function Gu(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Tr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Tr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Sh)r(o.inner,o.prec);else if(o instanceof pe)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof qn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,_t.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,_t.default),i.reduce((o,l)=>o.concat(l))}function Ei(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Jn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Qh=P.define(),Cr=P.define({combine:n=>n.some(e=>e),static:!0}),kh=P.define({combine:n=>n.length?n[0]:void 0,static:!0}),wh=P.define(),vh=P.define(),$h=P.define(),Ph=P.define({combine:n=>n.length?n[0]:!1});class St{constructor(e,t){this.type=e,this.value=t}static define(){return new Uu}}class Uu{of(e){return new St(this,e)}}class Fu{constructor(e){this.map=e}of(e){return new R(this,e)}}class R{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new R(this.type,t)}is(e){return this.type==e}static define(e={}){return new Fu(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}R.reconfigure=R.define();R.appendConfig=R.define();class ne{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&bh(i,t.newLength),r.some(l=>l.type==ne.time)||(this.annotations=r.concat(ne.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ne(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ne.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ne.time=St.define();ne.userEvent=St.define();ne.addToHistory=St.define();ne.remote=St.define();function Hu(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Th(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=oe.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:R.mapEffects(n.effects,s).concat(R.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function Zr(n,e,t){let i=e.selection,s=oi(e.annotations);return e.userEvent&&(s=s.concat(ne.userEvent.of(e.userEvent))),{changes:e.changes instanceof oe?e.changes:oe.of(e.changes||[],t,n.facet(kh)),selection:i&&(i instanceof x?i:x.single(i.anchor,i.head)),effects:oi(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Ch(n,e,t){let i=Zr(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=Th(i,Zr(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=ne.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Ju(t?Ku(s):s)}function Ku(n){let e=n.startState,t=!0;for(let s of e.facet(wh)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:Hu(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=oe.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=ne.create(e,s,n.selection&&n.selection.map(r),R.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(vh);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof ne?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ne?n=r[0]:n=Ch(e,oi(r),!1)}return n}function Ju(n){let e=n.startState,t=e.facet($h),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Th(i,Zr(e,r,n.changes.newLength),!0))}return i==n?n:ne.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const ed=[];function oi(n){return n==null?ed:Array.isArray(n)?n:[n]}var H=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(H||(H={}));const td=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ar;try{Ar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function id(n){if(Ar)return Ar.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||td.test(t)))return!0}return!1}function nd(n){return e=>{if(!/\S/.test(e))return H.Space;if(id(e))return H.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return H.Word;return H.Other}}class q{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Ei(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Ei(this,i),Jn(this,i)}update(...e){return Ch(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let l of e.effects)l.is(Ps.reconfigure)?(t&&(s=new Map,t.compartments.forEach((a,h)=>s.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(R.reconfigure)?(t=null,i=l.value):l.is(R.appendConfig)&&(t=null,i=oi(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=Kn.resolve(i,s,this),r=new q(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Cr)?e.newSelection:e.newSelection.asSingle();new q(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=oi(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=s.mapDesc(h,!0);r.push(a.range.map(f)),s=s.compose(c),o=R.mapEffects(o,c).concat(R.mapEffects(oi(a.effects),f))}return{changes:s,selection:x.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof oe?e:oe.of(e,this.doc.length,this.facet(q.lineSeparator))}toText(e){return Y.of(e.split(this.facet(q.lineSeparator)||wr))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Ei(this,t),Jn(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof pe&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return q.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Kn.resolve(e.extensions||[],new Map),i=e.doc instanceof Y?e.doc:Y.of((e.doc||"").split(t.staticFacet(q.lineSeparator)||wr)),s=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return bh(s,i.length),t.staticFacet(Cr)||(s=s.asSingle()),new q(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(q.tabSize)}get lineBreak(){return this.facet(q.lineSeparator)||`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,f as r}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{d as m,$ as s}from"../chunks/vtBo8kBV.js";import{h as p}from"../chunks/DL3Q5sfb.js";import{S as n}from"../chunks/
|
|
1
|
+
import{a as t,f as r}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{d as m,$ as s}from"../chunks/vtBo8kBV.js";import{h as p}from"../chunks/DL3Q5sfb.js";import{S as n}from"../chunks/BXTsojX2.js";import{P as f}from"../chunks/DoRPmqLn.js";var i=r('<meta name="description" content="Subscribed sources: labels, counts, pull and manage feeds."/>');function S(e){p("1uha8ag",o=>{var a=i();m(()=>{s.title=`Sources — ${f}`}),t(o,a)}),n(e,{})}export{S as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,f as d}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as Y}from"../chunks/Dyvi1wBH.js";import{at as Z,az as ee,au as te,d as se,i as s,z as h,av as o,aw as c,$ as ae,ax as r,ay as P,a5 as a,f as C}from"../chunks/vtBo8kBV.js";import{e as J,s as x}from"../chunks/B2cyTHdf.js";import{i as N}from"../chunks/BkD3yAYe.js";import{h as oe}from"../chunks/DL3Q5sfb.js";import{P as re,r as R}from"../chunks/DoRPmqLn.js";import{b as A}from"../chunks/C8umpVpB.js";import{i as ie}from"../chunks/DVa8Y-mQ.js";import{B as ne}from"../chunks/
|
|
1
|
+
import{a as p,f as d}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as Y}from"../chunks/Dyvi1wBH.js";import{at as Z,az as ee,au as te,d as se,i as s,z as h,av as o,aw as c,$ as ae,ax as r,ay as P,a5 as a,f as C}from"../chunks/vtBo8kBV.js";import{e as J,s as x}from"../chunks/B2cyTHdf.js";import{i as N}from"../chunks/BkD3yAYe.js";import{h as oe}from"../chunks/DL3Q5sfb.js";import{P as re,r as R}from"../chunks/DoRPmqLn.js";import{b as A}from"../chunks/C8umpVpB.js";import{i as ie}from"../chunks/DVa8Y-mQ.js";import{B as ne}from"../chunks/DAV9bzjw.js";import{b as S}from"../chunks/CBY2biv-.js";import{s as m}from"../chunks/CGCMIfh3.js";var ce=d('<p class="hint svelte-bhaf7m">加载中…</p>'),le=d('<input type="url" class="url-input svelte-bhaf7m" placeholder="https://agidaily.cc/api/gateway"/> <p class="hint svelte-bhaf7m">保存后生效;测试仅向 <code>…/test</code> 发一条合并的连通性请求(示例 items + 当前 sources),不写本地库。</p>',1),me=d('<p class="hint svelte-bhaf7m">加载中…</p>'),fe=d('<input type="password" class="url-input svelte-bhaf7m" placeholder="与下游 token.txt 内容一致,留空则不发送 Authorization" autocomplete="off"/> <p class="hint svelte-bhaf7m">非空时出站请求携带 Bearer。清空并保存可从配置中移除 token 字段。</p>',1),ve=d(`<div class="feed-wrap svelte-bhaf7m"><div class="feed-col svelte-bhaf7m"><div class="body svelte-bhaf7m"><!> <p class="intro svelte-bhaf7m">填写<strong>Gateway 基址</strong>(到 <code class="svelte-bhaf7m">/api/gateway</code> 为止,不要带 <code class="svelte-bhaf7m">/items</code>)。非空时:入库与 Pipeline
|
|
2
2
|
完成后会 <code class="svelte-bhaf7m"> </code>(体为 <code class="svelte-bhaf7m">sourceRef</code> + <code class="svelte-bhaf7m">items</code>);<code class="svelte-bhaf7m">sources.json</code> 变更后会 <code class="svelte-bhaf7m">POST …/sources</code>(正文与本地信源文件一致)。下游按固定路径接收即可。</p> <section class="form-section svelte-bhaf7m"><h3 class="section-title svelte-bhaf7m">Gateway 基址</h3> <!></section> <section class="form-section svelte-bhaf7m"><h3 class="section-title svelte-bhaf7m">Gateway 令牌(可选)</h3> <!></section> <section class="form-section svelte-bhaf7m"><div class="btn-row svelte-bhaf7m"><button type="button" class="btn btn-primary svelte-bhaf7m"> </button> <button type="button" class="btn btn-secondary svelte-bhaf7m"> </button></div></section></div></div></div>`);function Se(M,U){Z(U,!1);let i=h(""),n=h(""),l=h(!0),b=h(!1),u=h(!1);async function $(){a(l,!0);try{const e=await S("/api/deliver");a(i,(e==null?void 0:e.gateway)??""),a(n,(e==null?void 0:e.token)??"")}catch{a(i,""),a(n,"")}finally{a(l,!1)}}async function D(){a(b,!0);try{const e=await S("/api/deliver",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({gateway:s(i).trim(),token:s(n).trim()})});if(!(e!=null&&e.ok))throw new Error((e==null?void 0:e.message)??"保存失败");a(i,(e==null?void 0:e.gateway)??s(i)),a(n,(e==null?void 0:e.token)??s(n)),m("已保存","success")}catch(e){m("保存失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{a(b,!1)}}async function F(){const e=s(i).trim();if(!e){m("请先填写 Gateway 基址","error");return}a(u,!0);try{const t=await S("/api/deliver/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gateway:e,token:s(n).trim()})});t!=null&&t.ok?m("Gateway 测试投递成功(POST …/test)","success"):m("测试失败: "+((t==null?void 0:t.message)??"未知错误"),"error")}catch(t){m("测试失败: "+(t instanceof Error?t.message:String(t)),"error")}finally{a(u,!1)}}Y($),ie();var _=ve();oe("bhaf7m",e=>{se(()=>{ae.title=`投递 - ${re}`})});var O=o(_),G=o(O),E=o(G);ne(E,{});var g=c(E,2),j=c(o(g),7),q=o(j);r(j),P(9),r(g);var w=c(g,2),H=c(o(w),2);{var I=e=>{var t=ce();p(e,t)},K=e=>{var t=le(),v=C(t);R(v),P(2),A(v,()=>s(i),T=>a(i,T)),p(e,t)};N(H,e=>{s(l)?e(I):e(K,-1)})}r(w);var k=c(w,2),L=c(o(k),2);{var Q=e=>{var t=me();p(e,t)},V=e=>{var t=fe(),v=C(t);R(v),P(2),A(v,()=>s(n),T=>a(n,T)),p(e,t)};N(L,e=>{s(l)?e(Q):e(V,-1)})}r(k);var z=c(k,2),B=o(z),f=o(B),W=o(f,!0);r(f);var y=c(f,2),X=o(y,!0);r(y),r(B),r(z),r(G),r(O),r(_),ee(e=>{x(q,`POST ${(s(i)||"…")??""}/items`),f.disabled=s(b)||s(l),x(W,s(b)?"保存中…":"保存"),y.disabled=e,x(X,s(u)?"测试中…":"测试 Gateway")},[()=>s(u)||s(l)||!s(i).trim()]),J("click",f,D),J("click",y,F),p(M,_),te()}export{Se as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,f as p,t as ve}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as ce}from"../chunks/Dyvi1wBH.js";import{at as pe,az as R,au as me,d as fe,av as i,aw as n,$ as de,i as o,ax as l,a5 as s,z as c,f as ue,ay as j}from"../chunks/vtBo8kBV.js";import{e as z,s as $}from"../chunks/B2cyTHdf.js";import{i as b}from"../chunks/BkD3yAYe.js";import{h as ge}from"../chunks/DL3Q5sfb.js";import{P as _e,r as U,s as E}from"../chunks/DoRPmqLn.js";import{b as O}from"../chunks/C8umpVpB.js";import{i as ye}from"../chunks/DVa8Y-mQ.js";import{B as he}from"../chunks/
|
|
1
|
+
import{a as v,f as p,t as ve}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as ce}from"../chunks/Dyvi1wBH.js";import{at as pe,az as R,au as me,d as fe,av as i,aw as n,$ as de,i as o,ax as l,a5 as s,z as c,f as ue,ay as j}from"../chunks/vtBo8kBV.js";import{e as z,s as $}from"../chunks/B2cyTHdf.js";import{i as b}from"../chunks/BkD3yAYe.js";import{h as ge}from"../chunks/DL3Q5sfb.js";import{P as _e,r as U,s as E}from"../chunks/DoRPmqLn.js";import{b as O}from"../chunks/C8umpVpB.js";import{i as ye}from"../chunks/DVa8Y-mQ.js";import{B as he}from"../chunks/DAV9bzjw.js";import{b as C}from"../chunks/CBY2biv-.js";import{s as w}from"../chunks/CGCMIfh3.js";var be=p('<p class="hint svelte-1a0dvmg">加载中…</p>'),we=p('<input type="url" class="text-input svelte-1a0dvmg" placeholder="https://api.openai.com/v1" autocomplete="off"/>'),xe=p('<input type="text" class="text-input svelte-1a0dvmg" placeholder="gpt-4o-mini" autocomplete="off"/>'),Ke=p('<p class="hint svelte-1a0dvmg">加载中…</p>'),Pe=p("当前<strong>可用</strong>(文件或环境变量)。",1),Ae=p("未检测到 Key,请填写或设置 <code>OPENAI_API_KEY</code>。",1),Ie=p('<input type="password" class="text-input svelte-1a0dvmg" autocomplete="new-password"/> <p class="hint svelte-1a0dvmg"><!> <!></p>',1),ke=p('<div class="feed-wrap svelte-1a0dvmg"><div class="feed-col svelte-1a0dvmg"><div class="body svelte-1a0dvmg"><!> <p class="intro svelte-1a0dvmg">与 OpenAI 兼容的 Chat Completions API,用于列表解析、正文提取、Pipeline 打标签与翻译等。</p> <section class="form-section svelte-1a0dvmg"><h3 class="section-title svelte-1a0dvmg">API Base URL</h3> <!></section> <section class="form-section svelte-1a0dvmg"><h3 class="section-title svelte-1a0dvmg">模型</h3> <!></section> <section class="form-section svelte-1a0dvmg"><h3 class="section-title svelte-1a0dvmg">API Key</h3> <!></section> <section class="form-section svelte-1a0dvmg"><div class="btn-row svelte-1a0dvmg"><button type="button" class="btn btn-primary svelte-1a0dvmg"> </button> <button type="button" class="btn btn-secondary svelte-1a0dvmg"> </button></div></section></div></div></div>');function je(D,Y){pe(Y,!1);let m=c(""),f=c(""),u=c(""),g=c(!1),_=c(!1),d=c(!0),x=c(!1),K=c(!1);async function q(){s(d,!0);try{const e=await C("/api/llm");s(m,(e==null?void 0:e.baseUrl)??""),s(f,(e==null?void 0:e.model)??""),s(g,!!(e!=null&&e.hasApiKey)),s(_,!!(e!=null&&e.apiKeyInFile)),s(u,"")}catch{s(m,""),s(f,""),s(g,!1),s(_,!1)}finally{s(d,!1)}}async function G(){s(x,!0);try{const e={baseUrl:o(m).trim(),model:o(f).trim()},a=o(u).trim();a&&(e.apiKey=a);const t=await C("/api/llm",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!(t!=null&&t.ok))throw new Error((t==null?void 0:t.message)??"保存失败");s(m,(t==null?void 0:t.baseUrl)??o(m)),s(f,(t==null?void 0:t.model)??o(f)),s(g,!!(t!=null&&t.hasApiKey)),s(_,!!(t!=null&&t.apiKeyInFile)),s(u,""),w("已保存","success")}catch(e){w("保存失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{s(x,!1)}}async function H(){s(K,!0);try{const e=await C("/api/llm/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e!=null&&e.ok){const a=typeof e.reply=="string"?e.reply.trim():"";w(a?`连接成功:${a.slice(0,120)}${a.length>120?"…":""}`:"连接成功","success")}else w("测试失败: "+((e==null?void 0:e.message)??"未知错误"),"error")}catch(e){w("测试失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{s(K,!1)}}ce(q),ye();var A=ke();ge("1a0dvmg",e=>{fe(()=>{de.title=`LLM - ${_e}`})});var S=i(A),F=i(S),N=i(F);he(N,{});var I=n(N,4),Q=n(i(I),2);{var V=e=>{var a=be();v(e,a)},W=e=>{var a=we();U(a),O(a,()=>o(m),t=>s(m,t)),v(e,a)};b(Q,e=>{o(d)?e(V):e(W,-1)})}l(I);var k=n(I,2),X=n(i(k),2);{var Z=e=>{var a=xe();U(a),E(a,"spellcheck",!1),O(a,()=>o(f),t=>s(f,t)),v(e,a)};b(X,e=>{o(d)||e(Z)})}l(k);var T=n(k,2),ee=n(i(T),2);{var te=e=>{var a=Ke();v(e,a)},se=e=>{var a=Ie(),t=ue(a);U(t),E(t,"spellcheck",!1);var L=n(t,2),M=i(L);{var re=r=>{var h=Pe();j(2),v(r,h)},ie=r=>{var h=Ae();j(2),v(r,h)};b(M,r=>{o(g)?r(re):r(ie,-1)})}var le=n(M,2);{var ne=r=>{var h=ve("已写入配置文件。");v(r,h)};b(le,r=>{o(_)&&r(ne)})}l(L),R(()=>E(t,"placeholder",o(_)?"已保存在配置中,留空表示不修改":"sk-...")),O(t,()=>o(u),r=>s(u,r)),v(e,a)};b(ee,e=>{o(d)?e(te):e(se,-1)})}l(T);var B=n(T,2),J=i(B),y=i(J),ae=i(y,!0);l(y);var P=n(y,2),oe=i(P,!0);l(P),l(J),l(B),l(F),l(S),l(A),R(()=>{y.disabled=o(x)||o(d),$(ae,o(x)?"保存中…":"保存"),P.disabled=o(K)||o(d)||!o(g),$(oe,o(K)?"测试中…":"测试连接")}),z("click",y,G),z("click",P,H),v(D,A),me()}export{je as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,f as m}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as i}from"../chunks/Dyvi1wBH.js";import{at as f,au as n}from"../chunks/vtBo8kBV.js";import{s as l,a as u}from"../chunks/B6WG2Sd3.js";import{i as c}from"../chunks/DVa8Y-mQ.js";import{g}from"../chunks/
|
|
1
|
+
import{a as e,f as m}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as i}from"../chunks/Dyvi1wBH.js";import{at as f,au as n}from"../chunks/vtBo8kBV.js";import{s as l,a as u}from"../chunks/B6WG2Sd3.js";import{i as c}from"../chunks/DVa8Y-mQ.js";import{g}from"../chunks/Dr67pd7v.js";import{p as $}from"../chunks/DXDBlEGf.js";var v=m('<p class="muted svelte-1w6l7vk">正在跳转…</p>');function b(o,t){f(t,!1);const a=()=>u($,"$page",r),[r,s]=l();i(()=>{g("/logs"+a().url.search,{replaceState:!0})}),c();var p=v();e(o,p),n(),s()}export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w,f as O}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{at as M,az as T,i as s,au as W,d as X,av as t,a5 as o,z as d,$ as Y,ay as I,ax as r,aw as v}from"../chunks/vtBo8kBV.js";import{e as F,s as S}from"../chunks/B2cyTHdf.js";import{i as J}from"../chunks/BkD3yAYe.js";import{h as G}from"../chunks/DL3Q5sfb.js";import{P as K,r as q}from"../chunks/DoRPmqLn.js";import{b as C}from"../chunks/C8umpVpB.js";import{p as Q}from"../chunks/Bfc47y5P.js";import{i as V}from"../chunks/DVa8Y-mQ.js";import{B as Z}from"../chunks/
|
|
1
|
+
import{a as w,f as O}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{at as M,az as T,i as s,au as W,d as X,av as t,a5 as o,z as d,$ as Y,ay as I,ax as r,aw as v}from"../chunks/vtBo8kBV.js";import{e as F,s as S}from"../chunks/B2cyTHdf.js";import{i as J}from"../chunks/BkD3yAYe.js";import{h as G}from"../chunks/DL3Q5sfb.js";import{P as K,r as q}from"../chunks/DoRPmqLn.js";import{b as C}from"../chunks/C8umpVpB.js";import{p as Q}from"../chunks/Bfc47y5P.js";import{i as V}from"../chunks/DVa8Y-mQ.js";import{B as Z}from"../chunks/DAV9bzjw.js";var ee=O('<div class="result-error svelte-1x680s0" role="alert"> </div>'),se=O('<div class="result-wrap svelte-1x680s0"><p class="result-label svelte-1x680s0">解析结果(与下方接口一致)</p> <pre class="result-json svelte-1x680s0"> </pre></div>'),te=O('<div class="feed-wrap svelte-1x680s0"><div class="feed-col svelte-1x680s0"><div class="feed-header svelte-1x680s0"><!> <h2 class="svelte-1x680s0">Parse</h2> <p class="page-desc svelte-1x680s0">从列表页解析条目结构,返回 JSON,用于调试插件 Parser 规则</p></div> <div class="body svelte-1x680s0"><form><div class="url-row svelte-1x680s0"><input type="url" placeholder="输入列表页地址…" required="" autocomplete="url" class="svelte-1x680s0"/> <button type="submit" class="svelte-1x680s0"> </button></div> <div class="proxy-row svelte-1x680s0"><input type="text" placeholder="代理(可选),如 http://127.0.0.1:7890 — 覆盖信源与 HTTP_PROXY" autocomplete="off" spellcheck="false" class="svelte-1x680s0"/></div></form> <!> <!> <div class="info-box svelte-1x680s0"><p class="svelte-1x680s0">抓取在<strong>服务端</strong>执行,默认<strong>有头</strong> Chrome(与信源同一套 Puppeteer),会弹出可见窗口;本页 <code class="svelte-1x680s0">fetch</code> 仅用于展示 JSON。需要无头时在 URL 加 <code class="svelte-1x680s0">?headless=true</code>。</p> <p class="info-note svelte-1x680s0">返回中的 <code class="svelte-1x680s0">effectiveProxy</code> 为本次抓取实际选用的代理。若需在看得到的窗口里验证出口 IP,请在该 Puppeteer 窗口内打开 <code class="svelte-1x680s0">api.ipify.org</code> 等(勿用本机普通浏览器标签测代理)。</p></div></div></div></div>');function ue(z,B){M(B,!1);let i=d(""),m=d(""),n=d(!1),c=d(""),p=d("");async function D(){if(s(i).trim()){o(n,!0),o(c,""),o(p,"");try{const e=s(i).startsWith("http")?s(i):"https://"+s(i),a=new URLSearchParams,l=s(m).trim();l&&a.set("proxy",l);const u=a.toString(),b=await fetch("/admin/parse/"+encodeURIComponent(e)+(u?"?"+u:""),{credentials:"include"}),P=await b.text();if(!b.ok){o(c,P||`HTTP ${b.status}`);return}try{o(p,JSON.stringify(JSON.parse(P),null,2))}catch{o(p,P)}}catch(e){o(c,e instanceof Error?e.message:String(e))}finally{o(n,!1)}}}V();var x=te();G("1x680s0",e=>{X(()=>{Y.title=`Parse - ${K}`})});var R=t(x),_=t(R),E=t(_);Z(E,{}),I(4),r(_);var $=v(_,2),f=t($),h=t(f),g=t(h);q(g);var y=v(g,2),H=t(y,!0);r(y),r(h);var N=v(h,2),U=t(N);q(U),r(N),r(f);var k=v(f,2);{var L=e=>{var a=ee(),l=t(a,!0);r(a),T(()=>S(l,s(c))),w(e,a)};J(k,e=>{s(c)&&e(L)})}var j=v(k,2);{var A=e=>{var a=se(),l=v(t(a),2),u=t(l,!0);r(l),r(a),T(()=>S(u,s(p))),w(e,a)};J(j,e=>{s(p)&&e(A)})}I(2),r($),r(R),r(x),T(()=>{y.disabled=s(n),S(H,s(n)?"解析中…":"解析")}),C(g,()=>s(i),e=>o(i,e)),C(U,()=>s(m),e=>o(m,e)),F("submit",f,Q(D)),w(z,x),W()}export{ue as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,f as g}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as se}from"../chunks/Dyvi1wBH.js";import{at as te,au as re,d as le,av as o,$ as ie,ay as B,ax as i,aw as c,i as a,a5 as r,z as b,az as T,aA as oe}from"../chunks/vtBo8kBV.js";import{s as I,e as f}from"../chunks/B2cyTHdf.js";import{i as O}from"../chunks/BkD3yAYe.js";import{e as ne,i as de}from"../chunks/CFwxUBGi.js";import{h as ve}from"../chunks/DL3Q5sfb.js";import{P as ce,r as fe,a as pe,b as me}from"../chunks/DoRPmqLn.js";import{i as ue}from"../chunks/DVa8Y-mQ.js";import{B as be}from"../chunks/
|
|
1
|
+
import{a as u,f as g}from"../chunks/CS53ooo0.js";import"../chunks/BA4Gucnq.js";import{o as se}from"../chunks/Dyvi1wBH.js";import{at as te,au as re,d as le,av as o,$ as ie,ay as B,ax as i,aw as c,i as a,a5 as r,z as b,az as T,aA as oe}from"../chunks/vtBo8kBV.js";import{s as I,e as f}from"../chunks/B2cyTHdf.js";import{i as O}from"../chunks/BkD3yAYe.js";import{e as ne,i as de}from"../chunks/CFwxUBGi.js";import{h as ve}from"../chunks/DL3Q5sfb.js";import{P as ce,r as fe,a as pe,b as me}from"../chunks/DoRPmqLn.js";import{i as ue}from"../chunks/DVa8Y-mQ.js";import{B as be}from"../chunks/DAV9bzjw.js";import{b as $}from"../chunks/CBY2biv-.js";import{s as z}from"../chunks/CGCMIfh3.js";var ge=g('<div class="state svelte-jqd85f">加载中…</div>'),_e=g('<div role="listitem" draggable="true"><span class="drag-handle svelte-jqd85f" title="拖拽排序">⋮⋮</span> <label class="toggle-wrap svelte-jqd85f"><input type="checkbox" class="svelte-jqd85f"/> <span class="toggle-slider svelte-jqd85f"></span></label> <span class="step-label svelte-jqd85f"> </span></div>'),he=g('<button type="button" class="btn-add svelte-jqd85f">+ 添加步骤</button>'),je=g('<div class="body svelte-jqd85f"><section class="pipeline-section svelte-jqd85f"><h3 class="section-title svelte-jqd85f">Pipeline(入库前)</h3> <p class="hint svelte-jqd85f">对每条新入库条目执行,顺序由上到下。</p> <div class="step-list svelte-jqd85f" role="list"></div> <!></section> <div class="save-row svelte-jqd85f"><button type="button" class="btn btn-primary svelte-jqd85f"> </button></div></div>'),qe=g('<div class="feed-wrap svelte-jqd85f"><div class="feed-col svelte-jqd85f"><div class="feed-header svelte-jqd85f"><!> <h2 class="svelte-jqd85f">Pipeline</h2> <p class="page-desc svelte-jqd85f">入库前处理(打标签、翻译),可调整顺序与开关。</p></div> <!></div></div>');function $e(C,F){te(F,!1);const J={qualityFilter:"质量过滤",tagger:"打标签",translator:"翻译"};let t=b([]),_=b([]),q=b(!0),p=b(!1),m=b(null);async function L(){r(q,!0);try{const e=await $("/api/pipeline");r(t,(e==null?void 0:e.steps)??[]),r(_,(e==null?void 0:e.availableIds)??[])}catch{r(t,[]),r(_,[])}finally{r(q,!1)}}async function M(){r(p,!0);try{const e=await $("/api/pipeline",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({steps:a(t)})});if(!(e!=null&&e.ok))throw new Error((e==null?void 0:e.message)??"保存失败");r(t,(e==null?void 0:e.steps)??a(t)),z("已保存","success")}catch(e){z("保存失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{r(p,!1)}}function N(e){r(t,a(t).map((s,l)=>l===e?{...s,enabled:!s.enabled}:s))}function R(e){r(m,e)}function U(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move")}function G(e){if(a(m)==null)return;const s=[...a(t)],[l]=s.splice(a(m),1);s.splice(e,0,l),r(t,s),r(m,null)}function H(){const e=new Set(a(t).map(l=>l.id)),s=a(_).find(l=>!e.has(l));s&&r(t,[...a(t),{id:s,enabled:!1}])}se(L),ue();var y=qe();ve("jqd85f",e=>{le(()=>{ie.title=`Pipeline - ${ce}`})});var k=o(y),w=o(k),K=o(w);be(K,{}),B(4),i(w);var Q=c(w,2);{var V=e=>{var s=ge();u(e,s)},W=e=>{var s=je(),l=o(s),x=c(o(l),4);ne(x,5,()=>a(t),de,(d,n,j)=>{var v=_e();let D;var P=c(o(v),2),S=o(P);fe(S),B(2),i(P);var A=c(P,2),ae=o(A,!0);i(A),i(v),T(()=>{D=pe(v,1,"step-row svelte-jqd85f",null,D,{dragging:a(m)===j}),me(S,a(n).enabled),I(ae,J[a(n).id]??a(n).id)}),f("change",S,()=>N(j)),f("dragstart",v,()=>R(j)),f("dragover",v,U),f("drop",v,()=>G(j)),u(d,v)}),i(x);var X=c(x,2);{var Y=d=>{var n=he();T(()=>n.disabled=a(p)),f("click",n,H),u(d,n)},Z=oe(()=>a(_).some(d=>!a(t).some(n=>n.id===d)));O(X,d=>{a(Z)&&d(Y)})}i(l);var E=c(l,2),h=o(E),ee=o(h,!0);i(h),i(E),i(s),T(()=>{h.disabled=a(p),I(ee,a(p)?"保存中…":"保存")}),f("click",h,M),u(e,s)};O(Q,e=>{a(q)?e(V):e(W,-1)})}i(k),i(y),u(C,y),re()}export{$e as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1780571209371"}
|
package/dist/index.js
CHANGED
|
@@ -3920,7 +3920,7 @@ const CACHE_KEY_PREFIX = "feed-favicon:v1:";
|
|
|
3920
3920
|
const CACHE_MAX_AGE_SEC = 3 * 24 * 60 * 60;
|
|
3921
3921
|
const CACHE_MAX_AGE_MS = CACHE_MAX_AGE_SEC * 1e3;
|
|
3922
3922
|
const CACHE_CONTROL = `public, max-age=${CACHE_MAX_AGE_SEC}`;
|
|
3923
|
-
const FETCH_TIMEOUT_MS = 6e3;
|
|
3923
|
+
const FETCH_TIMEOUT_MS$1 = 6e3;
|
|
3924
3924
|
const MAX_ICON_BYTES = 2 * 1024 * 1024;
|
|
3925
3925
|
const MAX_HTML_BYTES = 512 * 1024;
|
|
3926
3926
|
const inflightByDomain = /* @__PURE__ */ new Map();
|
|
@@ -4008,7 +4008,7 @@ async function fetchHtmlPage(url) {
|
|
|
4008
4008
|
Accept: "text/html,application/xhtml+xml;q=0.9,*/*;q=0.1",
|
|
4009
4009
|
"User-Agent": "Mozilla/5.0 (compatible; RssAny/1.0; +https://github.com/rssany/rssany) favicon"
|
|
4010
4010
|
},
|
|
4011
|
-
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
|
|
4011
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS$1)
|
|
4012
4012
|
});
|
|
4013
4013
|
if (!upstream.ok) return null;
|
|
4014
4014
|
const ab = await upstream.arrayBuffer();
|
|
@@ -4105,7 +4105,7 @@ async function fetchIconCandidate(url) {
|
|
|
4105
4105
|
Accept: "image/avif,image/webp,image/apng,image/*,*/*;q=0.8",
|
|
4106
4106
|
"User-Agent": "Mozilla/5.0 (compatible; RssAny/1.0; +https://github.com/rssany/rssany) favicon"
|
|
4107
4107
|
},
|
|
4108
|
-
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
|
|
4108
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS$1)
|
|
4109
4109
|
});
|
|
4110
4110
|
} catch {
|
|
4111
4111
|
return null;
|
|
@@ -4216,9 +4216,53 @@ function registerFeedFaviconRoutes(app) {
|
|
|
4216
4216
|
});
|
|
4217
4217
|
});
|
|
4218
4218
|
}
|
|
4219
|
+
const MAX_BYTES = 5 * 1024 * 1024;
|
|
4220
|
+
const FETCH_TIMEOUT_MS = 12e3;
|
|
4221
|
+
function isAllowedImageUrl(raw) {
|
|
4222
|
+
try {
|
|
4223
|
+
const url = new URL(raw);
|
|
4224
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return null;
|
|
4225
|
+
if (!url.hostname) return null;
|
|
4226
|
+
return url;
|
|
4227
|
+
} catch {
|
|
4228
|
+
return null;
|
|
4229
|
+
}
|
|
4230
|
+
}
|
|
4231
|
+
function registerCoverImgRoutes(app) {
|
|
4232
|
+
app.get("/api/cover-img", async (c) => {
|
|
4233
|
+
const raw = (c.req.query("url") ?? "").trim();
|
|
4234
|
+
if (!raw) return c.text("missing url", 400);
|
|
4235
|
+
const url = isAllowedImageUrl(raw);
|
|
4236
|
+
if (!url) return c.text("invalid url", 400);
|
|
4237
|
+
try {
|
|
4238
|
+
const res = await fetch(url.toString(), {
|
|
4239
|
+
redirect: "follow",
|
|
4240
|
+
headers: {
|
|
4241
|
+
Accept: "image/avif,image/webp,image/apng,image/*,*/*;q=0.8",
|
|
4242
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
|
|
4243
|
+
Referer: `${url.origin}/`
|
|
4244
|
+
},
|
|
4245
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
|
|
4246
|
+
});
|
|
4247
|
+
if (!res.ok) return c.text("upstream error", 502);
|
|
4248
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
4249
|
+
if (buf.length > MAX_BYTES) return c.text("too large", 413);
|
|
4250
|
+
const ct = (res.headers.get("content-type") ?? "application/octet-stream").split(";")[0].trim();
|
|
4251
|
+
return new Response(buf, {
|
|
4252
|
+
headers: {
|
|
4253
|
+
"Content-Type": ct,
|
|
4254
|
+
"Cache-Control": "public, max-age=86400"
|
|
4255
|
+
}
|
|
4256
|
+
});
|
|
4257
|
+
} catch {
|
|
4258
|
+
return c.text("fetch failed", 502);
|
|
4259
|
+
}
|
|
4260
|
+
});
|
|
4261
|
+
}
|
|
4219
4262
|
function registerApiRoutes(app) {
|
|
4220
4263
|
registerServerRoutes(app);
|
|
4221
4264
|
registerFeedFaviconRoutes(app);
|
|
4265
|
+
registerCoverImgRoutes(app);
|
|
4222
4266
|
registerRssApiRoutes(app);
|
|
4223
4267
|
registerSchedulerRoutes(app);
|
|
4224
4268
|
registerPluginsRoutes(app);
|