@nodefony/studio 10.0.0-alpha.3 → 10.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -543
- package/README.md +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorateMetadata.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorateParam.js +1 -1
- package/dist/frontend/assets/{Accordion-DeeP_sUE.js → Accordion-CSYj18pO.js} +1 -1
- package/dist/frontend/assets/{ActionsLiveGraph-OtAEmCbe.js → ActionsLiveGraph-BxaCFGtT.js} +1 -1
- package/dist/frontend/assets/{ApiKeys-Do5AqihE.js → ApiKeys-C6Qxbzzu.js} +1 -1
- package/dist/frontend/assets/{ArchitectureLiveGraph-UVR2nwmV.js → ArchitectureLiveGraph-CJVdJHhW.js} +1 -1
- package/dist/frontend/assets/{Audit-CC2uyz48.js → Audit-ClOeY3RC.js} +1 -1
- package/dist/frontend/assets/{BackplaneLiveGraph-BsKE3ofy.js → BackplaneLiveGraph-DJ_fyOE3.js} +1 -1
- package/dist/frontend/assets/{Breadcrumbs-Di_zerWP.js → Breadcrumbs-BqaXSc5Y.js} +1 -1
- package/dist/frontend/assets/{BrickStoreChip-ChQfhXYK.js → BrickStoreChip-CsvDTxGr.js} +1 -1
- package/dist/frontend/assets/{Chat-BlyYQbsu.js → Chat-C_s0sg3L.js} +1 -1
- package/dist/frontend/assets/{Chip-Bl5u9dbS.js → Chip-BZMdRue_.js} +1 -1
- package/dist/frontend/assets/{Cluster-Dxqjasb2.js → Cluster-CngAn0c-.js} +1 -1
- package/dist/frontend/assets/Collapse-ixlBE3dZ.js +1 -0
- package/dist/frontend/assets/{ConfigPage-Pd1VGrYE.js → ConfigPage-B0fLh-C1.js} +1 -1
- package/dist/frontend/assets/{ConnectorCard-COW3xxIY.js → ConnectorCard-BOHv-B1U.js} +1 -1
- package/dist/frontend/assets/{Create-BtNi60yz.js → Create-BH4qbdxx.js} +1 -1
- package/dist/frontend/assets/{DashboardSupervision-DzES5rH6.js → DashboardSupervision-CYG-QND9.js} +1 -1
- package/dist/frontend/assets/{Database-B9ML7R0q.js → Database-Dbf6nzzP.js} +1 -1
- package/dist/frontend/assets/{DbLogo-Banbmr1E.js → DbLogo-DWQtpdyh.js} +1 -1
- package/dist/frontend/assets/{Documentation-D5GFgWWF.js → Documentation-VD6RebeR.js} +1 -1
- package/dist/frontend/assets/{FanOutLiveGraph-C9XplTDk.js → FanOutLiveGraph-DBimHnPZ.js} +1 -1
- package/dist/frontend/assets/{Firewall-8mJttiRK.js → Firewall-DFKt54zK.js} +1 -1
- package/dist/frontend/assets/{IconAdjustments-D0HfIe2W.js → IconAdjustments-C8dasIxn.js} +1 -1
- package/dist/frontend/assets/{IconAdjustmentsAlt-CpX5lLHt.js → IconAdjustmentsAlt-EcHTHWRg.js} +1 -1
- package/dist/frontend/assets/{IconAdjustmentsHorizontal-DImXiF4f.js → IconAdjustmentsHorizontal-BapdSASN.js} +1 -1
- package/dist/frontend/assets/{IconAffiliate-BlILKrfl.js → IconAffiliate-DO3138F0.js} +1 -1
- package/dist/frontend/assets/{IconApps-D42Eh0ms.js → IconApps-DJrfgTWN.js} +1 -1
- package/dist/frontend/assets/{IconArchive-B3mckh6a.js → IconArchive-BAp8LI1S.js} +1 -1
- package/dist/frontend/assets/{IconArrowDown-x3fexITu.js → IconArrowDown-CJDoBY_w.js} +1 -1
- package/dist/frontend/assets/{IconArrowLeft-BW1qFtph.js → IconArrowLeft-DmvfJmth.js} +1 -1
- package/dist/frontend/assets/{IconArrowUp-BA1LHiHP.js → IconArrowUp-BhHJpync.js} +1 -1
- package/dist/frontend/assets/IconArrowsExchange-CqUqlC4M.js +1 -0
- package/dist/frontend/assets/{IconArrowsSplit2-CQ6kodDz.js → IconArrowsSplit2-CaES63LD.js} +1 -1
- package/dist/frontend/assets/IconBan-DG_QSYu5.js +1 -0
- package/dist/frontend/assets/{IconBook-BBvFf5ZR.js → IconBook-BrHWMCrm.js} +1 -1
- package/dist/frontend/assets/{IconCircleCheck-A40shAqp.js → IconCircleCheck-CxgUPqFg.js} +1 -1
- package/dist/frontend/assets/{IconCircleDot-DJ3TPKeX.js → IconCircleDot-DXW19sp6.js} +1 -1
- package/dist/frontend/assets/IconCircuitResistor-C1I4I0s-.js +1 -0
- package/dist/frontend/assets/{IconCode-CKau3qWG.js → IconCode-DpM-J1KJ.js} +1 -1
- package/dist/frontend/assets/{IconDeviceDesktop-D5JRHElk.js → IconDeviceDesktop-DvusTMKc.js} +1 -1
- package/dist/frontend/assets/{IconDots-DxBL013E.js → IconDots-BV_CET9W.js} +1 -1
- package/dist/frontend/assets/{IconDownload-JE7axuwl.js → IconDownload-a2zrZGyV.js} +1 -1
- package/dist/frontend/assets/{IconEye-DO2HMGkp.js → IconEye-BrtKo3KV.js} +1 -1
- package/dist/frontend/assets/{IconFile-BhdAnR_G.js → IconFile-DF6vWKtb.js} +1 -1
- package/dist/frontend/assets/{IconFolder-Yt7HBZMR.js → IconFolder-DyhH98ZZ.js} +1 -1
- package/dist/frontend/assets/{IconGitBranch-BMDmzaoq.js → IconGitBranch-CYzRmKaR.js} +1 -1
- package/dist/frontend/assets/{IconHeartRateMonitor-CD4lXee2.js → IconHeartRateMonitor-B4XbDH_2.js} +1 -1
- package/dist/frontend/assets/{IconHelpCircle-Dn9dibbs.js → IconHelpCircle-DVhyybMg.js} +1 -1
- package/dist/frontend/assets/{IconLayoutGrid-BgtRb6yj.js → IconLayoutGrid-nzBpf-EU.js} +1 -1
- package/dist/frontend/assets/{IconNetwork-zXiVscld.js → IconNetwork-NwgQKRan.js} +1 -1
- package/dist/frontend/assets/{IconPackages-n3HB7b1q.js → IconPackages-BEEY_HA6.js} +1 -1
- package/dist/frontend/assets/{IconPencil-DbS-vJyZ.js → IconPencil-E8gbBJZM.js} +1 -1
- package/dist/frontend/assets/{IconPlayerPause-C7lj1Zh9.js → IconPlayerPause-BV1n07nh.js} +1 -1
- package/dist/frontend/assets/IconPlayerPlay-Bnjmz2tQ.js +1 -0
- package/dist/frontend/assets/IconPlus-BS5_mDd8.js +1 -0
- package/dist/frontend/assets/{IconPuzzle-CwhG8MRK.js → IconPuzzle-BYwvzqem.js} +1 -1
- package/dist/frontend/assets/{IconRecycle-BY_5VEAJ.js → IconRecycle-B17kLeHU.js} +1 -1
- package/dist/frontend/assets/{IconSend-BcRgfgxx.js → IconSend-qUoPOahB.js} +1 -1
- package/dist/frontend/assets/{IconServer2-C6dpzUEW.js → IconServer2-ePWwwDY5.js} +1 -1
- package/dist/frontend/assets/{IconShieldOff-D79HNNIy.js → IconShieldOff-Jf5MYTtm.js} +1 -1
- package/dist/frontend/assets/{IconSitemap-Dab03rIE.js → IconSitemap-D6pH6JtB.js} +1 -1
- package/dist/frontend/assets/{IconStack2-DyGf4gBB.js → IconStack2-CzLbifuv.js} +1 -1
- package/dist/frontend/assets/{IconTerminal2-DSH3YLIn.js → IconTerminal2-BSW455uy.js} +1 -1
- package/dist/frontend/assets/{IconUserOff-ChnC-rv1.js → IconUserOff-D-GLuxt0.js} +1 -1
- package/dist/frontend/assets/{IconWorld-hgife9QW.js → IconWorld-DwkkngvZ.js} +1 -1
- package/dist/frontend/assets/{List-DRlGV5Z9.js → List-VZvMDP2R.js} +1 -1
- package/dist/frontend/assets/{LogVisuals-CT7njxyS.js → LogVisuals-CPvlReD2.js} +1 -1
- package/dist/frontend/assets/Logs-CZoJR_i7.js +1 -0
- package/dist/frontend/assets/{Migrations-B-_naVTR.js → Migrations-DAtdcfuU.js} +1 -1
- package/dist/frontend/assets/{ModuleDetail-B0GAuHqs.js → ModuleDetail-CYtdUBpr.js} +1 -1
- package/dist/frontend/assets/{Modules-DmjSVmji.js → Modules-CvYA84P3.js} +1 -1
- package/dist/frontend/assets/{OrmEntity-BEZx7FYP.js → OrmEntity-HMrZUp7W.js} +1 -1
- package/dist/frontend/assets/{OrmOverview-CMxzsr9H.js → OrmOverview-XWo2bGLc.js} +1 -1
- package/dist/frontend/assets/{OrmWorker-D93uHZtx.js → OrmWorker-BWuECAHH.js} +1 -1
- package/dist/frontend/assets/{Playground-D_rfpkvQ.js → Playground-Be4rftVm.js} +1 -1
- package/dist/frontend/assets/{ProbesLiveGraph-BDd95SoY.js → ProbesLiveGraph-CmJtLn7n.js} +1 -1
- package/dist/frontend/assets/{Profile-2wi5abhR.js → Profile-avZg2CiQ.js} +1 -1
- package/dist/frontend/assets/{ProfileFields-CrS9PGuv.js → ProfileFields-C9mG7djZ.js} +1 -1
- package/dist/frontend/assets/{Progress-DInNqOHx.js → Progress-C-uVBbTz.js} +1 -1
- package/dist/frontend/assets/{ProtocoleLiveGraph-BW9WiiJR.js → ProtocoleLiveGraph-3KTHkxth.js} +1 -1
- package/dist/frontend/assets/{RealtimeConsole-77e0iDl2.js → RealtimeConsole-W_kNUVvD.js} +1 -1
- package/dist/frontend/assets/{RingProgress-CDDSa9QM.js → RingProgress-BcurYYhC.js} +1 -1
- package/dist/frontend/assets/{Roadmap-CSv00gl7.js → Roadmap-UmBGuO58.js} +1 -1
- package/dist/frontend/assets/{RoleSwitch-BVx1Ea5b.js → RoleSwitch-DyhIWh9u.js} +1 -1
- package/dist/frontend/assets/{Roles-CvbxUgPg.js → Roles-Cq3RNzS2.js} +1 -1
- package/dist/frontend/assets/{RoutesView-D61oUF0X.js → RoutesView-CLHQqjH2.js} +1 -1
- package/dist/frontend/assets/{Runtime-UIvgh_gO.js → Runtime-DcWHlgx8.js} +1 -1
- package/dist/frontend/assets/{Sessions-Chibt7_c.js → Sessions-KXXZDgao.js} +1 -1
- package/dist/frontend/assets/{Skeleton-Bo9zmk9r.js → Skeleton-CYTwt2iv.js} +1 -1
- package/dist/frontend/assets/{Slider-CEX_48EM.js → Slider-B3EsNyHw.js} +1 -1
- package/dist/frontend/assets/{StoresView-dGRhFCd-.js → StoresView-Bwaz45IX.js} +1 -1
- package/dist/frontend/assets/{System-qj1r2iXo.js → System-B2_HCksG.js} +1 -1
- package/dist/frontend/assets/{TagsInput-BL_ud2uJ.js → TagsInput-CF7wjb1h.js} +1 -1
- package/dist/frontend/assets/{Textarea-BlO8gUlE.js → Textarea-ajvDDbkh.js} +1 -1
- package/dist/frontend/assets/{TraceView-Ufd3bDP0.js → TraceView-Jvn87VtQ.js} +1 -1
- package/dist/frontend/assets/{Twin-J5wcamTD.js → Twin-BXsNqXZ8.js} +1 -1
- package/dist/frontend/assets/{UserProfile-BC6vIHRr.js → UserProfile-C9KCsAyr.js} +1 -1
- package/dist/frontend/assets/{Users-D5DFs-rY.js → Users-CFJL0HHJ.js} +1 -1
- package/dist/frontend/assets/{Webhooks-DNnY2_6O.js → Webhooks-CJpG8oqL.js} +1 -1
- package/dist/frontend/assets/{Workspace-CMTzcN6A.js → Workspace-Te56IBtl.js} +1 -1
- package/dist/frontend/assets/_basePickBy-QJXUw_pr.js +1 -0
- package/dist/frontend/assets/_baseUniq-DR4vVjyC.js +1 -0
- package/dist/frontend/assets/{abnfDiagram-VCTEODGH-Cernzewp.js → abnfDiagram-O67JEVCF-B8pam94f.js} +1 -1
- package/dist/frontend/assets/{apiKeysModel-CDXHN9jJ.js → apiKeysModel-BWOmAQaT.js} +1 -1
- package/dist/frontend/assets/architecture-7GRP2DOG-CBO_kzGR.js +1 -0
- package/dist/frontend/assets/architectureDiagram-NJMV4G6O-6gmizkIP.js +36 -0
- package/dist/frontend/assets/{auditFormat-0-j3KQs8.js → auditFormat-CKkFJZWr.js} +1 -1
- package/dist/frontend/assets/{auditModel-A_5uW57O.js → auditModel-DHrsrlmP.js} +1 -1
- package/dist/frontend/assets/{blockDiagram-I7D4REHJ-JEZGEK5g.js → blockDiagram-BEXU5L5S-CPV6OfBz.js} +15 -4
- package/dist/frontend/assets/c4Diagram-YGBWAQC7-BxzOrOd5.js +38 -0
- package/dist/frontend/assets/channel-CLVQeto6.js +1 -0
- package/dist/frontend/assets/chunk-3FUC2YCW-TJIJwE1t.js +2 -0
- package/dist/frontend/assets/{chunk-GVQU2GXP-CJTCPJEH.js → chunk-5DYCD2WN-C6fNpDCq.js} +1 -1
- package/dist/frontend/assets/{chunk-PWAF6VOD-8aIc0M2s.js → chunk-742MDFTN-BuWqUJ1x.js} +1 -1
- package/dist/frontend/assets/chunk-7INBJB4K-BLEZ8obp.js +62 -0
- package/dist/frontend/assets/chunk-7M6MHVWA-DRzYiIPp.js +213 -0
- package/dist/frontend/assets/chunk-7PRAP22T-CY3tH-_v.js +1 -0
- package/dist/frontend/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/frontend/assets/{chunk-FOHPRMQF-CoA4358r.js → chunk-FOHPRMQF-DzxwRta7.js} +2 -2
- package/dist/frontend/assets/{chunk-SVP7TREG-DDQGdttt.js → chunk-GTNCS2PH-DZtp2P9b.js} +1 -1
- package/dist/frontend/assets/{chunk-F27PBJKO-9OJHGb4f.js → chunk-GWA4HPMP-DwZHSyM6.js} +1 -1
- package/dist/frontend/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/frontend/assets/chunk-MBY4JIJT-DU8hh3vE.js +72 -0
- package/dist/frontend/assets/chunk-NETBCI7D-PrPyv2qf.js +1 -0
- package/dist/frontend/assets/chunk-O7XYJQB3-j8r_wK2Y.js +128 -0
- package/dist/frontend/assets/chunk-UA2S7LBM-EhjtOSNT.js +1 -0
- package/dist/frontend/assets/{chunk-POPQ4Y6H-DjvzCiTE.js → chunk-WEXAMYUT-DnLgt6Py.js} +1 -1
- package/dist/frontend/assets/{chunk-OSK3NFVY-COHJYKGg.js → chunk-Z7XXMR3K-B4DDNjo4.js} +3 -3
- package/dist/frontend/assets/{chunk-75Z2AOVW-8XdKJlnw.js → chunk-ZIGJFQKS-D7Dw35HO.js} +2 -2
- package/dist/frontend/assets/classDiagram-v2-NBCMYWYE-BtmMp0Pl.js +217 -0
- package/dist/frontend/assets/{configModel-DrP4M7xH.js → configModel-DMBA1qQ5.js} +1 -1
- package/dist/frontend/assets/{cose-bilkent-JH36ORCC-De3bNEVd.js → cose-bilkent-JH36ORCC-DrgF-lEP.js} +1 -1
- package/dist/frontend/assets/cynefin-OW5HDTMX-C57TpIt4.js +1 -0
- package/dist/frontend/assets/cynefinDiagram-VND7K2PF-DAC6UAuW.js +62 -0
- package/dist/frontend/assets/cytoscape.esm-EK2DW5Qr.js +321 -0
- package/dist/frontend/assets/dagre-6A5THRUB-CO85D-6G.js +4 -0
- package/dist/frontend/assets/diagram-22UHCM2B-BOX3CQqS.js +200 -0
- package/dist/frontend/assets/{diagram-VX7I27RA-C35dzzE2.js → diagram-3UASUU5V-CxvH61Hb.js} +2 -2
- package/dist/frontend/assets/{diagram-VSXAHHWV-C2RlE7sA.js → diagram-ATOU4E4O-B5UFYp-C.js} +3 -3
- package/dist/frontend/assets/{diagram-S7CK7UJ4-CiH5G7oo.js → diagram-CDSNMT55-BKs0JPfD.js} +3 -3
- package/dist/frontend/assets/{diagram-Z3DM3KII-dkqe3QpU.js → diagram-MLGK6HIB-D9BjufDu.js} +1 -1
- package/dist/frontend/assets/diagram-MPIPVDR6-CAjYxIoY.js +41 -0
- package/dist/frontend/assets/{ebnfDiagram-PWID7BFC-BNGHaYJh.js → ebnfDiagram-ZINNZB2B-DyFbyGL9.js} +1 -1
- package/dist/frontend/assets/elk-276RUBZZ-De_z70FL.js +27 -0
- package/dist/frontend/assets/{erDiagram-RLTQ6QDP-Bid1pEh4.js → erDiagram-OPXOYQCR-N61HA9T0.js} +15 -15
- package/dist/frontend/assets/{eventFlow-DkVb8OS6.js → eventFlow-CGihfe42.js} +1 -1
- package/dist/frontend/assets/eventmodeling-NTZA5JFV-BkawB1PZ.js +1 -0
- package/dist/frontend/assets/flowDiagram-KWPJA3E3-BubqL8R4.js +1 -0
- package/dist/frontend/assets/{ganttDiagram-EL5Y4UJY-Bd8tzKWH.js → ganttDiagram-FUAMR5RP-BDNJ7Bau.js} +2 -2
- package/dist/frontend/assets/gitGraph-4MIJSDKK-CAY6QM8x.js +1 -0
- package/dist/frontend/assets/{gitGraphDiagram-WWUBYQGX-_DeBz2Y8.js → gitGraphDiagram-X574FWY7-DB39dqwB.js} +4 -4
- package/dist/frontend/assets/graphlib-C9Tl7QrK.js +1 -0
- package/dist/frontend/assets/{hooks-Cq2g1mUn.js → hooks-uo6JdPzV.js} +1 -1
- package/dist/frontend/assets/index-22LA2xX4.css +1 -0
- package/dist/frontend/assets/index-BwPukNhM.js +28 -0
- package/dist/frontend/assets/info-A6RAGUB7-CIjHym4W.js +1 -0
- package/dist/frontend/assets/infoDiagram-VRGFBTTK-jzkh5hxl.js +2 -0
- package/dist/frontend/assets/{ishikawaDiagram-5VMMS53U-V6b0BWGR.js → ishikawaDiagram-OU5B5YK6-C-80YGTU.js} +2 -2
- package/dist/frontend/assets/{journeyDiagram-3NMN7TZE-Bpqkb9h5.js → journeyDiagram-ZHPQQLJL-CTLmUx34.js} +3 -3
- package/dist/frontend/assets/{kanban-definition-UXKFOSKX-iK7pOag1.js → kanban-definition-PNTS6WVX-CNUWj3n8.js} +7 -7
- package/dist/frontend/assets/{line-M-d-d1EU.js → line-BFnujzfH.js} +1 -1
- package/dist/frontend/assets/{mermaid-parser.core-CjM11pEo.js → mermaid-parser.core-BP-BgE7c.js} +3 -3
- package/dist/frontend/assets/mermaid.core-bi0KWxzD.js +44 -0
- package/dist/frontend/assets/{mindmap-definition-YA3MSWOX-DmZ6mtFL.js → mindmap-definition-NLK3R4M7-BpydpKOL.js} +24 -24
- package/dist/frontend/assets/packet-AYTQ26CC-CfGiptr4.js +1 -0
- package/dist/frontend/assets/{pegDiagram-XKGWAZYB-CBbcb55o.js → pegDiagram-GJSIUBJH-B8r97QN1.js} +1 -1
- package/dist/frontend/assets/pie-WAS4IAKB-lOu4mWy0.js +1 -0
- package/dist/frontend/assets/{pieDiagram-E7YTZNPT-DvIb4hiL.js → pieDiagram-5QR66LMP-kyKeYg-Q.js} +2 -2
- package/dist/frontend/assets/{preload-helper-DqwykoZ_.js → preload-helper-DfDauRb0.js} +1 -1
- package/dist/frontend/assets/{profileVisuals-ctjaF0gr.js → profileVisuals-D9M9BpAk.js} +1 -1
- package/dist/frontend/assets/{quadrantDiagram-AXDQQJYC-xXwWHqU1.js → quadrantDiagram-O4NWA36T-BcqZGb03.js} +3 -3
- package/dist/frontend/assets/radar-RG4KPBEZ-CncHVJ-Z.js +1 -0
- package/dist/frontend/assets/railroad-74A4TZTK-7mvjY84V.js +1 -0
- package/dist/frontend/assets/railroad-abnf-HS5TGJTU-DPThAF5w.js +1 -0
- package/dist/frontend/assets/railroad-ebnf-LZEXJU2U-Ck30vOwD.js +1 -0
- package/dist/frontend/assets/railroad-peg-WCYAUIDC-fLqqEJcF.js +1 -0
- package/dist/frontend/assets/{railroadDiagram-O6MQD6OU-D3MMDWru.js → railroadDiagram-XR7U4H2S-UqD2ngrA.js} +1 -1
- package/dist/frontend/assets/{requirementDiagram-BXWQKSXE-nt85uyup.js → requirementDiagram-PLB6GJNP-BCf1UDbg.js} +11 -11
- package/dist/frontend/assets/sankeyDiagram-IPEJSGJF-CLBdyFVN.js +40 -0
- package/dist/frontend/assets/sequenceDiagram-PO4LG4MO-BtmJQCMb.js +169 -0
- package/dist/frontend/assets/stateDiagram-v2-GCMORJYK-KOfXhGJl.js +291 -0
- package/dist/frontend/assets/{stores-CLUS0FeB.js → stores-DnaaQoge.js} +1 -1
- package/dist/frontend/assets/swimlanes-2SLR337P-CbhPYBmu.js +1 -0
- package/dist/frontend/assets/swimlanesDiagram-TC7HE7FX-DERYN-sv.js +8 -0
- package/dist/frontend/assets/timeline-definition-EJHVYXUP-DyFLwqcy.js +120 -0
- package/dist/frontend/assets/treeView-Q6P3EWNA-DFFnEAvn.js +1 -0
- package/dist/frontend/assets/treemap-WGGIJYW6-BibBNuzW.js +1 -0
- package/dist/frontend/assets/ui-D72MNfu0.js +319 -0
- package/dist/frontend/assets/{useBlockSource-zm0JfWOg.js → useBlockSource-Nwf0PRrs.js} +1 -1
- package/dist/frontend/assets/{useSocketLiveData-D5yoLGQm.js → useSocketLiveData-CNS1085V.js} +1 -1
- package/dist/frontend/assets/usecaseDiagram-POWQR4AR-DrNt0E-k.js +328 -0
- package/dist/frontend/assets/{usersFormat-D4sIKqYw.js → usersFormat-Cj9R_PHR.js} +1 -1
- package/dist/frontend/assets/vennDiagram-UO4OBE2U-CdTyOHVa.js +34 -0
- package/dist/frontend/assets/wardley-WFR3VGLG-C6RQiZKi.js +1 -0
- package/dist/frontend/assets/{wardleyDiagram-VM6X3IG4-D0hzksZQ.js → wardleyDiagram-VNRHLVJA-D8xJmOUJ.js} +3 -3
- package/dist/frontend/assets/{xychartDiagram-S5SC5T6Z-4iH1cxcS.js → xychartDiagram-PMCCYNJV-BwyKdA55.js} +3 -3
- package/dist/frontend/index.html +13 -13
- package/dist/index.js +20 -4
- package/dist/nodefony/config/config.js +14 -20
- package/dist/nodefony/config/defineModuleConfig.js +33 -0
- package/dist/nodefony/controller/StudioController.js +2 -2
- package/dist/nodefony/controller/StudioCreateController.js +3 -3
- package/dist/nodefony/controller/StudioRealtimeController.js +2 -2
- package/dist/nodefony/interfaces/IStudioConfig.js +1 -0
- package/dist/nodefony/service/ScaffoldService.js +8 -6
- package/dist/types/index.d.ts +43 -0
- package/dist/types/nodefony/config/config.d.ts +20 -0
- package/dist/types/nodefony/config/defineModuleConfig.d.ts +24 -0
- package/dist/types/nodefony/controller/StudioController.d.ts +98 -0
- package/dist/types/nodefony/controller/StudioCreateController.d.ts +58 -0
- package/dist/types/nodefony/controller/StudioRealtimeController.d.ts +93 -0
- package/dist/types/nodefony/interfaces/IStudioConfig.d.ts +19 -0
- package/dist/types/nodefony/realtime/clusterOrm.d.ts +30 -0
- package/dist/types/nodefony/realtime/clusterSupervision.d.ts +35 -0
- package/dist/types/nodefony/realtime/providers.d.ts +134 -0
- package/dist/types/nodefony/service/ScaffoldService.d.ts +199 -0
- package/package.json +30 -28
- package/dist/frontend/assets/Collapse-c8A5_Xw2.js +0 -1
- package/dist/frontend/assets/IconArrowsExchange-F0lEv98_.js +0 -1
- package/dist/frontend/assets/IconBan-VAlsgp2Z.js +0 -1
- package/dist/frontend/assets/IconCircuitResistor-DPBm4VS4.js +0 -1
- package/dist/frontend/assets/IconPlayerPlay-BnMxtNtL.js +0 -1
- package/dist/frontend/assets/IconPlus-C3Eai0ws.js +0 -1
- package/dist/frontend/assets/Logs-BjbwxWdb.js +0 -1
- package/dist/frontend/assets/architecture-7GRP2DOG-D19eKeHC.js +0 -1
- package/dist/frontend/assets/architectureDiagram-5GKGNRK7-ybI3XK-Z.js +0 -36
- package/dist/frontend/assets/c4Diagram-7LVT6UL2-CWZ8fEY-.js +0 -38
- package/dist/frontend/assets/channel-Dhikye2V.js +0 -1
- package/dist/frontend/assets/chunk-4HAMMTFA-BVE3Ntuo.js +0 -62
- package/dist/frontend/assets/chunk-DU6HZSFF-Ddor4J2O.js +0 -127
- package/dist/frontend/assets/chunk-GMAD6QVW-T1eAn0xk.js +0 -72
- package/dist/frontend/assets/chunk-IMKFNOWR-BrX7FTwU.js +0 -231
- package/dist/frontend/assets/chunk-L3NEJ4N5-CIKjoshr.js +0 -1
- package/dist/frontend/assets/chunk-P2QGCYS3-B9TYBq1U.js +0 -1
- package/dist/frontend/assets/chunk-SHT3W25Y-C_yspRzD.js +0 -168
- package/dist/frontend/assets/chunk-TICWLB2K-CKVEp1Rl.js +0 -206
- package/dist/frontend/assets/classDiagram-ZZMXUADV-DG8wCuQd.js +0 -1
- package/dist/frontend/assets/classDiagram-v2-VYDZK3BY-DG8wCuQd.js +0 -1
- package/dist/frontend/assets/cynefin-OW5HDTMX-CSeOsgpk.js +0 -1
- package/dist/frontend/assets/cynefinDiagram-5FMLGOSQ-DumbCcQA.js +0 -62
- package/dist/frontend/assets/cytoscape.esm-BsO9fSUN.js +0 -321
- package/dist/frontend/assets/dagre-C-rnJpZF.js +0 -1
- package/dist/frontend/assets/dagre-GXQ25YYZ-C_dPDp-P.js +0 -4
- package/dist/frontend/assets/diagram-UQ7AKVKN-KJ4yQtke.js +0 -41
- package/dist/frontend/assets/eventmodeling-NTZA5JFV-CMXM4LWU.js +0 -1
- package/dist/frontend/assets/flowDiagram-HODETNUW-BtETiN6B.js +0 -1
- package/dist/frontend/assets/gitGraph-4MIJSDKK-CwmqWyfB.js +0 -1
- package/dist/frontend/assets/graphlib-DS17s2tU.js +0 -1
- package/dist/frontend/assets/index-8Y7Th-EF.js +0 -28
- package/dist/frontend/assets/index-Bq9SDW24.css +0 -1
- package/dist/frontend/assets/info-A6RAGUB7-BNNzbqYr.js +0 -1
- package/dist/frontend/assets/infoDiagram-27XIBGKW-BLdr5J8o.js +0 -2
- package/dist/frontend/assets/mermaid.core-D0q9HDk7.js +0 -44
- package/dist/frontend/assets/packet-AYTQ26CC-CZMkZPcq.js +0 -1
- package/dist/frontend/assets/pie-WAS4IAKB-CI0EpLeA.js +0 -1
- package/dist/frontend/assets/radar-RG4KPBEZ-CyQDAhu-.js +0 -1
- package/dist/frontend/assets/railroad-74A4TZTK-B71O9n_n.js +0 -1
- package/dist/frontend/assets/railroad-abnf-HS5TGJTU-Df0ab8ny.js +0 -1
- package/dist/frontend/assets/railroad-ebnf-LZEXJU2U-Dcr334FZ.js +0 -1
- package/dist/frontend/assets/railroad-peg-WCYAUIDC-mcmVaJ9_.js +0 -1
- package/dist/frontend/assets/sankeyDiagram-P5KCCOFB-xg9O2BE4.js +0 -40
- package/dist/frontend/assets/sequenceDiagram-WJ2MYXX4-Cug_t4vg.js +0 -162
- package/dist/frontend/assets/stateDiagram-D77RDMKH-kjE2O9aM.js +0 -1
- package/dist/frontend/assets/stateDiagram-v2-MP3YSRHH-D7X2YGJU.js +0 -1
- package/dist/frontend/assets/swimlanes-42K2YHIH-6q0raMmQ.js +0 -1
- package/dist/frontend/assets/swimlanesDiagram-VR7AAH4N-BPC18vf0.js +0 -8
- package/dist/frontend/assets/timeline-definition-24CTP7MA-D_-APocZ.js +0 -120
- package/dist/frontend/assets/treeView-Q6P3EWNA-CC1707mF.js +0 -1
- package/dist/frontend/assets/treemap-WGGIJYW6-DBD8zPzq.js +0 -1
- package/dist/frontend/assets/ui-KaBQR2GX.js +0 -319
- package/dist/frontend/assets/vennDiagram-4TSXK5OY-D2AZPLVm.js +0 -34
- package/dist/frontend/assets/wardley-WFR3VGLG-905RnCT1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Bt as n,Et as r,H as i,Ht as a,K as o,Kt as s,Lt as c,Mn as l,Pn as u,Ut as d,V as f,Vt as p,Wn as m,Xt as ee,Z as h,Zt as g,_n as te,ct as _,di as v,dn as y,et as b,gt as x,h as S,it as C,n as w,nn as T,on as E,or as D,q as O,rt as ne,sn as k,t as re,tn as A,ut as j,vn as M,wt as N,yn as P,zt as ie}from"./ui-KaBQR2GX.js";import{t as F}from"./Accordion-DeeP_sUE.js";import{t as I}from"./Textarea-BlO8gUlE.js";import{t as L}from"./List-DRlGV5Z9.js";import{t as ae}from"./TagsInput-BL_ud2uJ.js";import{c as R,o as oe}from"./stores-CLUS0FeB.js";import{t as z}from"./IconArrowDown-x3fexITu.js";import{t as B}from"./IconArrowUp-BA1LHiHP.js";import{t as V}from"./IconCircleCheck-A40shAqp.js";import{t as H}from"./IconDots-DxBL013E.js";import{t as U}from"./IconEye-DO2HMGkp.js";import{t as se}from"./IconHelpCircle-Dn9dibbs.js";import{t as W}from"./IconPlayerPause-C7lj1Zh9.js";import{t as G}from"./IconPlayerPlay-BnMxtNtL.js";import{t as ce}from"./IconPlus-C3Eai0ws.js";import{a as le,i as ue,n as de,t as K}from"./pageQuery-yJh2-jSv.js";import{G as fe,S as q,Y as pe,k as me,v as he,vt as ge,y as _e}from"./index-8Y7Th-EF.js";import{t as ve}from"./BrickStoreChip-ChQfhXYK.js";var ye=r(`outline`,`asterisk`,`Asterisk`,[[`path`,{d:`M12 12l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12v9`,key:`svg-1`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-2`}],[`path`,{d:`M12 12l8 4.5`,key:`svg-3`}],[`path`,{d:`M12 3v9`,key:`svg-4`}],[`path`,{d:`M12 12l-8 4.5`,key:`svg-5`}]]),be=r(`outline`,`circle-x`,`CircleX`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M10 10l4 4m0 -4l-4 4`,key:`svg-1`}]]),xe=r(`outline`,`clock-pause`,`ClockPause`,[[`path`,{d:`M20.942 13.018a9 9 0 1 0 -7.909 7.922`,key:`svg-0`}],[`path`,{d:`M12 7v5l2 2`,key:`svg-1`}],[`path`,{d:`M17 17v5`,key:`svg-2`}],[`path`,{d:`M21 17v5`,key:`svg-3`}]]),Se=r(`outline`,`edit`,`Edit`,[[`path`,{d:`M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1`,key:`svg-0`}],[`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415`,key:`svg-1`}],[`path`,{d:`M16 5l3 3`,key:`svg-2`}]]),Ce=r(`outline`,`rotate-clockwise`,`RotateClockwise`,[[`path`,{d:`M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-0`}]]),J=e(v(),1),Y=`/nodefony/security/api/webhooks`,we=`${Y}/stats`;function X(e){return`${Y}/${encodeURIComponent(e)}`}function Te(e){return`${X(e)}/rotate`}function Ee(e){return`${X(e)}/reveal`}function De(e){return`${X(e)}/deliveries`}var Oe=`v1.0`,ke=[{domain:`Authentification`,events:[{value:`login.success`,label:`login.success — connexion réussie`},{value:`login.failure`,label:`login.failure — connexion échouée`},{value:`login.throttled`,label:`login.throttled — connexion freinée`},{value:`logout`,label:`logout — déconnexion`},{value:`auth.failure`,label:`auth.failure — credential invalide`},{value:`auth.throttled`,label:`auth.throttled — backoff NIST`},{value:`auth.denied`,label:`auth.denied — Zero Trust`}]},{domain:`Autorisation`,events:[{value:`access.denied`,label:`access.denied — refus voters/RBAC`},{value:`frame.denied`,label:`frame.denied — verrou de frame WS`}]},{domain:`Jetons & clés`,events:[{value:`token.issued`,label:`token.issued — jeton émis`},{value:`token.reuse_detected`,label:`token.reuse_detected — réutilisation détectée`},{value:`apikey.created`,label:`apikey.created — clé API créée`},{value:`apikey.revoked`,label:`apikey.revoked — clé API révoquée`}]}],Ae=ke.flatMap(e=>e.events.map(e=>e.value));function je(e){if(e.lastDeliveryAt===null)return`never`;if(e.failureCount>0)return`failing`;let t=e.lastDeliveryStatus;return t!==null&&t>=200&&t<300?`ok`:`failing`}function Me(e){let t=e.trim();if(t.length===0)return`L'URL de destination est requise.`;let n;try{n=new URL(t)}catch{return`URL invalide (ex. https://example.com/hooks/nodefony).`}return n.protocol!==`https:`&&n.protocol!==`http:`?`Seules les URL http(s) sont acceptées.`:null}function Ne(e){return e===null?`—`:new Date(e).toLocaleString(`fr-FR`,{dateStyle:`medium`,timeStyle:`short`})}function Pe(e,t=Date.now()){if(e===null)return`Jamais`;let n=Math.floor((t-e)/1e3);if(n<5)return`À l'instant`;if(n<60)return`Il y a ${n} s`;let r=Math.floor(n/60);if(r<60)return`Il y a ${r} min`;let i=Math.floor(r/60);if(i<24)return`Il y a ${i} h`;let a=Math.floor(i/24);if(a<30)return`Il y a ${a} j`;let o=Math.floor(a/30);return o<12?`Il y a ${o} mois`:`Il y a ${Math.floor(o/12)} an(s)`}function Z(e){let t=e?.status;if(t===401)return`Non authentifié — votre session Studio a expiré ou n'est plus reconnue par le firewall. Reconnectez-vous.`;if(t===403)return`Accès refusé — la gestion des webhooks est réservée aux administrateurs plateforme (ROLE_NODEFONY_ADMIN).`;if(t===422){let t=e?.message;return t?`URL refusée : ${t}`:`URL refusée — cible privée/interne interdite (protection anti-SSRF).`}if(t===400){let t=e?.message;return t?`Requête invalide : ${t}`:`Requête invalide.`}if(t===503)return`Webhooks indisponibles — désactivés en config sécurité (webhooks.enabled = false) ou store non provisionné.`;if(t===404)return`Endpoint introuvable — il a peut-être été supprimé entre-temps.`;let n=e?.message;return n?`Erreur de chargement des webhooks : ${n}`:`Erreur de chargement des webhooks.`}var Q=D();function Fe(e){try{return JSON.parse(e)}catch{return null}}function Ie({d:e}){return(0,Q.jsx)(k,{variant:e.ok?`light`:`filled`,color:e.ok?`teal`:`red`,size:`sm`,leftSection:e.ok?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(be,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e.status===null?e.error?`réseau`:`—`:e.status})}function Le({id:e}){let t=R(),n=(0,J.useCallback)(async()=>{try{return(await t.api.getAbsolute(De(e))).deliveries??[]}catch(e){throw Error(Z(e),{cause:e})}},[t,e]),{data:r,loading:i,error:a,reload:s}=_e(n),c=r??[];return(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsxs)(l,{justify:`space-between`,children:[(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,children:[c.length,` livraison(s) récente(s) — gardées en mémoire (par pod, éphémère).`]}),(0,Q.jsx)(E,{size:`xs`,variant:`light`,leftSection:(0,Q.jsx)(b,{size:14}),loading:i,onClick:s,children:`Recharger`})]}),(0,Q.jsx)(o,{loading:i&&!r,error:a,empty:c.length===0,emptyMessage:`Aucune livraison encore. Déclenche un événement souscrit (ex. un login échoué) pour en voir arriver.`,onRetry:s,children:(0,Q.jsx)(F,{variant:`separated`,chevronPosition:`left`,children:c.map((e,t)=>{let n=Fe(e.requestBody),r=e.responseBody?Fe(e.responseBody):null;return(0,Q.jsxs)(F.Item,{value:`${e.messageId}-${t}`,children:[(0,Q.jsx)(F.Control,{children:(0,Q.jsxs)(l,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(Ie,{d:e}),(0,Q.jsx)(k,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e.type}),(0,Q.jsxs)(M,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.durationMs,` ms`]}),e.attempt>0&&(0,Q.jsxs)(k,{variant:`light`,color:`orange`,size:`xs`,children:[`retry #`,e.attempt]}),(0,Q.jsx)(m,{style:{flex:1}}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Pe(e.ts)})]})}),(0,Q.jsx)(F.Panel,{children:(0,Q.jsxs)(d,{gap:`xs`,children:[(0,Q.jsxs)(l,{gap:`lg`,children:[(0,Q.jsxs)(M,{size:`xs`,c:`dimmed`,children:[`Message\xA0`,(0,Q.jsx)(T,{children:e.messageId})]}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Ne(e.ts)})]}),e.error&&(0,Q.jsx)(M,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:e.error}),(0,Q.jsxs)(M,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(B,{size:11}),` Envoyé (payload signé)`]}),n===null?(0,Q.jsx)(T,{block:!0,children:e.requestBody}):(0,Q.jsx)(S,{value:n,maxHeight:240}),(0,Q.jsxs)(M,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(z,{size:11}),` Réponse du destinataire`]}),e.responseBody===null?(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,fs:`italic`,children:`(aucun corps de réponse)`}):r===null?(0,Q.jsx)(T,{block:!0,children:e.responseBody}):(0,Q.jsx)(S,{value:r,maxHeight:200})]})})]},`${e.messageId}-${t}`)})})})]})}var Re={memory:`mémoire (volatile)`,orm:`base SQL (ORM)`};function ze({enabled:e,size:t=`sm`}){return(0,Q.jsx)(k,{variant:e?`light`:`outline`,color:e?`teal`:`gray`,size:t,leftSection:e?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(W,{size:12}),style:{textTransform:`none`},children:e?`Actif`:`Désactivé`})}var Be={never:{color:`gray`,label:`Jamais livré`,Icon:xe},ok:{color:`teal`,label:`OK`,Icon:V},failing:{color:`red`,label:`Échec`,Icon:be}};function Ve({endpoint:e,size:t=`sm`}){let n=je(e),r=Be[n],i=e.lastDeliveryStatus,a=n===`ok`&&i!==null?`${i}`:n===`failing`&&i!==null?`Échec (${i})`:r.label,o=(0,Q.jsx)(k,{variant:n===`ok`?`light`:n===`failing`?`filled`:`outline`,color:r.color,size:t,leftSection:(0,Q.jsx)(r.Icon,{size:12}),style:{textTransform:`none`},children:a});return e.lastDeliveryError||i!==null?(0,Q.jsx)(s,{withArrow:!0,openDelay:150,multiline:!0,maw:340,label:(0,Q.jsxs)(d,{gap:2,children:[i!==null&&(0,Q.jsxs)(M,{size:`xs`,children:[`Code HTTP : `,i]}),e.lastDeliveryError&&(0,Q.jsxs)(M,{size:`xs`,children:[`Erreur : `,e.lastDeliveryError]})]}),children:o}):o}function He({count:e,size:t=`sm`}){return e===0?(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:`0`}):(0,Q.jsx)(k,{variant:`light`,color:e>=5?`red`:`orange`,size:t,leftSection:(0,Q.jsx)(N,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e})}function Ue({events:e}){return e.includes(`*`)?(0,Q.jsx)(k,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,Q.jsx)(ye,{size:12}),style:{textTransform:`none`},children:`Tous les événements`}):e.length===0?(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,fs:`italic`,children:`aucun`}):(0,Q.jsx)(l,{gap:4,wrap:`wrap`,children:e.map(e=>(0,Q.jsx)(k,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e},e))})}function We({store:e,driver:t}){let n=t?Re[t]:`inconnu`,r=t===`orm`;return(0,Q.jsx)(s,{withArrow:!0,openDelay:150,multiline:!0,label:(0,Q.jsxs)(d,{gap:2,children:[(0,Q.jsxs)(M,{size:`xs`,children:[`Store : `,e]}),(0,Q.jsxs)(M,{size:`xs`,children:[`Driver : `,n]}),(0,Q.jsx)(M,{size:`xs`,children:r?`Endpoints persistés (survivent au redémarrage) ✓`:`⚠ Store volatile — endpoints perdus au redémarrage`})]}),children:(0,Q.jsx)(k,{variant:`light`,color:r?`grape`:`orange`,size:`sm`,leftSection:(0,Q.jsx)(pe,{size:12}),style:{textTransform:`none`},children:e})})}function $({k:e,children:t}){return(0,Q.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xl`,align:`flex-start`,children:[(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,style:{flexShrink:0},children:e}),(0,Q.jsx)(m,{style:{textAlign:`right`,minWidth:0},children:t})]})}function Ge({ep:e,actions:t,busyId:n}){return(0,Q.jsxs)(g,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,Q.jsx)(g.Target,{children:(0,Q.jsx)(u,{variant:`subtle`,color:`gray`,"aria-label":`Actions du webhook ${e.url}`,loading:n===e.id,onClick:e=>e.stopPropagation(),children:(0,Q.jsx)(H,{size:16})})}),(0,Q.jsxs)(g.Dropdown,{onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(Se,{size:14}),onClick:()=>t.onEdit(e),children:`Modifier`}),(0,Q.jsx)(g.Item,{leftSection:e.enabled?(0,Q.jsx)(W,{size:14}):(0,Q.jsx)(G,{size:14}),onClick:()=>t.onToggle(e),children:e.enabled?`Désactiver`:`Activer`}),(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(Ce,{size:14}),onClick:()=>t.onRotate(e),children:`Tourner le secret`}),(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(U,{size:14}),onClick:()=>t.onReveal(e),children:`Révéler le secret`}),(0,Q.jsx)(g.Divider,{}),(0,Q.jsx)(g.Item,{color:`red`,leftSection:(0,Q.jsx)(h,{size:14}),onClick:()=>t.onDelete(e),children:`Supprimer`})]})]})}var Ke={enabled:{label:`État`,hint:`Actif = le dispatcher lui livre. Désactivé = à la main, ou par le coupe-circuit après trop d'échecs consécutifs.`,values:{true:`Actifs`,false:`Désactivés`}},event:{label:`Événement`,hint:`Endpoints ABONNÉS à cet événement — « qui écoute user.created ? ». Nom exact de l'événement.`,placeholder:`user.created`},failing:{label:`Livraison`,hint:`En échec = compteur d'échecs consécutifs non nul. Se cumule avec l'état : un endpoint actif peut être en échec.`,values:{true:`En échec`,false:`Sains`}}},qe=ge(function({store:e,driver:t,filters:r,onFiltersChange:a,reloadKey:o=0,actions:s,busyId:c,onSearchChange:u}){let f=R(),[p,g]=(0,J.useState)(null),[v,y]=(0,J.useState)(`infos`),b=f.admin.pageCapabilities(Y),x=JSON.stringify(r),S=(0,J.useCallback)(async e=>{let t=ue(e,r);try{let e=await f.api.getAbsolute(`${Y}?${t}`);return de({...e,items:e.endpoints??[]})}catch(e){throw Error(Z(e),{cause:e})}},[f,x,o]),D=(0,J.useMemo)(()=>new Set(b?.sortable??[]),[b?.sortable]),O=(0,J.useMemo)(()=>[{key:`url`,header:`URL`,sortable:D.has(`url`),value:e=>e.url,render:e=>(0,Q.jsx)(M,{size:`sm`,style:{wordBreak:`break-all`},children:e.url}),size:240},{key:`description`,header:`Description`,sortable:D.has(`description`),value:e=>e.description??``,render:e=>e.description?(0,Q.jsx)(M,{size:`sm`,style:{wordBreak:`break-word`},children:e.description}):(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:`—`}),size:180},{key:`events`,header:`Événements`,value:e=>e.events.join(`, `),render:e=>(0,Q.jsx)(Ue,{events:e.events}),size:200},{key:`enabled`,header:`État`,sortable:D.has(`enabled`),value:e=>e.enabled?`Actif`:`Désactivé`,render:e=>(0,Q.jsx)(ze,{enabled:e.enabled}),size:110},{key:`lastDelivery`,header:`Dernière livraison`,sortable:D.has(`lastDelivery`),value:e=>e.lastDeliveryAt??0,render:e=>(0,Q.jsxs)(l,{gap:6,wrap:`nowrap`,children:[(0,Q.jsx)(Ve,{endpoint:e}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Pe(e.lastDeliveryAt)})]}),size:200},{key:`failureCount`,header:`Échecs`,sortable:D.has(`failureCount`),align:`right`,value:e=>e.failureCount,render:e=>(0,Q.jsx)(He,{count:e.failureCount}),size:90},{key:`actions`,header:``,align:`right`,render:e=>(0,Q.jsx)(Ge,{ep:e,actions:s,busyId:c}),size:60}],[s,c,D]);return(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:`Clic sur une ligne pour le détail.`}),(0,Q.jsx)(i,{title:`Webhooks sortants`,version:Oe,summary:`Un webhook notifie une URL externe quand un événement d'audit souscrit survient (modèle GitHub/Stripe). Chaque livraison est signée (Standard Webhooks v1) avec un secret propre à l'endpoint.`,sections:[{label:`Livraison`,body:`Au plus une livraison par événement matchant. En cas d'échec : retries bornés avec backoff, puis auto-désactivation au-delà d'un seuil (le compteur d'échecs consécutifs le pilote).`},{label:`Sécurité`,body:`L'URL est validée anti-SSRF (pas d'IP privée/interne, redirections 3xx non suivies, IP épinglée anti-rebinding). Le secret de signature est chiffré au repos et n'est montré qu'à la création/rotation/révélation.`},{label:`Anti-boucle`,body:`Les événements de la catégorie webhook (webhook.created/disabled…) ne déclenchent jamais de livraison (sinon boucle infinie).`}]}),(0,Q.jsx)(m,{style:{flex:1}}),(0,Q.jsx)(We,{store:e,driver:t})]}),(0,Q.jsx)(re,{spec:b?.filters??null,value:r,onChange:a,labels:Ke}),(0,Q.jsx)(w,{mode:`server`,loader:S,columns:O,getRowId:e=>e.id,onRowClick:e=>{g(e),y(`infos`)},dimRow:e=>!e.enabled,initialSort:D.has(`url`)?{key:`url`,dir:`asc`}:void 0,searchable:b?.search??!1,onSearchChange:u,searchPlaceholder:`Rechercher (URL, description, événement…)`,resetPageSignal:x,pageSize:25,persist:{key:`studio.webhooks`,storage:`session`},emptyMessage:`Aucun webhook ne correspond.`}),(0,Q.jsx)(ee,{opened:p!==null,onClose:()=>g(null),title:p?(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(M,{fw:700,children:`Webhook`}),(0,Q.jsx)(ze,{enabled:p.enabled})]}):``,centered:!0,size:`lg`,children:p&&(0,Q.jsxs)(n,{value:v,onChange:y,children:[(0,Q.jsxs)(n.List,{mb:`md`,children:[(0,Q.jsx)(n.Tab,{value:`infos`,leftSection:(0,Q.jsx)(C,{size:15}),children:`Infos`}),(0,Q.jsx)(n.Tab,{value:`deliveries`,leftSection:(0,Q.jsx)(fe,{size:15}),children:`Livraisons récentes`})]}),(0,Q.jsx)(n.Panel,{value:`infos`,children:(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsx)($,{k:`URL de destination`,children:(0,Q.jsx)(te,{href:p.url,target:`_blank`,rel:`noreferrer noopener`,size:`sm`,style:{wordBreak:`break-all`},children:(0,Q.jsxs)(l,{gap:4,wrap:`nowrap`,justify:`flex-end`,children:[p.url,(0,Q.jsx)(_,{size:13})]})})}),(0,Q.jsx)($,{k:`Identifiant`,children:(0,Q.jsx)(T,{children:p.id})}),(0,Q.jsx)($,{k:`Événements`,children:(0,Q.jsx)(Ue,{events:p.events})}),p.description&&(0,Q.jsx)($,{k:`Description`,children:(0,Q.jsx)(M,{size:`sm`,children:p.description})}),(0,Q.jsx)($,{k:`Dernière livraison`,children:(0,Q.jsxs)(l,{gap:6,wrap:`nowrap`,justify:`flex-end`,children:[(0,Q.jsx)(Ve,{endpoint:p}),(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:p.lastDeliveryAt===null?``:Ne(p.lastDeliveryAt)})]})}),p.lastDeliveryError&&(0,Q.jsx)($,{k:`Erreur de livraison`,children:(0,Q.jsx)(M,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:p.lastDeliveryError})}),(0,Q.jsx)($,{k:`Échecs consécutifs`,children:(0,Q.jsx)(He,{count:p.failureCount})}),p.createdBy&&(0,Q.jsx)($,{k:`Créé par`,children:(0,Q.jsx)(T,{children:p.createdBy})}),p.tenantId&&(0,Q.jsx)($,{k:`Tenant`,children:(0,Q.jsx)(T,{children:p.tenantId})}),(0,Q.jsx)($,{k:`Créé le`,children:(0,Q.jsx)(M,{size:`sm`,children:Ne(p.createdAt)})}),(0,Q.jsx)($,{k:`Modifié le`,children:(0,Q.jsx)(M,{size:`sm`,children:Ne(p.updatedAt)})}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(C,{size:16}),mt:`xs`,children:(0,Q.jsx)(M,{size:`xs`,children:`Le secret de signature n'est pas affiché ici : utilisez « Révéler le secret » (action sensible, auditée). « Tourner le secret » invalide immédiatement l'ancien.`})}),(0,Q.jsxs)(l,{justify:`space-between`,mt:`xs`,children:[(0,Q.jsx)(E,{variant:`default`,leftSection:p.enabled?(0,Q.jsx)(W,{size:16}):(0,Q.jsx)(G,{size:16}),onClick:()=>{let e=p;g(null),s.onToggle(e)},children:p.enabled?`Désactiver`:`Activer`}),(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(E,{variant:`light`,leftSection:(0,Q.jsx)(Se,{size:16}),onClick:()=>{let e=p;g(null),s.onEdit(e)},children:`Modifier`}),(0,Q.jsx)(E,{color:`red`,variant:`light`,leftSection:(0,Q.jsx)(h,{size:16}),onClick:()=>{let e=p;g(null),s.onDelete(e)},children:`Supprimer`})]})]})]})}),(0,Q.jsx)(n.Panel,{value:`deliveries`,children:v===`deliveries`&&(0,Q.jsx)(Le,{id:p.id})})]})})]})}),Je={created:{title:`Endpoint créé — copiez le secret`,once:!0,intro:`Configurez ce secret chez le destinataire pour qu'il vérifie la signature de chaque livraison.`},rotated:{title:`Secret régénéré — copiez le nouveau`,once:!0,intro:`L'ancien secret cesse immédiatement d'être valide. Mettez à jour le destinataire avec ce nouveau secret.`},revealed:{title:`Secret de signature`,once:!1,intro:`Secret en clair (réversible, conservé chiffré au repos). Copiez-le pour configurer ou diagnostiquer la vérification de signature.`}};function Ye({secret:e,url:t,context:n}){let r=Je[n];return(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(P,{role:`alert`,variant:`light`,color:r.once?`orange`:`blue`,icon:(0,Q.jsx)(N,{size:16}),title:r.once?`Copiez ce secret maintenant`:`Secret sensible`,children:r.once?(0,Q.jsxs)(Q.Fragment,{children:[`Il ne sera `,(0,Q.jsx)(`strong`,{children:`plus jamais affiché automatiquement`}),` `,`(récupérable seulement via « Révéler »). `,r.intro]}):r.intro}),(0,Q.jsxs)(m,{children:[(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:4,children:[`Secret pour `,(0,Q.jsx)(T,{children:t})]}),(0,Q.jsxs)(l,{gap:`xs`,wrap:`nowrap`,align:`stretch`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`var(--mantine-spacing-xs)`},children:[(0,Q.jsx)(T,{block:!0,style:{flex:1,wordBreak:`break-all`,background:`transparent`},children:e}),(0,Q.jsx)(A,{value:e,timeout:2e3,children:({copied:e,copy:t})=>(0,Q.jsx)(E,{color:e?`teal`:`brand`,variant:e?`light`:`filled`,leftSection:e?(0,Q.jsx)(x,{size:16}):(0,Q.jsx)(j,{size:16}),onClick:t,children:e?`Copié`:`Copier`})})]})]}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(me,{size:16}),children:(0,Q.jsxs)(M,{size:`xs`,children:[`Signature `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks v1`}),` : chaque livraison porte les en-têtes `,(0,Q.jsx)(T,{children:`webhook-id`}),`,`,` `,(0,Q.jsx)(T,{children:`webhook-timestamp`}),` et`,` `,(0,Q.jsx)(T,{children:`webhook-signature: v1,<base64>`}),` (HMAC-SHA256 de`,` `,(0,Q.jsx)(T,{children:`id.timestamp.payload`}),` avec ce secret). Le destinataire recalcule la signature pour authentifier l'appel.`]})})]})}function Xe({opened:e,onClose:t,secret:n,url:r,context:i}){return(0,Q.jsx)(ee,{opened:e,onClose:t,title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(i===`rotated`?Ce:U,{size:18}),(0,Q.jsx)(M,{fw:700,children:Je[i].title})]}),centered:!0,size:`lg`,closeOnClickOutside:!1,children:n!==null&&(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(Ye,{secret:n,url:r,context:i}),(0,Q.jsx)(l,{justify:`flex-end`,children:(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(x,{size:16}),onClick:t,children:i===`rotated`?`J'ai copié le nouveau secret`:`Fermer`})})]})})}function Ze({opened:e,onClose:t,endpoint:n,onSaved:r}){let i=R(),o=n!==null,[s,c]=(0,J.useState)(n?.url??``),[u,f]=(0,J.useState)(n?n.events.includes(`*`):!1),[p,h]=(0,J.useState)(n?n.events.filter(e=>e!==`*`):[]),[g,te]=(0,J.useState)(n?.description??``),[_,v]=(0,J.useState)(n?.enabled??!0),[b,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(null),[T,D]=(0,J.useState)(null),O=(0,J.useMemo)(()=>p.filter(e=>Ae.includes(e)),[p]),ne=(0,J.useMemo)(()=>p.filter(e=>!Ae.includes(e)),[p]);function k(){let e=T!==null;t(),e&&r()}function re(){return u?[`*`]:p}async function A(){w(null);let e=Me(s);if(e){w(e);return}let a=re();if(a.length===0){w(`Sélectionnez au moins un événement (ou « Tous les événements »).`);return}S(!0);try{let e=g.trim()===``?null:g.trim();if(o)await i.api.patchAbsolute(X(n.id),{url:s.trim(),events:a,description:e,enabled:_}),r(),t();else{let t=await i.api.postAbsolute(Y,{url:s.trim(),events:a,description:e,enabled:_});D(t)}}catch(e){w(Z(e))}finally{S(!1)}}return(0,Q.jsx)(ee,{opened:e,onClose:k,title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(M,{fw:700,children:T?`Webhook créé — copiez le secret`:o?`Modifier le webhook`:`Nouveau webhook`})]}),centered:!0,size:`lg`,closeOnClickOutside:T===null,children:T===null?(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(m,{mih:44,children:C&&(0,Q.jsx)(P,{role:`alert`,variant:`light`,color:`red`,icon:(0,Q.jsx)(N,{size:16}),children:C})}),(0,Q.jsx)(ie,{label:`URL de destination`,description:`Endpoint qui recevra les livraisons signées. Validé anti-SSRF côté serveur (pas d'IP privée/interne en prod). En dev, le récepteur de test local est sur le port http 5151.`,placeholder:`http://127.0.0.1:5151/nodefony/test/webhooks/sink`,required:!0,value:s,onChange:e=>{c(e.currentTarget.value),C&&w(null)},"data-autofocus":!0}),(0,Q.jsxs)(d,{gap:`xs`,children:[(0,Q.jsx)(a,{label:`Tous les événements (*)`,description:`Livrer chaque événement d'audit (sauf les événements webhook eux-mêmes, anti-boucle).`,checked:u,onChange:e=>f(e.currentTarget.checked),thumbIcon:u?(0,Q.jsx)(ye,{size:12}):void 0}),!u&&(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsx)(y.Group,{label:`Événements souscrits`,description:`Actions d'audit qui déclenchent une livraison. La liste s'enrichit côté serveur ; complétez librement ci-dessous si besoin.`,value:O,onChange:e=>h([...e,...ne]),children:(0,Q.jsx)(d,{gap:`sm`,mt:`xs`,children:ke.map(e=>(0,Q.jsxs)(m,{children:[(0,Q.jsx)(M,{size:`xs`,fw:600,c:`dimmed`,tt:`uppercase`,children:e.domain}),(0,Q.jsx)(d,{gap:4,mt:4,children:e.events.map(e=>(0,Q.jsx)(y,{value:e.value,label:e.label},e.value))})]},e.domain))})}),(0,Q.jsx)(ae,{label:`Événements personnalisés (optionnel)`,description:`Toute action d'audit hors catalogue (ex. user.created, order.shipped si émise par votre app).`,placeholder:`user.created, session.expired…`,value:ne,onChange:e=>h([...O,...e]),clearable:!0})]})]}),(0,Q.jsx)(I,{label:`Description (optionnel)`,description:`Libellé humain pour reconnaître l'endpoint.`,placeholder:`Notifie le SIEM des connexions échouées`,value:g,maxLength:200,autosize:!0,minRows:1,maxRows:3,onChange:e=>te(e.currentTarget.value)}),(0,Q.jsx)(a,{label:`Actif`,description:`Un endpoint désactivé ne reçoit aucune livraison.`,checked:_,onChange:e=>v(e.currentTarget.checked)}),(0,Q.jsxs)(l,{justify:`flex-end`,mt:`xs`,children:[(0,Q.jsx)(E,{variant:`default`,onClick:k,children:`Annuler`}),(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(q,{size:16}),loading:b,onClick:A,children:o?`Enregistrer`:`Créer le webhook`})]})]}):(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(Ye,{secret:T.secret,url:T.endpoint.url,context:`created`}),(0,Q.jsx)(l,{justify:`flex-end`,children:(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(x,{size:16}),onClick:k,children:`J'ai copié le secret`})})]})})}function Qe(){return(0,Q.jsxs)(d,{gap:`lg`,maw:820,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Qu'est-ce qu'un webhook ?`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,children:[`Un webhook notifie une `,(0,Q.jsx)(`strong`,{children:`URL externe`}),` (votre application, un SIEM, un canal Slack…) chaque fois qu'un`,` `,(0,Q.jsx)(`strong`,{children:`événement d'audit`}),` souscrit survient côté serveur. Nodefony envoie une requête `,(0,Q.jsx)(T,{children:`POST`}),` signée à la destination ; à charge du destinataire de vérifier la signature puis de traiter l'événement.`]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Vérifier la signature (Standard Webhooks v1)`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Chaque livraison porte trois en-têtes ; le destinataire recalcule la signature avec le `,(0,Q.jsx)(`strong`,{children:`secret de l'endpoint`}),` et la compare en temps constant :`]}),(0,Q.jsxs)(L,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-id`}),` — identifiant unique de la livraison (idempotence côté récepteur).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-timestamp`}),` — epoch (s) ; rejeter si trop ancien (anti-rejeu).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-signature`}),` —`,` `,(0,Q.jsx)(T,{children:`v1,<base64(HMAC-SHA256)>`}),` de la chaîne`,` `,(0,Q.jsx)(T,{children:`{id}.{timestamp}.{payload}`}),`.`]})]}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(me,{size:16}),mt:`xs`,children:(0,Q.jsxs)(M,{size:`xs`,children:[`Format conforme à la spécification`,` `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks`}),` — la plupart des SDK (`,(0,Q.jsx)(T,{children:`standardwebhooks`}),`, Svix…) vérifient ces en-têtes nativement. Un slot `,(0,Q.jsx)(T,{children:`v1a`}),` (Ed25519) est réservé pour une signature asymétrique future.`]})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Protections`}),(0,Q.jsxs)(L,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-SSRF`}),` : l'URL est refusée si elle pointe vers une IP privée/interne (RFC 6890) ; les redirections `,(0,Q.jsx)(T,{children:`3xx`}),` `,`ne sont pas suivies ; l'IP résolue est épinglée à la livraison (anti-rebinding DNS).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Retries bornés`}),` : un échec déclenche quelques tentatives avec backoff ; au-delà d'un seuil d'échecs consécutifs, l'endpoint est `,(0,Q.jsx)(`strong`,{children:`auto-désactivé`}),` (un événement d'audit`,` `,(0,Q.jsx)(T,{children:`webhook.disabled`}),` est tracé).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-DoS`}),` : concurrence et file d'attente bornées — un destinataire lent ou mort ne met jamais le framework en danger.`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Secret chiffré au repos`}),` (AES-256-GCM, réversible pour signer) — jamais stocké ni journalisé en clair.`]})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Événements disponibles`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Un webhook s'abonne à des `,(0,Q.jsx)(`strong`,{children:`actions d'audit`}),` (`,(0,Q.jsx)(T,{children:`<sujet>.<verbe>`}),`). Cochez `,(0,Q.jsx)(ye,{size:11}),` `,(0,Q.jsx)(`strong`,{children:`Tous les événements`}),` pour tout recevoir, ou choisissez dans le catalogue ci-dessous (complétable en saisie libre — la liste s'enrichit au fil des versions).`]}),(0,Q.jsxs)(p,{withTableBorder:!0,withColumnBorders:!0,striped:`odd`,children:[(0,Q.jsx)(p.Thead,{children:(0,Q.jsxs)(p.Tr,{children:[(0,Q.jsx)(p.Th,{children:`Domaine`}),(0,Q.jsx)(p.Th,{children:`Action`})]})}),(0,Q.jsx)(p.Tbody,{children:ke.map(e=>e.events.map((t,n)=>(0,Q.jsxs)(p.Tr,{children:[n===0&&(0,Q.jsx)(p.Td,{rowSpan:e.events.length,children:(0,Q.jsx)(M,{size:`sm`,fw:600,children:e.domain})}),(0,Q.jsxs)(p.Td,{children:[(0,Q.jsx)(T,{children:t.value}),` `,(0,Q.jsx)(M,{span:!0,size:`xs`,c:`dimmed`,children:t.label.replace(`${t.value} — `,``)})]})]},t.value)))})]}),(0,Q.jsx)(P,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(N,{size:16}),mt:`xs`,children:(0,Q.jsxs)(M,{size:`xs`,children:[`Les événements de la catégorie `,(0,Q.jsx)(T,{children:`webhook.*`}),` ne sont`,` `,(0,Q.jsx)(`strong`,{children:`pas`}),` livrables (garde anti-boucle : un webhook ne déclenche pas un webhook).`]})})]})]})}var $e=ge(()=>{let e=R(),r=oe(),[i,a]=(0,J.useState)(void 0),[s,c]=(0,J.useState)(null),[u,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1),[te,_]=(0,J.useState)(null),[v,y]=(0,J.useState)({}),[x,S]=(0,J.useState)(``),[C,w]=(0,J.useState)(0),T=(0,J.useCallback)(async()=>{try{return await e.api.getAbsolute(`${Y}?limit=1`)}catch(e){throw Error(Z(e),{cause:e})}},[e]),{data:D,loading:k,error:re,reload:A}=_e(T),j=(0,J.useCallback)(()=>{A(),w(e=>e+1)},[A]),ie=D?.enabled??!1,F=e.admin.pageCapabilities(we),I=le(v,F,x).toString(),L=(0,J.useCallback)(()=>e.api.getAbsolute(I?`${we}?${I}`:we),[e,I]),{data:ae,reload:z}=_e(L),B=he(F,v,y),H=(0,J.useMemo)(()=>ae??{total:null,active:null,disabled:null,failing:null},[ae]),U=(0,J.useCallback)(async t=>{_(t.id);try{await e.api.patchAbsolute(X(t.id),{enabled:!t.enabled}),r.notify(`success`,`Webhook ${t.enabled?`désactivé`:`activé`}.`,{source:`api`}),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r,j,z]),G=(0,J.useCallback)(async t=>{_(t.id);try{let n=await e.api.postAbsolute(Te(t.id));c({context:`rotated`,secret:n.secret,url:t.url}),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r,j,z]),ue=(0,J.useCallback)(async t=>{_(t.id);try{let n=await e.api.postAbsolute(Ee(t.id));c({context:`revealed`,secret:n.secret,url:t.url})}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r]);async function de(){if(!u)return;let t=u;g(!0);try{await e.api.deleteAbsolute(X(t.id)),r.notify(`success`,`Webhook supprimé.`,{source:`api`}),p(null),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{g(!1)}}let fe=(0,J.useMemo)(()=>({onEdit:e=>a(e),onToggle:U,onRotate:G,onReveal:ue,onDelete:e=>p(e)}),[U,G,ue]),pe=`${K(H.total)} endpoint(s) · ${K(H.active)} actif(s)${H.failing!==null&&H.failing>0?` · ${H.failing} en échec`:``}`;return(0,Q.jsxs)(O,{title:`Webhooks`,subtitle:pe,icon:(0,Q.jsx)(q,{size:26}),actions:(0,Q.jsxs)(l,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(ve,{brick:`webhooks`}),(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(ce,{size:16}),disabled:!ie,onClick:()=>a(null),children:`Nouveau webhook`}),(0,Q.jsx)(E,{variant:`light`,leftSection:(0,Q.jsx)(b,{size:16}),loading:k,onClick:j,children:`Recharger`})]}),children:[D&&!ie&&(0,Q.jsxs)(P,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(N,{size:16}),title:`Webhooks désactivés`,children:[`Le sous-système webhooks est désactivé en configuration sécurité (`,(0,Q.jsx)(M,{span:!0,ff:`monospace`,fz:`xs`,children:`webhooks.enabled = false`}),`) ou son store n'est pas provisionné. La création est indisponible ; les endpoints existants (s'il y en a) sont affichés en lecture seule.`]}),(0,Q.jsxs)(t,{children:[(0,Q.jsx)(f,{label:`Total`,...B(`total`,`tout le registre (retire les filtres de facette)`),icon:(0,Q.jsx)(q,{size:20,color:`var(--mantine-color-brand-5)`}),hint:`Nombre d'endpoints enregistrés, compté par le serveur sur le registre ENTIER — pas sur les lignes affichées. « — » = webhooks coupés ou backend incapable de compter.`,children:(0,Q.jsx)(M,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:K(H.total)})}),(0,Q.jsx)(f,{label:`Actifs`,...B(`active`,`les endpoints actifs`),icon:(0,Q.jsx)(V,{size:20,color:`var(--mantine-color-teal-6)`}),hint:`Endpoints qui reçoivent les livraisons (enabled).`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.active)})}),(0,Q.jsx)(f,{label:`En échec`,...B(`failing`,`les endpoints en échec de livraison`),icon:(0,Q.jsx)(N,{size:20,color:`var(--mantine-color-orange-6)`}),hint:`Endpoints avec au moins un échec de livraison consécutif courant (auto-désactivation au-delà du seuil). Recoupe « Actifs » et « Désactivés » : un endpoint peut être actif ET en échec.`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:H.failing!==null&&H.failing>0?`orange`:void 0,style:{fontVariantNumeric:`tabular-nums`},children:K(H.failing)})}),(0,Q.jsx)(f,{label:`Désactivés`,...B(`disabled`,`les endpoints désactivés`),icon:(0,Q.jsx)(W,{size:20,color:`var(--mantine-color-gray-6)`}),hint:`Endpoints inactifs (désactivés manuellement ou auto-désactivés après trop d'échecs).`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.disabled)})})]}),(0,Q.jsxs)(n,{defaultValue:`endpoints`,mt:`xs`,children:[(0,Q.jsxs)(n.List,{children:[(0,Q.jsx)(n.Tab,{value:`endpoints`,leftSection:(0,Q.jsx)(ne,{size:15}),children:`Endpoints`}),(0,Q.jsx)(n.Tab,{value:`help`,leftSection:(0,Q.jsx)(se,{size:15}),children:`Utilisation & aide`})]}),(0,Q.jsx)(n.Panel,{value:`endpoints`,pt:`md`,children:(0,Q.jsx)(o,{loading:k&&!D,error:re,onRetry:j,children:(0,Q.jsx)(qe,{store:D?.store??`none`,driver:D?.driver??null,filters:v,onFiltersChange:y,reloadKey:C,actions:fe,busyId:te,onSearchChange:S})})}),(0,Q.jsx)(n.Panel,{value:`help`,pt:`md`,children:(0,Q.jsx)(Qe,{})})]}),i!==void 0&&(0,Q.jsx)(Ze,{opened:!0,endpoint:i,onClose:()=>a(void 0),onSaved:j},i?.id??`create`),(0,Q.jsx)(Xe,{opened:s!==null,onClose:()=>c(null),secret:s?.secret??null,url:s?.url??``,context:s?.context??`revealed`}),(0,Q.jsx)(ee,{opened:u!==null,onClose:()=>m?void 0:p(null),title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(h,{size:18,color:`var(--mantine-color-red-6)`}),(0,Q.jsx)(M,{fw:700,children:`Supprimer le webhook ?`})]}),centered:!0,children:u&&(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(P,{variant:`light`,color:`red`,icon:(0,Q.jsx)(N,{size:16}),children:(0,Q.jsxs)(M,{size:`sm`,children:[`L'endpoint`,` `,(0,Q.jsx)(M,{span:!0,ff:`monospace`,fz:`xs`,children:u.url}),` `,`sera `,(0,Q.jsx)(`strong`,{children:`définitivement supprimé`}),` ; plus aucune livraison ne lui sera envoyée. Action irréversible (auditée).`]})}),(0,Q.jsxs)(l,{justify:`flex-end`,children:[(0,Q.jsx)(E,{variant:`default`,disabled:m,onClick:()=>p(null),children:`Annuler`}),(0,Q.jsx)(E,{color:`red`,leftSection:(0,Q.jsx)(h,{size:16}),loading:m,onClick:de,children:`Supprimer`})]})]})})]})});export{$e as Webhooks,$e as default};
|
|
1
|
+
import{k as e}from"./src-Dvwdl2PF.js";import{$t as t,Bt as n,Et as r,H as i,Ht as a,K as o,Kt as s,Lt as c,Mn as l,Pn as u,Ut as d,V as f,Vt as p,Wn as m,Xt as ee,Z as h,Zt as g,_n as te,ct as _,di as v,dn as y,et as b,gt as x,h as S,it as C,n as w,nn as T,on as E,or as D,q as O,rt as ne,sn as k,t as re,tn as A,ut as j,vn as M,wt as N,yn as P,zt as ie}from"./ui-D72MNfu0.js";import{t as F}from"./Accordion-CSYj18pO.js";import{t as I}from"./Textarea-ajvDDbkh.js";import{t as L}from"./List-VZvMDP2R.js";import{t as ae}from"./TagsInput-CF7wjb1h.js";import{c as R,o as oe}from"./stores-DnaaQoge.js";import{t as z}from"./IconArrowDown-CJDoBY_w.js";import{t as B}from"./IconArrowUp-BhHJpync.js";import{t as V}from"./IconCircleCheck-CxgUPqFg.js";import{t as H}from"./IconDots-BV_CET9W.js";import{t as U}from"./IconEye-BrtKo3KV.js";import{t as se}from"./IconHelpCircle-DVhyybMg.js";import{t as W}from"./IconPlayerPause-BV1n07nh.js";import{t as G}from"./IconPlayerPlay-Bnjmz2tQ.js";import{t as ce}from"./IconPlus-BS5_mDd8.js";import{a as le,i as ue,n as de,t as K}from"./pageQuery-yJh2-jSv.js";import{G as fe,S as q,Y as pe,k as me,v as he,vt as ge,y as _e}from"./index-BwPukNhM.js";import{t as ve}from"./BrickStoreChip-CsvDTxGr.js";var ye=r(`outline`,`asterisk`,`Asterisk`,[[`path`,{d:`M12 12l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12v9`,key:`svg-1`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-2`}],[`path`,{d:`M12 12l8 4.5`,key:`svg-3`}],[`path`,{d:`M12 3v9`,key:`svg-4`}],[`path`,{d:`M12 12l-8 4.5`,key:`svg-5`}]]),be=r(`outline`,`circle-x`,`CircleX`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M10 10l4 4m0 -4l-4 4`,key:`svg-1`}]]),xe=r(`outline`,`clock-pause`,`ClockPause`,[[`path`,{d:`M20.942 13.018a9 9 0 1 0 -7.909 7.922`,key:`svg-0`}],[`path`,{d:`M12 7v5l2 2`,key:`svg-1`}],[`path`,{d:`M17 17v5`,key:`svg-2`}],[`path`,{d:`M21 17v5`,key:`svg-3`}]]),Se=r(`outline`,`edit`,`Edit`,[[`path`,{d:`M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1`,key:`svg-0`}],[`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415`,key:`svg-1`}],[`path`,{d:`M16 5l3 3`,key:`svg-2`}]]),Ce=r(`outline`,`rotate-clockwise`,`RotateClockwise`,[[`path`,{d:`M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-0`}]]),J=e(v(),1),Y=`/nodefony/security/api/webhooks`,we=`${Y}/stats`;function X(e){return`${Y}/${encodeURIComponent(e)}`}function Te(e){return`${X(e)}/rotate`}function Ee(e){return`${X(e)}/reveal`}function De(e){return`${X(e)}/deliveries`}var Oe=`v1.0`,ke=[{domain:`Authentification`,events:[{value:`login.success`,label:`login.success — connexion réussie`},{value:`login.failure`,label:`login.failure — connexion échouée`},{value:`login.throttled`,label:`login.throttled — connexion freinée`},{value:`logout`,label:`logout — déconnexion`},{value:`auth.failure`,label:`auth.failure — credential invalide`},{value:`auth.throttled`,label:`auth.throttled — backoff NIST`},{value:`auth.denied`,label:`auth.denied — Zero Trust`}]},{domain:`Autorisation`,events:[{value:`access.denied`,label:`access.denied — refus voters/RBAC`},{value:`frame.denied`,label:`frame.denied — verrou de frame WS`}]},{domain:`Jetons & clés`,events:[{value:`token.issued`,label:`token.issued — jeton émis`},{value:`token.reuse_detected`,label:`token.reuse_detected — réutilisation détectée`},{value:`apikey.created`,label:`apikey.created — clé API créée`},{value:`apikey.revoked`,label:`apikey.revoked — clé API révoquée`}]}],Ae=ke.flatMap(e=>e.events.map(e=>e.value));function je(e){if(e.lastDeliveryAt===null)return`never`;if(e.failureCount>0)return`failing`;let t=e.lastDeliveryStatus;return t!==null&&t>=200&&t<300?`ok`:`failing`}function Me(e){let t=e.trim();if(t.length===0)return`L'URL de destination est requise.`;let n;try{n=new URL(t)}catch{return`URL invalide (ex. https://example.com/hooks/nodefony).`}return n.protocol!==`https:`&&n.protocol!==`http:`?`Seules les URL http(s) sont acceptées.`:null}function Ne(e){return e===null?`—`:new Date(e).toLocaleString(`fr-FR`,{dateStyle:`medium`,timeStyle:`short`})}function Pe(e,t=Date.now()){if(e===null)return`Jamais`;let n=Math.floor((t-e)/1e3);if(n<5)return`À l'instant`;if(n<60)return`Il y a ${n} s`;let r=Math.floor(n/60);if(r<60)return`Il y a ${r} min`;let i=Math.floor(r/60);if(i<24)return`Il y a ${i} h`;let a=Math.floor(i/24);if(a<30)return`Il y a ${a} j`;let o=Math.floor(a/30);return o<12?`Il y a ${o} mois`:`Il y a ${Math.floor(o/12)} an(s)`}function Z(e){let t=e?.status;if(t===401)return`Non authentifié — votre session Studio a expiré ou n'est plus reconnue par le firewall. Reconnectez-vous.`;if(t===403)return`Accès refusé — la gestion des webhooks est réservée aux administrateurs plateforme (ROLE_NODEFONY_ADMIN).`;if(t===422){let t=e?.message;return t?`URL refusée : ${t}`:`URL refusée — cible privée/interne interdite (protection anti-SSRF).`}if(t===400){let t=e?.message;return t?`Requête invalide : ${t}`:`Requête invalide.`}if(t===503)return`Webhooks indisponibles — désactivés en config sécurité (webhooks.enabled = false) ou store non provisionné.`;if(t===404)return`Endpoint introuvable — il a peut-être été supprimé entre-temps.`;let n=e?.message;return n?`Erreur de chargement des webhooks : ${n}`:`Erreur de chargement des webhooks.`}var Q=D();function Fe(e){try{return JSON.parse(e)}catch{return null}}function Ie({d:e}){return(0,Q.jsx)(k,{variant:e.ok?`light`:`filled`,color:e.ok?`teal`:`red`,size:`sm`,leftSection:e.ok?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(be,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e.status===null?e.error?`réseau`:`—`:e.status})}function Le({id:e}){let t=R(),n=(0,J.useCallback)(async()=>{try{return(await t.api.getAbsolute(De(e))).deliveries??[]}catch(e){throw Error(Z(e),{cause:e})}},[t,e]),{data:r,loading:i,error:a,reload:s}=_e(n),c=r??[];return(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsxs)(l,{justify:`space-between`,children:[(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,children:[c.length,` livraison(s) récente(s) — gardées en mémoire (par pod, éphémère).`]}),(0,Q.jsx)(E,{size:`xs`,variant:`light`,leftSection:(0,Q.jsx)(b,{size:14}),loading:i,onClick:s,children:`Recharger`})]}),(0,Q.jsx)(o,{loading:i&&!r,error:a,empty:c.length===0,emptyMessage:`Aucune livraison encore. Déclenche un événement souscrit (ex. un login échoué) pour en voir arriver.`,onRetry:s,children:(0,Q.jsx)(F,{variant:`separated`,chevronPosition:`left`,children:c.map((e,t)=>{let n=Fe(e.requestBody),r=e.responseBody?Fe(e.responseBody):null;return(0,Q.jsxs)(F.Item,{value:`${e.messageId}-${t}`,children:[(0,Q.jsx)(F.Control,{children:(0,Q.jsxs)(l,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(Ie,{d:e}),(0,Q.jsx)(k,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e.type}),(0,Q.jsxs)(M,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.durationMs,` ms`]}),e.attempt>0&&(0,Q.jsxs)(k,{variant:`light`,color:`orange`,size:`xs`,children:[`retry #`,e.attempt]}),(0,Q.jsx)(m,{style:{flex:1}}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Pe(e.ts)})]})}),(0,Q.jsx)(F.Panel,{children:(0,Q.jsxs)(d,{gap:`xs`,children:[(0,Q.jsxs)(l,{gap:`lg`,children:[(0,Q.jsxs)(M,{size:`xs`,c:`dimmed`,children:[`Message\xA0`,(0,Q.jsx)(T,{children:e.messageId})]}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Ne(e.ts)})]}),e.error&&(0,Q.jsx)(M,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:e.error}),(0,Q.jsxs)(M,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(B,{size:11}),` Envoyé (payload signé)`]}),n===null?(0,Q.jsx)(T,{block:!0,children:e.requestBody}):(0,Q.jsx)(S,{value:n,maxHeight:240}),(0,Q.jsxs)(M,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(z,{size:11}),` Réponse du destinataire`]}),e.responseBody===null?(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,fs:`italic`,children:`(aucun corps de réponse)`}):r===null?(0,Q.jsx)(T,{block:!0,children:e.responseBody}):(0,Q.jsx)(S,{value:r,maxHeight:200})]})})]},`${e.messageId}-${t}`)})})})]})}var Re={memory:`mémoire (volatile)`,orm:`base SQL (ORM)`};function ze({enabled:e,size:t=`sm`}){return(0,Q.jsx)(k,{variant:e?`light`:`outline`,color:e?`teal`:`gray`,size:t,leftSection:e?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(W,{size:12}),style:{textTransform:`none`},children:e?`Actif`:`Désactivé`})}var Be={never:{color:`gray`,label:`Jamais livré`,Icon:xe},ok:{color:`teal`,label:`OK`,Icon:V},failing:{color:`red`,label:`Échec`,Icon:be}};function Ve({endpoint:e,size:t=`sm`}){let n=je(e),r=Be[n],i=e.lastDeliveryStatus,a=n===`ok`&&i!==null?`${i}`:n===`failing`&&i!==null?`Échec (${i})`:r.label,o=(0,Q.jsx)(k,{variant:n===`ok`?`light`:n===`failing`?`filled`:`outline`,color:r.color,size:t,leftSection:(0,Q.jsx)(r.Icon,{size:12}),style:{textTransform:`none`},children:a});return e.lastDeliveryError||i!==null?(0,Q.jsx)(s,{withArrow:!0,openDelay:150,multiline:!0,maw:340,label:(0,Q.jsxs)(d,{gap:2,children:[i!==null&&(0,Q.jsxs)(M,{size:`xs`,children:[`Code HTTP : `,i]}),e.lastDeliveryError&&(0,Q.jsxs)(M,{size:`xs`,children:[`Erreur : `,e.lastDeliveryError]})]}),children:o}):o}function He({count:e,size:t=`sm`}){return e===0?(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:`0`}):(0,Q.jsx)(k,{variant:`light`,color:e>=5?`red`:`orange`,size:t,leftSection:(0,Q.jsx)(N,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e})}function Ue({events:e}){return e.includes(`*`)?(0,Q.jsx)(k,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,Q.jsx)(ye,{size:12}),style:{textTransform:`none`},children:`Tous les événements`}):e.length===0?(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,fs:`italic`,children:`aucun`}):(0,Q.jsx)(l,{gap:4,wrap:`wrap`,children:e.map(e=>(0,Q.jsx)(k,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e},e))})}function We({store:e,driver:t}){let n=t?Re[t]:`inconnu`,r=t===`orm`;return(0,Q.jsx)(s,{withArrow:!0,openDelay:150,multiline:!0,label:(0,Q.jsxs)(d,{gap:2,children:[(0,Q.jsxs)(M,{size:`xs`,children:[`Store : `,e]}),(0,Q.jsxs)(M,{size:`xs`,children:[`Driver : `,n]}),(0,Q.jsx)(M,{size:`xs`,children:r?`Endpoints persistés (survivent au redémarrage) ✓`:`⚠ Store volatile — endpoints perdus au redémarrage`})]}),children:(0,Q.jsx)(k,{variant:`light`,color:r?`grape`:`orange`,size:`sm`,leftSection:(0,Q.jsx)(pe,{size:12}),style:{textTransform:`none`},children:e})})}function $({k:e,children:t}){return(0,Q.jsxs)(l,{justify:`space-between`,wrap:`nowrap`,gap:`xl`,align:`flex-start`,children:[(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,style:{flexShrink:0},children:e}),(0,Q.jsx)(m,{style:{textAlign:`right`,minWidth:0},children:t})]})}function Ge({ep:e,actions:t,busyId:n}){return(0,Q.jsxs)(g,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,Q.jsx)(g.Target,{children:(0,Q.jsx)(u,{variant:`subtle`,color:`gray`,"aria-label":`Actions du webhook ${e.url}`,loading:n===e.id,onClick:e=>e.stopPropagation(),children:(0,Q.jsx)(H,{size:16})})}),(0,Q.jsxs)(g.Dropdown,{onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(Se,{size:14}),onClick:()=>t.onEdit(e),children:`Modifier`}),(0,Q.jsx)(g.Item,{leftSection:e.enabled?(0,Q.jsx)(W,{size:14}):(0,Q.jsx)(G,{size:14}),onClick:()=>t.onToggle(e),children:e.enabled?`Désactiver`:`Activer`}),(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(Ce,{size:14}),onClick:()=>t.onRotate(e),children:`Tourner le secret`}),(0,Q.jsx)(g.Item,{leftSection:(0,Q.jsx)(U,{size:14}),onClick:()=>t.onReveal(e),children:`Révéler le secret`}),(0,Q.jsx)(g.Divider,{}),(0,Q.jsx)(g.Item,{color:`red`,leftSection:(0,Q.jsx)(h,{size:14}),onClick:()=>t.onDelete(e),children:`Supprimer`})]})]})}var Ke={enabled:{label:`État`,hint:`Actif = le dispatcher lui livre. Désactivé = à la main, ou par le coupe-circuit après trop d'échecs consécutifs.`,values:{true:`Actifs`,false:`Désactivés`}},event:{label:`Événement`,hint:`Endpoints ABONNÉS à cet événement — « qui écoute user.created ? ». Nom exact de l'événement.`,placeholder:`user.created`},failing:{label:`Livraison`,hint:`En échec = compteur d'échecs consécutifs non nul. Se cumule avec l'état : un endpoint actif peut être en échec.`,values:{true:`En échec`,false:`Sains`}}},qe=ge(function({store:e,driver:t,filters:r,onFiltersChange:a,reloadKey:o=0,actions:s,busyId:c,onSearchChange:u}){let f=R(),[p,g]=(0,J.useState)(null),[v,y]=(0,J.useState)(`infos`),b=f.admin.pageCapabilities(Y),x=JSON.stringify(r),S=(0,J.useCallback)(async e=>{let t=ue(e,r);try{let e=await f.api.getAbsolute(`${Y}?${t}`);return de({...e,items:e.endpoints??[]})}catch(e){throw Error(Z(e),{cause:e})}},[f,x,o]),D=(0,J.useMemo)(()=>new Set(b?.sortable??[]),[b?.sortable]),O=(0,J.useMemo)(()=>[{key:`url`,header:`URL`,sortable:D.has(`url`),value:e=>e.url,render:e=>(0,Q.jsx)(M,{size:`sm`,style:{wordBreak:`break-all`},children:e.url}),size:240},{key:`description`,header:`Description`,sortable:D.has(`description`),value:e=>e.description??``,render:e=>e.description?(0,Q.jsx)(M,{size:`sm`,style:{wordBreak:`break-word`},children:e.description}):(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:`—`}),size:180},{key:`events`,header:`Événements`,value:e=>e.events.join(`, `),render:e=>(0,Q.jsx)(Ue,{events:e.events}),size:200},{key:`enabled`,header:`État`,sortable:D.has(`enabled`),value:e=>e.enabled?`Actif`:`Désactivé`,render:e=>(0,Q.jsx)(ze,{enabled:e.enabled}),size:110},{key:`lastDelivery`,header:`Dernière livraison`,sortable:D.has(`lastDelivery`),value:e=>e.lastDeliveryAt??0,render:e=>(0,Q.jsxs)(l,{gap:6,wrap:`nowrap`,children:[(0,Q.jsx)(Ve,{endpoint:e}),(0,Q.jsx)(M,{size:`xs`,c:`dimmed`,children:Pe(e.lastDeliveryAt)})]}),size:200},{key:`failureCount`,header:`Échecs`,sortable:D.has(`failureCount`),align:`right`,value:e=>e.failureCount,render:e=>(0,Q.jsx)(He,{count:e.failureCount}),size:90},{key:`actions`,header:``,align:`right`,render:e=>(0,Q.jsx)(Ge,{ep:e,actions:s,busyId:c}),size:60}],[s,c,D]);return(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:`Clic sur une ligne pour le détail.`}),(0,Q.jsx)(i,{title:`Webhooks sortants`,version:Oe,summary:`Un webhook notifie une URL externe quand un événement d'audit souscrit survient (modèle GitHub/Stripe). Chaque livraison est signée (Standard Webhooks v1) avec un secret propre à l'endpoint.`,sections:[{label:`Livraison`,body:`Au plus une livraison par événement matchant. En cas d'échec : retries bornés avec backoff, puis auto-désactivation au-delà d'un seuil (le compteur d'échecs consécutifs le pilote).`},{label:`Sécurité`,body:`L'URL est validée anti-SSRF (pas d'IP privée/interne, redirections 3xx non suivies, IP épinglée anti-rebinding). Le secret de signature est chiffré au repos et n'est montré qu'à la création/rotation/révélation.`},{label:`Anti-boucle`,body:`Les événements de la catégorie webhook (webhook.created/disabled…) ne déclenchent jamais de livraison (sinon boucle infinie).`}]}),(0,Q.jsx)(m,{style:{flex:1}}),(0,Q.jsx)(We,{store:e,driver:t})]}),(0,Q.jsx)(re,{spec:b?.filters??null,value:r,onChange:a,labels:Ke}),(0,Q.jsx)(w,{mode:`server`,loader:S,columns:O,getRowId:e=>e.id,onRowClick:e=>{g(e),y(`infos`)},dimRow:e=>!e.enabled,initialSort:D.has(`url`)?{key:`url`,dir:`asc`}:void 0,searchable:b?.search??!1,onSearchChange:u,searchPlaceholder:`Rechercher (URL, description, événement…)`,resetPageSignal:x,pageSize:25,persist:{key:`studio.webhooks`,storage:`session`},emptyMessage:`Aucun webhook ne correspond.`}),(0,Q.jsx)(ee,{opened:p!==null,onClose:()=>g(null),title:p?(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(M,{fw:700,children:`Webhook`}),(0,Q.jsx)(ze,{enabled:p.enabled})]}):``,centered:!0,size:`lg`,children:p&&(0,Q.jsxs)(n,{value:v,onChange:y,children:[(0,Q.jsxs)(n.List,{mb:`md`,children:[(0,Q.jsx)(n.Tab,{value:`infos`,leftSection:(0,Q.jsx)(C,{size:15}),children:`Infos`}),(0,Q.jsx)(n.Tab,{value:`deliveries`,leftSection:(0,Q.jsx)(fe,{size:15}),children:`Livraisons récentes`})]}),(0,Q.jsx)(n.Panel,{value:`infos`,children:(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsx)($,{k:`URL de destination`,children:(0,Q.jsx)(te,{href:p.url,target:`_blank`,rel:`noreferrer noopener`,size:`sm`,style:{wordBreak:`break-all`},children:(0,Q.jsxs)(l,{gap:4,wrap:`nowrap`,justify:`flex-end`,children:[p.url,(0,Q.jsx)(_,{size:13})]})})}),(0,Q.jsx)($,{k:`Identifiant`,children:(0,Q.jsx)(T,{children:p.id})}),(0,Q.jsx)($,{k:`Événements`,children:(0,Q.jsx)(Ue,{events:p.events})}),p.description&&(0,Q.jsx)($,{k:`Description`,children:(0,Q.jsx)(M,{size:`sm`,children:p.description})}),(0,Q.jsx)($,{k:`Dernière livraison`,children:(0,Q.jsxs)(l,{gap:6,wrap:`nowrap`,justify:`flex-end`,children:[(0,Q.jsx)(Ve,{endpoint:p}),(0,Q.jsx)(M,{size:`sm`,c:`dimmed`,children:p.lastDeliveryAt===null?``:Ne(p.lastDeliveryAt)})]})}),p.lastDeliveryError&&(0,Q.jsx)($,{k:`Erreur de livraison`,children:(0,Q.jsx)(M,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:p.lastDeliveryError})}),(0,Q.jsx)($,{k:`Échecs consécutifs`,children:(0,Q.jsx)(He,{count:p.failureCount})}),p.createdBy&&(0,Q.jsx)($,{k:`Créé par`,children:(0,Q.jsx)(T,{children:p.createdBy})}),p.tenantId&&(0,Q.jsx)($,{k:`Tenant`,children:(0,Q.jsx)(T,{children:p.tenantId})}),(0,Q.jsx)($,{k:`Créé le`,children:(0,Q.jsx)(M,{size:`sm`,children:Ne(p.createdAt)})}),(0,Q.jsx)($,{k:`Modifié le`,children:(0,Q.jsx)(M,{size:`sm`,children:Ne(p.updatedAt)})}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(C,{size:16}),mt:`xs`,children:(0,Q.jsx)(M,{size:`xs`,children:`Le secret de signature n'est pas affiché ici : utilisez « Révéler le secret » (action sensible, auditée). « Tourner le secret » invalide immédiatement l'ancien.`})}),(0,Q.jsxs)(l,{justify:`space-between`,mt:`xs`,children:[(0,Q.jsx)(E,{variant:`default`,leftSection:p.enabled?(0,Q.jsx)(W,{size:16}):(0,Q.jsx)(G,{size:16}),onClick:()=>{let e=p;g(null),s.onToggle(e)},children:p.enabled?`Désactiver`:`Activer`}),(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(E,{variant:`light`,leftSection:(0,Q.jsx)(Se,{size:16}),onClick:()=>{let e=p;g(null),s.onEdit(e)},children:`Modifier`}),(0,Q.jsx)(E,{color:`red`,variant:`light`,leftSection:(0,Q.jsx)(h,{size:16}),onClick:()=>{let e=p;g(null),s.onDelete(e)},children:`Supprimer`})]})]})]})}),(0,Q.jsx)(n.Panel,{value:`deliveries`,children:v===`deliveries`&&(0,Q.jsx)(Le,{id:p.id})})]})})]})}),Je={created:{title:`Endpoint créé — copiez le secret`,once:!0,intro:`Configurez ce secret chez le destinataire pour qu'il vérifie la signature de chaque livraison.`},rotated:{title:`Secret régénéré — copiez le nouveau`,once:!0,intro:`L'ancien secret cesse immédiatement d'être valide. Mettez à jour le destinataire avec ce nouveau secret.`},revealed:{title:`Secret de signature`,once:!1,intro:`Secret en clair (réversible, conservé chiffré au repos). Copiez-le pour configurer ou diagnostiquer la vérification de signature.`}};function Ye({secret:e,url:t,context:n}){let r=Je[n];return(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(P,{role:`alert`,variant:`light`,color:r.once?`orange`:`blue`,icon:(0,Q.jsx)(N,{size:16}),title:r.once?`Copiez ce secret maintenant`:`Secret sensible`,children:r.once?(0,Q.jsxs)(Q.Fragment,{children:[`Il ne sera `,(0,Q.jsx)(`strong`,{children:`plus jamais affiché automatiquement`}),` `,`(récupérable seulement via « Révéler »). `,r.intro]}):r.intro}),(0,Q.jsxs)(m,{children:[(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:4,children:[`Secret pour `,(0,Q.jsx)(T,{children:t})]}),(0,Q.jsxs)(l,{gap:`xs`,wrap:`nowrap`,align:`stretch`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`var(--mantine-spacing-xs)`},children:[(0,Q.jsx)(T,{block:!0,style:{flex:1,wordBreak:`break-all`,background:`transparent`},children:e}),(0,Q.jsx)(A,{value:e,timeout:2e3,children:({copied:e,copy:t})=>(0,Q.jsx)(E,{color:e?`teal`:`brand`,variant:e?`light`:`filled`,leftSection:e?(0,Q.jsx)(x,{size:16}):(0,Q.jsx)(j,{size:16}),onClick:t,children:e?`Copié`:`Copier`})})]})]}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(me,{size:16}),children:(0,Q.jsxs)(M,{size:`xs`,children:[`Signature `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks v1`}),` : chaque livraison porte les en-têtes `,(0,Q.jsx)(T,{children:`webhook-id`}),`,`,` `,(0,Q.jsx)(T,{children:`webhook-timestamp`}),` et`,` `,(0,Q.jsx)(T,{children:`webhook-signature: v1,<base64>`}),` (HMAC-SHA256 de`,` `,(0,Q.jsx)(T,{children:`id.timestamp.payload`}),` avec ce secret). Le destinataire recalcule la signature pour authentifier l'appel.`]})})]})}function Xe({opened:e,onClose:t,secret:n,url:r,context:i}){return(0,Q.jsx)(ee,{opened:e,onClose:t,title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(i===`rotated`?Ce:U,{size:18}),(0,Q.jsx)(M,{fw:700,children:Je[i].title})]}),centered:!0,size:`lg`,closeOnClickOutside:!1,children:n!==null&&(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(Ye,{secret:n,url:r,context:i}),(0,Q.jsx)(l,{justify:`flex-end`,children:(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(x,{size:16}),onClick:t,children:i===`rotated`?`J'ai copié le nouveau secret`:`Fermer`})})]})})}function Ze({opened:e,onClose:t,endpoint:n,onSaved:r}){let i=R(),o=n!==null,[s,c]=(0,J.useState)(n?.url??``),[u,f]=(0,J.useState)(n?n.events.includes(`*`):!1),[p,h]=(0,J.useState)(n?n.events.filter(e=>e!==`*`):[]),[g,te]=(0,J.useState)(n?.description??``),[_,v]=(0,J.useState)(n?.enabled??!0),[b,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(null),[T,D]=(0,J.useState)(null),O=(0,J.useMemo)(()=>p.filter(e=>Ae.includes(e)),[p]),ne=(0,J.useMemo)(()=>p.filter(e=>!Ae.includes(e)),[p]);function k(){let e=T!==null;t(),e&&r()}function re(){return u?[`*`]:p}async function A(){w(null);let e=Me(s);if(e){w(e);return}let a=re();if(a.length===0){w(`Sélectionnez au moins un événement (ou « Tous les événements »).`);return}S(!0);try{let e=g.trim()===``?null:g.trim();if(o)await i.api.patchAbsolute(X(n.id),{url:s.trim(),events:a,description:e,enabled:_}),r(),t();else{let t=await i.api.postAbsolute(Y,{url:s.trim(),events:a,description:e,enabled:_});D(t)}}catch(e){w(Z(e))}finally{S(!1)}}return(0,Q.jsx)(ee,{opened:e,onClose:k,title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(M,{fw:700,children:T?`Webhook créé — copiez le secret`:o?`Modifier le webhook`:`Nouveau webhook`})]}),centered:!0,size:`lg`,closeOnClickOutside:T===null,children:T===null?(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(m,{mih:44,children:C&&(0,Q.jsx)(P,{role:`alert`,variant:`light`,color:`red`,icon:(0,Q.jsx)(N,{size:16}),children:C})}),(0,Q.jsx)(ie,{label:`URL de destination`,description:`Endpoint qui recevra les livraisons signées. Validé anti-SSRF côté serveur (pas d'IP privée/interne en prod). En dev, le récepteur de test local est sur le port http 5151.`,placeholder:`http://127.0.0.1:5151/nodefony/test/webhooks/sink`,required:!0,value:s,onChange:e=>{c(e.currentTarget.value),C&&w(null)},"data-autofocus":!0}),(0,Q.jsxs)(d,{gap:`xs`,children:[(0,Q.jsx)(a,{label:`Tous les événements (*)`,description:`Livrer chaque événement d'audit (sauf les événements webhook eux-mêmes, anti-boucle).`,checked:u,onChange:e=>f(e.currentTarget.checked),thumbIcon:u?(0,Q.jsx)(ye,{size:12}):void 0}),!u&&(0,Q.jsxs)(d,{gap:`sm`,children:[(0,Q.jsx)(y.Group,{label:`Événements souscrits`,description:`Actions d'audit qui déclenchent une livraison. La liste s'enrichit côté serveur ; complétez librement ci-dessous si besoin.`,value:O,onChange:e=>h([...e,...ne]),children:(0,Q.jsx)(d,{gap:`sm`,mt:`xs`,children:ke.map(e=>(0,Q.jsxs)(m,{children:[(0,Q.jsx)(M,{size:`xs`,fw:600,c:`dimmed`,tt:`uppercase`,children:e.domain}),(0,Q.jsx)(d,{gap:4,mt:4,children:e.events.map(e=>(0,Q.jsx)(y,{value:e.value,label:e.label},e.value))})]},e.domain))})}),(0,Q.jsx)(ae,{label:`Événements personnalisés (optionnel)`,description:`Toute action d'audit hors catalogue (ex. user.created, order.shipped si émise par votre app).`,placeholder:`user.created, session.expired…`,value:ne,onChange:e=>h([...O,...e]),clearable:!0})]})]}),(0,Q.jsx)(I,{label:`Description (optionnel)`,description:`Libellé humain pour reconnaître l'endpoint.`,placeholder:`Notifie le SIEM des connexions échouées`,value:g,maxLength:200,autosize:!0,minRows:1,maxRows:3,onChange:e=>te(e.currentTarget.value)}),(0,Q.jsx)(a,{label:`Actif`,description:`Un endpoint désactivé ne reçoit aucune livraison.`,checked:_,onChange:e=>v(e.currentTarget.checked)}),(0,Q.jsxs)(l,{justify:`flex-end`,mt:`xs`,children:[(0,Q.jsx)(E,{variant:`default`,onClick:k,children:`Annuler`}),(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(q,{size:16}),loading:b,onClick:A,children:o?`Enregistrer`:`Créer le webhook`})]})]}):(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(Ye,{secret:T.secret,url:T.endpoint.url,context:`created`}),(0,Q.jsx)(l,{justify:`flex-end`,children:(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(x,{size:16}),onClick:k,children:`J'ai copié le secret`})})]})})}function Qe(){return(0,Q.jsxs)(d,{gap:`lg`,maw:820,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Qu'est-ce qu'un webhook ?`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,children:[`Un webhook notifie une `,(0,Q.jsx)(`strong`,{children:`URL externe`}),` (votre application, un SIEM, un canal Slack…) chaque fois qu'un`,` `,(0,Q.jsx)(`strong`,{children:`événement d'audit`}),` souscrit survient côté serveur. Nodefony envoie une requête `,(0,Q.jsx)(T,{children:`POST`}),` signée à la destination ; à charge du destinataire de vérifier la signature puis de traiter l'événement.`]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Vérifier la signature (Standard Webhooks v1)`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Chaque livraison porte trois en-têtes ; le destinataire recalcule la signature avec le `,(0,Q.jsx)(`strong`,{children:`secret de l'endpoint`}),` et la compare en temps constant :`]}),(0,Q.jsxs)(L,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-id`}),` — identifiant unique de la livraison (idempotence côté récepteur).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-timestamp`}),` — epoch (s) ; rejeter si trop ancien (anti-rejeu).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(T,{children:`webhook-signature`}),` —`,` `,(0,Q.jsx)(T,{children:`v1,<base64(HMAC-SHA256)>`}),` de la chaîne`,` `,(0,Q.jsx)(T,{children:`{id}.{timestamp}.{payload}`}),`.`]})]}),(0,Q.jsx)(P,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(me,{size:16}),mt:`xs`,children:(0,Q.jsxs)(M,{size:`xs`,children:[`Format conforme à la spécification`,` `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks`}),` — la plupart des SDK (`,(0,Q.jsx)(T,{children:`standardwebhooks`}),`, Svix…) vérifient ces en-têtes nativement. Un slot `,(0,Q.jsx)(T,{children:`v1a`}),` (Ed25519) est réservé pour une signature asymétrique future.`]})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Protections`}),(0,Q.jsxs)(L,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-SSRF`}),` : l'URL est refusée si elle pointe vers une IP privée/interne (RFC 6890) ; les redirections `,(0,Q.jsx)(T,{children:`3xx`}),` `,`ne sont pas suivies ; l'IP résolue est épinglée à la livraison (anti-rebinding DNS).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Retries bornés`}),` : un échec déclenche quelques tentatives avec backoff ; au-delà d'un seuil d'échecs consécutifs, l'endpoint est `,(0,Q.jsx)(`strong`,{children:`auto-désactivé`}),` (un événement d'audit`,` `,(0,Q.jsx)(T,{children:`webhook.disabled`}),` est tracé).`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-DoS`}),` : concurrence et file d'attente bornées — un destinataire lent ou mort ne met jamais le framework en danger.`]}),(0,Q.jsxs)(L.Item,{children:[(0,Q.jsx)(`strong`,{children:`Secret chiffré au repos`}),` (AES-256-GCM, réversible pour signer) — jamais stocké ni journalisé en clair.`]})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(c,{order:4,mb:4,children:`Événements disponibles`}),(0,Q.jsxs)(M,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Un webhook s'abonne à des `,(0,Q.jsx)(`strong`,{children:`actions d'audit`}),` (`,(0,Q.jsx)(T,{children:`<sujet>.<verbe>`}),`). Cochez `,(0,Q.jsx)(ye,{size:11}),` `,(0,Q.jsx)(`strong`,{children:`Tous les événements`}),` pour tout recevoir, ou choisissez dans le catalogue ci-dessous (complétable en saisie libre — la liste s'enrichit au fil des versions).`]}),(0,Q.jsxs)(p,{withTableBorder:!0,withColumnBorders:!0,striped:`odd`,children:[(0,Q.jsx)(p.Thead,{children:(0,Q.jsxs)(p.Tr,{children:[(0,Q.jsx)(p.Th,{children:`Domaine`}),(0,Q.jsx)(p.Th,{children:`Action`})]})}),(0,Q.jsx)(p.Tbody,{children:ke.map(e=>e.events.map((t,n)=>(0,Q.jsxs)(p.Tr,{children:[n===0&&(0,Q.jsx)(p.Td,{rowSpan:e.events.length,children:(0,Q.jsx)(M,{size:`sm`,fw:600,children:e.domain})}),(0,Q.jsxs)(p.Td,{children:[(0,Q.jsx)(T,{children:t.value}),` `,(0,Q.jsx)(M,{span:!0,size:`xs`,c:`dimmed`,children:t.label.replace(`${t.value} — `,``)})]})]},t.value)))})]}),(0,Q.jsx)(P,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(N,{size:16}),mt:`xs`,children:(0,Q.jsxs)(M,{size:`xs`,children:[`Les événements de la catégorie `,(0,Q.jsx)(T,{children:`webhook.*`}),` ne sont`,` `,(0,Q.jsx)(`strong`,{children:`pas`}),` livrables (garde anti-boucle : un webhook ne déclenche pas un webhook).`]})})]})]})}var $e=ge(()=>{let e=R(),r=oe(),[i,a]=(0,J.useState)(void 0),[s,c]=(0,J.useState)(null),[u,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1),[te,_]=(0,J.useState)(null),[v,y]=(0,J.useState)({}),[x,S]=(0,J.useState)(``),[C,w]=(0,J.useState)(0),T=(0,J.useCallback)(async()=>{try{return await e.api.getAbsolute(`${Y}?limit=1`)}catch(e){throw Error(Z(e),{cause:e})}},[e]),{data:D,loading:k,error:re,reload:A}=_e(T),j=(0,J.useCallback)(()=>{A(),w(e=>e+1)},[A]),ie=D?.enabled??!1,F=e.admin.pageCapabilities(we),I=le(v,F,x).toString(),L=(0,J.useCallback)(()=>e.api.getAbsolute(I?`${we}?${I}`:we),[e,I]),{data:ae,reload:z}=_e(L),B=he(F,v,y),H=(0,J.useMemo)(()=>ae??{total:null,active:null,disabled:null,failing:null},[ae]),U=(0,J.useCallback)(async t=>{_(t.id);try{await e.api.patchAbsolute(X(t.id),{enabled:!t.enabled}),r.notify(`success`,`Webhook ${t.enabled?`désactivé`:`activé`}.`,{source:`api`}),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r,j,z]),G=(0,J.useCallback)(async t=>{_(t.id);try{let n=await e.api.postAbsolute(Te(t.id));c({context:`rotated`,secret:n.secret,url:t.url}),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r,j,z]),ue=(0,J.useCallback)(async t=>{_(t.id);try{let n=await e.api.postAbsolute(Ee(t.id));c({context:`revealed`,secret:n.secret,url:t.url})}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{_(null)}},[e,r]);async function de(){if(!u)return;let t=u;g(!0);try{await e.api.deleteAbsolute(X(t.id)),r.notify(`success`,`Webhook supprimé.`,{source:`api`}),p(null),j(),z()}catch(e){r.notify(`error`,Z(e),{source:`api`})}finally{g(!1)}}let fe=(0,J.useMemo)(()=>({onEdit:e=>a(e),onToggle:U,onRotate:G,onReveal:ue,onDelete:e=>p(e)}),[U,G,ue]),pe=`${K(H.total)} endpoint(s) · ${K(H.active)} actif(s)${H.failing!==null&&H.failing>0?` · ${H.failing} en échec`:``}`;return(0,Q.jsxs)(O,{title:`Webhooks`,subtitle:pe,icon:(0,Q.jsx)(q,{size:26}),actions:(0,Q.jsxs)(l,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(ve,{brick:`webhooks`}),(0,Q.jsx)(E,{leftSection:(0,Q.jsx)(ce,{size:16}),disabled:!ie,onClick:()=>a(null),children:`Nouveau webhook`}),(0,Q.jsx)(E,{variant:`light`,leftSection:(0,Q.jsx)(b,{size:16}),loading:k,onClick:j,children:`Recharger`})]}),children:[D&&!ie&&(0,Q.jsxs)(P,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(N,{size:16}),title:`Webhooks désactivés`,children:[`Le sous-système webhooks est désactivé en configuration sécurité (`,(0,Q.jsx)(M,{span:!0,ff:`monospace`,fz:`xs`,children:`webhooks.enabled = false`}),`) ou son store n'est pas provisionné. La création est indisponible ; les endpoints existants (s'il y en a) sont affichés en lecture seule.`]}),(0,Q.jsxs)(t,{children:[(0,Q.jsx)(f,{label:`Total`,...B(`total`,`tout le registre (retire les filtres de facette)`),icon:(0,Q.jsx)(q,{size:20,color:`var(--mantine-color-brand-5)`}),hint:`Nombre d'endpoints enregistrés, compté par le serveur sur le registre ENTIER — pas sur les lignes affichées. « — » = webhooks coupés ou backend incapable de compter.`,children:(0,Q.jsx)(M,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:K(H.total)})}),(0,Q.jsx)(f,{label:`Actifs`,...B(`active`,`les endpoints actifs`),icon:(0,Q.jsx)(V,{size:20,color:`var(--mantine-color-teal-6)`}),hint:`Endpoints qui reçoivent les livraisons (enabled).`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.active)})}),(0,Q.jsx)(f,{label:`En échec`,...B(`failing`,`les endpoints en échec de livraison`),icon:(0,Q.jsx)(N,{size:20,color:`var(--mantine-color-orange-6)`}),hint:`Endpoints avec au moins un échec de livraison consécutif courant (auto-désactivation au-delà du seuil). Recoupe « Actifs » et « Désactivés » : un endpoint peut être actif ET en échec.`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:H.failing!==null&&H.failing>0?`orange`:void 0,style:{fontVariantNumeric:`tabular-nums`},children:K(H.failing)})}),(0,Q.jsx)(f,{label:`Désactivés`,...B(`disabled`,`les endpoints désactivés`),icon:(0,Q.jsx)(W,{size:20,color:`var(--mantine-color-gray-6)`}),hint:`Endpoints inactifs (désactivés manuellement ou auto-désactivés après trop d'échecs).`,children:(0,Q.jsx)(M,{fz:28,fw:700,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.disabled)})})]}),(0,Q.jsxs)(n,{defaultValue:`endpoints`,mt:`xs`,children:[(0,Q.jsxs)(n.List,{children:[(0,Q.jsx)(n.Tab,{value:`endpoints`,leftSection:(0,Q.jsx)(ne,{size:15}),children:`Endpoints`}),(0,Q.jsx)(n.Tab,{value:`help`,leftSection:(0,Q.jsx)(se,{size:15}),children:`Utilisation & aide`})]}),(0,Q.jsx)(n.Panel,{value:`endpoints`,pt:`md`,children:(0,Q.jsx)(o,{loading:k&&!D,error:re,onRetry:j,children:(0,Q.jsx)(qe,{store:D?.store??`none`,driver:D?.driver??null,filters:v,onFiltersChange:y,reloadKey:C,actions:fe,busyId:te,onSearchChange:S})})}),(0,Q.jsx)(n.Panel,{value:`help`,pt:`md`,children:(0,Q.jsx)(Qe,{})})]}),i!==void 0&&(0,Q.jsx)(Ze,{opened:!0,endpoint:i,onClose:()=>a(void 0),onSaved:j},i?.id??`create`),(0,Q.jsx)(Xe,{opened:s!==null,onClose:()=>c(null),secret:s?.secret??null,url:s?.url??``,context:s?.context??`revealed`}),(0,Q.jsx)(ee,{opened:u!==null,onClose:()=>m?void 0:p(null),title:(0,Q.jsxs)(l,{gap:`xs`,children:[(0,Q.jsx)(h,{size:18,color:`var(--mantine-color-red-6)`}),(0,Q.jsx)(M,{fw:700,children:`Supprimer le webhook ?`})]}),centered:!0,children:u&&(0,Q.jsxs)(d,{gap:`md`,children:[(0,Q.jsx)(P,{variant:`light`,color:`red`,icon:(0,Q.jsx)(N,{size:16}),children:(0,Q.jsxs)(M,{size:`sm`,children:[`L'endpoint`,` `,(0,Q.jsx)(M,{span:!0,ff:`monospace`,fz:`xs`,children:u.url}),` `,`sera `,(0,Q.jsx)(`strong`,{children:`définitivement supprimé`}),` ; plus aucune livraison ne lui sera envoyée. Action irréversible (auditée).`]})}),(0,Q.jsxs)(l,{justify:`flex-end`,children:[(0,Q.jsx)(E,{variant:`default`,disabled:m,onClick:()=>p(null),children:`Annuler`}),(0,Q.jsx)(E,{color:`red`,leftSection:(0,Q.jsx)(h,{size:16}),loading:m,onClick:de,children:`Supprimer`})]})]})})]})});export{$e as Webhooks,$e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,Ct as n,Et as r,Hn as i,Ht as a,Kt as o,Mn as s,Pn as c,Qt as l,Rt as u,St as d,Ut as f,Vn as p,Wn as m,Xt as h,Y as g,Z as _,Zt as v,an as y,di as b,et as x,gt as S,ht as C,on as w,or as T,sn as E,ut as D,vn as O,zt as ee}from"./ui-KaBQR2GX.js";import{t as te}from"./Collapse-c8A5_Xw2.js";import{t as k}from"./Chip-Bl5u9dbS.js";import{_ as A,c as j,f as M,g as N,l as P,m as F,p as I,r as L,u as R,v as ne}from"./stores-CLUS0FeB.js";import{t as re}from"./IconApps-D42Eh0ms.js";import{t as ie}from"./IconArrowLeft-BW1qFtph.js";import{n as ae,t as oe}from"./useBlockSource-zm0JfWOg.js";import{t as se}from"./IconDots-DxBL013E.js";import{t as z}from"./IconLayoutGrid-BgtRb6yj.js";import{t as ce}from"./IconPencil-DbS-vJyZ.js";import{t as B}from"./IconPlus-C3Eai0ws.js";import{X as le,pt as ue,vt as V,x as H,y as de}from"./index-8Y7Th-EF.js";import{n as fe}from"./realtimeHealth-CEJDxl45.js";var U=r(`outline`,`arrows-minimize`,`ArrowsMinimize`,[[`path`,{d:`M5 9l4 0l0 -4`,key:`svg-0`}],[`path`,{d:`M3 3l6 6`,key:`svg-1`}],[`path`,{d:`M5 15l4 0l0 4`,key:`svg-2`}],[`path`,{d:`M3 21l6 -6`,key:`svg-3`}],[`path`,{d:`M19 9l-4 0l0 -4`,key:`svg-4`}],[`path`,{d:`M15 9l6 -6`,key:`svg-5`}],[`path`,{d:`M19 15l-4 0l0 4`,key:`svg-6`}],[`path`,{d:`M15 15l6 6`,key:`svg-7`}]]),pe=r(`outline`,`dots-vertical`,`DotsVertical`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),W=r(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),G=e(b(),1),K=T(),me=V(({def:e,instance:t,ctx:n,dragHandlers:r,resizeHandlers:i})=>{let a=R(),o=ae(e.source,n.live),l=e.icon,d=e.source.kind!==`snapshot`;return(0,K.jsxs)(y,{withBorder:!0,radius:`md`,p:`sm`,h:`100%`,style:{contain:`content`,position:`relative`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,K.jsxs)(s,{justify:`space-between`,wrap:`nowrap`,mb:`xs`,style:{flexShrink:0},children:[(0,K.jsxs)(s,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,cursor:r?`grab`:void 0,touchAction:`none`},...r,children:[r?(0,K.jsx)(W,{size:14,style:{opacity:.45,flexShrink:0}}):null,(0,K.jsx)(u,{variant:`light`,color:`gray`,size:`sm`,radius:`md`,children:(0,K.jsx)(l,{size:15})}),(0,K.jsx)(O,{fw:600,size:`sm`,truncate:!0,children:e.title}),d?(0,K.jsx)(m,{"aria-hidden":!0,style:{width:7,height:7,borderRadius:`50%`,flexShrink:0,background:o.source.fromLive?`var(--mantine-color-teal-6)`:`var(--mantine-color-gray-5)`}}):null]}),(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Options du widget`,children:(0,K.jsx)(pe,{size:15})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:ne[e.category]}),(0,K.jsx)(v.Item,{color:`red`,leftSection:(0,K.jsx)(H,{size:14}),onClick:()=>a.removeWidget(e.id),children:`Retirer du bureau`})]})]})]}),(0,K.jsx)(m,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,K.jsx)(oe,{def:e,state:o,ctx:n,span:Math.max(1,Math.min(12,Math.round(t.w*12))),container:`widget`})}),i?(0,K.jsx)(m,{"aria-hidden":!0,...i,style:{position:`absolute`,right:3,bottom:3,width:14,height:14,cursor:`nwse-resize`,touchAction:`none`,borderRight:`2px solid var(--mantine-color-dimmed)`,borderBottom:`2px solid var(--mantine-color-dimmed)`,borderBottomRightRadius:4,opacity:.5}}):null]})}),he=6,ge=V(({layout:e,ctx:t})=>{let n=R(),r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useRef)(0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=e.items.filter(e=>I(e.widgetId)),f=d.reduce((e,t)=>Math.max(e,t.y+t.h),0)+80,p=(0,G.useCallback)(e=>{let t=i.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=i.current;e&&(e.el.style.transform=`translate3d(${e.cx-e.sx}px, ${e.cy-e.sy}px, 0)`)})))},[]),h=(0,G.useCallback)(e=>{let t=i.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.transform=``,t.el.style.willChange=``,document.body.style.userSelect=``;let r=t.ox+(t.cx-t.sx)/t.W,a=t.oy+(t.cy-t.sy);i.current=null,c(null),n.moveTo(t.id,r,a)},[n]),g=(0,G.useCallback)((e,t,a)=>o=>{if(o.button!==0)return;let s=r.current,l=o.currentTarget.closest(`[data-window]`);if(s&&l){o.preventDefault();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),i.current={id:e,el:l,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,ox:t,oy:a,W:s.getBoundingClientRect().width||1},l.style.willChange=`transform`,document.body.style.userSelect=`none`,c(e)}},[n]),_=(0,G.useCallback)(e=>{let t=a.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=a.current;if(!e)return;let t=M(e.w0+(e.cx-e.sx)/e.W,A,1),n=Math.max(96,e.h0+(e.cy-e.sy));e.el.style.width=`${t*100}%`,e.el.style.height=`${n}px`})))},[]),v=(0,G.useCallback)(e=>{let t=a.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.willChange=``,document.body.style.userSelect=``;let r=M(t.w0+(t.cx-t.sx)/t.W,A,1),i=Math.max(96,t.h0+(t.cy-t.sy));a.current=null,u(null),n.setSize(t.id,r,i)},[n]),y=(0,G.useCallback)((e,t,i)=>o=>{if(o.button!==0)return;let s=r.current,c=o.currentTarget.closest(`[data-window]`);if(s&&c){o.preventDefault(),o.stopPropagation();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),a.current={id:e,el:c,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,w0:t,h0:i,W:s.getBoundingClientRect().width||1},c.style.willChange=`width, height`,document.body.style.userSelect=`none`,u(e)}},[n]);return(0,K.jsx)(m,{ref:r,style:{position:`relative`,minHeight:f,width:`100%`,isolation:`isolate`},children:d.map(e=>{let r=I(e.widgetId);if(!r)return null;let i=s===e.widgetId||l===e.widgetId;return(0,K.jsx)(m,{"data-window":!0,"data-widget":e.widgetId,onPointerDownCapture:()=>n.bringToFront(e.widgetId),style:{position:`absolute`,left:`${e.x*100}%`,top:e.y,width:`${e.w*100}%`,height:e.h,padding:he,zIndex:e.z,transition:i?`none`:`left .18s ease, top .18s ease, width .12s ease, height .12s ease`},children:(0,K.jsx)(me,{def:r,instance:e,ctx:t,dragHandlers:{onPointerDown:g(e.widgetId,e.x,e.y),onPointerMove:p,onPointerUp:h},resizeHandlers:{onPointerDown:y(e.widgetId,e.w,e.h),onPointerMove:_,onPointerUp:v}})},e.widgetId)})})}),_e=[{id:`runtime`,label:`Runtime & lancement`,group:`domaine`},{id:`config`,label:`Configuration`,group:`domaine`},{id:`systeme`,label:`Système & santé`,group:`domaine`},{id:`orm`,label:`Données / ORM`,group:`domaine`},{id:`logs`,label:`Logs`,group:`domaine`},{id:`realtime`,label:`Temps réel`,group:`domaine`},{id:`cluster`,label:`Cluster`,group:`domaine`},{id:`erreurs`,label:`Erreurs`,group:`domaine`},{id:`securite`,label:`Sécurité`,group:`domaine`},{id:`compte`,label:`Mon compte`,group:`domaine`},{id:`ia`,label:`IA`,group:`domaine`},{id:`cpu`,label:`CPU`,group:`domaine`,parent:`systeme`},{id:`memoire`,label:`Mémoire`,group:`domaine`,parent:`systeme`},{id:`event-loop`,label:`Event-loop`,group:`domaine`,parent:`systeme`},{id:`gc`,label:`Garbage Collector`,group:`domaine`,parent:`systeme`},{id:`sante`,label:`Santé`,group:`domaine`,parent:`systeme`},{id:`handles`,label:`Ressources actives`,group:`domaine`,parent:`systeme`},{id:`identite`,label:`Identité`,group:`domaine`,parent:`systeme`},{id:`orm-debit`,label:`Débit`,group:`domaine`,parent:`orm`},{id:`orm-connecteurs`,label:`Connecteurs`,group:`domaine`,parent:`orm`},{id:`kpi`,label:`KPI (valeur)`,group:`nature`},{id:`graphe`,label:`Graphe (courbe)`,group:`nature`},{id:`indice`,label:`Indice composite`,group:`nature`},{id:`liste`,label:`Liste / flux`,group:`nature`},{id:`panneau`,label:`Panneau`,group:`nature`}],ve=Object.fromEntries(_e.map(e=>[e.id,e]));function q(e){return ve[e]}function J(e,t){return _e.filter(n=>n.group===e&&(t===void 0||n.parent===t))}function ye(e){return{clusterReady:e.clusterAware===!0,realtime:e.source.kind!==`snapshot`}}var be=`min(1280px, 95vw)`,xe=`min(720px, 90vh)`,Se=e=>e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase();function Y(e,t){return(e.tags??[]).includes(t)}function Ce({def:e,roles:t}){let n=ae(e.source,!0);return(0,K.jsx)(m,{style:{height:230,overflow:`auto`,padding:8,border:`1px solid var(--mantine-color-default-border)`,borderRadius:8,background:`var(--mantine-color-body)`},children:(0,K.jsx)(oe,{def:e,state:n,ctx:{live:!0,cluster:!1,instanceCount:1,roles:t},span:6,container:`widget`})})}function we({def:e}){let t=ye(e);return(0,K.jsxs)(K.Fragment,{children:[t.clusterReady?(0,K.jsx)(E,{size:`xs`,variant:`light`,color:`grape`,children:`cluster-ready`}):null,t.realtime?(0,K.jsx)(E,{size:`xs`,variant:`light`,color:`teal`,children:`temps réel`}):null]})}function Te({def:e,onBoard:t,roles:n,onToggle:r}){let i=e.icon,a=(e.tags??[]).map(q).filter(e=>!!e);return(0,K.jsxs)(l,{width:400,position:`right`,openDelay:220,closeDelay:80,withinPortal:!0,shadow:`md`,radius:`md`,children:[(0,K.jsx)(l.Target,{children:(0,K.jsx)(p,{"aria-pressed":t,onClick:r,style:{height:`100%`},children:(0,K.jsxs)(f,{gap:6,p:`sm`,h:`100%`,style:{border:`1px solid ${t?`var(--mantine-color-teal-5)`:`var(--mantine-color-default-border)`}`,borderRadius:10,background:t?`var(--mantine-color-teal-light)`:void 0},children:[(0,K.jsxs)(s,{gap:`sm`,wrap:`nowrap`,align:`flex-start`,children:[(0,K.jsx)(u,{variant:`light`,color:t?`teal`:`gray`,radius:`md`,children:(0,K.jsx)(i,{size:16})}),(0,K.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,K.jsx)(O,{size:`sm`,fw:600,truncate:!0,children:e.title}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,lineClamp:2,children:e.description})]}),(0,K.jsx)(u,{variant:t?`filled`:`light`,color:t?`teal`:`blue`,radius:`xl`,size:`sm`,children:t?(0,K.jsx)(S,{size:14}):(0,K.jsx)(B,{size:14})})]}),(0,K.jsxs)(s,{gap:4,wrap:`wrap`,children:[(0,K.jsx)(we,{def:e}),a.map(e=>(0,K.jsx)(E,{size:`xs`,variant:`default`,children:e.label},e.id))]})]})})}),(0,K.jsx)(l.Dropdown,{p:`sm`,children:(0,K.jsxs)(f,{gap:`sm`,children:[(0,K.jsxs)(s,{gap:`xs`,wrap:`wrap`,children:[(0,K.jsx)(u,{variant:`light`,color:`gray`,radius:`md`,size:`sm`,children:(0,K.jsx)(i,{size:15})}),(0,K.jsx)(O,{fw:700,size:`sm`,children:e.title}),(0,K.jsx)(we,{def:e})]}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,children:e.description}),(0,K.jsx)(O,{size:`xs`,fw:700,tt:`uppercase`,c:`dimmed`,children:`Aperçu en direct`}),(0,K.jsx)(Ce,{def:e,roles:n}),(0,K.jsx)(w,{size:`xs`,fullWidth:!0,variant:t?`light`:`filled`,color:t?`red`:`blue`,leftSection:t?(0,K.jsx)(S,{size:14}):(0,K.jsx)(B,{size:14}),onClick:r,children:t?`Retirer du bureau`:`Ajouter au bureau`})]})})]})}var X=`all`,Ee=V(({opened:e,onClose:n})=>{let r=R(),a=L(),l=F(a.roles),[u,p]=(0,G.useState)(``),[m,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(X),[y,b]=(0,G.useState)(X),[x,S]=(0,G.useState)(X),[C,w]=(0,G.useState)(!1),[T,D]=(0,G.useState)(!1),te=(0,G.useMemo)(()=>J(`domaine`).filter(e=>!e.parent),[]),A=(0,G.useMemo)(()=>_===X?[]:J(`domaine`,_),[_]),j=(0,G.useMemo)(()=>J(`nature`),[]),M=u.trim(),N=(0,G.useMemo)(()=>{let e=Se(M).split(/\s+/).filter(Boolean);return l.filter(t=>{if(_!==X&&!Y(t,_)||y!==X&&!Y(t,y)||x!==X&&!Y(t,x))return!1;let n=ye(t);if(C&&!n.clusterReady||T&&!n.realtime)return!1;if(e.length){let n=Se(`${t.title} ${t.description} ${(t.tags??[]).map(e=>q(e)?.label??``).join(` `)}`);if(!e.every(e=>n.includes(e)))return!1}return!0})},[l,M,_,y,x,C,T]),P=e=>l.filter(t=>Y(t,e)).length;return(0,K.jsx)(h,{opened:e,onClose:n,centered:!0,radius:`md`,size:`auto`,fullScreen:m,title:(0,K.jsxs)(s,{gap:`xs`,children:[(0,K.jsx)(O,{fw:700,children:`Catalogue de blocs`}),(0,K.jsx)(E,{variant:`light`,color:`gray`,children:l.length}),(0,K.jsx)(o,{label:m?`Réduire (16/9)`:`Plein écran`,withArrow:!0,children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`sm`,onClick:()=>g(e=>!e),"aria-label":m?`Réduire la fenêtre`:`Passer en plein écran`,children:m?(0,K.jsx)(U,{size:16}):(0,K.jsx)(d,{size:16})})})]}),styles:{content:{display:`flex`,flexDirection:`column`,...m?{}:{width:be,height:xe}},header:{flexShrink:0},body:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`}},children:(0,K.jsxs)(f,{gap:`sm`,style:{flex:1,minHeight:0},children:[(0,K.jsx)(ee,{placeholder:`Rechercher un bloc (titre, description, tag)…`,leftSection:(0,K.jsx)(t,{size:16}),value:u,onChange:e=>p(e.currentTarget.value),"aria-label":`Rechercher un bloc dans le catalogue`}),(0,K.jsx)(k.Group,{value:_,onChange:e=>{v(e||X),b(X)},children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,variant:`light`,children:[`Tous (`,l.length,`)`]}),te.map(e=>(0,K.jsxs)(k,{value:e.id,size:`xs`,variant:`light`,children:[e.label,` (`,P(e.id),`)`]},e.id))]})}),A.length>0?(0,K.jsx)(k.Group,{value:y,onChange:e=>b(e||X),children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,pl:`md`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,children:[`Tout `,q(_)?.label]}),A.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,children:e.label},e.id))]})}):null,(0,K.jsxs)(s,{gap:`md`,wrap:`wrap`,children:[(0,K.jsx)(k.Group,{value:x,onChange:e=>S(e||X),children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,children:[(0,K.jsx)(O,{size:`xs`,c:`dimmed`,fw:600,children:`Nature`}),(0,K.jsx)(k,{value:X,size:`xs`,variant:`outline`,children:`Toutes`}),j.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,variant:`outline`,children:e.label},e.id))]})}),(0,K.jsxs)(s,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(k,{checked:C,onChange:w,size:`xs`,color:`grape`,children:`cluster-ready`}),(0,K.jsx)(k,{checked:T,onChange:D,size:`xs`,color:`teal`,children:`temps réel`})]})]}),(0,K.jsxs)(i,{style:{flex:1},type:`auto`,children:[(0,K.jsx)(ue,{cols:{base:1,sm:2,lg:3},spacing:`sm`,pr:`xs`,children:N.map(e=>(0,K.jsx)(Te,{def:e,roles:a.roles,onBoard:r.hasWidget(e.id),onToggle:()=>r.hasWidget(e.id)?r.removeWidget(e.id):r.addWidget(e.id)},e.id))}),N.length===0?(0,K.jsx)(O,{c:`dimmed`,size:`sm`,py:`xl`,ta:`center`,children:`Aucun bloc pour ces filtres.`}):null]})]})})}),Z=156,Q=88,De=4;function Oe({layout:e,active:t}){let n=e.items,r=n.reduce((e,t)=>Math.max(e,t.y+t.h),0)||1;return(0,K.jsxs)(m,{"aria-hidden":!0,style:{position:`relative`,width:Z,height:Q,borderRadius:6,overflow:`hidden`,background:`radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--mantine-color-indigo-9) 16%, var(--mantine-color-body)) 0%, var(--mantine-color-body) 70%)`,border:`${t?`2px`:`1px`} solid ${t?`var(--mantine-color-brand-5)`:`var(--mantine-color-default-border)`}`},children:[n.map(e=>(0,K.jsx)(m,{style:{position:`absolute`,left:e.x*Z+1,top:e.y/r*Q+1,width:Math.max(2,e.w*Z-2),height:Math.max(2,e.h/r*Q-2),borderRadius:2,background:`color-mix(in srgb, var(--mantine-color-brand-5) 38%, var(--mantine-color-body))`,border:`1px solid var(--mantine-color-brand-4)`}},e.widgetId)),n.length===0?(0,K.jsx)(O,{size:`9px`,c:`dimmed`,style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`},children:`vide`}):null]})}var ke=V(()=>{let e=R(),t=L(),[r,i]=(0,G.useState)(!0),[a,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(``),f=e.layoutList.filter(e=>N(e.id,t.roles)),h=e.active,g=f.length>1,y=(0,G.useRef)(null),b=(0,G.useRef)(null),[x,S]=(0,G.useState)(null),[w,T]=(0,G.useState)(void 0),k=(0,G.useCallback)((e,t)=>{let n=y.current;if(!n)return null;let r=Array.from(n.querySelectorAll(`[data-ws-id]`));for(let n of r){let r=n.dataset.wsId;if(!r||r===t)continue;let i=n.getBoundingClientRect();if(e<i.left+i.width/2)return r}return null},[]),A=(0,G.useCallback)(e=>{let t=b.current;if(!t)return;let n=e.clientX-t.sx;!t.moved&&Math.abs(n)<De||(t.moved||(t.moved=!0,S(t.id),document.body.style.userSelect=`none`,t.el.style.willChange=`transform`),t.el.style.transform=`translate3d(${n}px, 0, 0)`,T(k(e.clientX,t.id)))},[k]),j=(0,G.useCallback)(t=>{let n=b.current;if(!n)return;try{t.currentTarget.releasePointerCapture(t.pointerId)}catch{}n.el.style.transform=``,n.el.style.willChange=``,document.body.style.userSelect=``;let r=n.moved,i=k(t.clientX,n.id);b.current=null,S(null),T(void 0),r&&e.moveWorkspace(n.id,i)},[k,e]),M=(0,G.useCallback)(e=>t=>{if(t.button!==0)return;let n=t.currentTarget.closest(`[data-ws-id]`);if(n){try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}b.current={id:e,el:n,sx:t.clientX,moved:!1}}},[]),P=(t,n)=>{let r=f.findIndex(e=>e.id===t);if(r<0)return;let i=r+n;i<0||i>=f.length||e.moveWorkspace(t,n===-1?f[i].id:f[i+1]?.id??null)},F=(e,t)=>{d(t),l(e)},I=()=>{a&&e.renameWorkspace(a,u),l(null)},ne=(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(o,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(c,{variant:`light`,size:`sm`,"aria-label":`Ajouter un bureau`,children:(0,K.jsx)(B,{size:15})})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:`Nouveau bureau`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,t.roles)).map(t=>(0,K.jsx)(v.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]});return(0,K.jsxs)(m,{children:[(0,K.jsxs)(s,{justify:`space-between`,wrap:`nowrap`,py:6,children:[(0,K.jsxs)(p,{onClick:()=>i(e=>!e),"aria-expanded":r,"aria-label":r?`Replier les bureaux`:`Afficher les bureaux`,style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,K.jsx)(C,{size:16,style:{transition:`transform .15s ease`,transform:r?`none`:`rotate(-90deg)`}}),(0,K.jsx)(O,{fw:600,size:`sm`,children:`Bureaux`}),(0,K.jsx)(E,{size:`sm`,variant:`light`,color:`gray`,children:f.length}),r?null:(0,K.jsxs)(O,{size:`xs`,c:`dimmed`,truncate:!0,children:[`· `,h.label]})]}),ne]}),(0,K.jsx)(te,{expanded:r,children:(0,K.jsxs)(m,{ref:y,role:`tablist`,"aria-label":`Bureaux`,style:{display:`flex`,gap:12,alignItems:`flex-start`,overflowX:`auto`,paddingTop:6,paddingBottom:12,scrollSnapType:x?`none`:`x proximity`},children:[f.map(t=>{let r=t.id===h.id,i=x===t.id,y=x!==null&&w===t.id;return(0,K.jsxs)(m,{"data-ws-id":t.id,style:{position:`relative`,flexShrink:0,width:Z,scrollSnapAlign:`start`,zIndex:i?2:void 0,opacity:i?.85:1,cursor:i?`grabbing`:void 0,borderLeft:y?`2px solid var(--mantine-color-brand-5)`:`2px solid transparent`,paddingLeft:4},children:[g?(0,K.jsx)(o,{label:`Supprimer ce bureau`,withArrow:!0,children:(0,K.jsx)(c,{size:`xs`,variant:`filled`,color:`dark`,radius:`xl`,"aria-label":`Supprimer le bureau ${t.label}`,onClick:n=>{n.stopPropagation(),e.deleteWorkspace(t.id)},style:{position:`absolute`,top:4,right:4,zIndex:2,opacity:.85},children:(0,K.jsx)(H,{size:12})})}):null,(0,K.jsx)(o,{label:`Glisser pour réordonner`,withArrow:!0,children:(0,K.jsx)(m,{role:`button`,tabIndex:-1,"aria-label":`Déplacer le bureau ${t.label}`,onPointerDown:M(t.id),onPointerMove:A,onPointerUp:j,onPointerCancel:j,style:{position:`absolute`,top:4,left:4,zIndex:2,display:`grid`,placeItems:`center`,width:20,height:20,borderRadius:4,color:`var(--mantine-color-dimmed)`,background:`color-mix(in srgb, var(--mantine-color-body) 70%, transparent)`,cursor:i?`grabbing`:`grab`,touchAction:`none`},children:(0,K.jsx)(W,{size:13})})}),(0,K.jsx)(p,{role:`tab`,"aria-selected":r,onClick:()=>e.setActive(t.id),style:{display:`block`,width:Z},children:(0,K.jsx)(Oe,{layout:t,active:r})}),(0,K.jsxs)(s,{gap:2,wrap:`nowrap`,mt:4,justify:`space-between`,children:[a===t.id?(0,K.jsx)(ee,{size:`xs`,value:u,autoFocus:!0,"aria-label":`Nom du bureau`,onChange:e=>d(e.currentTarget.value),onBlur:I,onKeyDown:e=>{e.key===`Enter`&&I(),e.key===`Escape`&&l(null)},style:{flex:1}}):(0,K.jsx)(O,{size:`xs`,fw:r?700:500,c:r?`brand`:void 0,truncate:!0,style:{flex:1,cursor:`text`,userSelect:`none`},onDoubleClick:()=>F(t.id,t.label),title:`Double-clic pour renommer`,children:t.label}),(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,returnFocus:!1,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Options du bureau ${t.label}`,children:(0,K.jsx)(se,{size:13})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(ce,{size:13}),onClick:()=>F(t.id,t.label),children:`Renommer`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(D,{size:13}),onClick:()=>e.duplicateWorkspace(t.id),children:`Dupliquer`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(ie,{size:13}),disabled:f[0]?.id===t.id,onClick:()=>P(t.id,-1),children:`Déplacer à gauche`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(n,{size:13}),disabled:f[f.length-1]?.id===t.id,onClick:()=>P(t.id,1),children:`Déplacer à droite`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Item,{color:`red`,leftSection:(0,K.jsx)(_,{size:13}),disabled:!g,onClick:()=>e.deleteWorkspace(t.id),children:`Supprimer`})]})]})]})]},t.id)}),(0,K.jsxs)(m,{style:{flexShrink:0,width:Z},children:[(0,K.jsxs)(v,{position:`bottom-start`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(o,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(p,{"aria-label":`Ajouter un bureau`,style:{display:`grid`,placeItems:`center`,width:Z,height:Q,borderRadius:6,border:`1px dashed var(--mantine-color-default-border)`,color:`var(--mantine-color-dimmed)`},children:(0,K.jsx)(B,{size:22})})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:`Nouveau bureau`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,t.roles)).map(t=>(0,K.jsx)(v.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,mt:4,ta:`center`,children:`Ajouter`})]})]})})]})});function Ae(){let e=j(),t=P(),n=L(),r=de((0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/realtime/api/health`),[e])),i=fe(r.data);return{ctx:{live:t.realtimeLive,cluster:i?.cluster??!1,instanceCount:i?.instances.length??1,roles:n.roles},reload:r.reload}}var $=V(()=>{let e=R(),t=P(),n=L(),[r,i]=(0,G.useState)(!1),{ctx:o,reload:c}=Ae(),l=e.active,u=e.layoutList.find(e=>N(e.id,n.roles))?.id;return(0,G.useEffect)(()=>{u&&!N(e.active.id,n.roles)&&e.setActive(u)},[e,n.roles,u]),(0,K.jsxs)(f,{gap:`md`,children:[(0,K.jsxs)(m,{style:{position:`sticky`,top:0,zIndex:5,background:`var(--mantine-color-body)`,marginInline:`calc(var(--mantine-spacing-md) * -1)`,paddingInline:`var(--mantine-spacing-md)`,borderBottom:`1px solid var(--mantine-color-default-border)`},children:[(0,K.jsx)(ke,{}),(0,K.jsx)(g,{title:l.label,subtitle:`Composez votre espace : ajoutez, retirez et agencez vos widgets.`,actions:(0,K.jsxs)(s,{gap:`xs`,children:[(0,K.jsx)(a,{size:`sm`,checked:t.realtimeLive,onChange:e=>t.setRealtimeLive(e.currentTarget.checked),label:`Temps réel`}),(0,K.jsx)(w,{size:`xs`,variant:`light`,leftSection:(0,K.jsx)(re,{size:14}),onClick:()=>i(!0),children:`Ajouter`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(U,{size:14}),onClick:()=>e.tidy(),children:`Ranger`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(x,{size:14}),onClick:c,children:`Rafraîchir`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,onClick:()=>e.resetToPreset(),children:`Réinitialiser`})]})})]}),o.cluster?(0,K.jsx)(s,{children:(0,K.jsxs)(E,{variant:`light`,color:`grape`,leftSection:(0,K.jsx)(le,{size:12}),children:[`Cluster · `,o.instanceCount,` workers — chaque tuile montre le pod, forage par worker au dépliage`]})}):null,l.items.length===0?(0,K.jsx)(O,{c:`dimmed`,ta:`center`,py:`xl`,children:`Bureau vide. Cliquez « Ajouter » pour poser vos premiers widgets.`}):(0,K.jsx)(ge,{layout:l,ctx:o}),(0,K.jsx)(Ee,{opened:r,onClose:()=>i(!1)})]})});export{$ as Workspace,$ as default};
|
|
1
|
+
import{k as e}from"./src-Dvwdl2PF.js";import{$ as t,Ct as n,Et as r,Hn as i,Ht as a,Kt as o,Mn as s,Pn as c,Qt as l,Rt as u,St as d,Ut as f,Vn as p,Wn as m,Xt as h,Y as g,Z as _,Zt as v,an as y,di as b,et as x,gt as S,ht as C,on as w,or as T,sn as E,ut as D,vn as O,zt as ee}from"./ui-D72MNfu0.js";import{t as te}from"./Collapse-ixlBE3dZ.js";import{t as k}from"./Chip-BZMdRue_.js";import{_ as A,c as j,f as M,g as N,l as P,m as F,p as I,r as L,u as R,v as ne}from"./stores-DnaaQoge.js";import{t as re}from"./IconApps-DJrfgTWN.js";import{t as ie}from"./IconArrowLeft-DmvfJmth.js";import{n as ae,t as oe}from"./useBlockSource-Nwf0PRrs.js";import{t as se}from"./IconDots-BV_CET9W.js";import{t as z}from"./IconLayoutGrid-nzBpf-EU.js";import{t as ce}from"./IconPencil-E8gbBJZM.js";import{t as B}from"./IconPlus-BS5_mDd8.js";import{X as le,pt as ue,vt as V,x as H,y as de}from"./index-BwPukNhM.js";import{n as fe}from"./realtimeHealth-CEJDxl45.js";var U=r(`outline`,`arrows-minimize`,`ArrowsMinimize`,[[`path`,{d:`M5 9l4 0l0 -4`,key:`svg-0`}],[`path`,{d:`M3 3l6 6`,key:`svg-1`}],[`path`,{d:`M5 15l4 0l0 4`,key:`svg-2`}],[`path`,{d:`M3 21l6 -6`,key:`svg-3`}],[`path`,{d:`M19 9l-4 0l0 -4`,key:`svg-4`}],[`path`,{d:`M15 9l6 -6`,key:`svg-5`}],[`path`,{d:`M19 15l-4 0l0 4`,key:`svg-6`}],[`path`,{d:`M15 15l6 6`,key:`svg-7`}]]),pe=r(`outline`,`dots-vertical`,`DotsVertical`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),W=r(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),G=e(b(),1),K=T(),me=V(({def:e,instance:t,ctx:n,dragHandlers:r,resizeHandlers:i})=>{let a=R(),o=ae(e.source,n.live),l=e.icon,d=e.source.kind!==`snapshot`;return(0,K.jsxs)(y,{withBorder:!0,radius:`md`,p:`sm`,h:`100%`,style:{contain:`content`,position:`relative`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,K.jsxs)(s,{justify:`space-between`,wrap:`nowrap`,mb:`xs`,style:{flexShrink:0},children:[(0,K.jsxs)(s,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,cursor:r?`grab`:void 0,touchAction:`none`},...r,children:[r?(0,K.jsx)(W,{size:14,style:{opacity:.45,flexShrink:0}}):null,(0,K.jsx)(u,{variant:`light`,color:`gray`,size:`sm`,radius:`md`,children:(0,K.jsx)(l,{size:15})}),(0,K.jsx)(O,{fw:600,size:`sm`,truncate:!0,children:e.title}),d?(0,K.jsx)(m,{"aria-hidden":!0,style:{width:7,height:7,borderRadius:`50%`,flexShrink:0,background:o.source.fromLive?`var(--mantine-color-teal-6)`:`var(--mantine-color-gray-5)`}}):null]}),(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Options du widget`,children:(0,K.jsx)(pe,{size:15})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:ne[e.category]}),(0,K.jsx)(v.Item,{color:`red`,leftSection:(0,K.jsx)(H,{size:14}),onClick:()=>a.removeWidget(e.id),children:`Retirer du bureau`})]})]})]}),(0,K.jsx)(m,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,K.jsx)(oe,{def:e,state:o,ctx:n,span:Math.max(1,Math.min(12,Math.round(t.w*12))),container:`widget`})}),i?(0,K.jsx)(m,{"aria-hidden":!0,...i,style:{position:`absolute`,right:3,bottom:3,width:14,height:14,cursor:`nwse-resize`,touchAction:`none`,borderRight:`2px solid var(--mantine-color-dimmed)`,borderBottom:`2px solid var(--mantine-color-dimmed)`,borderBottomRightRadius:4,opacity:.5}}):null]})}),he=6,ge=V(({layout:e,ctx:t})=>{let n=R(),r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useRef)(0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=e.items.filter(e=>I(e.widgetId)),f=d.reduce((e,t)=>Math.max(e,t.y+t.h),0)+80,p=(0,G.useCallback)(e=>{let t=i.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=i.current;e&&(e.el.style.transform=`translate3d(${e.cx-e.sx}px, ${e.cy-e.sy}px, 0)`)})))},[]),h=(0,G.useCallback)(e=>{let t=i.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.transform=``,t.el.style.willChange=``,document.body.style.userSelect=``;let r=t.ox+(t.cx-t.sx)/t.W,a=t.oy+(t.cy-t.sy);i.current=null,c(null),n.moveTo(t.id,r,a)},[n]),g=(0,G.useCallback)((e,t,a)=>o=>{if(o.button!==0)return;let s=r.current,l=o.currentTarget.closest(`[data-window]`);if(s&&l){o.preventDefault();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),i.current={id:e,el:l,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,ox:t,oy:a,W:s.getBoundingClientRect().width||1},l.style.willChange=`transform`,document.body.style.userSelect=`none`,c(e)}},[n]),_=(0,G.useCallback)(e=>{let t=a.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=a.current;if(!e)return;let t=M(e.w0+(e.cx-e.sx)/e.W,A,1),n=Math.max(96,e.h0+(e.cy-e.sy));e.el.style.width=`${t*100}%`,e.el.style.height=`${n}px`})))},[]),v=(0,G.useCallback)(e=>{let t=a.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.willChange=``,document.body.style.userSelect=``;let r=M(t.w0+(t.cx-t.sx)/t.W,A,1),i=Math.max(96,t.h0+(t.cy-t.sy));a.current=null,u(null),n.setSize(t.id,r,i)},[n]),y=(0,G.useCallback)((e,t,i)=>o=>{if(o.button!==0)return;let s=r.current,c=o.currentTarget.closest(`[data-window]`);if(s&&c){o.preventDefault(),o.stopPropagation();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),a.current={id:e,el:c,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,w0:t,h0:i,W:s.getBoundingClientRect().width||1},c.style.willChange=`width, height`,document.body.style.userSelect=`none`,u(e)}},[n]);return(0,K.jsx)(m,{ref:r,style:{position:`relative`,minHeight:f,width:`100%`,isolation:`isolate`},children:d.map(e=>{let r=I(e.widgetId);if(!r)return null;let i=s===e.widgetId||l===e.widgetId;return(0,K.jsx)(m,{"data-window":!0,"data-widget":e.widgetId,onPointerDownCapture:()=>n.bringToFront(e.widgetId),style:{position:`absolute`,left:`${e.x*100}%`,top:e.y,width:`${e.w*100}%`,height:e.h,padding:he,zIndex:e.z,transition:i?`none`:`left .18s ease, top .18s ease, width .12s ease, height .12s ease`},children:(0,K.jsx)(me,{def:r,instance:e,ctx:t,dragHandlers:{onPointerDown:g(e.widgetId,e.x,e.y),onPointerMove:p,onPointerUp:h},resizeHandlers:{onPointerDown:y(e.widgetId,e.w,e.h),onPointerMove:_,onPointerUp:v}})},e.widgetId)})})}),_e=[{id:`runtime`,label:`Runtime & lancement`,group:`domaine`},{id:`config`,label:`Configuration`,group:`domaine`},{id:`systeme`,label:`Système & santé`,group:`domaine`},{id:`orm`,label:`Données / ORM`,group:`domaine`},{id:`logs`,label:`Logs`,group:`domaine`},{id:`realtime`,label:`Temps réel`,group:`domaine`},{id:`cluster`,label:`Cluster`,group:`domaine`},{id:`erreurs`,label:`Erreurs`,group:`domaine`},{id:`securite`,label:`Sécurité`,group:`domaine`},{id:`compte`,label:`Mon compte`,group:`domaine`},{id:`ia`,label:`IA`,group:`domaine`},{id:`cpu`,label:`CPU`,group:`domaine`,parent:`systeme`},{id:`memoire`,label:`Mémoire`,group:`domaine`,parent:`systeme`},{id:`event-loop`,label:`Event-loop`,group:`domaine`,parent:`systeme`},{id:`gc`,label:`Garbage Collector`,group:`domaine`,parent:`systeme`},{id:`sante`,label:`Santé`,group:`domaine`,parent:`systeme`},{id:`handles`,label:`Ressources actives`,group:`domaine`,parent:`systeme`},{id:`identite`,label:`Identité`,group:`domaine`,parent:`systeme`},{id:`orm-debit`,label:`Débit`,group:`domaine`,parent:`orm`},{id:`orm-connecteurs`,label:`Connecteurs`,group:`domaine`,parent:`orm`},{id:`kpi`,label:`KPI (valeur)`,group:`nature`},{id:`graphe`,label:`Graphe (courbe)`,group:`nature`},{id:`indice`,label:`Indice composite`,group:`nature`},{id:`liste`,label:`Liste / flux`,group:`nature`},{id:`panneau`,label:`Panneau`,group:`nature`}],ve=Object.fromEntries(_e.map(e=>[e.id,e]));function q(e){return ve[e]}function J(e,t){return _e.filter(n=>n.group===e&&(t===void 0||n.parent===t))}function ye(e){return{clusterReady:e.clusterAware===!0,realtime:e.source.kind!==`snapshot`}}var be=`min(1280px, 95vw)`,xe=`min(720px, 90vh)`,Se=e=>e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase();function Y(e,t){return(e.tags??[]).includes(t)}function Ce({def:e,roles:t}){let n=ae(e.source,!0);return(0,K.jsx)(m,{style:{height:230,overflow:`auto`,padding:8,border:`1px solid var(--mantine-color-default-border)`,borderRadius:8,background:`var(--mantine-color-body)`},children:(0,K.jsx)(oe,{def:e,state:n,ctx:{live:!0,cluster:!1,instanceCount:1,roles:t},span:6,container:`widget`})})}function we({def:e}){let t=ye(e);return(0,K.jsxs)(K.Fragment,{children:[t.clusterReady?(0,K.jsx)(E,{size:`xs`,variant:`light`,color:`grape`,children:`cluster-ready`}):null,t.realtime?(0,K.jsx)(E,{size:`xs`,variant:`light`,color:`teal`,children:`temps réel`}):null]})}function Te({def:e,onBoard:t,roles:n,onToggle:r}){let i=e.icon,a=(e.tags??[]).map(q).filter(e=>!!e);return(0,K.jsxs)(l,{width:400,position:`right`,openDelay:220,closeDelay:80,withinPortal:!0,shadow:`md`,radius:`md`,children:[(0,K.jsx)(l.Target,{children:(0,K.jsx)(p,{"aria-pressed":t,onClick:r,style:{height:`100%`},children:(0,K.jsxs)(f,{gap:6,p:`sm`,h:`100%`,style:{border:`1px solid ${t?`var(--mantine-color-teal-5)`:`var(--mantine-color-default-border)`}`,borderRadius:10,background:t?`var(--mantine-color-teal-light)`:void 0},children:[(0,K.jsxs)(s,{gap:`sm`,wrap:`nowrap`,align:`flex-start`,children:[(0,K.jsx)(u,{variant:`light`,color:t?`teal`:`gray`,radius:`md`,children:(0,K.jsx)(i,{size:16})}),(0,K.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,K.jsx)(O,{size:`sm`,fw:600,truncate:!0,children:e.title}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,lineClamp:2,children:e.description})]}),(0,K.jsx)(u,{variant:t?`filled`:`light`,color:t?`teal`:`blue`,radius:`xl`,size:`sm`,children:t?(0,K.jsx)(S,{size:14}):(0,K.jsx)(B,{size:14})})]}),(0,K.jsxs)(s,{gap:4,wrap:`wrap`,children:[(0,K.jsx)(we,{def:e}),a.map(e=>(0,K.jsx)(E,{size:`xs`,variant:`default`,children:e.label},e.id))]})]})})}),(0,K.jsx)(l.Dropdown,{p:`sm`,children:(0,K.jsxs)(f,{gap:`sm`,children:[(0,K.jsxs)(s,{gap:`xs`,wrap:`wrap`,children:[(0,K.jsx)(u,{variant:`light`,color:`gray`,radius:`md`,size:`sm`,children:(0,K.jsx)(i,{size:15})}),(0,K.jsx)(O,{fw:700,size:`sm`,children:e.title}),(0,K.jsx)(we,{def:e})]}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,children:e.description}),(0,K.jsx)(O,{size:`xs`,fw:700,tt:`uppercase`,c:`dimmed`,children:`Aperçu en direct`}),(0,K.jsx)(Ce,{def:e,roles:n}),(0,K.jsx)(w,{size:`xs`,fullWidth:!0,variant:t?`light`:`filled`,color:t?`red`:`blue`,leftSection:t?(0,K.jsx)(S,{size:14}):(0,K.jsx)(B,{size:14}),onClick:r,children:t?`Retirer du bureau`:`Ajouter au bureau`})]})})]})}var X=`all`,Ee=V(({opened:e,onClose:n})=>{let r=R(),a=L(),l=F(a.roles),[u,p]=(0,G.useState)(``),[m,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(X),[y,b]=(0,G.useState)(X),[x,S]=(0,G.useState)(X),[C,w]=(0,G.useState)(!1),[T,D]=(0,G.useState)(!1),te=(0,G.useMemo)(()=>J(`domaine`).filter(e=>!e.parent),[]),A=(0,G.useMemo)(()=>_===X?[]:J(`domaine`,_),[_]),j=(0,G.useMemo)(()=>J(`nature`),[]),M=u.trim(),N=(0,G.useMemo)(()=>{let e=Se(M).split(/\s+/).filter(Boolean);return l.filter(t=>{if(_!==X&&!Y(t,_)||y!==X&&!Y(t,y)||x!==X&&!Y(t,x))return!1;let n=ye(t);if(C&&!n.clusterReady||T&&!n.realtime)return!1;if(e.length){let n=Se(`${t.title} ${t.description} ${(t.tags??[]).map(e=>q(e)?.label??``).join(` `)}`);if(!e.every(e=>n.includes(e)))return!1}return!0})},[l,M,_,y,x,C,T]),P=e=>l.filter(t=>Y(t,e)).length;return(0,K.jsx)(h,{opened:e,onClose:n,centered:!0,radius:`md`,size:`auto`,fullScreen:m,title:(0,K.jsxs)(s,{gap:`xs`,children:[(0,K.jsx)(O,{fw:700,children:`Catalogue de blocs`}),(0,K.jsx)(E,{variant:`light`,color:`gray`,children:l.length}),(0,K.jsx)(o,{label:m?`Réduire (16/9)`:`Plein écran`,withArrow:!0,children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`sm`,onClick:()=>g(e=>!e),"aria-label":m?`Réduire la fenêtre`:`Passer en plein écran`,children:m?(0,K.jsx)(U,{size:16}):(0,K.jsx)(d,{size:16})})})]}),styles:{content:{display:`flex`,flexDirection:`column`,...m?{}:{width:be,height:xe}},header:{flexShrink:0},body:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`}},children:(0,K.jsxs)(f,{gap:`sm`,style:{flex:1,minHeight:0},children:[(0,K.jsx)(ee,{placeholder:`Rechercher un bloc (titre, description, tag)…`,leftSection:(0,K.jsx)(t,{size:16}),value:u,onChange:e=>p(e.currentTarget.value),"aria-label":`Rechercher un bloc dans le catalogue`}),(0,K.jsx)(k.Group,{value:_,onChange:e=>{v(e||X),b(X)},children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,variant:`light`,children:[`Tous (`,l.length,`)`]}),te.map(e=>(0,K.jsxs)(k,{value:e.id,size:`xs`,variant:`light`,children:[e.label,` (`,P(e.id),`)`]},e.id))]})}),A.length>0?(0,K.jsx)(k.Group,{value:y,onChange:e=>b(e||X),children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,pl:`md`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,children:[`Tout `,q(_)?.label]}),A.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,children:e.label},e.id))]})}):null,(0,K.jsxs)(s,{gap:`md`,wrap:`wrap`,children:[(0,K.jsx)(k.Group,{value:x,onChange:e=>S(e||X),children:(0,K.jsxs)(s,{gap:6,wrap:`wrap`,children:[(0,K.jsx)(O,{size:`xs`,c:`dimmed`,fw:600,children:`Nature`}),(0,K.jsx)(k,{value:X,size:`xs`,variant:`outline`,children:`Toutes`}),j.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,variant:`outline`,children:e.label},e.id))]})}),(0,K.jsxs)(s,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(k,{checked:C,onChange:w,size:`xs`,color:`grape`,children:`cluster-ready`}),(0,K.jsx)(k,{checked:T,onChange:D,size:`xs`,color:`teal`,children:`temps réel`})]})]}),(0,K.jsxs)(i,{style:{flex:1},type:`auto`,children:[(0,K.jsx)(ue,{cols:{base:1,sm:2,lg:3},spacing:`sm`,pr:`xs`,children:N.map(e=>(0,K.jsx)(Te,{def:e,roles:a.roles,onBoard:r.hasWidget(e.id),onToggle:()=>r.hasWidget(e.id)?r.removeWidget(e.id):r.addWidget(e.id)},e.id))}),N.length===0?(0,K.jsx)(O,{c:`dimmed`,size:`sm`,py:`xl`,ta:`center`,children:`Aucun bloc pour ces filtres.`}):null]})]})})}),Z=156,Q=88,De=4;function Oe({layout:e,active:t}){let n=e.items,r=n.reduce((e,t)=>Math.max(e,t.y+t.h),0)||1;return(0,K.jsxs)(m,{"aria-hidden":!0,style:{position:`relative`,width:Z,height:Q,borderRadius:6,overflow:`hidden`,background:`radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--mantine-color-indigo-9) 16%, var(--mantine-color-body)) 0%, var(--mantine-color-body) 70%)`,border:`${t?`2px`:`1px`} solid ${t?`var(--mantine-color-brand-5)`:`var(--mantine-color-default-border)`}`},children:[n.map(e=>(0,K.jsx)(m,{style:{position:`absolute`,left:e.x*Z+1,top:e.y/r*Q+1,width:Math.max(2,e.w*Z-2),height:Math.max(2,e.h/r*Q-2),borderRadius:2,background:`color-mix(in srgb, var(--mantine-color-brand-5) 38%, var(--mantine-color-body))`,border:`1px solid var(--mantine-color-brand-4)`}},e.widgetId)),n.length===0?(0,K.jsx)(O,{size:`9px`,c:`dimmed`,style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`},children:`vide`}):null]})}var ke=V(()=>{let e=R(),t=L(),[r,i]=(0,G.useState)(!0),[a,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(``),f=e.layoutList.filter(e=>N(e.id,t.roles)),h=e.active,g=f.length>1,y=(0,G.useRef)(null),b=(0,G.useRef)(null),[x,S]=(0,G.useState)(null),[w,T]=(0,G.useState)(void 0),k=(0,G.useCallback)((e,t)=>{let n=y.current;if(!n)return null;let r=Array.from(n.querySelectorAll(`[data-ws-id]`));for(let n of r){let r=n.dataset.wsId;if(!r||r===t)continue;let i=n.getBoundingClientRect();if(e<i.left+i.width/2)return r}return null},[]),A=(0,G.useCallback)(e=>{let t=b.current;if(!t)return;let n=e.clientX-t.sx;!t.moved&&Math.abs(n)<De||(t.moved||(t.moved=!0,S(t.id),document.body.style.userSelect=`none`,t.el.style.willChange=`transform`),t.el.style.transform=`translate3d(${n}px, 0, 0)`,T(k(e.clientX,t.id)))},[k]),j=(0,G.useCallback)(t=>{let n=b.current;if(!n)return;try{t.currentTarget.releasePointerCapture(t.pointerId)}catch{}n.el.style.transform=``,n.el.style.willChange=``,document.body.style.userSelect=``;let r=n.moved,i=k(t.clientX,n.id);b.current=null,S(null),T(void 0),r&&e.moveWorkspace(n.id,i)},[k,e]),M=(0,G.useCallback)(e=>t=>{if(t.button!==0)return;let n=t.currentTarget.closest(`[data-ws-id]`);if(n){try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}b.current={id:e,el:n,sx:t.clientX,moved:!1}}},[]),P=(t,n)=>{let r=f.findIndex(e=>e.id===t);if(r<0)return;let i=r+n;i<0||i>=f.length||e.moveWorkspace(t,n===-1?f[i].id:f[i+1]?.id??null)},F=(e,t)=>{d(t),l(e)},I=()=>{a&&e.renameWorkspace(a,u),l(null)},ne=(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(o,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(c,{variant:`light`,size:`sm`,"aria-label":`Ajouter un bureau`,children:(0,K.jsx)(B,{size:15})})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:`Nouveau bureau`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,t.roles)).map(t=>(0,K.jsx)(v.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]});return(0,K.jsxs)(m,{children:[(0,K.jsxs)(s,{justify:`space-between`,wrap:`nowrap`,py:6,children:[(0,K.jsxs)(p,{onClick:()=>i(e=>!e),"aria-expanded":r,"aria-label":r?`Replier les bureaux`:`Afficher les bureaux`,style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,K.jsx)(C,{size:16,style:{transition:`transform .15s ease`,transform:r?`none`:`rotate(-90deg)`}}),(0,K.jsx)(O,{fw:600,size:`sm`,children:`Bureaux`}),(0,K.jsx)(E,{size:`sm`,variant:`light`,color:`gray`,children:f.length}),r?null:(0,K.jsxs)(O,{size:`xs`,c:`dimmed`,truncate:!0,children:[`· `,h.label]})]}),ne]}),(0,K.jsx)(te,{expanded:r,children:(0,K.jsxs)(m,{ref:y,role:`tablist`,"aria-label":`Bureaux`,style:{display:`flex`,gap:12,alignItems:`flex-start`,overflowX:`auto`,paddingTop:6,paddingBottom:12,scrollSnapType:x?`none`:`x proximity`},children:[f.map(t=>{let r=t.id===h.id,i=x===t.id,y=x!==null&&w===t.id;return(0,K.jsxs)(m,{"data-ws-id":t.id,style:{position:`relative`,flexShrink:0,width:Z,scrollSnapAlign:`start`,zIndex:i?2:void 0,opacity:i?.85:1,cursor:i?`grabbing`:void 0,borderLeft:y?`2px solid var(--mantine-color-brand-5)`:`2px solid transparent`,paddingLeft:4},children:[g?(0,K.jsx)(o,{label:`Supprimer ce bureau`,withArrow:!0,children:(0,K.jsx)(c,{size:`xs`,variant:`filled`,color:`dark`,radius:`xl`,"aria-label":`Supprimer le bureau ${t.label}`,onClick:n=>{n.stopPropagation(),e.deleteWorkspace(t.id)},style:{position:`absolute`,top:4,right:4,zIndex:2,opacity:.85},children:(0,K.jsx)(H,{size:12})})}):null,(0,K.jsx)(o,{label:`Glisser pour réordonner`,withArrow:!0,children:(0,K.jsx)(m,{role:`button`,tabIndex:-1,"aria-label":`Déplacer le bureau ${t.label}`,onPointerDown:M(t.id),onPointerMove:A,onPointerUp:j,onPointerCancel:j,style:{position:`absolute`,top:4,left:4,zIndex:2,display:`grid`,placeItems:`center`,width:20,height:20,borderRadius:4,color:`var(--mantine-color-dimmed)`,background:`color-mix(in srgb, var(--mantine-color-body) 70%, transparent)`,cursor:i?`grabbing`:`grab`,touchAction:`none`},children:(0,K.jsx)(W,{size:13})})}),(0,K.jsx)(p,{role:`tab`,"aria-selected":r,onClick:()=>e.setActive(t.id),style:{display:`block`,width:Z},children:(0,K.jsx)(Oe,{layout:t,active:r})}),(0,K.jsxs)(s,{gap:2,wrap:`nowrap`,mt:4,justify:`space-between`,children:[a===t.id?(0,K.jsx)(ee,{size:`xs`,value:u,autoFocus:!0,"aria-label":`Nom du bureau`,onChange:e=>d(e.currentTarget.value),onBlur:I,onKeyDown:e=>{e.key===`Enter`&&I(),e.key===`Escape`&&l(null)},style:{flex:1}}):(0,K.jsx)(O,{size:`xs`,fw:r?700:500,c:r?`brand`:void 0,truncate:!0,style:{flex:1,cursor:`text`,userSelect:`none`},onDoubleClick:()=>F(t.id,t.label),title:`Double-clic pour renommer`,children:t.label}),(0,K.jsxs)(v,{position:`bottom-end`,withinPortal:!0,returnFocus:!1,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(c,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Options du bureau ${t.label}`,children:(0,K.jsx)(se,{size:13})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(ce,{size:13}),onClick:()=>F(t.id,t.label),children:`Renommer`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(D,{size:13}),onClick:()=>e.duplicateWorkspace(t.id),children:`Dupliquer`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(ie,{size:13}),disabled:f[0]?.id===t.id,onClick:()=>P(t.id,-1),children:`Déplacer à gauche`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(n,{size:13}),disabled:f[f.length-1]?.id===t.id,onClick:()=>P(t.id,1),children:`Déplacer à droite`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Item,{color:`red`,leftSection:(0,K.jsx)(_,{size:13}),disabled:!g,onClick:()=>e.deleteWorkspace(t.id),children:`Supprimer`})]})]})]})]},t.id)}),(0,K.jsxs)(m,{style:{flexShrink:0,width:Z},children:[(0,K.jsxs)(v,{position:`bottom-start`,withinPortal:!0,children:[(0,K.jsx)(v.Target,{children:(0,K.jsx)(o,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(p,{"aria-label":`Ajouter un bureau`,style:{display:`grid`,placeItems:`center`,width:Z,height:Q,borderRadius:6,border:`1px dashed var(--mantine-color-default-border)`,color:`var(--mantine-color-dimmed)`},children:(0,K.jsx)(B,{size:22})})})}),(0,K.jsxs)(v.Dropdown,{children:[(0,K.jsx)(v.Label,{children:`Nouveau bureau`}),(0,K.jsx)(v.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(v.Divider,{}),(0,K.jsx)(v.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,t.roles)).map(t=>(0,K.jsx)(v.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]}),(0,K.jsx)(O,{size:`xs`,c:`dimmed`,mt:4,ta:`center`,children:`Ajouter`})]})]})})]})});function Ae(){let e=j(),t=P(),n=L(),r=de((0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/realtime/api/health`),[e])),i=fe(r.data);return{ctx:{live:t.realtimeLive,cluster:i?.cluster??!1,instanceCount:i?.instances.length??1,roles:n.roles},reload:r.reload}}var $=V(()=>{let e=R(),t=P(),n=L(),[r,i]=(0,G.useState)(!1),{ctx:o,reload:c}=Ae(),l=e.active,u=e.layoutList.find(e=>N(e.id,n.roles))?.id;return(0,G.useEffect)(()=>{u&&!N(e.active.id,n.roles)&&e.setActive(u)},[e,n.roles,u]),(0,K.jsxs)(f,{gap:`md`,children:[(0,K.jsxs)(m,{style:{position:`sticky`,top:0,zIndex:5,background:`var(--mantine-color-body)`,marginInline:`calc(var(--mantine-spacing-md) * -1)`,paddingInline:`var(--mantine-spacing-md)`,borderBottom:`1px solid var(--mantine-color-default-border)`},children:[(0,K.jsx)(ke,{}),(0,K.jsx)(g,{title:l.label,subtitle:`Composez votre espace : ajoutez, retirez et agencez vos widgets.`,actions:(0,K.jsxs)(s,{gap:`xs`,children:[(0,K.jsx)(a,{size:`sm`,checked:t.realtimeLive,onChange:e=>t.setRealtimeLive(e.currentTarget.checked),label:`Temps réel`}),(0,K.jsx)(w,{size:`xs`,variant:`light`,leftSection:(0,K.jsx)(re,{size:14}),onClick:()=>i(!0),children:`Ajouter`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(U,{size:14}),onClick:()=>e.tidy(),children:`Ranger`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(x,{size:14}),onClick:c,children:`Rafraîchir`}),(0,K.jsx)(w,{size:`xs`,variant:`subtle`,color:`gray`,onClick:()=>e.resetToPreset(),children:`Réinitialiser`})]})})]}),o.cluster?(0,K.jsx)(s,{children:(0,K.jsxs)(E,{variant:`light`,color:`grape`,leftSection:(0,K.jsx)(le,{size:12}),children:[`Cluster · `,o.instanceCount,` workers — chaque tuile montre le pod, forage par worker au dépliage`]})}):null,l.items.length===0?(0,K.jsx)(O,{c:`dimmed`,ta:`center`,py:`xl`,children:`Bureau vide. Cliquez « Ajouter » pour poser vos premiers widgets.`}):(0,K.jsx)(ge,{layout:l,ctx:o}),(0,K.jsx)(Ee,{opened:r,onClose:()=>i(!1)})]})});export{$ as Workspace,$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,C as n,D as r,E as i,G as a,H as o,I as s,K as c,M as l,N as u,P as d,R as f,S as p,T as m,U as ee,V as h,X as g,Y as _,ct as v,dt as y,et as te,f as ne,ft as re,h as b,j as ie,k as ae,lt as oe,mt as se,nt as x,pt as ce,q as le,st as S,ut as ue,v as de,w as fe,z as pe}from"./_baseUniq-DR4vVjyC.js";var me=/\s/;function he(e){for(var t=e.length;t--&&me.test(e.charAt(t)););return t}var ge=/^\s+/;function _e(e){return e&&e.slice(0,he(e)+1).replace(ge,``)}var C=NaN,ve=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,be=/^0o[0-7]+$/i,xe=parseInt;function Se(e){if(typeof e==`number`)return e;if(ue(e))return C;if(S(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=S(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=_e(e);var n=ye.test(e);return n||be.test(e)?xe(e.slice(2),n?2:8):ve.test(e)?C:+e}var w=1/0,Ce=17976931348623157e292;function T(e){return e?(e=Se(e),e===w||e===-w?(e<0?-1:1)*Ce:e===e?e:0):e===0?e:0}function E(e){var t=T(e),n=t%1;return t===t?n?t-n:t:0}var D=Object.create,we=function(){function e(){}return function(t){if(!S(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function O(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function k(e,t,n){t==`__proto__`&&x?x(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Te=Object.prototype.hasOwnProperty;function A(e,t,n){var r=e[t];(!(Te.call(e,t)&&_(r,n))||n===void 0&&!(t in e))&&k(e,t,n)}function j(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?k(n,s,c):A(n,s,c)}return n}function M(e,t,n){if(!S(n))return!1;var r=typeof t;return(r==`number`?c(n)&&g(t,n.length):r==`string`&&t in n)?_(n[t],e):!1}function Ee(e){return le(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&M(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function De(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Oe=Object.prototype.hasOwnProperty;function ke(e){if(!S(e))return De(e);var t=a(e),n=[];for(var r in e)(r!=`constructor`||!t&&Oe.call(e,r))&&n.push(r);return n}function N(e){return c(e)?pe(e,!0):ke(e)}function Ae(e){return e!=null&&e.length?t(e,1):[]}var P=f(Object.getPrototypeOf,Object);function je(e,t){return e&&j(t,s(t),e)}function Me(e,t){return e&&j(t,N(t),e)}var F=typeof exports==`object`&&exports&&!exports.nodeType&&exports,I=F&&typeof module==`object`&&module&&!module.nodeType&&module,L=I&&I.exports===F?se.Buffer:void 0,R=L?L.allocUnsafe:void 0;function z(e,t){if(t)return e.slice();var n=e.length,r=R?R(n):new e.constructor(n);return e.copy(r),r}function Ne(e,t){return j(e,i(e),t)}var B=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ie(t,i(e)),e=P(e);return t}:r;function Pe(e,t){return j(e,B(e),t)}function V(e){return m(e,N,B)}var Fe=Object.prototype.hasOwnProperty;function Ie(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Fe.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function H(e){var t=new e.constructor(e.byteLength);return new p(t).set(new p(e)),t}function Le(e,t){var n=t?H(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Re=/\w*$/;function ze(e){var t=new e.constructor(e.source,Re.exec(e));return t.lastIndex=e.lastIndex,t}var U=ce?ce.prototype:void 0,W=U?U.valueOf:void 0;function Be(e){return W?Object(W.call(e)):{}}function G(e,t){var n=t?H(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Ve=`[object Boolean]`,He=`[object Date]`,Ue=`[object Map]`,We=`[object Number]`,Ge=`[object RegExp]`,Ke=`[object Set]`,qe=`[object String]`,Je=`[object Symbol]`,Ye=`[object ArrayBuffer]`,Xe=`[object DataView]`,Ze=`[object Float32Array]`,Qe=`[object Float64Array]`,$e=`[object Int8Array]`,et=`[object Int16Array]`,tt=`[object Int32Array]`,nt=`[object Uint8Array]`,rt=`[object Uint8ClampedArray]`,it=`[object Uint16Array]`,at=`[object Uint32Array]`;function ot(e,t,n){var r=e.constructor;switch(t){case Ye:return H(e);case Ve:case He:return new r(+e);case Xe:return Le(e,n);case Ze:case Qe:case $e:case et:case tt:case nt:case rt:case it:case at:return G(e,n);case Ue:return new r;case We:case qe:return new r(e);case Ge:return ze(e);case Ke:return new r;case Je:return Be(e)}}function K(e){return typeof e.constructor==`function`&&!a(e)?we(P(e)):{}}var st=`[object Map]`;function ct(e){return y(e)&&n(e)==st}var q=h&&h.isMap,lt=q?o(q):ct,ut=`[object Set]`;function dt(e){return y(e)&&n(e)==ut}var J=h&&h.isSet,ft=J?o(J):dt,pt=1,mt=2,ht=4,Y=`[object Arguments]`,gt=`[object Array]`,_t=`[object Boolean]`,vt=`[object Date]`,yt=`[object Error]`,X=`[object Function]`,bt=`[object GeneratorFunction]`,xt=`[object Map]`,St=`[object Number]`,Z=`[object Object]`,Ct=`[object RegExp]`,wt=`[object Set]`,Tt=`[object String]`,Et=`[object Symbol]`,Dt=`[object WeakMap]`,Ot=`[object ArrayBuffer]`,kt=`[object DataView]`,At=`[object Float32Array]`,jt=`[object Float64Array]`,Mt=`[object Int8Array]`,Nt=`[object Int16Array]`,Pt=`[object Int32Array]`,Ft=`[object Uint8Array]`,It=`[object Uint8ClampedArray]`,Lt=`[object Uint16Array]`,Rt=`[object Uint32Array]`,Q={};Q[Y]=Q[gt]=Q[Ot]=Q[kt]=Q[_t]=Q[vt]=Q[At]=Q[jt]=Q[Mt]=Q[Nt]=Q[Pt]=Q[xt]=Q[St]=Q[Z]=Q[Ct]=Q[wt]=Q[Tt]=Q[Et]=Q[Ft]=Q[It]=Q[Lt]=Q[Rt]=!0,Q[yt]=Q[X]=Q[Dt]=!1;function $(e,t,r,i,a,o){var c,l=t&pt,u=t&mt,d=t&ht;if(r&&(c=a?r(e,i,a,o):r(e)),c!==void 0)return c;if(!S(e))return e;var f=v(e);if(f){if(c=Ie(e),!l)return O(e,c)}else{var p=n(e),m=p==X||p==bt;if(ee(e))return z(e,l);if(p==Z||p==Y||m&&!a){if(c=u||m?{}:K(e),!l)return u?Pe(e,Me(c,e)):Ne(e,je(c,e))}else{if(!Q[p])return a?e:{};c=ot(e,p,l)}}o||=new ae;var h=o.get(e);if(h)return h;o.set(e,c),ft(e)?e.forEach(function(n){c.add($(n,t,r,n,e,o))}):lt(e)&&e.forEach(function(n,i){c.set(i,$(n,t,r,i,e,o))});var g=f?void 0:(d?u?V:fe:u?N:s)(e);return te(g||e,function(n,i){g&&(i=n,n=e[i]),A(c,i,$(n,t,r,i,e,o))}),c}var zt=Object.prototype,Bt=zt.hasOwnProperty,Vt=le(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&M(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=N(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||_(u,zt[l])&&!Bt.call(e,l))&&(e[l]=a[l])}return e});function Ht(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ut(e){return function(t,n,r){var i=Object(t);if(!c(t)){var a=b(n,3);t=s(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Wt=Math.max;function Gt(t,n,r){var i=t==null?0:t.length;if(!i)return-1;var a=r==null?0:E(r);return a<0&&(a=Wt(i+a,0)),e(t,b(n,3),a)}var Kt=Ut(Gt);function qt(e,t){var n=-1,r=c(e)?Array(e.length):[];return ne(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Jt(e,t){return(v(e)?oe:qt)(e,b(t,3))}var Yt=Object.prototype.hasOwnProperty;function Xt(e,t){return e!=null&&Yt.call(e,t)}function Zt(e,t){return e!=null&&de(e,t,Xt)}var Qt=`[object String]`;function $t(e){return typeof e==`string`||!v(e)&&y(e)&&re(e)==Qt}function en(e,t,n,r){if(!S(e))return e;t=d(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=u(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var f=s[c];l=r?r(f,c,s):void 0,l===void 0&&(l=S(f)?f:g(t[i+1])?[]:{})}A(s,c,l),s=s[c]}return e}function tn(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=l(e,o);n(s,o)&&en(a,d(o,e),s)}return a}export{E as C,O as S,Ee as _,qt as a,A as b,Vt as c,G as d,V as f,N as g,Ae as h,Jt as i,$ as l,P as m,$t as n,Kt as o,z as p,Zt as r,Ht as s,tn as t,K as u,M as v,T as w,k as x,j as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=typeof global==`object`&&global&&global.Object===Object&&global,t=typeof self==`object`&&self&&self.Object===Object&&self,n=e||t||Function(`return this`)(),r=n.Symbol,i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;function c(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch{}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}var l=Object.prototype.toString;function u(e){return l.call(e)}var d=`[object Null]`,f=`[object Undefined]`,p=r?r.toStringTag:void 0;function m(e){return e==null?e===void 0?f:d:p&&p in Object(e)?c(e):u(e)}function h(e){return typeof e==`object`&&!!e}var g=`[object Symbol]`;function _(e){return typeof e==`symbol`||h(e)&&m(e)==g}function v(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var y=Array.isArray,ee=1/0,te=r?r.prototype:void 0,ne=te?te.toString:void 0;function re(e){if(typeof e==`string`)return e;if(y(e))return v(e,re)+``;if(_(e))return ne?ne.call(e):``;var t=e+``;return t==`0`&&1/e==-ee?`-0`:t}function b(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function x(e){return e}var ie=`[object AsyncFunction]`,ae=`[object Function]`,oe=`[object GeneratorFunction]`,se=`[object Proxy]`;function ce(e){if(!b(e))return!1;var t=m(e);return t==ae||t==oe||t==ie||t==se}var le=n[`__core-js_shared__`],ue=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function de(e){return!!ue&&ue in e}var fe=Function.prototype.toString;function S(e){if(e!=null){try{return fe.call(e)}catch{}try{return e+``}catch{}}return``}var pe=/[\\^$.*+?()[\]{}|]/g,me=/^\[object .+?Constructor\]$/,he=Function.prototype,ge=Object.prototype,_e=he.toString,ve=ge.hasOwnProperty,ye=RegExp(`^`+_e.call(ve).replace(pe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function be(e){return!b(e)||de(e)?!1:(ce(e)?ye:me).test(S(e))}function xe(e,t){return e?.[t]}function C(e,t){var n=xe(e,t);return be(n)?n:void 0}var w=C(n,`WeakMap`);function Se(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ce(){}var we=800,Te=16,Ee=Date.now;function De(e){var t=0,n=0;return function(){var r=Ee(),i=Te-(r-n);if(n=r,i>0){if(++t>=we)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oe(e){return function(){return e}}var T=function(){try{var e=C(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),ke=De(T?function(e,t){return T(e,`toString`,{configurable:!0,enumerable:!1,value:Oe(t),writable:!0})}:x);function Ae(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function je(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Me(e){return e!==e}function Ne(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Pe(e,t,n){return t===t?Ne(e,t,n):je(e,Me,n)}function Fe(e,t){return!!(e!=null&&e.length)&&Pe(e,t,0)>-1}var Ie=9007199254740991,Le=/^(?:0|[1-9]\d*)$/;function E(e,t){var n=typeof e;return t??=Ie,!!t&&(n==`number`||n!=`symbol`&&Le.test(e))&&e>-1&&e%1==0&&e<t}function D(e,t){return e===t||e!==e&&t!==t}var Re=Math.max;function ze(e,t,n){return t=Re(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Re(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Se(e,this,s)}}function Be(e,t){return ke(ze(e,t,x),e+``)}var Ve=9007199254740991;function O(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Ve}function k(e){return e!=null&&O(e.length)&&!ce(e)}var He=Object.prototype;function A(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||He)}function Ue(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var We=`[object Arguments]`;function Ge(e){return h(e)&&m(e)==We}var Ke=Object.prototype,qe=Ke.hasOwnProperty,Je=Ke.propertyIsEnumerable,j=Ge(function(){return arguments}())?Ge:function(e){return h(e)&&qe.call(e,`callee`)&&!Je.call(e,`callee`)};function Ye(){return!1}var Xe=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ze=Xe&&typeof module==`object`&&module&&!module.nodeType&&module,Qe=Ze&&Ze.exports===Xe?n.Buffer:void 0,M=(Qe?Qe.isBuffer:void 0)||Ye,$e=`[object Arguments]`,et=`[object Array]`,tt=`[object Boolean]`,nt=`[object Date]`,rt=`[object Error]`,it=`[object Function]`,at=`[object Map]`,ot=`[object Number]`,st=`[object Object]`,ct=`[object RegExp]`,lt=`[object Set]`,ut=`[object String]`,dt=`[object WeakMap]`,ft=`[object ArrayBuffer]`,pt=`[object DataView]`,mt=`[object Float32Array]`,ht=`[object Float64Array]`,gt=`[object Int8Array]`,_t=`[object Int16Array]`,vt=`[object Int32Array]`,yt=`[object Uint8Array]`,bt=`[object Uint8ClampedArray]`,xt=`[object Uint16Array]`,St=`[object Uint32Array]`,N={};N[mt]=N[ht]=N[gt]=N[_t]=N[vt]=N[yt]=N[bt]=N[xt]=N[St]=!0,N[$e]=N[et]=N[ft]=N[tt]=N[pt]=N[nt]=N[rt]=N[it]=N[at]=N[ot]=N[st]=N[ct]=N[lt]=N[ut]=N[dt]=!1;function Ct(e){return h(e)&&O(e.length)&&!!N[m(e)]}function wt(e){return function(t){return e(t)}}var Tt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,P=Tt&&typeof module==`object`&&module&&!module.nodeType&&module,F=P&&P.exports===Tt&&e.process,Et=function(){try{return P&&P.require&&P.require(`util`).types||F&&F.binding&&F.binding(`util`)}catch{}}(),Dt=Et&&Et.isTypedArray,I=Dt?wt(Dt):Ct,Ot=Object.prototype.hasOwnProperty;function kt(e,t){var n=y(e),r=!n&&j(e),i=!n&&!r&&M(e),a=!n&&!r&&!i&&I(e),o=n||r||i||a,s=o?Ue(e.length,String):[],c=s.length;for(var l in e)(t||Ot.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||E(l,c)))&&s.push(l);return s}function At(e,t){return function(n){return e(t(n))}}var jt=At(Object.keys,Object),Mt=Object.prototype.hasOwnProperty;function Nt(e){if(!A(e))return jt(e);var t=[];for(var n in Object(e))Mt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function L(e){return k(e)?kt(e):Nt(e)}var Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ft=/^\w*$/;function It(e,t){if(y(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||_(e)?!0:Ft.test(e)||!Pt.test(e)||t!=null&&e in Object(t)}var R=C(Object,`create`);function Lt(){this.__data__=R?R(null):{},this.size=0}function Rt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var zt=`__lodash_hash_undefined__`,Bt=Object.prototype.hasOwnProperty;function Vt(e){var t=this.__data__;if(R){var n=t[e];return n===zt?void 0:n}return Bt.call(t,e)?t[e]:void 0}var Ht=Object.prototype.hasOwnProperty;function Ut(e){var t=this.__data__;return R?t[e]!==void 0:Ht.call(t,e)}var Wt=`__lodash_hash_undefined__`;function Gt(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=R&&t===void 0?Wt:t,this}function z(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}z.prototype.clear=Lt,z.prototype.delete=Rt,z.prototype.get=Vt,z.prototype.has=Ut,z.prototype.set=Gt;function Kt(){this.__data__=[],this.size=0}function B(e,t){for(var n=e.length;n--;)if(D(e[n][0],t))return n;return-1}var qt=Array.prototype.splice;function Jt(e){var t=this.__data__,n=B(t,e);return n<0?!1:(n==t.length-1?t.pop():qt.call(t,n,1),--this.size,!0)}function Yt(e){var t=this.__data__,n=B(t,e);return n<0?void 0:t[n][1]}function Xt(e){return B(this.__data__,e)>-1}function Zt(e,t){var n=this.__data__,r=B(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}V.prototype.clear=Kt,V.prototype.delete=Jt,V.prototype.get=Yt,V.prototype.has=Xt,V.prototype.set=Zt;var H=C(n,`Map`);function Qt(){this.size=0,this.__data__={hash:new z,map:new(H||V),string:new z}}function $t(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function U(e,t){var n=e.__data__;return $t(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function en(e){var t=U(this,e).delete(e);return this.size-=+!!t,t}function tn(e){return U(this,e).get(e)}function nn(e){return U(this,e).has(e)}function rn(e,t){var n=U(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function W(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}W.prototype.clear=Qt,W.prototype.delete=en,W.prototype.get=tn,W.prototype.has=nn,W.prototype.set=rn;var an=`Expected a function`;function on(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(an);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(on.Cache||W),n}on.Cache=W;var sn=500;function cn(e){var t=on(e,function(e){return n.size===sn&&n.clear(),e}),n=t.cache;return t}var ln=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/\\(\\)?/g,dn=cn(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(ln,function(e,n,r,i){t.push(r?i.replace(un,`$1`):n||e)}),t});function fn(e){return e==null?``:re(e)}function pn(e,t){return y(e)?e:It(e,t)?[e]:dn(fn(e))}var mn=1/0;function G(e){if(typeof e==`string`||_(e))return e;var t=e+``;return t==`0`&&1/e==-mn?`-0`:t}function K(e,t){t=pn(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[G(t[n++])];return n&&n==r?e:void 0}function hn(e,t,n){var r=e==null?void 0:K(e,t);return r===void 0?n:r}function gn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _n=r?r.isConcatSpreadable:void 0;function vn(e){return y(e)||j(e)||!!(_n&&e&&e[_n])}function yn(e,t,n,r,i){var a=-1,o=e.length;for(n||=vn,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?yn(s,t-1,n,r,i):gn(i,s):r||(i[i.length]=s)}return i}function bn(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function xn(){this.__data__=new V,this.size=0}function Sn(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Cn(e){return this.__data__.get(e)}function wn(e){return this.__data__.has(e)}var Tn=200;function En(e,t){var n=this.__data__;if(n instanceof V){var r=n.__data__;if(!H||r.length<Tn-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new W(r)}return n.set(e,t),this.size=n.size,this}function q(e){var t=this.__data__=new V(e);this.size=t.size}q.prototype.clear=xn,q.prototype.delete=Sn,q.prototype.get=Cn,q.prototype.has=wn,q.prototype.set=En;function Dn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function On(){return[]}var kn=Object.prototype.propertyIsEnumerable,An=Object.getOwnPropertySymbols,jn=An?function(e){return e==null?[]:(e=Object(e),Dn(An(e),function(t){return kn.call(e,t)}))}:On;function Mn(e,t,n){var r=t(e);return y(e)?r:gn(r,n(e))}function Nn(e){return Mn(e,L,jn)}var Pn=C(n,`DataView`),Fn=C(n,`Promise`),J=C(n,`Set`),In=`[object Map]`,Ln=`[object Object]`,Rn=`[object Promise]`,zn=`[object Set]`,Bn=`[object WeakMap]`,Vn=`[object DataView]`,Hn=S(Pn),Un=S(H),Wn=S(Fn),Gn=S(J),Kn=S(w),Y=m;(Pn&&Y(new Pn(new ArrayBuffer(1)))!=Vn||H&&Y(new H)!=In||Fn&&Y(Fn.resolve())!=Rn||J&&Y(new J)!=zn||w&&Y(new w)!=Bn)&&(Y=function(e){var t=m(e),n=t==Ln?e.constructor:void 0,r=n?S(n):``;if(r)switch(r){case Hn:return Vn;case Un:return In;case Wn:return Rn;case Gn:return zn;case Kn:return Bn}return t});var X=Y,qn=n.Uint8Array,Jn=`__lodash_hash_undefined__`;function Yn(e){return this.__data__.set(e,Jn),this}function Xn(e){return this.__data__.has(e)}function Z(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new W;++t<n;)this.add(e[t])}Z.prototype.add=Z.prototype.push=Yn,Z.prototype.has=Xn;function Zn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Qn(e,t){return e.has(t)}var $n=1,er=2;function tr(e,t,n,r,i,a){var o=n&$n,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&er?new Z:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Zn(t,function(e,t){if(!Qn(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function nr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function rr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ir=1,ar=2,or=`[object Boolean]`,sr=`[object Date]`,cr=`[object Error]`,lr=`[object Map]`,ur=`[object Number]`,dr=`[object RegExp]`,fr=`[object Set]`,pr=`[object String]`,mr=`[object Symbol]`,hr=`[object ArrayBuffer]`,gr=`[object DataView]`,_r=r?r.prototype:void 0,vr=_r?_r.valueOf:void 0;function yr(e,t,n,r,i,a,o){switch(n){case gr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case hr:return!(e.byteLength!=t.byteLength||!a(new qn(e),new qn(t)));case or:case sr:case ur:return D(+e,+t);case cr:return e.name==t.name&&e.message==t.message;case dr:case pr:return e==t+``;case lr:var s=nr;case fr:var c=r&ir;if(s||=rr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=ar,o.set(e,t);var u=tr(s(e),s(t),r,i,a,o);return o.delete(e),u;case mr:if(vr)return vr.call(e)==vr.call(t)}return!1}var br=1,xr=Object.prototype.hasOwnProperty;function Sr(e,t,n,r,i,a){var o=n&br,s=Nn(e),c=s.length;if(c!=Nn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:xr.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Cr=1,wr=`[object Arguments]`,Tr=`[object Array]`,Q=`[object Object]`,Er=Object.prototype.hasOwnProperty;function Dr(e,t,n,r,i,a){var o=y(e),s=y(t),c=o?Tr:X(e),l=s?Tr:X(t);c=c==wr?Q:c,l=l==wr?Q:l;var u=c==Q,d=l==Q,f=c==l;if(f&&M(e)){if(!M(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new q,o||I(e)?tr(e,t,n,r,i,a):yr(e,t,c,n,r,i,a);if(!(n&Cr)){var p=u&&Er.call(e,`__wrapped__`),m=d&&Er.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new q,i(h,g,n,r,a)}}return f?(a||=new q,Sr(e,t,n,r,i,a)):!1}function Or(e,t,n,r,i){return e===t?!0:e==null||t==null||!h(e)&&!h(t)?e!==e&&t!==t:Dr(e,t,n,r,Or,i)}var kr=1,Ar=2;function jr(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new q;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?Or(u,l,kr|Ar,r,d):f))return!1}}return!0}function Mr(e){return e===e&&!b(e)}function Nr(e){for(var t=L(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Mr(i)]}return t}function Pr(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function Fr(e){var t=Nr(e);return t.length==1&&t[0][2]?Pr(t[0][0],t[0][1]):function(n){return n===e||jr(n,e,t)}}function Ir(e,t){return e!=null&&t in Object(e)}function Lr(e,t,n){t=pn(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=G(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&O(i)&&E(o,i)&&(y(e)||j(e)))}function Rr(e,t){return e!=null&&Lr(e,t,Ir)}var zr=1,Br=2;function Vr(e,t){return It(e)&&Mr(t)?Pr(G(e),t):function(n){var r=hn(n,e);return r===void 0&&r===t?Rr(n,e):Or(t,r,zr|Br)}}function Hr(e){return function(t){return t?.[e]}}function Ur(e){return function(t){return K(t,e)}}function Wr(e){return It(e)?Hr(G(e)):Ur(e)}function Gr(e){return typeof e==`function`?e:e==null?x:typeof e==`object`?y(e)?Vr(e[0],e[1]):Fr(e):Wr(e)}function Kr(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var qr=Kr();function Jr(e,t){return e&&qr(e,t,L)}function Yr(e,t){return function(n,r){if(n==null)return n;if(!k(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $=Yr(Jr);function Xr(e){return h(e)&&k(e)}function Zr(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Qr(e){return typeof e==`function`?e:x}function $r(e,t){return(y(e)?Ae:$)(e,Qr(t))}function ei(e,t){var n=[];return $(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function ti(e,t){return(y(e)?Dn:ei)(e,Gr(t,3))}function ni(e,t){return v(t,function(t){return e[t]})}function ri(e){return e==null?[]:ni(e,L(e))}var ii=`[object Map]`,ai=`[object Set]`,oi=Object.prototype.hasOwnProperty;function si(e){if(e==null)return!0;if(k(e)&&(y(e)||typeof e==`string`||typeof e.splice==`function`||M(e)||I(e)||j(e)))return!e.length;var t=X(e);if(t==ii||t==ai)return!e.size;if(A(e))return!Nt(e).length;for(var n in e)if(oi.call(e,n))return!1;return!0}function ci(e){return e===void 0}function li(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function ui(e,t,n){var r=y(e)?bn:li,i=arguments.length<3;return r(e,Gr(t,4),n,i,$)}var di=J&&1/rr(new J([,-0]))[1]==1/0?function(e){return new J(e)}:Ce,fi=200;function pi(e,t,n){var r=-1,i=Fe,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=Zr;else if(a>=fi){var l=t?null:di(e);if(l)return rr(l);o=!1,i=Qn,c=new Z}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}export{je as $,yn as A,I as B,X as C,On as D,jn as E,fn as F,A as G,wt as H,L as I,ze as J,k as K,Nt as L,K as M,G as N,Dn as O,pn as P,Pe as Q,At as R,qn as S,Mn as T,M as U,Et as V,j as W,E as X,D as Y,Fe as Z,Rr as _,ri as a,ce as at,Zn as b,$r as c,y as ct,Xr as d,h as dt,Ae as et,$ as f,m as ft,Hr as g,Gr as h,si as i,Ce as it,gn as j,q as k,Qr as l,v as lt,qr as m,n as mt,ui as n,T as nt,ti as o,x as ot,Jr as p,r as pt,Be as q,ci as r,Oe as rt,ei as s,b as st,pi as t,ke as tt,Zr as u,_ as ut,Lr as v,Nn as w,Z as x,Qn as y,kt as z};
|
package/dist/frontend/assets/{abnfDiagram-VCTEODGH-Cernzewp.js → abnfDiagram-O67JEVCF-B8pam94f.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,t}from"./mermaid-parser.core-
|
|
1
|
+
import{m as e,t}from"./mermaid-parser.core-BP-BgE7c.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as r}from"./src-CmaQbKwl.js";import"./chunk-O7XYJQB3-j8r_wK2Y.js";import{n as i,r as a,t as o}from"./chunk-GTNCS2PH-DZtp2P9b.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-bi0KWxzD.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BwPukNhM.js";var e=`/nodefony/security/api/keys`,t=`/nodefony/security/api/keys/capabilities`,n=`/nodefony/security/api/apikeys`,r=`/nodefony/security/api/apikeys/status`,i=`/nodefony/security/api/apikeys/stats`;function a(t){return`${e}/${encodeURIComponent(t)}`}function o(e){return`${n}/${encodeURIComponent(e)}/revoke`}var s=`v1.0`;function c(e,t=Date.now()){return e.revokedAt===null?e.expiresAt!==null&&e.expiresAt<=t?`expired`:`active`:`revoked`}function l(e,t=Date.now()){let n={active:0,expired:0,revoked:0};for(let r of e)n[c(r,t)]++;return{total:e.length,...n}}var u=864e5;function d(e){return e===null?`—`:new Date(e).toLocaleString(`fr-FR`,{dateStyle:`medium`,timeStyle:`short`})}function f(e,t=Date.now()){if(e===null)return`Sans expiration`;let n=Math.ceil((e-t)/u);return n<0?`Expirée il y a ${-n} j`:n===0?`Expire aujourd'hui`:n===1?`Expire demain`:`Expire dans ${n} j`}function p(e,t=Date.now()){if(e===null)return`Jamais utilisée`;let n=Math.floor((t-e)/u);if(n<=0)return`Utilisée aujourd'hui`;if(n===1)return`Hier`;if(n<30)return`Il y a ${n} j`;let r=Math.floor(n/30);return r<12?`Il y a ${r} mois`:`Il y a ${Math.floor(r/12)} an(s)`}function m(e){let t=e?.status;if(t===401)return`Non authentifié — votre session Studio a expiré ou n'est plus reconnue par le firewall. Reconnectez-vous.`;if(t===403)return`Accès refusé — la gestion des clés API en mode Administration est réservée aux administrateurs (ROLE_NODEFONY_ADMIN).`;if(t===503)return`Clés API indisponibles — émission désactivée en config sécurité (apiKeys.enabled = false) ou store de jetons non provisionné.`;if(t===404)return`Endpoint introuvable — le module @nodefony/security n'est peut-être pas chargé.`;if(t===409)return`Plafond de clés actives atteint pour ce porteur — révoquez-en une avant d'en créer une nouvelle.`;let n=e?.message;return n?`Erreur de chargement des clés API : ${n}`:`Erreur de chargement des clés API.`}export{t as a,l as c,f as d,p as f,r as i,m as l,a as m,s as n,e as o,c as p,i as r,o as s,n as t,d as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-FOHPRMQF-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-BP-BgE7c.js";export{e as createArchitectureServices};
|