crewx 0.8.7-rc.21 → 0.8.7-rc.23

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.
Files changed (60) hide show
  1. package/dist/assets/{MarketPage-aY16UW1_.js → MarketPage-lLBtAENs.js} +10 -15
  2. package/dist/assets/{PromptTab-C3aTJS6u.js → PromptTab-Daq54dMi.js} +1 -1
  3. package/dist/assets/_baseUniq-BJDqmZBO.js +1 -0
  4. package/dist/assets/{arc-BCQAokB1.js → arc-ByjRIa5p.js} +1 -1
  5. package/dist/assets/{architectureDiagram-UYN6MBPD-Bc87ujv2.js → architectureDiagram-UYN6MBPD-DcKpqSFb.js} +1 -1
  6. package/dist/assets/{blockDiagram-ZHA2E4KO-wC9uH8Lb.js → blockDiagram-ZHA2E4KO-YvUeULT5.js} +1 -1
  7. package/dist/assets/{c4Diagram-6F5ED5ID-CqB7lqni.js → c4Diagram-6F5ED5ID-vggzH2N5.js} +1 -1
  8. package/dist/assets/channel-1Y6YooBb.js +1 -0
  9. package/dist/assets/{chunk-5HRBRIJM-Cc1L17Eh.js → chunk-5HRBRIJM-BbaQwJkn.js} +1 -1
  10. package/dist/assets/{chunk-7U56Z5CX-Df3nu_7G.js → chunk-7U56Z5CX-DVYVpFaa.js} +1 -1
  11. package/dist/assets/{chunk-ASOPGD6M-DIXslLG-.js → chunk-ASOPGD6M-CXEvWb-8.js} +1 -1
  12. package/dist/assets/{chunk-KFBOBJHC-FytVljyP.js → chunk-KFBOBJHC-CadVXFV3.js} +1 -1
  13. package/dist/assets/{chunk-T2TOU4HS-CU5z-cXq.js → chunk-T2TOU4HS-lDZr1sVF.js} +1 -1
  14. package/dist/assets/{chunk-TMUBEWPD-CWo1AFyn.js → chunk-TMUBEWPD-D5A0MrFD.js} +1 -1
  15. package/dist/assets/classDiagram-LNE6IOMH-CDxkV2JV.js +1 -0
  16. package/dist/assets/classDiagram-v2-MQ7JQ4JX-CDxkV2JV.js +1 -0
  17. package/dist/assets/clone-6xznz_9G.js +1 -0
  18. package/dist/assets/{dagre-4EVJKHTY-CgZW5tg4.js → dagre-4EVJKHTY-Bncx7Ijq.js} +1 -1
  19. package/dist/assets/{diagram-QW4FP2JN-CJAng8RC.js → diagram-QW4FP2JN-RkxVNs99.js} +1 -1
  20. package/dist/assets/{erDiagram-6RL3IURR-C1uHztHX.js → erDiagram-6RL3IURR-DIiKqQdx.js} +1 -1
  21. package/dist/assets/{flowDiagram-7ASYPVHJ-Yiu2odO-.js → flowDiagram-7ASYPVHJ-DQ5PN7v6.js} +1 -1
  22. package/dist/assets/{ganttDiagram-NTVNEXSI-tutc0dJP.js → ganttDiagram-NTVNEXSI-BeNWGpB6.js} +1 -1
  23. package/dist/assets/{gitGraph-YCYPL57B-C3jM6T4G.js → gitGraph-YCYPL57B-CdMe059q.js} +1 -1
  24. package/dist/assets/{gitGraphDiagram-NRZ2UAAF-0aqHEKzz.js → gitGraphDiagram-NRZ2UAAF-BEke5TyK.js} +1 -1
  25. package/dist/assets/{graph-DC224ILV.js → graph-DyQIwWJd.js} +1 -1
  26. package/dist/assets/{infoDiagram-A4XQUW5V-Do7Mpzkx.js → infoDiagram-A4XQUW5V-CUcC8I_5.js} +1 -1
  27. package/dist/assets/{journeyDiagram-G5WM74LC-DAruEJc7.js → journeyDiagram-G5WM74LC-CQ5DqAH5.js} +1 -1
  28. package/dist/assets/{kanban-definition-QRCXZQQD-DB63vLR0.js → kanban-definition-QRCXZQQD-BBsgOii7.js} +1 -1
  29. package/dist/assets/{layout-BiYH5x6Q.js → layout-D7vBs_Wy.js} +1 -1
  30. package/dist/assets/{linear-CLyGW2s0.js → linear-CEOF9oJz.js} +1 -1
  31. package/dist/assets/{main-CEKkUqZb.js → main-Bx1nZ7_p.js} +278 -273
  32. package/dist/assets/main-C4ebvOIJ.css +10 -0
  33. package/dist/assets/{min-ChJMFU2N.js → min-RK9J5Utn.js} +1 -1
  34. package/dist/assets/{mindmap-definition-GWI6TPTV-CtADqQgd.js → mindmap-definition-GWI6TPTV-BXvEU7qC.js} +1 -1
  35. package/dist/assets/{pieDiagram-YF2LJOPJ-BSOfzo3O.js → pieDiagram-YF2LJOPJ-TrXqcpni.js} +1 -1
  36. package/dist/assets/{quadrantDiagram-OS5C2QUG-BLBQNFVb.js → quadrantDiagram-OS5C2QUG-B-chTEU4.js} +1 -1
  37. package/dist/assets/{requirementDiagram-MIRIMTAZ-DqorvuS6.js → requirementDiagram-MIRIMTAZ-BgJhNLp_.js} +1 -1
  38. package/dist/assets/{sankeyDiagram-Y46BX6SQ-4NDcrLkB.js → sankeyDiagram-Y46BX6SQ-BVsgYKK7.js} +1 -1
  39. package/dist/assets/{sequenceDiagram-G6AWOVSC-yha6BxK2.js → sequenceDiagram-G6AWOVSC-ByJOpkq3.js} +1 -1
  40. package/dist/assets/{stateDiagram-MAYHULR4-XJ_I41ez.js → stateDiagram-MAYHULR4-Dw7lUL1B.js} +1 -1
  41. package/dist/assets/stateDiagram-v2-4JROLMXI-DYJiM3bF.js +1 -0
  42. package/dist/assets/{timeline-definition-U7ZMHBDA-DCNrmvE7.js → timeline-definition-U7ZMHBDA-CSoEYs60.js} +1 -1
  43. package/dist/assets/{xychartDiagram-6QU3TZC5-9N-Ohhdp.js → xychartDiagram-6QU3TZC5-0_rG7p3L.js} +1 -1
  44. package/dist/index.html +2 -2
  45. package/dist-server/app.module.js +2 -0
  46. package/dist-server/domain/cron/cron.controller.js +115 -0
  47. package/dist-server/domain/cron/cron.module.js +22 -0
  48. package/dist-server/domain/cron/cron.service.js +71 -0
  49. package/dist-server/domain/cron/dto/cron.dto.js +80 -0
  50. package/dist-server/domain/market/default-marketplace.json +24 -0
  51. package/dist-server/package.json +3 -0
  52. package/package.json +9 -9
  53. package/packages/cli/package.json +1 -1
  54. package/dist/assets/_baseUniq-DxEFlwNt.js +0 -1
  55. package/dist/assets/channel-DNLHkiNp.js +0 -1
  56. package/dist/assets/classDiagram-LNE6IOMH-B430Onym.js +0 -1
  57. package/dist/assets/classDiagram-v2-MQ7JQ4JX-B430Onym.js +0 -1
  58. package/dist/assets/clone-B9O3E3P1.js +0 -1
  59. package/dist/assets/main-D3YeRndF.css +0 -10
  60. package/dist/assets/stateDiagram-v2-4JROLMXI-CxcyPJO2.js +0 -1
@@ -1,51 +1,46 @@
1
- import{aJ as j,aK as Ue,aL as b,aM as N,aN as Pe,aO as g,aP as e,aQ as ue,aR as Z,aS as de,aT as I,aU as ge,aV as pe,aW as Ve,aX as ye,aY as J,aZ as Fe,a_ as Oe,a$ as Be,b0 as he,b1 as He,b2 as Qe}from"./main-CEKkUqZb.js";/**
1
+ import{aJ as j,aK as Ue,aL as b,aM as N,aN as Pe,aO as g,aP as e,aQ as ue,aR as Z,aS as de,aT as I,aU as ge,aV as pe,aW as Ve,aX as ye,aY as J,aZ as Fe,a_ as Oe,a$ as Be,b0 as He,b1 as he,b2 as Qe,b3 as We}from"./main-Bx1nZ7_p.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const We=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fe=j("badge-check",We);/**
6
+ */const qe=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fe=j("badge-check",qe);/**
7
7
  * @license lucide-react v0.563.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const qe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],be=j("circle-arrow-up",qe);/**
11
+ */const Ke=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],be=j("circle-arrow-up",Ke);/**
12
12
  * @license lucide-react v0.563.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Ke=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ge=j("clock-3",Ke);/**
16
+ */const Ge=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],je=j("layout-template",Ge);/**
17
17
  * @license lucide-react v0.563.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const Ze=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],je=j("layout-template",Ze);/**
21
+ */const Ze=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ne=j("plug",Ze);/**
22
22
  * @license lucide-react v0.563.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const Je=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ne=j("plug",Je);/**
26
+ */const Je=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ve=j("puzzle",Je);/**
27
27
  * @license lucide-react v0.563.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const Xe=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ve=j("puzzle",Xe);/**
31
+ */const Xe=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],Ye=j("scale",Xe);/**
32
32
  * @license lucide-react v0.563.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const Ye=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],et=j("scale",Ye);/**
36
+ */const et=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],tt=j("settings-2",et);/**
37
37
  * @license lucide-react v0.563.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const tt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],at=j("settings-2",tt);/**
41
+ */const at=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],F=j("shield-alert",at);/**
42
42
  * @license lucide-react v0.563.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const st=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],F=j("shield-alert",st);/**
47
- * @license lucide-react v0.563.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const rt=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],ke=j("workflow",rt);function T(t){return t instanceof Error?t.message:String(t)}function nt(t){return[...t].sort((a,r)=>a.isInstalled!==r.isInstalled?a.isInstalled?-1:1:(a.displayName||a.name).localeCompare(r.displayName||r.name))}const oe={trusted:2,verified:1,unverified:0};function lt(t,a){return oe[t]>=oe[a]?t:a}function it(t=[],a=[]){return Array.from(new Set([...t,...a]))}function ce(t,a){var s;if(!t)return a;const r=lt(t.trustLevel,a.trustLevel);return{...t,...a,displayName:a.displayName||t.displayName||a.name,description:a.description||t.description,author:a.author||t.author,version:a.version||t.version,tags:it(t.tags,a.tags),type:a.type||t.type,trustLevel:r,isVerified:r!=="unverified",isInstalled:t.isInstalled||a.isInstalled,registryId:a.registryId??t.registryId,registryName:a.registryName??t.registryName,installSource:a.installSource??t.installSource,hasUpdate:a.hasUpdate??t.hasUpdate,remoteVersion:a.remoteVersion??t.remoteVersion,isCustomized:a.isCustomized??t.isCustomized,authors:(s=a.authors)!=null&&s.length?a.authors:t.authors,updatedAt:a.updatedAt??t.updatedAt,stars:a.stars??t.stars,license:a.license??t.license,installCount:a.installCount??t.installCount}}function dt(t){return t.toLowerCase().replace(/[\s_]+/g,"-")}function V(t){const a=new Map;for(const s of t){const d=dt(s.name),l=a.get(d)??[];l.push(s),a.set(d,l)}const r=[];for(const[,s]of a){if(s.length===1){r.push(s[0]);continue}const d=s.find(l=>l.isInstalled);if(d){const l=s.find(c=>c.registryId&&c.registryId!=="_local"),o=l?ce(l,d):d;r.push(o)}else{const l=new Map;for(const o of s){const c=o.registryId??"_local",u=l.get(c);l.set(c,ce(u,o))}r.push(...l.values())}}return nt(r)}function ot(t){return t.find(a=>a.isDefault)??t.find(a=>a.trustLevel!=="unverified")??t[0]??null}function ct(t,a){return V([...t,...a])}function G(t,a){var r;return a&&t.some(s=>s.name===a)?a:((r=t[0])==null?void 0:r.name)??null}const mt=Ue((t,a)=>({initialized:!1,loading:!1,loadingOfficial:!1,loadingInstalled:!1,savingRegistry:!1,deletingRegistryId:null,mutatingItemName:null,error:null,registries:[],officialRegistryId:null,allItems:[],activeFilter:"all",searchQuery:"",selectedItemName:null,setActiveFilter:r=>t({activeFilter:r}),setSearchQuery:r=>t({searchQuery:r}),setSelectedItem:r=>t({selectedItemName:r}),initialize:async()=>{const r=a().selectedItemName;t({loading:!0,loadingOfficial:!0,loadingInstalled:!0,error:null});try{const[s,d,l]=await Promise.all([b.getMarketRegistries(),b.getMarketItems(),b.getInstalledMarkets()]),o=s.registries,c=ot(o),u=d.items,m=V(l.items.filter(h=>!h.source||h.source==="local")),y=ct(u,m);t({initialized:!0,loading:!1,loadingOfficial:!1,loadingInstalled:!1,registries:o,officialRegistryId:(c==null?void 0:c.id)??null,allItems:y,selectedItemName:G(y,r)}),b.checkMarketUpdates().then(h=>{!h||Object.keys(h).length===0||t(p=>({allItems:p.allItems.map(z=>{const v=h[z.name];return v?{...z,hasUpdate:v.hasUpdate,remoteVersion:v.remoteVersion,isCustomized:v.isCustomized}:z})}))}).catch(()=>{})}catch(s){throw t({loading:!1,loadingOfficial:!1,loadingInstalled:!1,error:T(s)}),s}},refresh:async()=>{await a().initialize()},addRegistry:async(r,s)=>{const d=r.trim();if(!d){const l=new Error("Registry URL is required");throw t({error:l.message}),l}t({savingRegistry:!0,error:null});try{const l=(s==null?void 0:s.trim())||void 0;await b.addMarketRegistry(d,l),await a().initialize(),t({savingRegistry:!1})}catch(l){throw t({savingRegistry:!1,error:T(l)}),l}},deleteRegistry:async r=>{t({deletingRegistryId:r,error:null});try{await b.deleteMarketRegistry(r),await a().initialize(),t({deletingRegistryId:null})}catch(s){throw t({deletingRegistryId:null,error:T(s)}),s}},installItem:async(r,s)=>{t({mutatingItemName:s,error:null});try{await b.installMarketItem(r,s),t(d=>{const l=d.registries.find(c=>c.id===r),o=V(d.allItems.map(c=>c.name===s?{...c,isInstalled:!0,registryId:c.registryId??r,registryName:c.registryName??(l==null?void 0:l.name)}:c));return{allItems:o,mutatingItemName:null,selectedItemName:G(o,d.selectedItemName??s)}})}catch(d){throw t({mutatingItemName:null,error:T(d)}),d}},uninstallItem:async r=>{t({mutatingItemName:r,error:null});try{await b.uninstallMarketItem(r),t(s=>{const d=V(s.allItems.map(l=>l.name===r?{...l,isInstalled:!1}:l));return{allItems:d,mutatingItemName:null,selectedItemName:G(d,s.selectedItemName)}})}catch(s){throw t({mutatingItemName:null,error:T(s)}),s}},clearError:()=>t({error:null})}));function we(t,a){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":new Intl.DateTimeFormat(a,{year:"numeric",month:"short",day:"numeric"}).format(r)}function xt(t,a){if(!t)return null;const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const s=r.getTime()-Date.now(),d=[{unit:"year",ms:1e3*60*60*24*365},{unit:"month",ms:1e3*60*60*24*30},{unit:"week",ms:1e3*60*60*24*7},{unit:"day",ms:1e3*60*60*24},{unit:"hour",ms:1e3*60*60},{unit:"minute",ms:1e3*60}],l=new Intl.RelativeTimeFormat(a,{numeric:"auto"});for(const o of d)if(Math.abs(s)>=o.ms||o.unit==="minute")return l.format(Math.round(s/o.ms),o.unit);return null}function me(t,a){return typeof t!="number"?"—":new Intl.NumberFormat(a,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}).format(t)}function X(t){switch(t==null?void 0:t.toLowerCase()){case"template":return"template";case"agent":return"agent";case"workflow":return"workflow";case"plugin":return"plugin";default:return"skill"}}function Ie({type:t}){const{t:a}=N(),r=X(t),s={skill:"bg-violet-50 text-violet-700",template:"bg-amber-50 text-amber-700",agent:"bg-emerald-50 text-emerald-700",workflow:"bg-cyan-50 text-cyan-700",plugin:"bg-rose-50 text-rose-700"},d={skill:ve,template:je,agent:ge,workflow:ke,plugin:Ne},l={skill:a("market.types.skill"),template:a("market.types.template"),agent:a("market.types.agent"),workflow:a("market.types.workflow"),plugin:a("market.types.plugin")},o=d[r];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ${s[r]}`,children:[e.jsx(o,{size:12}),l[r]]})}const ut={trusted:{bg:"bg-green-50",text:"text-green-700",icon:pe,label:"market.badges.trusted"},verified:{bg:"bg-blue-50",text:"text-blue-700",icon:fe,label:"market.badges.verified"},unverified:{bg:"bg-gray-50",text:"text-gray-500",icon:F,label:"market.badges.unverified"}};function gt({level:t}){const{t:a}=N(),r=ut[t],s=r.icon;return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium ${r.bg} ${r.text}`,children:[e.jsx(s,{size:13}),a(r.label)]})}function Ce(t){if(t.trustLevel==="unverified"){if(t.type==="plugin")return{allowed:!1,reason:"market.trust.blockedPlugin"};if(t.type==="exec")return{allowed:!1,reason:"market.trust.blockedExec"}}return t.trustLevel==="verified"&&t.type==="plugin"?{allowed:!0,needsConfirm:!0}:{allowed:!0}}function pt({itemName:t,onConfirm:a,onCancel:r}){const{t:s}=N();return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"w-full max-w-md overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s("market.pluginDialog.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("market.pluginDialog.description")})]}),e.jsxs("div",{className:"space-y-3 px-6 py-5",children:[e.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-3",children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:t}),e.jsx("p",{className:"mt-1 text-sm text-amber-800",children:s("market.pluginDialog.warning")})]}),e.jsxs("ul",{className:"space-y-2 text-sm text-gray-600",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(F,{size:14,className:"shrink-0 text-amber-500"}),s("market.pluginDialog.perm1")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(F,{size:14,className:"shrink-0 text-amber-500"}),s("market.pluginDialog.perm2")]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[e.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:s("market.actions.cancel")}),e.jsx("button",{type:"button",onClick:a,className:"rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600",children:s("market.actions.install")})]})]})})}function yt({url:t,tokenEnv:a,error:r,submitting:s,onChangeUrl:d,onChangeTokenEnv:l,onClose:o,onSubmit:c}){const{t:u}=N(),m=y=>{y.preventDefault(),c()};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"w-full max-w-xl overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:u("market.addRegistryModal.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:u("market.addRegistryModal.description")})]}),e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"space-y-4 px-6 py-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"registry-url",className:"mb-2 block text-sm font-medium text-gray-700",children:u("market.addRegistryModal.urlLabel")}),e.jsx("input",{id:"registry-url",type:"url",value:t,onChange:y=>d(y.target.value),placeholder:u("market.addRegistryModal.urlPlaceholder"),className:"w-full rounded-lg border border-gray-300 px-4 py-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"registry-token-env",className:"mb-2 block text-sm font-medium text-gray-700",children:[u("market.addRegistryModal.tokenEnvLabel","Token Env Variable"),e.jsx("span",{className:"ml-1 text-xs font-normal text-gray-400",children:u("market.addRegistryModal.optional","(optional)")})]}),e.jsx("input",{id:"registry-token-env",type:"text",value:a,onChange:y=>l(y.target.value),placeholder:u("market.addRegistryModal.tokenEnvPlaceholder","e.g. GITHUB_TOKEN"),className:"w-full rounded-lg border border-gray-300 px-4 py-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"}),e.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:u("market.addRegistryModal.tokenEnvHint","Environment variable name for private GitHub PAT. The token value must be set in .env or shell profile.")})]}),e.jsx("div",{className:"rounded-xl border border-blue-200 bg-blue-50 px-4 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-white text-blue-600",children:e.jsx(He,{size:18})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-blue-900",children:u("market.addRegistryModal.compatibilityTitle")}),e.jsx("p",{className:"mt-1 text-sm leading-6 text-blue-800",children:u("market.addRegistryModal.compatibilityDescription")})]})]})}),r&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-red-700",children:[e.jsx(Z,{size:18,className:"mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm",children:r})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[e.jsx("button",{type:"button",onClick:o,disabled:s,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:u("market.actions.cancel")}),e.jsxs("button",{type:"submit",disabled:s,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50",children:[s?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(J,{size:16}),u("market.actions.addRegistry")]})]})]})]})})}function ht({registry:t,deleting:a,onDelete:r}){const{t:s,i18n:d}=N();return e.jsxs("article",{className:"flex flex-col gap-4 rounded-xl border border-gray-200 bg-white p-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("div",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${t.trustLevel!=="unverified"?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-500"}`,children:e.jsx(he,{size:20})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-base font-semibold text-gray-900",children:t.name}),e.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ${t.isDefault?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"}`,children:t.isDefault?s("market.registryCard.defaultBadge"):s("market.registryCard.customBadge")})]}),e.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"mt-2 inline-flex break-all text-sm text-blue-600 hover:text-blue-700",children:[e.jsx("span",{children:t.url}),e.jsx(Qe,{size:14,className:"ml-1 mt-0.5 shrink-0"})]})]})]}),e.jsxs("button",{type:"button",onClick:()=>r(t.id),disabled:t.isDefault||a,className:`inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${t.isDefault?"cursor-not-allowed bg-gray-100 text-gray-400":"bg-red-50 text-red-600 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-50"}`,children:[a?e.jsx(I,{size:15,className:"animate-spin"}):e.jsx(ye,{size:15}),t.isDefault?s("market.registryCard.lockedAction"):s("market.actions.deleteRegistry")]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:s("market.registryCard.skillCount")}),e.jsx("p",{className:"mt-1 text-lg font-semibold text-gray-900",children:t.itemCount})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:s("market.registryCard.addedAt")}),e.jsx("p",{className:"mt-1 text-sm font-medium text-gray-900",children:we(t.addedAt,d.language)})]})]}),e.jsx("p",{className:"text-xs text-gray-500",children:t.isDefault?s("market.registryCard.defaultHint"):s("market.registryCard.customHint")})]})}function ft({registries:t,loading:a,deletingRegistryId:r,onAdd:s,onClose:d,onDelete:l}){const{t:o}=N();return e.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"flex max-h-[85vh] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:o("market.registryModal.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:o("market.registryModal.description")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600",children:[e.jsx(J,{size:16}),o("market.actions.addRegistry")]}),e.jsx("button",{type:"button",onClick:d,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:o("market.actions.close")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:a?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(I,{size:22,className:"animate-spin text-gray-400"})}):t.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-300 px-6 py-16 text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(he,{size:20})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-gray-900",children:o("market.empty.registryTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:o("market.empty.registryDescription")})]}):e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:t.map(c=>e.jsx(ht,{registry:c,deleting:r===c.id,onDelete:l},c.id))})})]})})}function xe({skill:t,selected:a,onSelect:r}){const{t:s,i18n:d}=N(),l=xt(t.updatedAt,d.language),o=X(t.type),c={skill:ve,template:je,agent:ge,workflow:ke,plugin:Ne},u={skill:t.isInstalled?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-500",template:"bg-amber-100 text-amber-700",agent:"bg-emerald-100 text-emerald-700",workflow:"bg-cyan-100 text-cyan-700",plugin:"bg-rose-100 text-rose-700"},m=c[o];return e.jsx("button",{type:"button",onClick:()=>r(t.name),className:`w-full rounded-xl border p-3 text-left transition-colors ${a?"border-blue-200 bg-blue-50 shadow-sm":"border-transparent bg-white hover:border-gray-200 hover:bg-gray-50"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl ${u[o]}`,children:e.jsx(m,{size:18})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:t.displayName||t.name}),t.trustLevel==="trusted"&&e.jsx(pe,{className:"h-3.5 w-3.5 shrink-0 text-green-600"}),t.trustLevel==="verified"&&e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),e.jsx(Ie,{type:t.type})]}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500",children:t.description||s("market.card.noDescription")}),e.jsxs("p",{className:"mt-2 text-[11px] text-gray-400",children:[t.registryName||t.author||s("market.card.unknownAuthor"),l?` · ${s("market.list.updatedLabel",{time:l})}`:""]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[t.isInstalled&&e.jsx("span",{className:"rounded-full bg-green-100 px-2 py-0.5 text-[10px] font-medium text-green-700",children:s("market.badges.installed")}),t.hasUpdate&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-orange-50 px-2 py-0.5 text-[10px] font-medium text-orange-700",children:[e.jsx(be,{size:10}),s("market.badges.updateAvailable",{version:t.remoteVersion})]})]})]})})}function P({icon:t,label:a,value:r}){return e.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"text-gray-400",children:t}),e.jsx("span",{children:a})]}),e.jsx("p",{className:"mt-2 text-sm font-semibold text-gray-900",children:r})]})}function bt({skill:t,markdownBody:a,descriptionLoading:r,descriptionError:s,busy:d,canInstall:l,onInstall:o,onUninstall:c,onRefresh:u}){const{t:m,i18n:y}=N(),h=typeof(t==null?void 0:t.installCount)=="number";return t?e.jsxs("section",{className:"flex h-full min-h-[520px] flex-col rounded-2xl border border-gray-200 bg-white p-6 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-gray-200 pb-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{className:"text-2xl font-semibold text-gray-900",children:t.displayName||t.name}),e.jsxs("span",{className:"rounded-full bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-600",children:["v",t.version]}),t.hasUpdate&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-orange-50 px-2.5 py-1 text-xs font-medium text-orange-700",children:[e.jsx(be,{size:12}),m("market.badges.updateAvailable",{version:t.remoteVersion})]}),e.jsx(Ie,{type:t.type}),e.jsx(gt,{level:t.trustLevel})]}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:t.registryName||t.author||m("market.card.unknownAuthor")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.isInstalled?e.jsxs("button",{type:"button",onClick:()=>c(t.name),disabled:d,className:"inline-flex items-center gap-2 rounded-lg bg-red-50 px-4 py-2 text-sm font-medium text-red-600 transition-colors hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-50",children:[d?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(ye,{size:16}),m("market.actions.uninstall")]}):(()=>{const p=Ce(t);return p.allowed?e.jsxs("button",{type:"button",onClick:()=>o(t),disabled:d||!l,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50",children:[d?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(J,{size:16}),m("market.actions.install")]}):e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-400",children:[e.jsx(F,{size:16}),m(p.reason)]})})(),e.jsxs("button",{type:"button",onClick:u,className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:[e.jsx(ue,{size:16}),m("market.actions.checkUpdates")]})]})]}),e.jsxs("div",{className:"space-y-6 py-6",children:[t.isCustomized&&t.hasUpdate&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3",children:[e.jsx(Z,{size:16,className:"mt-0.5 shrink-0 text-amber-600"}),e.jsx("p",{className:"text-sm text-amber-800",children:m("market.badges.customizedWarning")})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.description")}),e.jsxs("div",{className:"mt-2",children:[t.description&&e.jsx("p",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-600",children:t.description}),r?e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-gray-500",children:[e.jsx(I,{size:16,className:"animate-spin"}),e.jsx("span",{children:m("market.detail.loadingBody")})]}):a!=null&&a.trim()?e.jsx("div",{className:t.description?"mt-3 border-t border-gray-100 pt-3":"",children:e.jsx(Fe,{content:a,className:"text-sm"})}):e.jsxs(e.Fragment,{children:[s&&e.jsx("div",{className:"mt-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:s}),!t.description&&e.jsx("p",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-600",children:m("market.card.noDescription")})]})]})]}),t.tags.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.tags")}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.tags.map(p=>e.jsxs("span",{className:"rounded-full border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs text-gray-600",children:["#",p]},p))})]}),t.authors&&t.authors.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.developers")}),e.jsx("div",{className:"mt-3 space-y-3",children:t.authors.map(p=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:p.avatarUrl,alt:`@${p.login}`,className:"h-8 w-8 rounded-full border border-gray-200 object-cover"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium text-gray-900",children:p.name||p.login}),e.jsxs("div",{className:"text-xs text-gray-500",children:["@",p.login]})]}),typeof p.contributions=="number"&&e.jsx("div",{className:"text-xs text-gray-400",children:m("market.detail.contributions",{count:p.contributions})})]},`${t.name}-${p.login}`))})]})]}),e.jsxs("div",{className:`mt-auto grid gap-3 border-t border-gray-200 pt-6 sm:grid-cols-2 ${h?"xl:grid-cols-4":"xl:grid-cols-3"}`,children:[e.jsx(P,{icon:e.jsx(Oe,{size:14}),label:m("market.detail.stats.stars"),value:me(t.stars,y.language)}),h&&e.jsx(P,{icon:e.jsx(Be,{size:14}),label:m("market.detail.stats.installs"),value:me(t.installCount,y.language)}),e.jsx(P,{icon:e.jsx(et,{size:14}),label:m("market.detail.stats.license"),value:t.license||m("market.detail.unavailable")}),e.jsx(P,{icon:e.jsx(Ge,{size:14}),label:m("market.detail.stats.updatedAt"),value:we(t.updatedAt,y.language)})]})]}):e.jsx("div",{className:"flex h-full min-h-[520px] items-center justify-center rounded-2xl border border-gray-200 bg-white p-8 shadow-sm",children:e.jsxs("div",{className:"max-w-sm text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(Ve,{size:20})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-gray-900",children:m("market.detail.emptyTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:m("market.detail.emptyDescription")})]})})}function Nt(){const{t}=N(),{setPageHeader:a}=Pe(),[r,s]=g.useState(!1),[d,l]=g.useState(!1),[o,c]=g.useState(""),[u,m]=g.useState(""),[y,h]=g.useState(null),[p,L]=g.useState({}),[z,v]=g.useState(null),[Me,O]=g.useState(null),[_,B]=g.useState(null),{initialized:Y,loading:$,savingRegistry:ze,deletingRegistryId:Re,mutatingItemName:De,error:ee,registries:Te,officialRegistryId:R,allItems:C,activeFilter:M,searchQuery:H,selectedItemName:S,setActiveFilter:Le,setSearchQuery:_e,setSelectedItem:E,initialize:te,refresh:A,addRegistry:ae,deleteRegistry:se,installItem:re,uninstallItem:ne,clearError:U}=mt();g.useEffect(()=>{Y||te().catch(()=>{})},[Y,te]);const le=g.useMemo(()=>C.filter(n=>n.isInstalled).length,[C]),k=g.useMemo(()=>{const n=H.trim().toLowerCase();return C.filter(x=>M==="installed"&&!x.isInstalled||M!=="all"&&M!=="installed"&&X(x.type)!==M?!1:n?[x.displayName,x.name,x.description,x.author,x.registryName,...x.tags].filter(w=>!!w).some(w=>w.toLowerCase().includes(n)):!0)},[M,C,H]),i=g.useMemo(()=>k.find(n=>n.name===S)??k[0]??null,[k,S]),Q=i?p[i.name]:void 0;g.useEffect(()=>{const n=(i==null?void 0:i.name)??null;n!==S&&E(n)},[i,S,E]),g.useEffect(()=>{if(!i)return;if(Q!==void 0){O(null);return}let n=!1;const x=i.name;return v(x),O(null),(i.isInstalled?b.getInstalledMarketDetail(x).then(f=>f.body??""):(()=>{const f=i.registryId??R;return f?b.getRemoteMarketDetail(f,x).then(D=>D.body??""):Promise.resolve("")})()).then(f=>{n||L(D=>({...D,[x]:f}))}).catch(f=>{if(!n){if(!i.isInstalled){L(D=>({...D,[x]:""}));return}O(f instanceof Error?f.message:t("market.errors.detailLoad"))}}).finally(()=>{n||v(f=>f===x?null:f)}),()=>{n=!0}},[i==null?void 0:i.isInstalled,i==null?void 0:i.name,i==null?void 0:i.registryId,Q,R,t]);const W=g.useCallback(n=>{n&&L(x=>{if(!(n in x))return x;const w={...x};return delete w[n],w})},[]);g.useEffect(()=>{a({title:t("market.title"),subtitle:t("market.subtitle.summary",{total:C.length,installed:le}),actions:e.jsxs("button",{type:"button",onClick:()=>{U(),W((i==null?void 0:i.name)??null),A().catch(()=>{})},className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:[e.jsx(ue,{size:16,className:$?"animate-spin":""}),t("market.actions.refresh")]})})},[C.length,U,$,A,W,i==null?void 0:i.name,a,t,le]);const q=g.useCallback(n=>{const x=n.registryId??R;x&&re(x,n.name).catch(()=>{})},[re,R]),$e=g.useCallback(n=>{const x=Ce(n);if(x.allowed){if(x.needsConfirm){B(n);return}q(n)}},[q]),Se=g.useCallback(n=>{window.confirm(t("market.actions.confirmUninstall",{name:n}))&&ne(n).catch(()=>{})},[t,ne]),Ee=g.useCallback(n=>{se(n).catch(()=>{})},[se]),Ae=g.useCallback(async()=>{h(null);try{await ae(o,u||void 0),c(""),m(""),l(!1)}catch(n){h(n instanceof Error?n.message:t("market.errors.addRegistry"))}},[ae,o,u,t]),K=k.filter(n=>n.isInstalled),ie=k.filter(n=>!n.isInstalled);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-6",children:[ee&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-red-700",children:[e.jsx(Z,{size:18,className:"mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:t("market.errors.bannerTitle")}),e.jsx("p",{className:"mt-1 break-words text-sm",children:ee})]}),e.jsx("button",{type:"button",onClick:()=>{U(),A().catch(()=>{})},className:"shrink-0 rounded-md bg-red-100 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:t("market.actions.retry")})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-gray-200 bg-white p-4 shadow-sm lg:flex-row lg:items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(de,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"search",value:H,onChange:n=>_e(n.target.value),placeholder:t("market.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 py-2.5 pl-10 pr-4 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("button",{type:"button",onClick:()=>s(!0),className:"inline-flex items-center justify-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-100",children:[e.jsx(at,{size:16}),t("market.actions.manageSources")]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["all","installed","skill","template","agent"].map(n=>e.jsx("button",{type:"button",onClick:()=>Le(n),className:`rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${M===n?"border-blue-500 bg-blue-500 text-white":"border-gray-200 bg-white text-gray-600 hover:bg-gray-50"}`,children:t(`market.filters.${n}`)},n))}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[360px_minmax(0,1fr)]",children:[e.jsxs("section",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("div",{className:"border-b border-gray-200 px-4 py-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:t("market.list.title")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:t("market.list.count",{count:k.length})})]}),e.jsx("div",{className:"max-h-[640px] overflow-y-auto p-3",children:$?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(I,{size:22,className:"animate-spin text-gray-400"})}):k.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-300 px-4 py-12 text-center",children:[e.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(de,{size:18})}),e.jsx("h3",{className:"mt-3 text-sm font-semibold text-gray-900",children:t("market.empty.filteredTitle")}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:t("market.empty.filteredDescription")})]}):e.jsxs("div",{className:"space-y-3",children:[K.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"px-1 text-xs font-semibold uppercase tracking-wide text-gray-400",children:t("market.list.installedHeading")}),K.map(n=>e.jsx(xe,{skill:n,selected:(i==null?void 0:i.name)===n.name,onSelect:E},`${n.registryId??"_"}:${n.name}`))]}),ie.length>0&&e.jsxs("div",{className:"space-y-2",children:[K.length>0&&e.jsx("p",{className:"px-1 pt-2 text-xs font-semibold uppercase tracking-wide text-gray-400",children:t("market.list.availableHeading")}),ie.map(n=>e.jsx(xe,{skill:n,selected:(i==null?void 0:i.name)===n.name,onSelect:E},`${n.registryId??"_"}:${n.name}`))]})]})})]}),e.jsx(bt,{skill:i,markdownBody:Q,descriptionLoading:i?z===i.name:!1,descriptionError:Me,busy:i?De===i.name:!1,canInstall:!!((i==null?void 0:i.registryId)??R),onInstall:$e,onUninstall:Se,onRefresh:()=>{U(),W((i==null?void 0:i.name)??null),A().catch(()=>{})}})]})]}),r&&e.jsx(ft,{registries:Te,loading:$,deletingRegistryId:Re,onAdd:()=>{h(null),c(""),m(""),l(!0)},onClose:()=>s(!1),onDelete:Ee}),d&&e.jsx(yt,{url:o,tokenEnv:u,error:y,submitting:ze,onChangeUrl:c,onChangeTokenEnv:m,onClose:()=>{h(null),l(!1)},onSubmit:Ae}),_&&e.jsx(pt,{itemName:_.displayName||_.name,onConfirm:()=>{q(_),B(null)},onCancel:()=>B(null)})]})}export{Nt as default};
46
+ */const st=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],we=j("workflow",st);function T(t){return t instanceof Error?t.message:String(t)}function rt(t){return[...t].sort((a,r)=>a.isInstalled!==r.isInstalled?a.isInstalled?-1:1:(a.displayName||a.name).localeCompare(r.displayName||r.name))}const oe={trusted:2,verified:1,unverified:0};function nt(t,a){return oe[t]>=oe[a]?t:a}function lt(t=[],a=[]){return Array.from(new Set([...t,...a]))}function ce(t,a){var s;if(!t)return a;const r=nt(t.trustLevel,a.trustLevel);return{...t,...a,displayName:a.displayName||t.displayName||a.name,description:a.description||t.description,author:a.author||t.author,version:a.version||t.version,tags:lt(t.tags,a.tags),type:a.type||t.type,trustLevel:r,isVerified:r!=="unverified",isInstalled:t.isInstalled||a.isInstalled,registryId:a.registryId??t.registryId,registryName:a.registryName??t.registryName,installSource:a.installSource??t.installSource,hasUpdate:a.hasUpdate??t.hasUpdate,remoteVersion:a.remoteVersion??t.remoteVersion,isCustomized:a.isCustomized??t.isCustomized,authors:(s=a.authors)!=null&&s.length?a.authors:t.authors,updatedAt:a.updatedAt??t.updatedAt,stars:a.stars??t.stars,license:a.license??t.license,installCount:a.installCount??t.installCount}}function it(t){return t.toLowerCase().replace(/[\s_]+/g,"-")}function V(t){const a=new Map;for(const s of t){const d=it(s.name),l=a.get(d)??[];l.push(s),a.set(d,l)}const r=[];for(const[,s]of a){if(s.length===1){r.push(s[0]);continue}const d=s.find(l=>l.isInstalled);if(d){const l=s.find(c=>c.registryId&&c.registryId!=="_local"),o=l?ce(l,d):d;r.push(o)}else{const l=new Map;for(const o of s){const c=o.registryId??"_local",u=l.get(c);l.set(c,ce(u,o))}r.push(...l.values())}}return rt(r)}function dt(t){return t.find(a=>a.isDefault)??t.find(a=>a.trustLevel!=="unverified")??t[0]??null}function ot(t,a){return V([...t,...a])}function G(t,a){var r;return a&&t.some(s=>s.name===a)?a:((r=t[0])==null?void 0:r.name)??null}const ct=Ue((t,a)=>({initialized:!1,loading:!1,loadingOfficial:!1,loadingInstalled:!1,savingRegistry:!1,deletingRegistryId:null,mutatingItemName:null,error:null,registries:[],officialRegistryId:null,allItems:[],activeFilter:"all",searchQuery:"",selectedItemName:null,setActiveFilter:r=>t({activeFilter:r}),setSearchQuery:r=>t({searchQuery:r}),setSelectedItem:r=>t({selectedItemName:r}),initialize:async()=>{const r=a().selectedItemName;t({loading:!0,loadingOfficial:!0,loadingInstalled:!0,error:null});try{const[s,d,l]=await Promise.all([b.getMarketRegistries(),b.getMarketItems(),b.getInstalledMarkets()]),o=s.registries,c=dt(o),u=d.items,m=V(l.items.filter(h=>!h.source||h.source==="local")),y=ot(u,m);t({initialized:!0,loading:!1,loadingOfficial:!1,loadingInstalled:!1,registries:o,officialRegistryId:(c==null?void 0:c.id)??null,allItems:y,selectedItemName:G(y,r)}),b.checkMarketUpdates().then(h=>{!h||Object.keys(h).length===0||t(p=>({allItems:p.allItems.map(M=>{const v=h[M.name];return v?{...M,hasUpdate:v.hasUpdate,remoteVersion:v.remoteVersion,isCustomized:v.isCustomized}:M})}))}).catch(()=>{})}catch(s){throw t({loading:!1,loadingOfficial:!1,loadingInstalled:!1,error:T(s)}),s}},refresh:async()=>{await a().initialize()},addRegistry:async(r,s)=>{const d=r.trim();if(!d){const l=new Error("Registry URL is required");throw t({error:l.message}),l}t({savingRegistry:!0,error:null});try{const l=(s==null?void 0:s.trim())||void 0;await b.addMarketRegistry(d,l),await a().initialize(),t({savingRegistry:!1})}catch(l){throw t({savingRegistry:!1,error:T(l)}),l}},deleteRegistry:async r=>{t({deletingRegistryId:r,error:null});try{await b.deleteMarketRegistry(r),await a().initialize(),t({deletingRegistryId:null})}catch(s){throw t({deletingRegistryId:null,error:T(s)}),s}},installItem:async(r,s)=>{t({mutatingItemName:s,error:null});try{await b.installMarketItem(r,s),t(d=>{const l=d.registries.find(c=>c.id===r),o=V(d.allItems.map(c=>c.name===s?{...c,isInstalled:!0,registryId:c.registryId??r,registryName:c.registryName??(l==null?void 0:l.name)}:c));return{allItems:o,mutatingItemName:null,selectedItemName:G(o,d.selectedItemName??s)}})}catch(d){throw t({mutatingItemName:null,error:T(d)}),d}},uninstallItem:async r=>{t({mutatingItemName:r,error:null});try{await b.uninstallMarketItem(r),t(s=>{const d=V(s.allItems.map(l=>l.name===r?{...l,isInstalled:!1}:l));return{allItems:d,mutatingItemName:null,selectedItemName:G(d,s.selectedItemName)}})}catch(s){throw t({mutatingItemName:null,error:T(s)}),s}},clearError:()=>t({error:null})}));function ke(t,a){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":new Intl.DateTimeFormat(a,{year:"numeric",month:"short",day:"numeric"}).format(r)}function mt(t,a){if(!t)return null;const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const s=r.getTime()-Date.now(),d=[{unit:"year",ms:1e3*60*60*24*365},{unit:"month",ms:1e3*60*60*24*30},{unit:"week",ms:1e3*60*60*24*7},{unit:"day",ms:1e3*60*60*24},{unit:"hour",ms:1e3*60*60},{unit:"minute",ms:1e3*60}],l=new Intl.RelativeTimeFormat(a,{numeric:"auto"});for(const o of d)if(Math.abs(s)>=o.ms||o.unit==="minute")return l.format(Math.round(s/o.ms),o.unit);return null}function me(t,a){return typeof t!="number"?"—":new Intl.NumberFormat(a,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}).format(t)}function X(t){switch(t==null?void 0:t.toLowerCase()){case"template":return"template";case"agent":return"agent";case"workflow":return"workflow";case"plugin":return"plugin";default:return"skill"}}function Ie({type:t}){const{t:a}=N(),r=X(t),s={skill:"bg-violet-50 text-violet-700",template:"bg-amber-50 text-amber-700",agent:"bg-emerald-50 text-emerald-700",workflow:"bg-cyan-50 text-cyan-700",plugin:"bg-rose-50 text-rose-700"},d={skill:ve,template:je,agent:ge,workflow:we,plugin:Ne},l={skill:a("market.types.skill"),template:a("market.types.template"),agent:a("market.types.agent"),workflow:a("market.types.workflow"),plugin:a("market.types.plugin")},o=d[r];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ${s[r]}`,children:[e.jsx(o,{size:12}),l[r]]})}const xt={trusted:{bg:"bg-green-50",text:"text-green-700",icon:pe,label:"market.badges.trusted"},verified:{bg:"bg-blue-50",text:"text-blue-700",icon:fe,label:"market.badges.verified"},unverified:{bg:"bg-gray-50",text:"text-gray-500",icon:F,label:"market.badges.unverified"}};function ut({level:t}){const{t:a}=N(),r=xt[t],s=r.icon;return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium ${r.bg} ${r.text}`,children:[e.jsx(s,{size:13}),a(r.label)]})}function Ce(t){if(t.trustLevel==="unverified"){if(t.type==="plugin")return{allowed:!1,reason:"market.trust.blockedPlugin"};if(t.type==="exec")return{allowed:!1,reason:"market.trust.blockedExec"}}return t.trustLevel==="verified"&&t.type==="plugin"?{allowed:!0,needsConfirm:!0}:{allowed:!0}}function gt({itemName:t,onConfirm:a,onCancel:r}){const{t:s}=N();return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"w-full max-w-md overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s("market.pluginDialog.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("market.pluginDialog.description")})]}),e.jsxs("div",{className:"space-y-3 px-6 py-5",children:[e.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-3",children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:t}),e.jsx("p",{className:"mt-1 text-sm text-amber-800",children:s("market.pluginDialog.warning")})]}),e.jsxs("ul",{className:"space-y-2 text-sm text-gray-600",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(F,{size:14,className:"shrink-0 text-amber-500"}),s("market.pluginDialog.perm1")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(F,{size:14,className:"shrink-0 text-amber-500"}),s("market.pluginDialog.perm2")]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[e.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:s("market.actions.cancel")}),e.jsx("button",{type:"button",onClick:a,className:"rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600",children:s("market.actions.install")})]})]})})}function pt({url:t,tokenEnv:a,error:r,submitting:s,onChangeUrl:d,onChangeTokenEnv:l,onClose:o,onSubmit:c}){const{t:u}=N(),m=y=>{y.preventDefault(),c()};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"w-full max-w-xl overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:u("market.addRegistryModal.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:u("market.addRegistryModal.description")})]}),e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"space-y-4 px-6 py-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"registry-url",className:"mb-2 block text-sm font-medium text-gray-700",children:u("market.addRegistryModal.urlLabel")}),e.jsx("input",{id:"registry-url",type:"url",value:t,onChange:y=>d(y.target.value),placeholder:u("market.addRegistryModal.urlPlaceholder"),className:"w-full rounded-lg border border-gray-300 px-4 py-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"registry-token-env",className:"mb-2 block text-sm font-medium text-gray-700",children:[u("market.addRegistryModal.tokenEnvLabel","Token Env Variable"),e.jsx("span",{className:"ml-1 text-xs font-normal text-gray-400",children:u("market.addRegistryModal.optional","(optional)")})]}),e.jsx("input",{id:"registry-token-env",type:"text",value:a,onChange:y=>l(y.target.value),placeholder:u("market.addRegistryModal.tokenEnvPlaceholder","e.g. GITHUB_TOKEN"),className:"w-full rounded-lg border border-gray-300 px-4 py-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"}),e.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:u("market.addRegistryModal.tokenEnvHint","Environment variable name for private GitHub PAT. The token value must be set in .env or shell profile.")})]}),e.jsx("div",{className:"rounded-xl border border-blue-200 bg-blue-50 px-4 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-white text-blue-600",children:e.jsx(Qe,{size:18})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-blue-900",children:u("market.addRegistryModal.compatibilityTitle")}),e.jsx("p",{className:"mt-1 text-sm leading-6 text-blue-800",children:u("market.addRegistryModal.compatibilityDescription")})]})]})}),r&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-red-700",children:[e.jsx(Z,{size:18,className:"mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm",children:r})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[e.jsx("button",{type:"button",onClick:o,disabled:s,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:u("market.actions.cancel")}),e.jsxs("button",{type:"submit",disabled:s,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50",children:[s?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(J,{size:16}),u("market.actions.addRegistry")]})]})]})]})})}function yt({registry:t,deleting:a,onDelete:r}){const{t:s,i18n:d}=N();return e.jsxs("article",{className:"flex flex-col gap-4 rounded-xl border border-gray-200 bg-white p-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("div",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${t.trustLevel!=="unverified"?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-500"}`,children:e.jsx(he,{size:20})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-base font-semibold text-gray-900",children:t.name}),e.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ${t.isDefault?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"}`,children:t.isDefault?s("market.registryCard.defaultBadge"):s("market.registryCard.customBadge")})]}),e.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"mt-2 inline-flex break-all text-sm text-blue-600 hover:text-blue-700",children:[e.jsx("span",{children:t.url}),e.jsx(We,{size:14,className:"ml-1 mt-0.5 shrink-0"})]})]})]}),e.jsxs("button",{type:"button",onClick:()=>r(t.id),disabled:t.isDefault||a,className:`inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${t.isDefault?"cursor-not-allowed bg-gray-100 text-gray-400":"bg-red-50 text-red-600 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-50"}`,children:[a?e.jsx(I,{size:15,className:"animate-spin"}):e.jsx(ye,{size:15}),t.isDefault?s("market.registryCard.lockedAction"):s("market.actions.deleteRegistry")]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:s("market.registryCard.skillCount")}),e.jsx("p",{className:"mt-1 text-lg font-semibold text-gray-900",children:t.itemCount})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:s("market.registryCard.addedAt")}),e.jsx("p",{className:"mt-1 text-sm font-medium text-gray-900",children:ke(t.addedAt,d.language)})]})]}),e.jsx("p",{className:"text-xs text-gray-500",children:t.isDefault?s("market.registryCard.defaultHint"):s("market.registryCard.customHint")})]})}function ht({registries:t,loading:a,deletingRegistryId:r,onAdd:s,onClose:d,onDelete:l}){const{t:o}=N();return e.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-black/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true",className:"flex max-h-[85vh] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:o("market.registryModal.title")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:o("market.registryModal.description")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600",children:[e.jsx(J,{size:16}),o("market.actions.addRegistry")]}),e.jsx("button",{type:"button",onClick:d,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:o("market.actions.close")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:a?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(I,{size:22,className:"animate-spin text-gray-400"})}):t.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-300 px-6 py-16 text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(he,{size:20})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-gray-900",children:o("market.empty.registryTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:o("market.empty.registryDescription")})]}):e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:t.map(c=>e.jsx(yt,{registry:c,deleting:r===c.id,onDelete:l},c.id))})})]})})}function xe({skill:t,selected:a,onSelect:r}){const{t:s,i18n:d}=N(),l=mt(t.updatedAt,d.language),o=X(t.type),c={skill:ve,template:je,agent:ge,workflow:we,plugin:Ne},u={skill:t.isInstalled?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-500",template:"bg-amber-100 text-amber-700",agent:"bg-emerald-100 text-emerald-700",workflow:"bg-cyan-100 text-cyan-700",plugin:"bg-rose-100 text-rose-700"},m=c[o];return e.jsx("button",{type:"button",onClick:()=>r(t.name),className:`w-full rounded-xl border p-3 text-left transition-colors ${a?"border-blue-200 bg-blue-50 shadow-sm":"border-transparent bg-white hover:border-gray-200 hover:bg-gray-50"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl ${u[o]}`,children:e.jsx(m,{size:18})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:t.displayName||t.name}),t.trustLevel==="trusted"&&e.jsx(pe,{className:"h-3.5 w-3.5 shrink-0 text-green-600"}),t.trustLevel==="verified"&&e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),e.jsx(Ie,{type:t.type})]}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500",children:t.description||s("market.card.noDescription")}),e.jsxs("p",{className:"mt-2 text-[11px] text-gray-400",children:[t.registryName||t.author||s("market.card.unknownAuthor"),l?` · ${s("market.list.updatedLabel",{time:l})}`:""]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[t.isInstalled&&e.jsx("span",{className:"rounded-full bg-green-100 px-2 py-0.5 text-[10px] font-medium text-green-700",children:s("market.badges.installed")}),t.hasUpdate&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-orange-50 px-2 py-0.5 text-[10px] font-medium text-orange-700",children:[e.jsx(be,{size:10}),s("market.badges.updateAvailable",{version:t.remoteVersion})]})]})]})})}function P({icon:t,label:a,value:r}){return e.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"text-gray-400",children:t}),e.jsx("span",{children:a})]}),e.jsx("p",{className:"mt-2 text-sm font-semibold text-gray-900",children:r})]})}function ft({skill:t,markdownBody:a,descriptionLoading:r,descriptionError:s,busy:d,canInstall:l,onInstall:o,onUninstall:c,onRefresh:u}){const{t:m,i18n:y}=N(),h=typeof(t==null?void 0:t.installCount)=="number";return t?e.jsxs("section",{className:"flex h-full min-h-[520px] flex-col rounded-2xl border border-gray-200 bg-white p-6 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-gray-200 pb-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{className:"text-2xl font-semibold text-gray-900",children:t.displayName||t.name}),e.jsxs("span",{className:"rounded-full bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-600",children:["v",t.version]}),t.hasUpdate&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-orange-50 px-2.5 py-1 text-xs font-medium text-orange-700",children:[e.jsx(be,{size:12}),m("market.badges.updateAvailable",{version:t.remoteVersion})]}),e.jsx(Ie,{type:t.type}),e.jsx(ut,{level:t.trustLevel})]}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:t.registryName||t.author||m("market.card.unknownAuthor")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.isInstalled?e.jsxs("button",{type:"button",onClick:()=>c(t.name),disabled:d,className:"inline-flex items-center gap-2 rounded-lg bg-red-50 px-4 py-2 text-sm font-medium text-red-600 transition-colors hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-50",children:[d?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(ye,{size:16}),m("market.actions.uninstall")]}):(()=>{const p=Ce(t);return p.allowed?e.jsxs("button",{type:"button",onClick:()=>o(t),disabled:d||!l,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50",children:[d?e.jsx(I,{size:16,className:"animate-spin"}):e.jsx(J,{size:16}),m("market.actions.install")]}):e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-400",children:[e.jsx(F,{size:16}),m(p.reason)]})})(),e.jsxs("button",{type:"button",onClick:u,className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:[e.jsx(ue,{size:16}),m("market.actions.checkUpdates")]})]})]}),e.jsxs("div",{className:"space-y-6 py-6",children:[t.isCustomized&&t.hasUpdate&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3",children:[e.jsx(Z,{size:16,className:"mt-0.5 shrink-0 text-amber-600"}),e.jsx("p",{className:"text-sm text-amber-800",children:m("market.badges.customizedWarning")})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.description")}),e.jsxs("div",{className:"mt-2",children:[t.description&&e.jsx("p",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-600",children:t.description}),r?e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-gray-500",children:[e.jsx(I,{size:16,className:"animate-spin"}),e.jsx("span",{children:m("market.detail.loadingBody")})]}):a!=null&&a.trim()?e.jsx("div",{className:t.description?"mt-3 border-t border-gray-100 pt-3":"",children:e.jsx(Fe,{content:a,className:"text-sm"})}):e.jsxs(e.Fragment,{children:[s&&e.jsx("div",{className:"mt-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:s}),!t.description&&e.jsx("p",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-600",children:m("market.card.noDescription")})]})]})]}),t.tags.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.tags")}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.tags.map(p=>e.jsxs("span",{className:"rounded-full border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs text-gray-600",children:["#",p]},p))})]}),t.authors&&t.authors.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:m("market.detail.developers")}),e.jsx("div",{className:"mt-3 space-y-3",children:t.authors.map(p=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:p.avatarUrl,alt:`@${p.login}`,className:"h-8 w-8 rounded-full border border-gray-200 object-cover"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium text-gray-900",children:p.name||p.login}),e.jsxs("div",{className:"text-xs text-gray-500",children:["@",p.login]})]}),typeof p.contributions=="number"&&e.jsx("div",{className:"text-xs text-gray-400",children:m("market.detail.contributions",{count:p.contributions})})]},`${t.name}-${p.login}`))})]})]}),e.jsxs("div",{className:`mt-auto grid gap-3 border-t border-gray-200 pt-6 sm:grid-cols-2 ${h?"xl:grid-cols-4":"xl:grid-cols-3"}`,children:[e.jsx(P,{icon:e.jsx(Oe,{size:14}),label:m("market.detail.stats.stars"),value:me(t.stars,y.language)}),h&&e.jsx(P,{icon:e.jsx(Be,{size:14}),label:m("market.detail.stats.installs"),value:me(t.installCount,y.language)}),e.jsx(P,{icon:e.jsx(Ye,{size:14}),label:m("market.detail.stats.license"),value:t.license||m("market.detail.unavailable")}),e.jsx(P,{icon:e.jsx(He,{size:14}),label:m("market.detail.stats.updatedAt"),value:ke(t.updatedAt,y.language)})]})]}):e.jsx("div",{className:"flex h-full min-h-[520px] items-center justify-center rounded-2xl border border-gray-200 bg-white p-8 shadow-sm",children:e.jsxs("div",{className:"max-w-sm text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(Ve,{size:20})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-gray-900",children:m("market.detail.emptyTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:m("market.detail.emptyDescription")})]})})}function jt(){const{t}=N(),{setPageHeader:a}=Pe(),[r,s]=g.useState(!1),[d,l]=g.useState(!1),[o,c]=g.useState(""),[u,m]=g.useState(""),[y,h]=g.useState(null),[p,L]=g.useState({}),[M,v]=g.useState(null),[ze,O]=g.useState(null),[S,B]=g.useState(null),{initialized:Y,loading:_,savingRegistry:Me,deletingRegistryId:Re,mutatingItemName:De,error:ee,registries:Te,officialRegistryId:R,allItems:C,activeFilter:z,searchQuery:H,selectedItemName:$,setActiveFilter:Le,setSearchQuery:Se,setSelectedItem:E,initialize:te,refresh:A,addRegistry:ae,deleteRegistry:se,installItem:re,uninstallItem:ne,clearError:U}=ct();g.useEffect(()=>{Y||te().catch(()=>{})},[Y,te]);const le=g.useMemo(()=>C.filter(n=>n.isInstalled).length,[C]),w=g.useMemo(()=>{const n=H.trim().toLowerCase();return C.filter(x=>z==="installed"&&!x.isInstalled||z!=="all"&&z!=="installed"&&X(x.type)!==z?!1:n?[x.displayName,x.name,x.description,x.author,x.registryName,...x.tags].filter(k=>!!k).some(k=>k.toLowerCase().includes(n)):!0)},[z,C,H]),i=g.useMemo(()=>w.find(n=>n.name===$)??w[0]??null,[w,$]),Q=i?p[i.name]:void 0;g.useEffect(()=>{const n=(i==null?void 0:i.name)??null;n!==$&&E(n)},[i,$,E]),g.useEffect(()=>{if(!i)return;if(Q!==void 0){O(null);return}let n=!1;const x=i.name;return v(x),O(null),(i.isInstalled?b.getInstalledMarketDetail(x).then(f=>f.body??""):(()=>{const f=i.registryId??R;return f?b.getRemoteMarketDetail(f,x).then(D=>D.body??""):Promise.resolve("")})()).then(f=>{n||L(D=>({...D,[x]:f}))}).catch(f=>{if(!n){if(!i.isInstalled){L(D=>({...D,[x]:""}));return}O(f instanceof Error?f.message:t("market.errors.detailLoad"))}}).finally(()=>{n||v(f=>f===x?null:f)}),()=>{n=!0}},[i==null?void 0:i.isInstalled,i==null?void 0:i.name,i==null?void 0:i.registryId,Q,R,t]);const W=g.useCallback(n=>{n&&L(x=>{if(!(n in x))return x;const k={...x};return delete k[n],k})},[]);g.useEffect(()=>{a({title:t("market.title"),subtitle:t("market.subtitle.summary",{total:C.length,installed:le}),actions:e.jsxs("button",{type:"button",onClick:()=>{U(),W((i==null?void 0:i.name)??null),A().catch(()=>{})},className:"inline-flex items-center gap-2 rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:[e.jsx(ue,{size:16,className:_?"animate-spin":""}),t("market.actions.refresh")]})})},[C.length,U,_,A,W,i==null?void 0:i.name,a,t,le]);const q=g.useCallback(n=>{const x=n.registryId??R;x&&re(x,n.name).catch(()=>{})},[re,R]),_e=g.useCallback(n=>{const x=Ce(n);if(x.allowed){if(x.needsConfirm){B(n);return}q(n)}},[q]),$e=g.useCallback(n=>{window.confirm(t("market.actions.confirmUninstall",{name:n}))&&ne(n).catch(()=>{})},[t,ne]),Ee=g.useCallback(n=>{se(n).catch(()=>{})},[se]),Ae=g.useCallback(async()=>{h(null);try{await ae(o,u||void 0),c(""),m(""),l(!1)}catch(n){h(n instanceof Error?n.message:t("market.errors.addRegistry"))}},[ae,o,u,t]),K=w.filter(n=>n.isInstalled),ie=w.filter(n=>!n.isInstalled);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-6",children:[ee&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-red-700",children:[e.jsx(Z,{size:18,className:"mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:t("market.errors.bannerTitle")}),e.jsx("p",{className:"mt-1 break-words text-sm",children:ee})]}),e.jsx("button",{type:"button",onClick:()=>{U(),A().catch(()=>{})},className:"shrink-0 rounded-md bg-red-100 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:t("market.actions.retry")})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-gray-200 bg-white p-4 shadow-sm lg:flex-row lg:items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(de,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"search",value:H,onChange:n=>Se(n.target.value),placeholder:t("market.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 py-2.5 pl-10 pr-4 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("button",{type:"button",onClick:()=>s(!0),className:"inline-flex items-center justify-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-100",children:[e.jsx(tt,{size:16}),t("market.actions.manageSources")]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:["all","installed","skill","template","agent"].map(n=>e.jsx("button",{type:"button",onClick:()=>Le(n),className:`rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${z===n?"border-blue-500 bg-blue-500 text-white":"border-gray-200 bg-white text-gray-600 hover:bg-gray-50"}`,children:t(`market.filters.${n}`)},n))}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[360px_minmax(0,1fr)]",children:[e.jsxs("section",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("div",{className:"border-b border-gray-200 px-4 py-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:t("market.list.title")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:t("market.list.count",{count:w.length})})]}),e.jsx("div",{className:"max-h-[640px] overflow-y-auto p-3",children:_?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(I,{size:22,className:"animate-spin text-gray-400"})}):w.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-300 px-4 py-12 text-center",children:[e.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 text-gray-400",children:e.jsx(de,{size:18})}),e.jsx("h3",{className:"mt-3 text-sm font-semibold text-gray-900",children:t("market.empty.filteredTitle")}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:t("market.empty.filteredDescription")})]}):e.jsxs("div",{className:"space-y-3",children:[K.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"px-1 text-xs font-semibold uppercase tracking-wide text-gray-400",children:t("market.list.installedHeading")}),K.map(n=>e.jsx(xe,{skill:n,selected:(i==null?void 0:i.name)===n.name,onSelect:E},`${n.registryId??"_"}:${n.name}`))]}),ie.length>0&&e.jsxs("div",{className:"space-y-2",children:[K.length>0&&e.jsx("p",{className:"px-1 pt-2 text-xs font-semibold uppercase tracking-wide text-gray-400",children:t("market.list.availableHeading")}),ie.map(n=>e.jsx(xe,{skill:n,selected:(i==null?void 0:i.name)===n.name,onSelect:E},`${n.registryId??"_"}:${n.name}`))]})]})})]}),e.jsx(ft,{skill:i,markdownBody:Q,descriptionLoading:i?M===i.name:!1,descriptionError:ze,busy:i?De===i.name:!1,canInstall:!!((i==null?void 0:i.registryId)??R),onInstall:_e,onUninstall:$e,onRefresh:()=>{U(),W((i==null?void 0:i.name)??null),A().catch(()=>{})}})]})]}),r&&e.jsx(ht,{registries:Te,loading:_,deletingRegistryId:Re,onAdd:()=>{h(null),c(""),m(""),l(!0)},onClose:()=>s(!1),onDelete:Ee}),d&&e.jsx(pt,{url:o,tokenEnv:u,error:y,submitting:Me,onChangeUrl:c,onChangeTokenEnv:m,onClose:()=>{h(null),l(!1)},onSubmit:Ae}),S&&e.jsx(gt,{itemName:S.displayName||S.name,onConfirm:()=>{q(S),B(null)},onCancel:()=>B(null)})]})}export{jt as default};
@@ -1,4 +1,4 @@
1
- import{aJ as V,aM as B,aO as u,aP as r,b3 as ke,aT as J,aZ as we,b4 as je,aL as F,b5 as de,aS as ue,b6 as K,b0 as Ne,b7 as Ce,b8 as Le,b9 as _e,aX as Se,ba as pe,bb as Ee,bc as De,bd as Me,be as Ae,bf as Te,bg as $e,bh as Ie,bi as Pe,bj as Re,bk as Be,bl as ze,bm as Oe,bn as qe,bo as Fe,bp as Ve,bq as He,br as Ke,bs as Qe,bt as Ue,bu as We,bv as Je,bw as Xe,bx as Ze,by as Y}from"./main-CEKkUqZb.js";/**
1
+ import{aJ as V,aM as B,aO as u,aP as r,b4 as ke,aT as J,aZ as we,b5 as je,aL as F,b6 as de,aS as ue,b7 as K,b1 as Ne,b8 as Ce,b9 as Le,ba as _e,aX as Se,bb as pe,bc as Ee,bd as De,be as Me,bf as Ae,bg as Te,bh as $e,bi as Ie,bj as Pe,bk as Re,bl as Be,bm as ze,bn as Oe,bo as qe,bp as Fe,bq as Ve,br as He,bs as Ke,bt as Qe,bu as Ue,bv as We,bw as Je,bx as Xe,by as Ze,bz as Y}from"./main-Bx1nZ7_p.js";/**
2
2
  * @license lucide-react v0.563.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{bG as L,cf as ln,aC as A,bE as P,aB as W,cg as gn,ch as dn,ci as hn,cj as z,ck as pn,ca as An,cl as m,bH as N,bM as B,bP as R,cm as _n,bK as on,cn,cd as wn,aD as V,cb as On,co as I}from"./main-Bx1nZ7_p.js";var Pn="[object Symbol]";function x(n){return typeof n=="symbol"||L(n)&&ln(n)==Pn}function vn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e<i;)f[e]=r(n[e],e,n);return f}var K=P?P.prototype:void 0,U=K?K.toString:void 0;function k(n){if(typeof n=="string")return n;if(A(n))return vn(n,k)+"";if(x(n))return U?U.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yn(){}function En(n,r){for(var e=-1,i=n==null?0:n.length;++e<i&&r(n[e],e,n)!==!1;);return n}function Tn(n,r,e,i){for(var f=n.length,t=e+-1;++t<f;)if(r(n[t],t,n))return t;return-1}function Rn(n){return n!==n}function bn(n,r,e){for(var i=e-1,f=n.length;++i<f;)if(n[i]===r)return i;return-1}function In(n,r,e){return r===r?bn(n,r,e):Tn(n,Rn,e)}function Sn(n,r){var e=n==null?0:n.length;return!!e&&In(n,r,0)>-1}function M(n){return W(n)?gn(n):dn(n)}var Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xn=/^\w*$/;function C(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||x(n)?!0:xn.test(n)||!Ln.test(n)||r!=null&&n in Object(r)}var Mn=500;function Cn(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var $n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,Gn=Cn(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace($n,function(e,i,f,t){r.push(f?t.replace(Dn,"$1"):i||e)}),r});function Fn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:C(n,r)?[n]:Gn(Fn(n))}function b(n){if(typeof n=="string"||x(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&e<i;)n=n[b(r[e++])];return e&&e==i?n:void 0}function mn(n,r,e){var i=n==null?void 0:nn(n,r);return i===void 0?e:i}function rn(n,r){for(var e=-1,i=r.length,f=n.length;++e<i;)n[f+e]=r[e];return n}var H=P?P.isConcatSpreadable:void 0;function Nn(n){return A(n)||z(n)||!!(H&&n&&n[H])}function Hr(n,r,e,i,f){var t=-1,s=n.length;for(e||(e=Nn),f||(f=[]);++t<s;){var u=n[t];e(u)?rn(f,u):i||(f[f.length]=u)}return f}function Bn(n,r,e,i){var f=-1,t=n==null?0:n.length;for(i&&t&&(e=n[++f]);++f<t;)e=r(e,n[f],f,n);return e}function en(n,r){for(var e=-1,i=n==null?0:n.length,f=0,t=[];++e<i;){var s=n[e];r(s,e,n)&&(t[f++]=s)}return t}function Kn(){return[]}var Un=Object.prototype,Hn=Un.propertyIsEnumerable,q=Object.getOwnPropertySymbols,qn=q?function(n){return n==null?[]:(n=Object(n),en(q(n),function(r){return Hn.call(n,r)}))}:Kn;function Zn(n,r,e){var i=r(n);return A(n)?i:rn(i,e(n))}function Z(n){return Zn(n,M,qn)}var Yn="__lodash_hash_undefined__";function Xn(n){return this.__data__.set(n,Yn),this}function Jn(n){return this.__data__.has(n)}function v(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new pn;++r<e;)this.add(n[r])}v.prototype.add=v.prototype.push=Xn;v.prototype.has=Jn;function Qn(n,r){for(var e=-1,i=n==null?0:n.length;++e<i;)if(r(n[e],e,n))return!0;return!1}function tn(n,r){return n.has(r)}var Wn=1,zn=2;function fn(n,r,e,i,f,t){var s=e&Wn,u=n.length,a=r.length;if(u!=a&&!(s&&a>u))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new v:void 0;for(t.set(n,r),t.set(r,n);++l<u;){var p=n[l],_=r[l];if(i)var c=s?i(_,p,l,r,n,t):i(p,_,l,n,r,t);if(c!==void 0){if(c)continue;d=!1;break}if(o){if(!Qn(r,function(w,O){if(!tn(o,O)&&(p===w||f(p,w,e,i,t)))return o.push(O)})){d=!1;break}}else if(!(p===_||f(p,_,e,i,t))){d=!1;break}}return t.delete(n),t.delete(r),d}function Vn(n){var r=-1,e=Array(n.size);return n.forEach(function(i,f){e[++r]=[f,i]}),e}function $(n){var r=-1,e=Array(n.size);return n.forEach(function(i){e[++r]=i}),e}var kn=1,jn=2,nr="[object Boolean]",rr="[object Date]",er="[object Error]",ir="[object Map]",tr="[object Number]",fr="[object RegExp]",sr="[object Set]",ur="[object String]",ar="[object Symbol]",lr="[object ArrayBuffer]",gr="[object DataView]",Y=P?P.prototype:void 0,S=Y?Y.valueOf:void 0;function dr(n,r,e,i,f,t,s){switch(e){case gr:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case lr:return!(n.byteLength!=r.byteLength||!t(new m(n),new m(r)));case nr:case rr:case tr:return An(+n,+r);case er:return n.name==r.name&&n.message==r.message;case fr:case ur:return n==r+"";case ir:var u=Vn;case sr:var a=i&kn;if(u||(u=$),n.size!=r.size&&!a)return!1;var h=s.get(n);if(h)return h==r;i|=jn,s.set(n,r);var g=fn(u(n),u(r),i,f,t,s);return s.delete(n),g;case ar:if(S)return S.call(n)==S.call(r)}return!1}var hr=1,pr=Object.prototype,Ar=pr.hasOwnProperty;function _r(n,r,e,i,f,t){var s=e&hr,u=Z(n),a=u.length,h=Z(r),g=h.length;if(a!=g&&!s)return!1;for(var l=a;l--;){var d=u[l];if(!(s?d in r:Ar.call(r,d)))return!1}var o=t.get(n),p=t.get(r);if(o&&p)return o==r&&p==n;var _=!0;t.set(n,r),t.set(r,n);for(var c=s;++l<a;){d=u[l];var w=n[d],O=r[d];if(i)var F=s?i(O,w,d,r,n,t):i(w,O,d,n,r,t);if(!(F===void 0?w===O||f(w,O,e,i,t):F)){_=!1;break}c||(c=d=="constructor")}if(_&&!c){var y=n.constructor,E=r.constructor;y!=E&&"constructor"in n&&"constructor"in r&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(_=!1)}return t.delete(n),t.delete(r),_}var or=1,X="[object Arguments]",J="[object Array]",T="[object Object]",cr=Object.prototype,Q=cr.hasOwnProperty;function wr(n,r,e,i,f,t){var s=A(n),u=A(r),a=s?J:N(n),h=u?J:N(r);a=a==X?T:a,h=h==X?T:h;var g=a==T,l=h==T,d=a==h;if(d&&B(n)){if(!B(r))return!1;s=!0,g=!1}if(d&&!g)return t||(t=new R),s||_n(n)?fn(n,r,e,i,f,t):dr(n,r,a,e,i,f,t);if(!(e&or)){var o=g&&Q.call(n,"__wrapped__"),p=l&&Q.call(r,"__wrapped__");if(o||p){var _=o?n.value():n,c=p?r.value():r;return t||(t=new R),f(_,c,e,i,t)}}return d?(t||(t=new R),_r(n,r,e,i,f,t)):!1}function D(n,r,e,i,f){return n===r?!0:n==null||r==null||!L(n)&&!L(r)?n!==n&&r!==r:wr(n,r,e,i,D,f)}var Or=1,Pr=2;function vr(n,r,e,i){var f=e.length,t=f;if(n==null)return!t;for(n=Object(n);f--;){var s=e[f];if(s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++f<t;){s=e[f];var u=s[0],a=n[u],h=s[1];if(s[2]){if(a===void 0&&!(u in n))return!1}else{var g=new R,l;if(!(l===void 0?D(h,a,Or|Pr,i,g):l))return!1}}return!0}function sn(n){return n===n&&!on(n)}function yr(n){for(var r=M(n),e=r.length;e--;){var i=r[e],f=n[i];r[e]=[i,f,sn(f)]}return r}function un(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function Er(n){var r=yr(n);return r.length==1&&r[0][2]?un(r[0][0],r[0][1]):function(e){return e===n||vr(e,n,r)}}function Tr(n,r){return n!=null&&r in Object(n)}function Rr(n,r,e){r=j(r,n);for(var i=-1,f=r.length,t=!1;++i<f;){var s=b(r[i]);if(!(t=n!=null&&e(n,s)))break;n=n[s]}return t||++i!=f?t:(f=n==null?0:n.length,!!f&&cn(f)&&wn(s,f)&&(A(n)||z(n)))}function br(n,r){return n!=null&&Rr(n,r,Tr)}var Ir=1,Sr=2;function Lr(n,r){return C(n)&&sn(r)?un(b(n),r):function(e){var i=mn(e,n);return i===void 0&&i===r?br(e,n):D(r,i,Ir|Sr)}}function xr(n){return function(r){return r==null?void 0:r[n]}}function Mr(n){return function(r){return nn(r,n)}}function Cr(n){return C(n)?xr(b(n)):Mr(n)}function an(n){return typeof n=="function"?n:n==null?V:typeof n=="object"?A(n)?Lr(n[0],n[1]):Er(n):Cr(n)}function $r(n,r){return n&&On(n,r,M)}function Dr(n,r){return function(e,i){if(e==null)return e;if(!W(e))return n(e,i);for(var f=e.length,t=-1,s=Object(e);++t<f&&i(s[t],t,s)!==!1;);return e}}var G=Dr($r);function Gr(n){return typeof n=="function"?n:V}function qr(n,r){var e=A(n)?En:G;return e(n,Gr(r))}function Fr(n,r){var e=[];return G(n,function(i,f,t){r(i,f,t)&&e.push(i)}),e}function Zr(n,r){var e=A(n)?en:Fr;return e(n,an(r))}function mr(n,r,e,i,f){return f(n,function(t,s,u){e=i?(i=!1,t):r(e,t,s,u)}),e}function Yr(n,r,e){var i=A(n)?Bn:mr,f=arguments.length<3;return i(n,an(r),e,f,G)}var Nr=1/0,Br=I&&1/$(new I([,-0]))[1]==Nr?function(n){return new I(n)}:yn,Kr=200;function Xr(n,r,e){var i=-1,f=Sn,t=n.length,s=!0,u=[],a=u;if(t>=Kr){var h=r?null:Br(n);if(h)return $(h);s=!1,f=tn,a=new v}else a=r?[]:u;n:for(;++i<t;){var g=n[i],l=r?r(g):g;if(g=g!==0?g:0,s&&l===l){for(var d=a.length;d--;)if(a[d]===l)continue n;r&&a.push(l),u.push(g)}else f(a,l,e)||(a!==u&&a.push(l),u.push(g))}return u}export{G as a,Hr as b,an as c,vn as d,rn as e,Zn as f,qn as g,En as h,x as i,Z as j,M as k,Xr as l,Zr as m,qr as n,Tn as o,Gr as p,$r as q,Yr as r,Kn as s,Rr as t,j as u,b as v,nn as w,br as x,Fn as y};
@@ -1 +1 @@
1
- import{$ as ln,a0 as an,a1 as y,a2 as tn,a3 as G,a4 as q,a5 as _,a6 as un,a7 as rn,a8 as K,a9 as o,aa as z,ab as sn,ac as on,ad as fn}from"./main-CEKkUqZb.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,B,a){var O=I-l,i=D-h,n=B-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function V(l,h,I,D,v,A,B){var a=l-I,O=h-D,i=(B?A:-A)/K(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,C=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*K(fn(0,T*T*R-P*P)),$=(P*g-m*S)/R,j=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=$-C,e=j-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&($=w,j=p),{cx:$,cy:j,x01:-n,y01:-d,x11:$*(v/T-1),y11:j*(v/T-1)}}function hn(){var l=cn,h=yn,I=z(0),D=null,v=gn,A=dn,B=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,C=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(C>tn-y)a.moveTo(s*G(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*G(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=C,S=C,$=B.apply(this,arguments)/2,j=$>y&&(D?+D.apply(this,arguments):K(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(j>y){var F=sn(j/u*q($)),L=sn(j/s*q($));(P-=F*2)>y?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(S-=L*2)>y?(L*=t?1:-1,m+=L,g-=L):(S=0,m=g=(f+c)/2)}var H=s*G(m),J=s*q(m),M=u*G(T),N=u*q(T);if(w>y){var Q=s*G(g),U=s*q(g),W=u*G(R),X=u*q(R),E;if(C<rn)if(E=pn(H,J,W,X,Q,U,M,N)){var Y=H-E[0],Z=J-E[1],b=Q-E[0],k=U-E[1],nn=1/q(on((Y*b+Z*k)/(K(Y*Y+Z*Z)*K(b*b+k*k)))/2),en=K(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,g,!t)):a.moveTo(H,J),!(u>y)||!(P>y)?a.lineTo(M,N):p>y?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[G(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:z(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:z(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{$ as ln,a0 as an,a1 as y,a2 as tn,a3 as G,a4 as q,a5 as _,a6 as un,a7 as rn,a8 as K,a9 as o,aa as z,ab as sn,ac as on,ad as fn}from"./main-Bx1nZ7_p.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,B,a){var O=I-l,i=D-h,n=B-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function V(l,h,I,D,v,A,B){var a=l-I,O=h-D,i=(B?A:-A)/K(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,C=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*K(fn(0,T*T*R-P*P)),$=(P*g-m*S)/R,j=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=$-C,e=j-t,r=w-C,F=p-t;return x*x+e*e>r*r+F*F&&($=w,j=p),{cx:$,cy:j,x01:-n,y01:-d,x11:$*(v/T-1),y11:j*(v/T-1)}}function hn(){var l=cn,h=yn,I=z(0),D=null,v=gn,A=dn,B=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,C=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(C>tn-y)a.moveTo(s*G(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*G(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=C,S=C,$=B.apply(this,arguments)/2,j=$>y&&(D?+D.apply(this,arguments):K(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(j>y){var F=sn(j/u*q($)),L=sn(j/s*q($));(P-=F*2)>y?(F*=t?1:-1,R+=F,T-=F):(P=0,R=T=(f+c)/2),(S-=L*2)>y?(L*=t?1:-1,m+=L,g-=L):(S=0,m=g=(f+c)/2)}var H=s*G(m),J=s*q(m),M=u*G(T),N=u*q(T);if(w>y){var Q=s*G(g),U=s*q(g),W=u*G(R),X=u*q(R),E;if(C<rn)if(E=pn(H,J,W,X,Q,U,M,N)){var Y=H-E[0],Z=J-E[1],b=Q-E[0],k=U-E[1],nn=1/q(on((Y*b+Z*k)/(K(Y*Y+Z*Z)*K(b*b+k*k)))/2),en=K(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=V(W,X,H,J,s,x,t),r=V(Q,U,M,N,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(H,J),a.arc(0,0,s,m,g,!t)):a.moveTo(H,J),!(u>y)||!(P>y)?a.lineTo(M,N):p>y?(e=V(M,N,Q,U,u,-p,t),r=V(H,J,W,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[G(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:z(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:z(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:z(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:z(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:z(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:z(+n),i):A},i.padAngle=function(n){return arguments.length?(B=typeof n=="function"?n:z(+n),i):B},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};