@acedatacloud/nexior 3.351.6 → 3.353.0
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/dist/assets/{ApiCodeButton-CWiYAicH.js → ApiCodeButton-c4MVRYWA.js} +1 -1
- package/dist/assets/{Artifacts-DZrJejTY.js → Artifacts-BkjAjCWw.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-DIRm-MSJ.js → AskUserQuestionCard-DJWHa7Ja.js} +1 -1
- package/dist/assets/{Auth-B2k7vKVG.js → Auth-DQ972Db6.js} +1 -1
- package/dist/assets/{Bare-vptsTYxC.js → Bare-DXyJstOY.js} +1 -1
- package/dist/assets/{BotPlaceholder-BHQueIfj.js → BotPlaceholder-BX5DiQGy.js} +1 -1
- package/dist/assets/{BottomFooter-cESF8u7r.js → BottomFooter-DsZc8xcN.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-kUSsJKyI.js → BrowserPairingDialog-D-aBJ4i-.js} +1 -1
- package/dist/assets/{Callback-B97V3jOr.js → Callback-CM63bEdD.js} +1 -1
- package/dist/assets/{CodeSnippet-c6Sd91X3.js → CodeSnippet-DYqQv90s.js} +1 -1
- package/dist/assets/{Console-AOWTreCM.js → Console-CJ7rfVV2.js} +1 -1
- package/dist/assets/{Consumption-N9Abtlt1.js → Consumption-BV9bmqJy.js} +1 -1
- package/dist/assets/{Conversation-D8wskZgv.js → Conversation-AmBeH4Me.js} +1 -1
- package/dist/assets/{Conversation-12PizzXo.css → Conversation-CP1PCEGM.css} +1 -1
- package/dist/assets/{Conversation-CW0CSUPn.js → Conversation-L2d-M26D.js} +1 -1
- package/dist/assets/{CopyToClipboard-DVZZKKIn.js → CopyToClipboard-BNiTrCI3.js} +1 -1
- package/dist/assets/{Detail-K7chxtBx.js → Detail-DdPdcTAO.js} +2 -2
- package/dist/assets/{Extra-DjKRvqs2.js → Extra-99-HxkEi.js} +1 -1
- package/dist/assets/{FilePreview-B6I6kKaC.js → FilePreview--zEyXqDR.js} +1 -1
- package/dist/assets/{Hailuo-C2ebFNAx.js → Hailuo-Djeo3PV1.js} +1 -1
- package/dist/assets/{History-DsC3jjzY.js → History-g_v9VsWO.js} +1 -1
- package/dist/assets/{ImagePreview-BnDg8SMo.js → ImagePreview-D_V9IWmn.js} +1 -1
- package/dist/assets/{ImageWrapper-Jwh0NBdB.js → ImageWrapper-Y8BiY6mm.js} +1 -1
- package/dist/assets/{Index-DSi2yqSe.js → Index-3IHjjO2v.js} +1 -1
- package/dist/assets/{Index-DI9SWffO.js → Index-90yYKTG_.js} +1 -1
- package/dist/assets/{Index-BNwrqbE-.js → Index-B1ELKGQL.js} +1 -1
- package/dist/assets/{Index-B9G8qnKi.js → Index-B69wcUOt.js} +1 -1
- package/dist/assets/{Index-D-rXaQWx.js → Index-B7wK0FYy.js} +1 -1
- package/dist/assets/{Index-BeHaNPAl.js → Index-BFIbfu49.js} +1 -1
- package/dist/assets/{Index-Bz-MqL-D.js → Index-BJdlfZtc.js} +1 -1
- package/dist/assets/{Index-DNH-lcd-.js → Index-BfnAXZhd.js} +1 -1
- package/dist/assets/{Index-CXngK-bo.js → Index-BrfLwks_.js} +1 -1
- package/dist/assets/{Index-Bmc-W7Ti.js → Index-Bv_SvPF7.js} +1 -1
- package/dist/assets/{Index-dL2ArM37.js → Index-C6kMHBvY.js} +1 -1
- package/dist/assets/{Index-BjleO-8V2.js → Index-CCwswMzL2.js} +1 -1
- package/dist/assets/{Index-BMQ4wVID2.js → Index-CDqbVtNg2.js} +1 -1
- package/dist/assets/{Index-93HsN9hi.js → Index-CGAxwoCa.js} +1 -1
- package/dist/assets/{Index-CvNX8Rpq.js → Index-CI495m_i.js} +1 -1
- package/dist/assets/{Index-1RtTbuhL.js → Index-CQsz1Prj.js} +1 -1
- package/dist/assets/{Index-DkJaSkoV2.js → Index-CWbHHdNM2.js} +1 -1
- package/dist/assets/{Index-BxEK8H_I2.js → Index-CXFY-2zZ2.js} +1 -1
- package/dist/assets/{Index-CA1mwjrQ.js → Index-CY6Cidmg.js} +1 -1
- package/dist/assets/{Index-C4Jlcf-_.js → Index-C_OlTOwd.js} +1 -1
- package/dist/assets/{Index-n_ElHp0x.js → Index-CbYL_JAt.js} +1 -1
- package/dist/assets/{Index-BBuVgL90.js → Index-Cl5urK-i.js} +1 -1
- package/dist/assets/{Index-ZL-MwGi6.js → Index-Cm6FQ_BV.js} +1 -1
- package/dist/assets/{Index-DRJtx_pN.js → Index-DC_GNsQk.js} +1 -1
- package/dist/assets/{Index-CNANiIuw.js → Index-DMSF4d33.js} +1 -1
- package/dist/assets/{Index-DPI8Fu-1.js → Index-DeFoLB8T.js} +1 -1
- package/dist/assets/{Index-BAL9rhD92.js → Index-Ds0wLKsf2.js} +1 -1
- package/dist/assets/{Index-CqsMJzzs.js → Index-P58zVki9.js} +1 -1
- package/dist/assets/{Index-Bf5ZdbUi.js → Index-X4nyPCLD.js} +1 -1
- package/dist/assets/{Index-CWpe-a_S.js → Index-XJsQKuT2.js} +1 -1
- package/dist/assets/{Index-hAoMtAPz.js → Index-aRxc15Zp.js} +1 -1
- package/dist/assets/{Index-sZmhi3kj.js → Index-grpCD8gd.js} +1 -1
- package/dist/assets/{Index-BsYZSSeu.js → Index-wFF_vb3V.js} +1 -1
- package/dist/assets/{Invitees-et9QAl45.js → Invitees-Bikfj7bV.js} +1 -1
- package/dist/assets/{List-DupEBozx.js → List-BpiariI5.js} +1 -1
- package/dist/assets/{List-CFXGd3Zx.js → List-DPRtYSmZ.js} +1 -1
- package/dist/assets/{List-Ol7hBsVJ.js → List-DqPl8qI9.js} +1 -1
- package/dist/assets/{LocalTools-BGsRtmfM.js → LocalTools-DTiVZm09.js} +1 -1
- package/dist/assets/{LocalTools-BJP81aJX.js → LocalTools-Dnx43kL2.js} +1 -1
- package/dist/assets/{Logo-By4wlUy2.js → Logo-DHHyOaCW.js} +1 -1
- package/dist/assets/{Main-BNGu4ECB.js → Main-CTPo69sn.js} +1 -1
- package/dist/assets/Message-BHyfyCOT.js +3 -0
- package/dist/assets/{Message-CVGtRcIt.css → Message-CS1bwgnl.css} +1 -1
- package/dist/assets/{Model-Dp_gJaGO.js → Model-DQEr6jOk.js} +1 -1
- package/dist/assets/{Navigator-CrwR_1m7.js → Navigator-DovJPQFQ.js} +3 -3
- package/dist/assets/{NotFound-B1kF8C7f.js → NotFound-CNQP8oF9.js} +1 -1
- package/dist/assets/{PageHeader-RatwVDYh.js → PageHeader-CZBqZXqm.js} +1 -1
- package/dist/assets/{Pay-CBK5r_J1.js → Pay-BgzjlVlE.js} +1 -1
- package/dist/assets/{Player-WrYA_czH.js → Player-JcpaZVqa.js} +1 -1
- package/dist/assets/{Poivelle-Bwd-gMLK.js → Poivelle-BYFBJsz4.js} +1 -1
- package/dist/assets/{RealtimeCall-BuYdLiLd.js → RealtimeCall-C_DXsOjb.js} +1 -1
- package/dist/assets/{ReportButton-bTSHZewr.js → ReportButton-BW2lfho9.js} +1 -1
- package/dist/assets/{ReportDialog-YFeHG_CR.js → ReportDialog-KUbVVrnD.js} +1 -1
- package/dist/assets/{ScheduledTasks-D3jj-vEm.js → ScheduledTasks-B_SeGrgI.js} +1 -1
- package/dist/assets/{Status-DBr7DmmH.js → Status-CeZKzJRK.js} +1 -1
- package/dist/assets/{Subscribe-D9OrwH1Z.js → Subscribe-r_cbTuuk.js} +1 -1
- package/dist/assets/{TabSwitcher-CuHTRfhU.js → TabSwitcher-wl0dL1eD.js} +1 -1
- package/dist/assets/{Tts-BFw0ZrRL.js → Tts-BYed_hGQ.js} +1 -1
- package/dist/assets/{VideoPlayer-B5wPvH-Y.js → VideoPlayer-DB6PHZeD.js} +1 -1
- package/dist/assets/{VideoPreview-Bg7a5qjZ.js → VideoPreview-CZGmCNoo.js} +1 -1
- package/dist/assets/arrow-down-I1uQV181.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-CyX7ECtk.js → arrow-down-wide-narrow-_PzOAnCW.js} +1 -1
- package/dist/assets/arrow-left-Cu2n5LPM.js +1 -0
- package/dist/assets/arrow-right-farwTGbL.js +1 -0
- package/dist/assets/arrow-up-B5ui6chY.js +1 -0
- package/dist/assets/{authorizeFlow-DDuPRkQ6.js → authorizeFlow-DefmA1fY.js} +1 -1
- package/dist/assets/{avatar-CNnchEqv.js → avatar-CmB4Kr-K.js} +1 -1
- package/dist/assets/{basic-DAmfySfk.js → basic-BBxjvfaZ.js} +1 -1
- package/dist/assets/{book-open-BJrmFN4r.js → book-open-bWuEfgUg.js} +1 -1
- package/dist/assets/{box-5RQYuqPM.js → box-CPKJfUwq.js} +1 -1
- package/dist/assets/{boxes-XPhVUNqy.js → boxes-BggycWQ3.js} +1 -1
- package/dist/assets/{brain-TD9WNpE6.js → brain-Cw9UTwNf.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-DJpDso2B.js → chart-no-axes-combined-Z91Yq8Hk.js} +1 -1
- package/dist/assets/{chat-9dB50Xkk.js → chat-3vsZBdL_.js} +1 -1
- package/dist/assets/{chat-DhMJ8APc.js → chat-B498vI5m.js} +1 -1
- package/dist/assets/{chat-B2621yw9.js → chat-B5nPwlDF.js} +1 -1
- package/dist/assets/{chat-WMOrJFOw.js → chat-BTCQbiu-.js} +1 -1
- package/dist/assets/{chat-CYua_6ue.js → chat-Bx2IC7g4.js} +1 -1
- package/dist/assets/{chat-CeYVzg-g.js → chat-C9FsTT2z.js} +1 -1
- package/dist/assets/{chat-CEn-qc3G.js → chat-CBTzxhxo.js} +1 -1
- package/dist/assets/{chat-CgmRBpam.js → chat-CV6dVkzG.js} +1 -1
- package/dist/assets/{chat-icYr0M8I.js → chat-Cd23_p1Z.js} +1 -1
- package/dist/assets/{chat-eEXBg1CH.js → chat-ClGb8aJq.js} +1 -1
- package/dist/assets/{chat-C_EyHW86.js → chat-DCw2iEzj.js} +1 -1
- package/dist/assets/{chat-Dan7BQ_0.js → chat-DHTlwnxl.js} +1 -1
- package/dist/assets/{chat-BTa6DoJT.js → chat-Df_w1_S3.js} +1 -1
- package/dist/assets/{chat-D3-hndY7.js → chat-DfnvhmDk.js} +1 -1
- package/dist/assets/{chat-HaYrnCAt.js → chat-DlvXoVwl.js} +1 -1
- package/dist/assets/{chat-CpvG4t7w.js → chat-UzzPgLAH.js} +1 -1
- package/dist/assets/{chat-ErGUOmuT.js → chat-bEsXg3MF.js} +1 -1
- package/dist/assets/{chat-DBzzeToh.js → chat-dqFmGqCf.js} +1 -1
- package/dist/assets/{chat-DeJNAc5V.js → chat-qdQdZYe0.js} +1 -1
- package/dist/assets/check-TXz76tUJ.js +1 -0
- package/dist/assets/chevron-down-YIB0Ajqi.js +1 -0
- package/dist/assets/chevron-right-Db5wwR3e.js +1 -0
- package/dist/assets/circle-check-C-zk7SxT.js +1 -0
- package/dist/assets/{circle-question-mark-UZBen5vb.js → circle-question-mark-CCZotCPz.js} +1 -1
- package/dist/assets/{clipboard-list-DGrwWttH.js → clipboard-list-CG8tLDrt.js} +1 -1
- package/dist/assets/clock-ChX1xgIa.js +1 -0
- package/dist/assets/code-CKi9ZKH0.js +1 -0
- package/dist/assets/{codingBridge-C3gfb5tE.js → codingBridge-BGxcrpSj.js} +1 -1
- package/dist/assets/{codingBridgeNotify-CM10j5Yv.js → codingBridgeNotify-DdDyIm9P.js} +2 -2
- package/dist/assets/{coins-BzTWgwI6.js → coins-BdOCP74n.js} +1 -1
- package/dist/assets/{collapse-DnwOyVfC.js → collapse-Ln_aczrJ.js} +1 -1
- package/dist/assets/{constants-DQjc0Ctr.js → constants-CzYWUlOY.js} +1 -1
- package/dist/assets/{copy-C20Z1lQD.js → copy-Bm54uK0_.js} +1 -1
- package/dist/assets/{createTaskActions-BMApVkC0.js → createTaskActions-CO67YADV.js} +1 -1
- package/dist/assets/{digitalhuman-DzulZMpY.js → digitalhuman-DsGK3OJH.js} +1 -1
- package/dist/assets/{dollar-sign-z6SJbu2X.js → dollar-sign-ChvSYyny.js} +1 -1
- package/dist/assets/{download-Bjl7D12N.js → download-Cb74PKPX.js} +1 -1
- package/dist/assets/{drawer-CKa-RvLj.js → drawer-BYSZqwf9.js} +1 -1
- package/dist/assets/{dropdown-cV8wOdWz.js → dropdown-6s0Ah2n3.js} +1 -1
- package/dist/assets/{dropdown-Iu9QeHww.js → dropdown-Dp6Zt2pT.js} +1 -1
- package/dist/assets/{ellipsis-BU0uayKw.js → ellipsis-DWEyfGX3.js} +1 -1
- package/dist/assets/{esm-CgDYfwnr.js → esm-BEp5lGgc.js} +2 -2
- package/dist/assets/esm-BhIAwXI6.js +1 -0
- package/dist/assets/{esm-Ch3U7MD6.js → esm-Bw42C7HJ.js} +3 -3
- package/dist/assets/{esm-Det_wcOd.js → esm-DcaGkTvm.js} +1 -1
- package/dist/assets/{esm-BJAwkUFj.js → esm-DdLRtgHm.js} +1 -1
- package/dist/assets/{esm-CddC7qip.js → esm-XsrSBmcp.js} +2 -2
- package/dist/assets/{esm-aLmpyIkQ.js → esm-eu15aKIr.js} +1 -1
- package/dist/assets/{external-link-Bv7xVKE1.js → external-link-H5pl8ERC.js} +1 -1
- package/dist/assets/{eye-CzKIbV3W.js → eye-BsXbhBKz.js} +1 -1
- package/dist/assets/{file-B_liOBtz.js → file-C8lcsbIr.js} +1 -1
- package/dist/assets/{file-output-DbxM5kN5.js → file-output-BpN4tQ0R.js} +1 -1
- package/dist/assets/{file-text-BLdKFglG.js → file-text-pAkqd4ZQ.js} +1 -1
- package/dist/assets/{fish-WUB4MCXn.js → fish-CrCHRelo.js} +1 -1
- package/dist/assets/{flux-aigopm_p.js → flux-CL8IkrfQ.js} +1 -1
- package/dist/assets/{folder-NsgWKb6i.js → folder-B-gZBejm.js} +1 -1
- package/dist/assets/gauge-C5c8qgbK.js +1 -0
- package/dist/assets/{globe-CmEoR8gp.js → globe-j8VgrZzd.js} +1 -1
- package/dist/assets/{grokvideo-DuzxqFZj.js → grokvideo-DVKCP-8O.js} +1 -1
- package/dist/assets/{hailuo-DMXL3rub.js → hailuo-CJSwp8xi.js} +1 -1
- package/dist/assets/{headphones-DwfquY-K.js → headphones-4iz6sikr.js} +1 -1
- package/dist/assets/{history-un45_T_n.js → history-B12HIbBz.js} +1 -1
- package/dist/assets/{house-CPXShJ2M.js → house-A_1I4I09.js} +1 -1
- package/dist/assets/{i18n-BzCApSeU.js → i18n-CSLcjJrY.js} +1 -1
- package/dist/assets/{image-D9EEgt17.js → image-BsqAN2U9.js} +1 -1
- package/dist/assets/{index-CD2-hqNW.js → index-CBKO4rem.js} +4 -4
- package/dist/assets/{index.browser.esm-BKmjgYx3.js → index.browser.esm-CwdzyGMo.js} +1 -1
- package/dist/assets/{index.es-Ds-FIqsY.js → index.es-Ckkoz2gg.js} +1 -1
- package/dist/assets/{info-B1cNmQ-o.js → info-DrWjfo9Y.js} +1 -1
- package/dist/assets/{input-number-D6pYNASF.js → input-number-DLZvLiIr.js} +1 -1
- package/dist/assets/{key-round-B3nKnP4v.js → key-round-BTS01sNL.js} +1 -1
- package/dist/assets/{kling-Bmlq2Ex9.js → kling-D4mZU6Km.js} +1 -1
- package/dist/assets/{languages-BuIV0FmG.js → languages-CbFK3LA2.js} +1 -1
- package/dist/assets/{laptop-dgLGqDJT.js → laptop-DOQ7QKr2.js} +1 -1
- package/dist/assets/{lightbulb-DJmYMTty.js → lightbulb-DxyCSxDz.js} +1 -1
- package/dist/assets/{link-Drwjhjzx.js → link-DB9lF2gd.js} +1 -1
- package/dist/assets/loader-circle-DtKrvyTx.js +1 -0
- package/dist/assets/{lock-DAPZQEW-.js → lock-BHtf5Lm2.js} +1 -1
- package/dist/assets/{luma-MHX9O_-v.js → luma-C9G9swwP.js} +1 -1
- package/dist/assets/{maestro-jbHMBkLA.js → maestro-CxVb3RkR.js} +1 -1
- package/dist/assets/{maestro-3z8ioYKY.js → maestro-DkeRJRcB.js} +1 -1
- package/dist/assets/{mail-DYOEAP3i.js → mail-Bst8pPbL.js} +1 -1
- package/dist/assets/{message-circle-C2n1Tllg.js → message-circle-BER098k6.js} +1 -1
- package/dist/assets/{mic-BLEuIvo5.js → mic-IagBfpjJ.js} +1 -1
- package/dist/assets/{midjourney-BFmyZ_tU.js → midjourney-l0Wlipgu.js} +1 -1
- package/dist/assets/{mobileLocalExec-hkgnAyxe.js → mobileLocalExec-zvl-u8Fr.js} +2 -2
- package/dist/assets/{models-OSW29aqo.js → models-yTQ4rqqP.js} +1 -1
- package/dist/assets/{monitor-Di7iE4c5.js → monitor-Dp27ibQf.js} +1 -1
- package/dist/assets/{mouse-pointer-2-C1h_KY8D.js → mouse-pointer-2-Bsy1yc3T.js} +1 -1
- package/dist/assets/music-2-BK3nFfL9.js +1 -0
- package/dist/assets/{nanobanana-PYaELAh2.js → nanobanana-BPqmJJRq.js} +1 -1
- package/dist/assets/{omni-DDt3d_Oj.js → omni-CPSB863y.js} +1 -1
- package/dist/assets/{openaiimage-DHNDrMex.js → openaiimage-Cmh-mMlz.js} +1 -1
- package/dist/assets/{pagination-DXXXQ5cp.js → pagination-BySJ8ZVa.js} +1 -1
- package/dist/assets/{pagination-TqCcRUaD.js → pagination-DjJwgPO2.js} +1 -1
- package/dist/assets/{pagination-CyddWiCJ.js → pagination-KA1ofG-e.js} +1 -1
- package/dist/assets/{palette-DFAnY6jW.js → palette-0hlIYrNs.js} +1 -1
- package/dist/assets/{paperclip-BAszH3iv.js → paperclip-BF6HKkL9.js} +1 -1
- package/dist/assets/{pause-5G63TB0J.js → pause-Dg_JmCI-.js} +1 -1
- package/dist/assets/{pencil-BJ_6ojX2.js → pencil-CwpE2bnx.js} +1 -1
- package/dist/assets/{pika-BzWKiitX.js → pika-D8eb-7rN.js} +1 -1
- package/dist/assets/{pixverse-D3A0XjE_.js → pixverse-PnZKoumn.js} +1 -1
- package/dist/assets/play-BA08kFaD.js +1 -0
- package/dist/assets/{plug-BoylcuFT.js → plug-CHGFjzJy.js} +1 -1
- package/dist/assets/plus-padNMCLo.js +1 -0
- package/dist/assets/{poivelle-CPlUdPaK.js → poivelle-I87bY-F4.js} +1 -1
- package/dist/assets/{popover-Dt75xsHQ.js → popover-0ATBKFVp.js} +1 -1
- package/dist/assets/{producer--xGbOart.js → producer-BsbDy8Ld.js} +1 -1
- package/dist/assets/{qrart-D0n1nlRD.js → qrart-C6PYvhyG.js} +1 -1
- package/dist/assets/{realtime-DuOffBBr.js → realtime-CD51yd-S.js} +1 -1
- package/dist/assets/{refresh-cw-Tn7gJ13d.js → refresh-cw-Bfw0ROs-.js} +1 -1
- package/dist/assets/rotate-ccw-ofWALSeT.js +1 -0
- package/dist/assets/rotate-cw-CPuLRe-U.js +1 -0
- package/dist/assets/{row-G9xh75fd.js → row-ZP6dDlmT.js} +1 -1
- package/dist/assets/search-DPHPWb6w.js +1 -0
- package/dist/assets/{seedance-tFAlAOfn.js → seedance-E-1Iywd8.js} +1 -1
- package/dist/assets/{seedream-Gt4aau_1.js → seedream-B4t4nlUY.js} +1 -1
- package/dist/assets/{select-3zeZnDWr.js → select-By5KXS1U.js} +1 -1
- package/dist/assets/{serp-DjMqZxkM.js → serp-CKv7qVTp.js} +1 -1
- package/dist/assets/{shield-BJg_SW7v.js → shield-BhZRAZxV.js} +1 -1
- package/dist/assets/{shuffle-BcaNQO-S.js → shuffle-KRDzDyU9.js} +1 -1
- package/dist/assets/{slider-WaUKHi3z.js → slider-Bto_Z5Ho.js} +1 -1
- package/dist/assets/{solana-wallets-DNpZJ0FH.js → solana-wallets-C0kbt-QL.js} +2 -2
- package/dist/assets/{solana-wallets-vue-C1VmdDik.js → solana-wallets-vue-BWYDArfN.js} +1 -1
- package/dist/assets/{sora-BERB9XTM.js → sora-DIx_31Y3.js} +1 -1
- package/dist/assets/{sparkles-4u5uzQOL.js → sparkles-BcyzP5OG.js} +1 -1
- package/dist/assets/square-DJTa4kRR.js +1 -0
- package/dist/assets/{store-Jc8QTABa.js → store-B77iF5fz.js} +1 -1
- package/dist/assets/{suno-Chn2b9Yw.js → suno-B2yLArTR.js} +1 -1
- package/dist/assets/{switch-B8KB4C7k.js → switch-DsYeNq-3.js} +1 -1
- package/dist/assets/{table-CvCqswG1.js → table-C6EDCFOD.js} +1 -1
- package/dist/assets/{tabs-CPEEm64y.js → tabs-CEdTUVdB.js} +1 -1
- package/dist/assets/{tag-RstAx2l-.js → tag-BFoD3iTt.js} +1 -1
- package/dist/assets/terminal-DNNUFSrz.js +1 -0
- package/dist/assets/{time-picker-C6uBKm3r.js → time-picker-BJrVVhDw.js} +1 -1
- package/dist/assets/{tooltip-CPF0ns2F.js → tooltip-PVpDuzzH.js} +1 -1
- package/dist/assets/{trash-2-CO44aulg.js → trash-2-CQLSuQ3X.js} +1 -1
- package/dist/assets/{triangle-alert-QijY2HDu.js → triangle-alert-ClpR6g4l.js} +1 -1
- package/dist/assets/{upload-BngN7c-y.js → upload-Cjls2phY.js} +1 -1
- package/dist/assets/{upload-B9LBkWpk.js → upload-KOO0FgHZ.js} +1 -1
- package/dist/assets/user-DKXw8t2m.js +1 -0
- package/dist/assets/{veo-NwNcRspq.js → veo-C7UCj1Ih.js} +1 -1
- package/dist/assets/{video-Dx41_516.js → video-CbNnfoDX.js} +1 -1
- package/dist/assets/{volume-2-N0VJQa8U.js → volume-2-mztVP_0n.js} +1 -1
- package/dist/assets/{wallet-Cwtb7YQp.js → wallet-Vu9qXLJx.js} +1 -1
- package/dist/assets/{wan-BV3Hy5p7.js → wan-BNkd2vFi.js} +1 -1
- package/dist/assets/{wand-sparkles-BxwmnK2z.js → wand-sparkles-BLnx2H-s.js} +1 -1
- package/dist/assets/{web-BK57F_t0.js → web-BEvLgLwK.js} +1 -1
- package/dist/assets/{web-Dju-sTdk.js → web-BWB-XSX4.js} +1 -1
- package/dist/assets/{web-DxWEviRF.js → web-C0Iyd47w.js} +1 -1
- package/dist/assets/{web-CQtlWScV.js → web-DogjNwiV.js} +1 -1
- package/dist/assets/{web-B46bWo_4.js → web-JwwqID9f.js} +1 -1
- package/dist/assets/{webextrator-iNFF8-7T.js → webextrator-DkqI4T0T.js} +1 -1
- package/dist/assets/{zap-Ct4mMP79.js → zap-zUhLSf0N.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Message-DcoJB-ne.js +0 -3
- package/dist/assets/arrow-down-B_frOIPC.js +0 -1
- package/dist/assets/arrow-left-CJ0n8LA_.js +0 -1
- package/dist/assets/arrow-right-Br_YYe9p.js +0 -1
- package/dist/assets/arrow-up-BVQIU7Wp.js +0 -1
- package/dist/assets/check-CaL0o823.js +0 -1
- package/dist/assets/chevron-down-C9iuUElc.js +0 -1
- package/dist/assets/chevron-right-CF0ttnXF.js +0 -1
- package/dist/assets/circle-check-CI_AaSn_.js +0 -1
- package/dist/assets/clock-D1-Kt6-f.js +0 -1
- package/dist/assets/code-C_2s4NTL.js +0 -1
- package/dist/assets/esm-DrJmtPL7.js +0 -1
- package/dist/assets/gauge-IUCx-_5y.js +0 -1
- package/dist/assets/loader-circle-BSTNdJW2.js +0 -1
- package/dist/assets/music-2-DYNSFUWX.js +0 -1
- package/dist/assets/play-BI7VWnLS.js +0 -1
- package/dist/assets/plus-B_IO_O6G.js +0 -1
- package/dist/assets/rotate-ccw-BOWa3Fk_.js +0 -1
- package/dist/assets/rotate-cw-cd-8ZJKX.js +0 -1
- package/dist/assets/search-DxOwIk71.js +0 -1
- package/dist/assets/square-5QWQXF9g.js +0 -1
- package/dist/assets/terminal-DSaSnXUU.js +0 -1
- package/dist/assets/user-a4Rp6J3a.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,j as u,mt as d,rt as f,tt as p,x as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,t as _}from"./form-BdKMEyCR.js";import{m as v,v as y}from"./models-OSW29aqo.js";import{t as b}from"./card-IQwqnRJR.js";import{n as x,r as S}from"./radio-BNhFzeBO.js";import{n as C,t as w}from"./row-G9xh75fd.js";import{t as T}from"./divider-Du_3kymg.js";import{t as E}from"./empty-C5KjRN0h.js";import{t as D}from"./skeleton-Dj_a_iIP.js";import{En as O,G as k,K as A,Mi as j,Mr as M,O as N,Pi as P,Sn as ee,Y as F,bn as I,fi as L,in as R,pr as z,wr as B,xn as V}from"./index-CD2-hqNW.js";var H=h({name:`ApiPrice`,props:{price:{type:Number,required:!1,default:0},unit:{type:String,required:!1,default:void 0},start:{type:Boolean,required:!1,default:!1}},methods:{getPriceString:R}}),U={class:`price-text`},W={key:0,class:`unfree`},G={key:1,class:`free`};function K(e,t,n,i,a,s){return p(),o(`div`,U,[e.price>0?(p(),o(`span`,W,r(e.getPriceString({value:e.price}))+` `+r(e.unit?` / ${e.unit}`:``)+r(e.start?e.$t(`common.message.startPrice`):``),1)):(p(),o(`span`,G,r(e.$t(`common.message.free`)),1))])}var q=N(H,[[`render`,K],[`__scopeId`,`data-v-bb068181`]]),J=h({name:`ServiceEstimation`,components:{},props:{service:{type:Object,required:!0},package:{type:Object,required:!0}},methods:{getPriceString:R}}),Y={class:`estimation`},X={key:0,class:`item`},te={key:0},Z={key:1},Q={key:2},ne={key:0},re={key:1};function ie(e,t,i,c,l,u){return p(),o(`div`,Y,[(p(!0),o(s,null,f(e.service?.apis,(t,i)=>(p(),o(`div`,{key:i},[(p(!0),o(s,null,f(t?.estimation,(t,i)=>(p(),o(`div`,{key:i,class:`items`},[e.package?.amount&&t?.cost?(p(),o(`p`,X,[n(` ≈ `+r(t.name)+` `+r(Math.round(e.package.amount/t.cost))+` `+r(e.$t(`api.unit.count`))+` `,1),e.package.price>0?(p(),o(`span`,te,` - `+r(e.getPriceString({value:e.package.price/(e.package.amount/t.cost),fractionDigits:3})+` / `+e.$t(`api.unit.count`)),1)):a(``,!0),t.remark?(p(),o(`span`,Z,` (`+r(t.remark)+`) `,1)):a(``,!0),(t?.comparisons?.length??0)>0?(p(),o(`span`,Q,` - `)):a(``,!0),(p(!0),o(s,null,f(t?.comparisons,(t,n)=>(p(),o(`span`,{key:n,class:`comparison`},[t?.value<0?(p(),o(`i`,ne,r(e.$t(`api.message.cheaperThan`).replace(`$[[value]]`,t?.target?.toString()))+` `+r(Math.abs(t?.value)*100)+`% `,1)):a(``,!0),t?.value>0?(p(),o(`i`,re,r(e.$t(`api.message.moreExpensiveThan`).replace(`$[[value]]`,t?.target?.toString()))+` `+r(Math.abs(t?.value)*100)+`% `,1)):a(``,!0)]))),128))])):a(``,!0)]))),128))]))),128))])}var ae=h({name:`ConsoleApplicationBuy`,components:{ElSkeleton:D,ElRow:w,ElCol:C,ElCard:b,ElForm:_,ElFormItem:g,ElButton:P,ElDivider:T,ElEmpty:E,ElRadioGroup:S,ElRadioButton:x,ElTag:j,Price:q,ServiceEstimation:N(J,[[`render`,ie],[`__scopeId`,`data-v-768cf35f`]])},data(){return{lang:this.$i18n.locale,application:void 0,loading:!1,loadFailed:!1,type:v.USAGE,form:{packageId:void 0,amount:void 0},creating:!1}},computed:{applicationId(){return this.$route.params?.id?.toString()},id(){return this.$route.params?.id?.toString()},showPayment(){return!0},price(){return this.application?.service?.price&&this.form.amount?this.form.amount*this.application.service?.price:0},packages(){let e=this.application?.packages?.filter(e=>e.type===v.USAGE).sort((e,t)=>e.amount-t.amount)||[];return L()?e.filter(e=>!!e?.metadata?.apple_product_id):e},package(){if(this.packages&&this.form.packageId){let e=this.packages.filter(e=>e.id===this.form.packageId);if(e.length>0)return e[0]}},site(){return this.$store.getters.site},globalBuyTitle(){let e=this.$store.state.site?.title||`Ace Data Cloud`;return this.$t(`application.title.globalBuy`,{brand:e})},markupRatio(){return ee(this.application,this.site)},orderDiscountRate(){return L()?0:V(this.application)},pricingAvailable(){return this.markupRatio!==void 0&&this.orderDiscountRate!==void 0},displayPackagePrice(){return this.package&&this.markupRatio!==void 0?I(this.package.price,this.markupRatio):void 0},displayUnitPrice(){return this.package&&this.markupRatio!==void 0?I(this.package.price,this.markupRatio)/this.package.amount:void 0},displayFinalPrice(){if(!(this.displayPackagePrice===void 0||this.orderDiscountRate===void 0))return this.displayPackagePrice*(1-this.orderDiscountRate)},hasOrderDiscount(){return(this.orderDiscountRate??0)>0},discountPercent(){let e=(this.orderDiscountRate??0)*100;return Number.isInteger(e)?e.toFixed(0):e.toFixed(1)}},mounted(){if(O(this.$store.getters.site)){this.$router.replace({name:k});return}this.onFetchApplication()},methods:{getDiscount(e){return this.packages&&this.packages.length>0?this.lang?.startsWith(`zh`)?(10*e?.price/e?.amount/(this.packages[0].price/this.packages[0]?.amount)).toFixed(1)+`折`:Math.round(100-100*e?.price/e?.amount/(this.packages[0].price/this.packages[0]?.amount))+`% OFF`:``},onSubscribe(){this.$router.push({name:A,params:this.$route.params})},getPriceString:R,onFetchApplication(){this.loading=!0,this.loadFailed=!1,B.get(this.id).then(({data:e})=>{this.application=e,this.loading=!1,this.form.packageId=this.packages?.[0]?.id}).catch(()=>{this.loading=!1,this.loadFailed=!0})},onChangeType(){this.$router.push({name:A,params:this.$route.params})},onCreateOrder(){if(!this.application?.id||!this.pricingAvailable||!this.package)return;this.creating=!0;let e=this.$t(`service.unit.${this.application?.service?.unit}s`);M(`payment_initiated`,{service:this.application?.service?.alias,amount:this.package?.amount,package_id:this.package?.id,action:`extra`}),z.create({application_id:this.application?.id,amount:this.package?.amount,...this.form.packageId!==`custom`&&this.package?{package_id:this.package.id}:{},description:this.application?.service?`${this.application?.service?.title} x ${this.package?.amount} ${e}`:this.globalBuyTitle+` - `+this.package?.amount+` `+this.$t(`service.unit.credits`)}).then(({data:e})=>{this.creating=!1;let t=e;this.$router.push({name:F,params:{id:t.id}})}).catch(e=>{y.error(this.$t(`order.message.createFailed`)),this.creating=!1,M(`payment_failed`,{service:this.application?.service?.alias,action:`extra`,error:e?.response?.data?.error?.message??String(e)})})}}}),oe={class:`title`},se={key:1,class:`text-center`},ce={key:0},le={class:`text-[var(--el-text-color-secondary)] text-[12px] mb-3`},ue={key:0,class:`ml-2`},$={key:1,class:`text-[var(--el-text-color-secondary)]`},de={key:0,class:`final-price-block`},fe={class:`final-price-line`},pe={key:0,class:`discount-hint`},me={key:1,class:`text-[var(--el-text-color-secondary)]`};function he(h,g,_,v,y,b){let x=c(`el-col`),S=c(`el-row`),C=c(`el-skeleton`),w=c(`el-empty`),T=c(`el-button`),E=c(`el-divider`),D=c(`el-form-item`),O=c(`el-radio-button`),k=c(`el-radio-group`),A=c(`service-estimation`),j=c(`price`),M=c(`el-tag`),N=c(`el-form`),P=c(`el-card`);return p(),u(S,{class:`panel`},{default:d(()=>[i(x,{span:24},{default:d(()=>[i(S,null,{default:d(()=>[i(x,{span:24},{default:d(()=>[e(`h2`,oe,r(h.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(S,null,{default:d(()=>[i(x,{span:24},{default:d(()=>[i(P,{shadow:`hover`,class:`min-h-[500px]`},{default:d(()=>[i(S,null,{default:d(()=>[i(x,{xs:{span:22,offset:1},sm:{span:20,offset:2},md:{span:16,offset:4}},{default:d(()=>[h.loading?(p(),u(C,{key:0})):h.loadFailed?(p(),o(`div`,se,[i(w,{description:h.$t(`common.message.noData`)},null,8,[`description`]),i(T,{type:`primary`,round:``,onClick:h.onFetchApplication},{default:d(()=>[n(r(h.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):h.showPayment?h.application?(p(),u(N,{key:3,class:`purchase-form`,"label-width":`100px`},{default:d(()=>[h.application?.service?a(``,!0):(p(),o(`div`,ce,[e(`p`,le,r(h.$t(`application.message.globalBalanceBuyDescription`)),1),i(E,{"border-style":`dashed`})])),h.application?.service?(p(),u(D,{key:1,label:h.$t(`application.field.service`)},{default:d(()=>[n(r(h.application?.service?.title),1)]),_:1},8,[`label`])):(p(),u(D,{key:2,label:h.$t(`application.field.scope`)},{default:d(()=>[n(r(h.globalBuyTitle),1)]),_:1},8,[`label`])),i(D,{label:h.$t(`application.field.package`),class:`mb-0`},{default:d(()=>[h.packages.length>0?(p(),u(k,{key:0,modelValue:h.form.packageId,"onUpdate:modelValue":g[0]||=e=>h.form.packageId=e,class:`package-options`},{default:d(()=>[(p(!0),o(s,null,f(h.packages,(t,i)=>(p(),u(O,{key:i,label:t.id,class:`mb-2`},{default:d(()=>[l(e(`span`,{class:`corner`},r(h.getDiscount(t)),513),[[m,i!==0]]),n(` `+r(t.amount)+` `+r(h.$t(`service.unit.${h.application?.service?.unit||`credit`}s`)),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])):(p(),u(w,{key:1,description:h.$t(`common.message.noData`),"image-size":48},null,8,[`description`]))]),_:1},8,[`label`]),h.application?.service?.apis&&h.application?.service?.apis?.map(e=>e?.estimation).filter(e=>!!e)?.length>0?(p(),u(D,{key:3},{default:d(()=>[h.application?.service?(p(),u(A,{key:0,service:h.application.service,package:h.package},null,8,[`service`,`package`])):a(``,!0)]),_:1})):a(``,!0),i(D,{label:h.$t(`service.field.price`)},{default:d(()=>[h.package&&h.pricingAvailable?(p(),o(s,{key:0},[i(j,{price:h.displayPackagePrice},null,8,[`price`]),h.package?(p(),o(`span`,ue,`(`+r(h.getPriceString({value:h.displayUnitPrice})+` / `+h.$t(`service.unit.${h.application?.service?.unit||`credits`}`))+`) `,1)):a(``,!0)],64)):(p(),o(`span`,$,r(h.$t(`common.message.noData`)),1))]),_:1},8,[`label`]),i(E,{"border-style":`dashed`}),i(D,{label:h.$t(`application.field.shouldPayPrice`)},{default:d(()=>[h.displayFinalPrice===void 0?(p(),o(`span`,me,r(h.$t(`common.message.noData`)),1)):(p(),o(`div`,de,[e(`div`,fe,[e(`span`,{class:t({price:!0,unfree:h.displayFinalPrice>0,free:h.displayFinalPrice===0})},r(h.getPriceString({value:h.displayFinalPrice})),3),h.hasOrderDiscount?(p(),u(M,{key:0,class:`discount-tag`,effect:`light`,size:`small`,type:`success`},{default:d(()=>[n(r(h.$t(`order.message.discountTag`,{percent:h.discountPercent})),1)]),_:1})):a(``,!0)]),h.hasOrderDiscount?(p(),o(`p`,pe,r(h.$t(`order.message.discountHint`,{percent:h.discountPercent})),1)):a(``,!0)]))]),_:1},8,[`label`]),i(D,null,{default:d(()=>[h.showPayment?(p(),u(T,{key:0,type:`primary`,size:`large`,class:`btn-create`,loading:h.creating,disabled:!h.pricingAvailable||!h.package,round:``,onClick:h.onCreateOrder},{default:d(()=>[n(r(h.$t(`application.button.createOrder`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])):a(``,!0)]),_:1}),i(E,{"border-style":`dashed`}),l(i(D,{label:``},{default:d(()=>[e(`span`,null,r(h.$t(`console.message.doNotWantExtra`)),1),i(T,{type:`primary`,class:`btn btn-subscribe`,round:``,size:`small`,onClick:h.onSubscribe},{default:d(()=>[n(r(h.$t(`console.message.subscribe`)),1)]),_:1},8,[`onClick`])]),_:1},512),[[m,!1]])]),_:1})):a(``,!0):(p(),u(w,{key:2,description:h.$t(`common.message.noData`)},null,8,[`description`]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ge=N(ae,[[`render`,he],[`__scopeId`,`data-v-015815c7`]]);export{ge as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,j as u,mt as d,rt as f,tt as p,x as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,t as _}from"./form-BdKMEyCR.js";import{m as v,v as y}from"./models-yTQ4rqqP.js";import{t as b}from"./card-IQwqnRJR.js";import{n as x,r as S}from"./radio-BNhFzeBO.js";import{n as C,t as w}from"./row-ZP6dDlmT.js";import{t as T}from"./divider-Du_3kymg.js";import{t as E}from"./empty-C5KjRN0h.js";import{t as D}from"./skeleton-Dj_a_iIP.js";import{En as O,G as k,K as A,Mi as j,Mr as M,O as N,Pi as P,Sn as ee,Y as F,bn as I,fi as L,in as R,pr as z,wr as B,xn as V}from"./index-CBKO4rem.js";var H=h({name:`ApiPrice`,props:{price:{type:Number,required:!1,default:0},unit:{type:String,required:!1,default:void 0},start:{type:Boolean,required:!1,default:!1}},methods:{getPriceString:R}}),U={class:`price-text`},W={key:0,class:`unfree`},G={key:1,class:`free`};function K(e,t,n,i,a,s){return p(),o(`div`,U,[e.price>0?(p(),o(`span`,W,r(e.getPriceString({value:e.price}))+` `+r(e.unit?` / ${e.unit}`:``)+r(e.start?e.$t(`common.message.startPrice`):``),1)):(p(),o(`span`,G,r(e.$t(`common.message.free`)),1))])}var q=N(H,[[`render`,K],[`__scopeId`,`data-v-bb068181`]]),J=h({name:`ServiceEstimation`,components:{},props:{service:{type:Object,required:!0},package:{type:Object,required:!0}},methods:{getPriceString:R}}),Y={class:`estimation`},X={key:0,class:`item`},te={key:0},Z={key:1},Q={key:2},ne={key:0},re={key:1};function ie(e,t,i,c,l,u){return p(),o(`div`,Y,[(p(!0),o(s,null,f(e.service?.apis,(t,i)=>(p(),o(`div`,{key:i},[(p(!0),o(s,null,f(t?.estimation,(t,i)=>(p(),o(`div`,{key:i,class:`items`},[e.package?.amount&&t?.cost?(p(),o(`p`,X,[n(` ≈ `+r(t.name)+` `+r(Math.round(e.package.amount/t.cost))+` `+r(e.$t(`api.unit.count`))+` `,1),e.package.price>0?(p(),o(`span`,te,` - `+r(e.getPriceString({value:e.package.price/(e.package.amount/t.cost),fractionDigits:3})+` / `+e.$t(`api.unit.count`)),1)):a(``,!0),t.remark?(p(),o(`span`,Z,` (`+r(t.remark)+`) `,1)):a(``,!0),(t?.comparisons?.length??0)>0?(p(),o(`span`,Q,` - `)):a(``,!0),(p(!0),o(s,null,f(t?.comparisons,(t,n)=>(p(),o(`span`,{key:n,class:`comparison`},[t?.value<0?(p(),o(`i`,ne,r(e.$t(`api.message.cheaperThan`).replace(`$[[value]]`,t?.target?.toString()))+` `+r(Math.abs(t?.value)*100)+`% `,1)):a(``,!0),t?.value>0?(p(),o(`i`,re,r(e.$t(`api.message.moreExpensiveThan`).replace(`$[[value]]`,t?.target?.toString()))+` `+r(Math.abs(t?.value)*100)+`% `,1)):a(``,!0)]))),128))])):a(``,!0)]))),128))]))),128))])}var ae=h({name:`ConsoleApplicationBuy`,components:{ElSkeleton:D,ElRow:w,ElCol:C,ElCard:b,ElForm:_,ElFormItem:g,ElButton:P,ElDivider:T,ElEmpty:E,ElRadioGroup:S,ElRadioButton:x,ElTag:j,Price:q,ServiceEstimation:N(J,[[`render`,ie],[`__scopeId`,`data-v-768cf35f`]])},data(){return{lang:this.$i18n.locale,application:void 0,loading:!1,loadFailed:!1,type:v.USAGE,form:{packageId:void 0,amount:void 0},creating:!1}},computed:{applicationId(){return this.$route.params?.id?.toString()},id(){return this.$route.params?.id?.toString()},showPayment(){return!0},price(){return this.application?.service?.price&&this.form.amount?this.form.amount*this.application.service?.price:0},packages(){let e=this.application?.packages?.filter(e=>e.type===v.USAGE).sort((e,t)=>e.amount-t.amount)||[];return L()?e.filter(e=>!!e?.metadata?.apple_product_id):e},package(){if(this.packages&&this.form.packageId){let e=this.packages.filter(e=>e.id===this.form.packageId);if(e.length>0)return e[0]}},site(){return this.$store.getters.site},globalBuyTitle(){let e=this.$store.state.site?.title||`Ace Data Cloud`;return this.$t(`application.title.globalBuy`,{brand:e})},markupRatio(){return ee(this.application,this.site)},orderDiscountRate(){return L()?0:V(this.application)},pricingAvailable(){return this.markupRatio!==void 0&&this.orderDiscountRate!==void 0},displayPackagePrice(){return this.package&&this.markupRatio!==void 0?I(this.package.price,this.markupRatio):void 0},displayUnitPrice(){return this.package&&this.markupRatio!==void 0?I(this.package.price,this.markupRatio)/this.package.amount:void 0},displayFinalPrice(){if(!(this.displayPackagePrice===void 0||this.orderDiscountRate===void 0))return this.displayPackagePrice*(1-this.orderDiscountRate)},hasOrderDiscount(){return(this.orderDiscountRate??0)>0},discountPercent(){let e=(this.orderDiscountRate??0)*100;return Number.isInteger(e)?e.toFixed(0):e.toFixed(1)}},mounted(){if(O(this.$store.getters.site)){this.$router.replace({name:k});return}this.onFetchApplication()},methods:{getDiscount(e){return this.packages&&this.packages.length>0?this.lang?.startsWith(`zh`)?(10*e?.price/e?.amount/(this.packages[0].price/this.packages[0]?.amount)).toFixed(1)+`折`:Math.round(100-100*e?.price/e?.amount/(this.packages[0].price/this.packages[0]?.amount))+`% OFF`:``},onSubscribe(){this.$router.push({name:A,params:this.$route.params})},getPriceString:R,onFetchApplication(){this.loading=!0,this.loadFailed=!1,B.get(this.id).then(({data:e})=>{this.application=e,this.loading=!1,this.form.packageId=this.packages?.[0]?.id}).catch(()=>{this.loading=!1,this.loadFailed=!0})},onChangeType(){this.$router.push({name:A,params:this.$route.params})},onCreateOrder(){if(!this.application?.id||!this.pricingAvailable||!this.package)return;this.creating=!0;let e=this.$t(`service.unit.${this.application?.service?.unit}s`);M(`payment_initiated`,{service:this.application?.service?.alias,amount:this.package?.amount,package_id:this.package?.id,action:`extra`}),z.create({application_id:this.application?.id,amount:this.package?.amount,...this.form.packageId!==`custom`&&this.package?{package_id:this.package.id}:{},description:this.application?.service?`${this.application?.service?.title} x ${this.package?.amount} ${e}`:this.globalBuyTitle+` - `+this.package?.amount+` `+this.$t(`service.unit.credits`)}).then(({data:e})=>{this.creating=!1;let t=e;this.$router.push({name:F,params:{id:t.id}})}).catch(e=>{y.error(this.$t(`order.message.createFailed`)),this.creating=!1,M(`payment_failed`,{service:this.application?.service?.alias,action:`extra`,error:e?.response?.data?.error?.message??String(e)})})}}}),oe={class:`title`},se={key:1,class:`text-center`},ce={key:0},le={class:`text-[var(--el-text-color-secondary)] text-[12px] mb-3`},ue={key:0,class:`ml-2`},$={key:1,class:`text-[var(--el-text-color-secondary)]`},de={key:0,class:`final-price-block`},fe={class:`final-price-line`},pe={key:0,class:`discount-hint`},me={key:1,class:`text-[var(--el-text-color-secondary)]`};function he(h,g,_,v,y,b){let x=c(`el-col`),S=c(`el-row`),C=c(`el-skeleton`),w=c(`el-empty`),T=c(`el-button`),E=c(`el-divider`),D=c(`el-form-item`),O=c(`el-radio-button`),k=c(`el-radio-group`),A=c(`service-estimation`),j=c(`price`),M=c(`el-tag`),N=c(`el-form`),P=c(`el-card`);return p(),u(S,{class:`panel`},{default:d(()=>[i(x,{span:24},{default:d(()=>[i(S,null,{default:d(()=>[i(x,{span:24},{default:d(()=>[e(`h2`,oe,r(h.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(S,null,{default:d(()=>[i(x,{span:24},{default:d(()=>[i(P,{shadow:`hover`,class:`min-h-[500px]`},{default:d(()=>[i(S,null,{default:d(()=>[i(x,{xs:{span:22,offset:1},sm:{span:20,offset:2},md:{span:16,offset:4}},{default:d(()=>[h.loading?(p(),u(C,{key:0})):h.loadFailed?(p(),o(`div`,se,[i(w,{description:h.$t(`common.message.noData`)},null,8,[`description`]),i(T,{type:`primary`,round:``,onClick:h.onFetchApplication},{default:d(()=>[n(r(h.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):h.showPayment?h.application?(p(),u(N,{key:3,class:`purchase-form`,"label-width":`100px`},{default:d(()=>[h.application?.service?a(``,!0):(p(),o(`div`,ce,[e(`p`,le,r(h.$t(`application.message.globalBalanceBuyDescription`)),1),i(E,{"border-style":`dashed`})])),h.application?.service?(p(),u(D,{key:1,label:h.$t(`application.field.service`)},{default:d(()=>[n(r(h.application?.service?.title),1)]),_:1},8,[`label`])):(p(),u(D,{key:2,label:h.$t(`application.field.scope`)},{default:d(()=>[n(r(h.globalBuyTitle),1)]),_:1},8,[`label`])),i(D,{label:h.$t(`application.field.package`),class:`mb-0`},{default:d(()=>[h.packages.length>0?(p(),u(k,{key:0,modelValue:h.form.packageId,"onUpdate:modelValue":g[0]||=e=>h.form.packageId=e,class:`package-options`},{default:d(()=>[(p(!0),o(s,null,f(h.packages,(t,i)=>(p(),u(O,{key:i,label:t.id,class:`mb-2`},{default:d(()=>[l(e(`span`,{class:`corner`},r(h.getDiscount(t)),513),[[m,i!==0]]),n(` `+r(t.amount)+` `+r(h.$t(`service.unit.${h.application?.service?.unit||`credit`}s`)),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])):(p(),u(w,{key:1,description:h.$t(`common.message.noData`),"image-size":48},null,8,[`description`]))]),_:1},8,[`label`]),h.application?.service?.apis&&h.application?.service?.apis?.map(e=>e?.estimation).filter(e=>!!e)?.length>0?(p(),u(D,{key:3},{default:d(()=>[h.application?.service?(p(),u(A,{key:0,service:h.application.service,package:h.package},null,8,[`service`,`package`])):a(``,!0)]),_:1})):a(``,!0),i(D,{label:h.$t(`service.field.price`)},{default:d(()=>[h.package&&h.pricingAvailable?(p(),o(s,{key:0},[i(j,{price:h.displayPackagePrice},null,8,[`price`]),h.package?(p(),o(`span`,ue,`(`+r(h.getPriceString({value:h.displayUnitPrice})+` / `+h.$t(`service.unit.${h.application?.service?.unit||`credits`}`))+`) `,1)):a(``,!0)],64)):(p(),o(`span`,$,r(h.$t(`common.message.noData`)),1))]),_:1},8,[`label`]),i(E,{"border-style":`dashed`}),i(D,{label:h.$t(`application.field.shouldPayPrice`)},{default:d(()=>[h.displayFinalPrice===void 0?(p(),o(`span`,me,r(h.$t(`common.message.noData`)),1)):(p(),o(`div`,de,[e(`div`,fe,[e(`span`,{class:t({price:!0,unfree:h.displayFinalPrice>0,free:h.displayFinalPrice===0})},r(h.getPriceString({value:h.displayFinalPrice})),3),h.hasOrderDiscount?(p(),u(M,{key:0,class:`discount-tag`,effect:`light`,size:`small`,type:`success`},{default:d(()=>[n(r(h.$t(`order.message.discountTag`,{percent:h.discountPercent})),1)]),_:1})):a(``,!0)]),h.hasOrderDiscount?(p(),o(`p`,pe,r(h.$t(`order.message.discountHint`,{percent:h.discountPercent})),1)):a(``,!0)]))]),_:1},8,[`label`]),i(D,null,{default:d(()=>[h.showPayment?(p(),u(T,{key:0,type:`primary`,size:`large`,class:`btn-create`,loading:h.creating,disabled:!h.pricingAvailable||!h.package,round:``,onClick:h.onCreateOrder},{default:d(()=>[n(r(h.$t(`application.button.createOrder`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])):a(``,!0)]),_:1}),i(E,{"border-style":`dashed`}),l(i(D,{label:``},{default:d(()=>[e(`span`,null,r(h.$t(`console.message.doNotWantExtra`)),1),i(T,{type:`primary`,class:`btn btn-subscribe`,round:``,size:`small`,onClick:h.onSubscribe},{default:d(()=>[n(r(h.$t(`console.message.subscribe`)),1)]),_:1},8,[`onClick`])]),_:1},512),[[m,!1]])]),_:1})):a(``,!0):(p(),u(w,{key:2,description:h.$t(`common.message.noData`)},null,8,[`description`]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ge=N(ae,[[`render`,he],[`__scopeId`,`data-v-015815c7`]]);export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,M as r,N as i,at as a,ht as o,tt as s,x as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./progress-BuyYfFZn.js";import{t as d}from"./file-text-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,M as r,N as i,at as a,ht as o,tt as s,x as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./progress-BuyYfFZn.js";import{t as d}from"./file-text-pAkqd4ZQ.js";import{O as f,hn as p,vi as m}from"./index-CBKO4rem.js";var h=l({name:`FilePreview`,components:{CloseIcon:m,FileTextIcon:d,ElProgress:u},props:{name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:[`remove`],computed:{isUploading(){return typeof this.percentage==`number`&&this.percentage<100},displayPercentage(){return typeof this.percentage==`number`?this.percentage:0}},methods:{isImageUrl:p}}),g={class:`file cursor-pointer relative rounded-[10px] h-[50px] w-[250px] flex flex-row items-center justify-start bg-[var(--el-bg-color)]`},_={class:`left h-[50px] w-[50px] flex items-center justify-center`},v={class:`wrapper relative w-[35px] h-[35px] flex items-center justify-center rounded-[10px] text-white bg-[#10a37f] m-auto`},y={class:`right flex-1 h-[50px] flex items-center justify-start pl-[2px] text-[14px] text-[var(--el-text-color-primary)] truncate`},b={class:`text-xs font-bold truncate`},x=[`aria-label`,`title`];function S(l,u,d,f,p,m){let h=a(`file-text-icon`),S=a(`el-progress`),C=a(`close-icon`);return s(),i(`div`,g,[e(`div`,_,[e(`div`,v,[n(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),o(n(S,{type:`circle`,"stroke-width":3,percentage:l.displayPercentage,width:25,class:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[25px] h-[25px] z-[10] m-auto`},null,8,[`percentage`]),[[c,l.isUploading]])])]),e(`div`,y,[e(`span`,b,t(l.name),1)]),l.closable?(s(),i(`button`,{key:0,type:`button`,class:`close absolute cursor-pointer top-[5px] right-[5px] bg-[rgba(0,0,0,0.7)] text-white w-[15px] rounded-full h-[15px] flex text-[10px] text-center items-center justify-center`,"aria-label":l.$t(`common.button.close`),title:l.$t(`common.button.close`),onClick:u[0]||=e=>l.$emit(`remove`)},[n(C,{class:`icon icon-close`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,x)):r(``,!0)])}var C=f(h,[[`render`,S]]);export{C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,L as t,N as n,at as r,ht as i,it as a,mt as o,tt as s,x as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./drawer-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,L as t,N as n,at as r,ht as i,it as a,mt as o,tt as s,x as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./drawer-BYSZqwf9.js";import{t as d}from"./wand-sparkles-BLnx2H-s.js";import{O as f,Pi as p}from"./index-CBKO4rem.js";import{n as m}from"./taskDrawerMixin-DyAUhFEq.js";var h=l({name:`LayoutHailuo`,components:{MagicIcon:d,ElDrawer:u,ElButton:p},mixins:[m]}),g={class:`main flex flex-row flex-1`},_={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},v={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function y(l,u,d,f,p,m){let h=r(`magic-icon`),y=r(`el-button`),b=r(`el-drawer`);return s(),n(`div`,g,[e(`div`,_,[a(l.$slots,`config`,{},void 0,!0)]),e(`div`,v,[a(l.$slots,`result`,{},void 0,!0)]),i(t(y,{circle:``,class:`menu`,"aria-label":l.$t(`common.button.openMenu`),title:l.$t(`common.button.openMenu`),onClick:u[0]||=e=>l.drawer=!0},{default:o(()=>[t(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[c,!l.tasksEmpty]]),t(b,{modelValue:l.drawer,"onUpdate:modelValue":u[1]||=e=>l.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:o(()=>[a(l.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var b=f(h,[[`render`,y],[`__scopeId`,`data-v-185b4a95`]]);export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,at as r,ht as i,j as a,mt as o,ot as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{n as u,t as d}from"./table-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,at as r,ht as i,j as a,mt as o,ot as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{n as u,t as d}from"./table-C6EDCFOD.js";import{t as f}from"./card-IQwqnRJR.js";import{n as p,t as m}from"./row-ZP6dDlmT.js";import{O as h,in as g,lr as _}from"./index-CBKO4rem.js";import{t as v}from"./CopyToClipboard-BNiTrCI3.js";import{t as y}from"./pagination-DjJwgPO2.js";var b=l({name:`ConsoleDistributionList`,components:{Pagination:y,CopyToClipboard:v,ElRow:m,ElCol:p,ElTable:d,ElTableColumn:u,ElCard:f},data(){return{distributionHistories:[],distributionStatus:void 0,loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:g,onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchDistributionHistory()]).finally(()=>{this.loading=!1})},async onFetchDistributionHistory(){let{data:e}=await _.getAll({user_id:this.$store.getters.user.id,ordering:`-created_at`,limit:this.limit,offset:(this.page-1)*this.limit});this.distributionHistories=e.items,this.total=e.count}}}),x={class:`title`},S={class:`key`},C={class:`copy`},w={class:`key`},T={class:`copy`},E={class:`price`},D={class:`description`},O={class:`description`},k={class:`created-at`},A={class:`pagination m-v-lg`};function j(l,u,d,f,p,m){let h=r(`el-col`),g=r(`el-row`),_=r(`copy-to-clipboard`),v=r(`el-table-column`),y=r(`el-table`),b=r(`el-card`),j=r(`pagination`),M=s(`loading`);return c(),a(g,{class:`panel`},{default:o(()=>[n(h,{span:24},{default:o(()=>[n(g,null,{default:o(()=>[n(h,{span:24},{default:o(()=>[e(`h2`,x,t(l.$t(`common.title.distributionHistory`)),1)]),_:1})]),_:1}),n(g,null,{default:o(()=>[n(h,{span:24},{default:o(()=>[n(b,{shadow:`hover`},{default:o(()=>[i((c(),a(y,{data:l.distributionHistories,stripe:``},{default:o(()=>[n(v,{prop:`id`,label:l.$t(`distribution.field.id`),"class-name":`text-center`,width:`350px`},{default:o(r=>[e(`span`,S,t(r.row.id),1),e(`span`,C,[n(_,{content:r.row.id},null,8,[`content`])])]),_:1},8,[`label`]),n(v,{prop:`id`,label:l.$t(`distribution.field.userId`),"class-name":`text-center`,width:`350px`},{default:o(r=>[e(`span`,w,t(r.row.user_id),1),e(`span`,T,[n(_,{content:r.row.user_id},null,8,[`content`])])]),_:1},8,[`label`]),n(v,{label:l.$t(`distribution.field.price`),width:`100px`},{default:o(n=>[e(`span`,E,t(l.getPriceString({value:n.row?.price})),1)]),_:1},8,[`label`]),n(v,{label:l.$t(`distribution.field.reward`),width:`100px`},{default:o(n=>[e(`span`,D,t(l.getPriceString({value:n.row?.reward})),1)]),_:1},8,[`label`]),n(v,{label:l.$t(`distribution.field.percentage`),width:`120px`},{default:o(n=>[e(`span`,O,t(n.row.percentage)+`%`,1)]),_:1},8,[`label`]),n(v,{label:l.$t(`distribution.field.createdAt`),width:`200px`},{default:o(n=>[e(`span`,k,t(l.$dayjs.format(n.row.created_at)),1)]),_:1},8,[`label`])]),_:1},8,[`data`])),[[M,l.loading]])]),_:1})]),_:1})]),_:1}),n(g,null,{default:o(()=>[n(h,{span:10,offset:14},{default:o(()=>[e(`div`,A,[n(j,{"current-page":l.page,"page-size":l.limit,total:l.total,onChange:l.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])]),_:1})]),_:1})]),_:1})]),_:1})}var M=h(b,[[`render`,j],[`__scopeId`,`data-v-6a004666`]]);export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,L as n,M as r,N as i,at as a,ht as o,j as s,tt as c,x as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./progress-BuyYfFZn.js";import{O as f,vi as p,wi as m}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,L as n,M as r,N as i,at as a,ht as o,j as s,tt as c,x as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./progress-BuyYfFZn.js";import{O as f,vi as p,wi as m}from"./index-CBKO4rem.js";var h=u({name:`ImagePreview`,components:{CloseIcon:p,ElProgress:d,ElImageViewer:m},props:{url:{type:String,required:!0},name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:[`remove`],data(){return{showViewer:!1}},computed:{isUploading(){return typeof this.percentage==`number`&&this.percentage<100},displayPercentage(){return typeof this.percentage==`number`?this.percentage:0}},methods:{onPreview(){this.isUploading||!this.url||(this.showViewer=!0)}}}),g={class:`image w-[50px] h-[50px] relative rounded-[var(--el-border-radius-base)] overflow-hidden shadow-sm bg-[var(--el-fill-color-lighter)]`},_=[`src`,`alt`],v={class:`overlay absolute inset-0 bg-[var(--el-mask-color)] backdrop-blur-[1px]`},y=[`aria-label`,`title`];function b(u,d,f,p,m,h){let b=a(`el-image-viewer`),x=a(`el-progress`),S=a(`close-icon`);return c(),i(`div`,g,[e(`img`,{class:`w-full h-full object-cover cursor-zoom-in`,src:u.url,alt:u.name,onClick:d[0]||=t((...e)=>u.onPreview&&u.onPreview(...e),[`stop`])},null,8,_),u.showViewer?(c(),s(b,{key:0,"url-list":[u.url],teleported:``,"hide-on-click-modal":``,onClose:d[1]||=e=>u.showViewer=!1},null,8,[`url-list`])):r(``,!0),o(e(`div`,v,null,512),[[l,u.isUploading]]),o(n(x,{type:`circle`,"stroke-width":4,percentage:u.displayPercentage,width:34,class:`absolute inset-0 z-[10] flex items-center justify-center text-[12px]`},null,8,[`percentage`]),[[l,u.isUploading]]),u.closable?(c(),i(`button`,{key:1,type:`button`,class:`close absolute cursor-pointer top-[4px] right-[4px] bg-[rgba(0,0,0,0.65)] text-white w-[16px] h-[16px] rounded-full flex text-[10px] text-center items-center justify-center hover:bg-[rgba(0,0,0,0.8)]`,"aria-label":u.$t(`common.button.close`),title:u.$t(`common.button.close`),onClick:d[2]||=t(e=>u.$emit(`remove`),[`stop`])},[n(S,{class:`icon icon-close`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,y)):r(``,!0)])}var x=f(h,[[`render`,b]]);export{x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{C as e,I as t,Jt as n,M as r,N as i,at as a,j as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{O as u,Pi as d,wi as f}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{C as e,I as t,Jt as n,M as r,N as i,at as a,j as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{O as u,Pi as d,wi as f}from"./index-CBKO4rem.js";var p=l({name:`ImageWrapper`,components:{ElButton:d,ElImageViewer:f},props:{src:{type:String,required:!0},rawSrc:{type:String,required:!1,default:void 0}},data(){return{showViewer:!1,displaySrc:this.src}},watch:{src(e){this.displaySrc=e}},methods:{onOpenUrl(e){window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;this.displaySrc=n.toString()}}}),m={class:`image-wrapper`},h=[`src`];function g(l,u,d,f,p,g){let _=a(`el-button`),v=a(`el-image-viewer`);return c(),i(`div`,m,[l.displaySrc?(c(),i(`img`,{key:0,src:l.displaySrc,class:`image cursor-zoom-in`,onError:u[0]||=(...e)=>l.onReload&&l.onReload(...e),onClick:u[1]||=e=>l.showViewer=!0},null,40,h)):r(``,!0),l.rawSrc?(c(),o(_,{key:1,type:`info`,round:``,class:`btn-raw`,onClick:u[2]||=e(e=>l.onOpenUrl(l.rawSrc),[`stop`])},{default:s(()=>[t(n(l.$t(`common.button.seeRawImage`)),1)]),_:1})):r(``,!0),l.showViewer?(c(),o(v,{key:2,"url-list":[l.rawSrc||l.displaySrc],teleported:``,"hide-on-click-modal":``,onClose:u[3]||=e=>l.showViewer=!1},null,8,[`url-list`])):r(``,!0)])}var _=u(p,[[`render`,g],[`__scopeId`,`data-v-1207ba3e`]]);export{_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-BngN7c-y.js";import{t as y}from"./tooltip-CPF0ns2F.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-OSW29aqo.js";import{t as C}from"./drawer-CKa-RvLj.js";import{t as w}from"./switch-B8KB4C7k.js";import{t as T}from"./clock-D1-Kt6-f.js";import{a as E,c as D,n as O,o as k,r as A,t as j}from"./pagination-CyddWiCJ.js";import{t as M}from"./info-B1cNmQ-o.js";import{t as N}from"./trash-2-CO44aulg.js";import{t as ee}from"./triangle-alert-QijY2HDu.js";import{t as P}from"./upload-B9LBkWpk.js";import{t as F}from"./wand-sparkles-BxwmnK2z.js";import"./constants-DQjc0Ctr.js";import{$t as I,O as L,Pi as R,Qt as z,Zt as te,ar as ne,bi as B,en as V,fn as H,jr as U,oi as W,qt as G,rn as K,tn as q}from"./index-CD2-hqNW.js";import{t as J}from"./CopyToClipboard-DVZZKKIn.js";import{t as Y}from"./ReportButton-bTSHZewr.js";import{t as X}from"./FilePreview-B6I6kKaC.js";import{t as Z}from"./ImagePreview-BnDg8SMo.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-N9Abtlt1.js";import{t as Q}from"./VideoPlayer-B5wPvH-Y.js";import{t as ae}from"./ApiCodeButton-CWiYAicH.js";import{t as oe}from"./BotPlaceholder-BHQueIfj.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:F,ElDrawer:C,ElButton:R},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ce,[e(`div`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:P,ElUpload:v,ElButton:R,InfoIcon:k,FilePreview:X},mixins:[V,z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:F,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:R,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return K(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:N,ChannelIcon:D,InfoIcon:M,MagicIcon:F,TimeIcon:T,WarningIcon:ee,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:R,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await B.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:A,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await j({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!H())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,ne.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-Cjls2phY.js";import{t as y}from"./tooltip-PVpDuzzH.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-yTQ4rqqP.js";import{t as C}from"./drawer-BYSZqwf9.js";import{t as w}from"./switch-DsYeNq-3.js";import{t as T}from"./clock-ChX1xgIa.js";import{a as E,c as D,n as O,o as k,r as A,t as j}from"./pagination-KA1ofG-e.js";import{t as M}from"./info-DrWjfo9Y.js";import{t as N}from"./trash-2-CQLSuQ3X.js";import{t as ee}from"./triangle-alert-ClpR6g4l.js";import{t as P}from"./upload-KOO0FgHZ.js";import{t as F}from"./wand-sparkles-BLnx2H-s.js";import"./constants-CzYWUlOY.js";import{$t as I,O as L,Pi as R,Qt as z,Zt as te,ar as ne,bi as B,en as V,fn as H,jr as U,oi as W,qt as G,rn as K,tn as q}from"./index-CBKO4rem.js";import{t as J}from"./CopyToClipboard-BNiTrCI3.js";import{t as Y}from"./ReportButton-BW2lfho9.js";import{t as X}from"./FilePreview--zEyXqDR.js";import{t as Z}from"./ImagePreview-D_V9IWmn.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-BV9bmqJy.js";import{t as Q}from"./VideoPlayer-DB6PHZeD.js";import{t as ae}from"./ApiCodeButton-c4MVRYWA.js";import{t as oe}from"./BotPlaceholder-BX5DiQGy.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:F,ElDrawer:C,ElButton:R},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ce,[e(`div`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:P,ElUpload:v,ElButton:R,InfoIcon:k,FilePreview:X},mixins:[V,z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:F,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:R,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return K(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:N,ChannelIcon:D,InfoIcon:M,MagicIcon:F,TimeIcon:T,WarningIcon:ee,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:R,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await B.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:A,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await j({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!H())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,ne.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-3zeZnDWr.js";import{n as S,t as C}from"./tabs-CPEEm64y.js";import{t as w}from"./tooltip-CPF0ns2F.js";import{v as T}from"./models-OSW29aqo.js";import{n as E,r as D,t as O}from"./dropdown-cV8wOdWz.js";import{t as k}from"./pagination-DXXXQ5cp.js";import{t as A}from"./switch-B8KB4C7k.js";import{t as j}from"./arrow-down-B_frOIPC.js";import{t as M}from"./arrow-left-CJ0n8LA_.js";import{t as N}from"./book-open-BJrmFN4r.js";import{t as P}from"./chevron-down-C9iuUElc.js";import{t as F}from"./chevron-right-CF0ttnXF.js";import{t as I}from"./circle-check-CI_AaSn_.js";import{t as L}from"./circle-question-mark-UZBen5vb.js";import{t as ee}from"./clipboard-list-DGrwWttH.js";import{t as te}from"./code-C_2s4NTL.js";import{t as R}from"./copy-C20Z1lQD.js";import{t as ne}from"./ellipsis-BU0uayKw.js";import{t as re}from"./eye-CzKIbV3W.js";import{t as ie}from"./file-text-BLdKFglG.js";import{t as z}from"./file-B_liOBtz.js";import{t as B}from"./folder-NsgWKb6i.js";import{t as ae}from"./image-D9EEgt17.js";import{t as oe}from"./lock-DAPZQEW-.js";import{t as V}from"./plus-B_IO_O6G.js";import{n as se,t as ce}from"./store-Jc8QTABa.js";import{t as le}from"./search-DxOwIk71.js";import{t as ue}from"./trash-2-CO44aulg.js";import{t as de}from"./triangle-alert-QijY2HDu.js";import{t as fe}from"./upload-B9LBkWpk.js";import{t as pe}from"./wand-sparkles-BxwmnK2z.js";import{Hi as H,Mi as me,O as U,Pi as W,Ti as G,Tr as K,ai as he,bi as ge,di as _e,fi as ve,gi as ye,si as be,ui as xe,xi as q,yi as J}from"./index-CD2-hqNW.js";import{a as Se,c as Ce,d as we,f as Te,i as Ee,l as De,m as Y,n as Oe,o as ke,p as Ae,r as je,s as Me,t as Ne,u as Pe}from"./vendor-highlight-BHrfT4-E.js";import{t as Fe}from"./index.es-Ds-FIqsY.js";import{t as Ie}from"./VueMarkdown-CiiRjbWs.js";import{t as Le}from"./PageHeader-RatwVDYh.js";var Re=J(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),ze=J(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Be=J(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Ve=J(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),He=J(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${he()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return K.get(`/${this.key}/`,X())}async get(e){return K.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return K.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),K.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return K.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return K.delete(`/${this.key}/${e}/`,X())}async enable(e){return K.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return K.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await K.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return K.get(`/${this.key}/`,{...X(),params:e})}async get(e){return K.get(`/${this.key}/${e}/`,X())}async categories(){return K.get(`/${this.key}/categories/`,X())}async install(e,t={}){return K.post(`/${this.key}/${e}/install/`,t,X())}};function Ue(){let e=new Set;_e()&&e.add(`desktop`),ve()&&e.add(`ios`),xe()&&e.add(`android`),ye()&&e.add(`web`);let t=be();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ve()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var We=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ge(e){let t=e.filter(e=>We.has(e));if(!t.length)return!0;let n=Ue();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,Ae),Y.registerLanguage(`json`,Te),Y.registerLanguage(`markdown`,we),Y.registerLanguage(`python`,Pe),Y.registerLanguage(`shell`,De),Y.registerLanguage(`yaml`,Ce),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var Ke=12,qe=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Ie,ElDialog:G,ElInput:H,ElButton:W,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Fe,AddIcon:V,BackIcon:M,DownIcon:j,InstallIcon:Re,LockIcon:oe,SearchIcon:le,SuccessIcon:I},directives:{loading:q},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return Ke},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ge(this.restrictedSurfaces(e))}}}),Je={class:`directory`},Ye={class:`directory-main`},Xe={class:`directory-header`},Ze={class:`directory-controls`},Qe={class:`directory-grid-wrapper`},$e={key:0,class:`directory-empty`},et={key:1,class:`directory-grid`},tt=[`onClick`],nt={class:`directory-card-head`},rt={class:`directory-card-title`},it=[`title`],at=[`title`],ot=[`aria-label`,`title`,`onClick`],st=[`title`],ct={class:`directory-card-meta`},lt={class:`directory-card-publisher`},ut={key:0,class:`directory-card-count`},dt=[`title`],ft={class:`directory-card-desc`},pt={key:0,class:`directory-footer`},mt={class:`directory-detail-head`},ht={class:`directory-detail-actions`},gt=[`href`],_t={class:`directory-detail-body`},vt={class:`directory-detail-title`},yt={class:`directory-detail-meta`},bt={key:0},xt={key:1},St=[`title`],Ct={class:`directory-detail-desc`};function wt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Je,[e(`main`,Ye,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,mt,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,ht,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,gt)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,_t,[e(`h2`,vt,`/`+i(u.selectedItem.slug),1),e(`div`,yt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,bt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,xt,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,St)):o(``,!0)]),e(`p`,Ct,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Xe,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Ze,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,Qe,[!u.loading&&u.total===0?(v(),s(`p`,$e,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,et,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,nt,[e(`span`,rt,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,it)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st))]),e(`div`,ct,[e(`span`,lt,i(c.publisher),1),c.install_count>0?(v(),s(`span`,ut,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,dt)):o(``,!0)]),e(`p`,ft,i(c.description),1)],10,tt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,pt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Tt=U(qe,[[`render`,wt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,Ae),Y.registerLanguage(`css`,Me),Y.registerLanguage(`go`,ke),Y.registerLanguage(`javascript`,Se),Y.registerLanguage(`json`,Te),Y.registerLanguage(`markdown`,we),Y.registerLanguage(`python`,Pe),Y.registerLanguage(`rust`,Ee),Y.registerLanguage(`shell`,De),Y.registerLanguage(`sql`,je),Y.registerLanguage(`typescript`,Oe),Y.registerLanguage(`xml`,Ne),Y.registerLanguage(`html`,Ne),Y.registerLanguage(`yaml`,Ce),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Et(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Dt(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var Ot=y({name:`SkillFilePreview`,components:{ElButton:W,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:Ve,ViewIcon:re,WarningIcon:de,VueMarkdown:Ie},directives:{loading:q},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1}},computed:{kind(){return this.path?Et(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Dt(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Et(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),kt={class:`preview-root`},At={class:`toolbar`},jt={class:`path-display`},Mt={key:0,class:`size-display`},Nt={class:`body`},Pt={key:0,class:`error`},Ft=[`srcdoc`],It={key:3,class:`image-pane`},Lt=[`src`,`alt`],Rt={key:4,class:`binary`},zt=[`placeholder`],Bt={key:6,class:`source-pane`},Vt={key:7,class:`truncated-warning`};function Ht(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`copy-icon`),C=l(`el-tooltip`),w=l(`view-icon`),T=l(`el-tab-pane`),E=l(`code-icon`),D=l(`el-tabs`),O=l(`warning-icon`),k=l(`vue-markdown`),A=l(`file-icon`),j=m(`loading`);return d((v(),s(`div`,kt,[e(`div`,At,[e(`span`,jt,i(t.path||`—`),1),t.size?(v(),s(`span`,Mt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(C,{content:t.$t(`skill.preview.copy`),placement:`bottom`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.$t(`skill.preview.copy`),title:t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[a(S,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])]),t.canRender?(v(),f(D,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(T,{name:`rendered`},{label:p(()=>[a(w,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(T,{name:`source`},{label:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Nt,[t.error?(v(),s(`div`,Pt,[a(O,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(k,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,Ft)):t.kind===`image`?(v(),s(`div`,It,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Lt)])):t.kind===`binary`?(v(),s(`div`,Rt,[a(A,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,zt)),[[u,t.textContent]]):(v(),s(`pre`,Bt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Vt,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[j,t.loading]])}var Ut=U(Ot,[[`render`,Ht],[`__scopeId`,`data-v-ec0a447e`]]),Wt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Gt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function Kt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Gt.has(n)?ae:Wt.has(n)?Be:z}function qt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Jt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Fe},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?Kt(e.path):B},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Yt=[`aria-label`,`title`],Xt={key:1,class:`node-chevron-spacer`},Zt={class:`node-label`},Qt={key:0,class:`children`};function $t(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Xt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Yt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Zt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,Qt,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var en=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:se,FileNode:U(Jt,[[`render`,$t],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return qt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),tn={class:`skill-row-wrapper`},nn=[`aria-label`,`title`],rn={key:1,class:`row-chevron-spacer`},an=[`title`],on={key:0,class:`file-list`};function sn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,tn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,nn)):(v(),s(`span`,rn)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,an)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,on,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var cn=U(en,[[`render`,sn],[`__scopeId`,`data-v-231c2ce1`]]),ln=10*1024*1024,un=/\.(tar\.gz|tgz|tar|zip|md)$/i,dn=y({name:`UploadSkillDialog`,components:{ElDialog:G,ElButton:W,AddFileIcon:He,CloudUploadIcon:ze},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>ln){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!un.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),fn={key:0,class:`dropzone-hint`},pn={key:1,class:`dropzone-file`},mn={class:`dropzone-file-name`},hn={class:`dropzone-file-size`},gn={class:`requirements`},_n={class:`requirements-title`};function vn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`skill.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,pn,[e(`span`,mn,i(o.file.name),1),e(`span`,hn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,fn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,gn,[e(`p`,_n,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var yn=U(dn,[[`render`,vn],[`__scopeId`,`data-v-01ead824`]]),bn=y({name:`WriteSkillDialog`,components:{ElDialog:G,ElButton:W,ElInput:H,CloudUploadIcon:ze},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),xn={class:`hint`};function Sn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`skill.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,xn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var Cn=y({name:`UserSkills`,components:{ConsolePageHeader:Le,ElInput:H,ElSwitch:A,ElTag:me,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:V,AiCreateIcon:pe,DeleteIcon:ue,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:ce,MoreIcon:ne,SearchIcon:le,SkillIcon:se,UploadIcon:fe,WriteIcon:ee,BrowseSkillsDialog:Tt,SkillFilePreview:Ut,SkillRow:cn,UploadSkillDialog:yn,WriteSkillDialog:U(bn,[[`render`,Sn],[`__scopeId`,`data-v-f39aab5d`]])},directives:{loading:q},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await ge.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`skill.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),wn={class:`skills-page`},Tn={class:`skills-shell`},En={class:`left-pane`},Dn={class:`left-header`},On=[`aria-label`,`title`],kn={class:`submenu-trigger`},An={class:`badge-soon`},jn={class:`left-body`},Mn={class:`section`},Nn={key:0,class:`skill-list`},Pn={key:0,class:`empty-row`},Fn={key:0,class:`section`},In={key:0,class:`skill-list`},Ln={class:`right-pane`},Rn={class:`right-header`},zn={class:`right-title`},Bn={class:`right-actions`},Vn=[`aria-label`,`title`],Hn={class:`meta-card`},Un={class:`meta-grid`},Wn={class:`meta-cell`},Gn={class:`meta-label`},Kn={class:`meta-value`},qn={class:`meta-cell`},Jn={class:`meta-label`},Yn={class:`meta-value`},Xn={key:0,class:`meta-cell`},Zn={class:`meta-label`},Qn={class:`meta-tags`},$n={key:0,class:`meta-description`},er={class:`meta-description-label`},tr={class:`meta-label`},nr={class:`preview-card`},rr={key:2,class:`right-empty`};function ir(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),B=m(`loading`);return v(),s(`div`,wn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,Tn,[e(`aside`,En,[e(`header`,Dn,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,An,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,kn,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,On)]),_:1})]),d((v(),s(`div`,jn,[e(`section`,Mn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Nn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Pn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,Fn,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,In,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[B,t.loading]])]),e(`main`,Ln,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,Rn,[e(`h3`,zn,i(t.selectedSkill.slug),1),e(`div`,Bn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Vn)]),_:1}))])]),e(`div`,Hn,[e(`div`,Un,[e(`div`,Wn,[e(`span`,Gn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,Kn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,qn,[e(`span`,Jn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Yn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Xn,[e(`span`,Zn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,Qn,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,$n,[e(`div`,er,[e(`span`,tr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,nr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,rr,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var ar=U(Cn,[[`render`,ir],[`__scopeId`,`data-v-e3209347`]]);export{ar as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-By5KXS1U.js";import{n as S,t as C}from"./tabs-CEdTUVdB.js";import{t as w}from"./tooltip-PVpDuzzH.js";import{v as T}from"./models-yTQ4rqqP.js";import{n as E,r as D,t as O}from"./dropdown-6s0Ah2n3.js";import{t as k}from"./pagination-BySJ8ZVa.js";import{t as A}from"./switch-DsYeNq-3.js";import{t as j}from"./arrow-down-I1uQV181.js";import{t as M}from"./arrow-left-Cu2n5LPM.js";import{t as N}from"./book-open-bWuEfgUg.js";import{t as P}from"./chevron-down-YIB0Ajqi.js";import{t as F}from"./chevron-right-Db5wwR3e.js";import{t as I}from"./circle-check-C-zk7SxT.js";import{t as L}from"./circle-question-mark-CCZotCPz.js";import{t as ee}from"./clipboard-list-CG8tLDrt.js";import{t as te}from"./code-CKi9ZKH0.js";import{t as R}from"./copy-Bm54uK0_.js";import{t as ne}from"./ellipsis-DWEyfGX3.js";import{t as re}from"./eye-BsXbhBKz.js";import{t as ie}from"./file-text-pAkqd4ZQ.js";import{t as z}from"./file-C8lcsbIr.js";import{t as B}from"./folder-B-gZBejm.js";import{t as ae}from"./image-BsqAN2U9.js";import{t as oe}from"./lock-BHtf5Lm2.js";import{t as V}from"./plus-padNMCLo.js";import{n as se,t as ce}from"./store-B77iF5fz.js";import{t as le}from"./search-DPHPWb6w.js";import{t as ue}from"./trash-2-CQLSuQ3X.js";import{t as de}from"./triangle-alert-ClpR6g4l.js";import{t as fe}from"./upload-KOO0FgHZ.js";import{t as pe}from"./wand-sparkles-BLnx2H-s.js";import{Hi as H,Mi as me,O as U,Pi as W,Ti as G,Tr as K,ai as he,bi as ge,di as _e,fi as ve,gi as ye,si as be,ui as xe,xi as q,yi as J}from"./index-CBKO4rem.js";import{a as Se,c as Ce,d as we,f as Te,i as Ee,l as De,m as Y,n as Oe,o as ke,p as Ae,r as je,s as Me,t as Ne,u as Pe}from"./vendor-highlight-BHrfT4-E.js";import{t as Fe}from"./index.es-Ckkoz2gg.js";import{t as Ie}from"./VueMarkdown-CiiRjbWs.js";import{t as Le}from"./PageHeader-CZBqZXqm.js";var Re=J(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),ze=J(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Be=J(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Ve=J(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),He=J(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${he()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return K.get(`/${this.key}/`,X())}async get(e){return K.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return K.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),K.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return K.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return K.delete(`/${this.key}/${e}/`,X())}async enable(e){return K.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return K.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await K.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return K.get(`/${this.key}/`,{...X(),params:e})}async get(e){return K.get(`/${this.key}/${e}/`,X())}async categories(){return K.get(`/${this.key}/categories/`,X())}async install(e,t={}){return K.post(`/${this.key}/${e}/install/`,t,X())}};function Ue(){let e=new Set;_e()&&e.add(`desktop`),ve()&&e.add(`ios`),xe()&&e.add(`android`),ye()&&e.add(`web`);let t=be();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ve()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var We=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ge(e){let t=e.filter(e=>We.has(e));if(!t.length)return!0;let n=Ue();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,Ae),Y.registerLanguage(`json`,Te),Y.registerLanguage(`markdown`,we),Y.registerLanguage(`python`,Pe),Y.registerLanguage(`shell`,De),Y.registerLanguage(`yaml`,Ce),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var Ke=12,qe=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Ie,ElDialog:G,ElInput:H,ElButton:W,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Fe,AddIcon:V,BackIcon:M,DownIcon:j,InstallIcon:Re,LockIcon:oe,SearchIcon:le,SuccessIcon:I},directives:{loading:q},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return Ke},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ge(this.restrictedSurfaces(e))}}}),Je={class:`directory`},Ye={class:`directory-main`},Xe={class:`directory-header`},Ze={class:`directory-controls`},Qe={class:`directory-grid-wrapper`},$e={key:0,class:`directory-empty`},et={key:1,class:`directory-grid`},tt=[`onClick`],nt={class:`directory-card-head`},rt={class:`directory-card-title`},it=[`title`],at=[`title`],ot=[`aria-label`,`title`,`onClick`],st=[`title`],ct={class:`directory-card-meta`},lt={class:`directory-card-publisher`},ut={key:0,class:`directory-card-count`},dt=[`title`],ft={class:`directory-card-desc`},pt={key:0,class:`directory-footer`},mt={class:`directory-detail-head`},ht={class:`directory-detail-actions`},gt=[`href`],_t={class:`directory-detail-body`},vt={class:`directory-detail-title`},yt={class:`directory-detail-meta`},bt={key:0},xt={key:1},St=[`title`],Ct={class:`directory-detail-desc`};function wt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Je,[e(`main`,Ye,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,mt,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,ht,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,gt)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,_t,[e(`h2`,vt,`/`+i(u.selectedItem.slug),1),e(`div`,yt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,bt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,xt,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,St)):o(``,!0)]),e(`p`,Ct,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Xe,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Ze,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,Qe,[!u.loading&&u.total===0?(v(),s(`p`,$e,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,et,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,nt,[e(`span`,rt,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,it)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st))]),e(`div`,ct,[e(`span`,lt,i(c.publisher),1),c.install_count>0?(v(),s(`span`,ut,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,dt)):o(``,!0)]),e(`p`,ft,i(c.description),1)],10,tt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,pt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Tt=U(qe,[[`render`,wt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,Ae),Y.registerLanguage(`css`,Me),Y.registerLanguage(`go`,ke),Y.registerLanguage(`javascript`,Se),Y.registerLanguage(`json`,Te),Y.registerLanguage(`markdown`,we),Y.registerLanguage(`python`,Pe),Y.registerLanguage(`rust`,Ee),Y.registerLanguage(`shell`,De),Y.registerLanguage(`sql`,je),Y.registerLanguage(`typescript`,Oe),Y.registerLanguage(`xml`,Ne),Y.registerLanguage(`html`,Ne),Y.registerLanguage(`yaml`,Ce),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Et(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Dt(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var Ot=y({name:`SkillFilePreview`,components:{ElButton:W,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:Ve,ViewIcon:re,WarningIcon:de,VueMarkdown:Ie},directives:{loading:q},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1}},computed:{kind(){return this.path?Et(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Dt(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Et(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),kt={class:`preview-root`},At={class:`toolbar`},jt={class:`path-display`},Mt={key:0,class:`size-display`},Nt={class:`body`},Pt={key:0,class:`error`},Ft=[`srcdoc`],It={key:3,class:`image-pane`},Lt=[`src`,`alt`],Rt={key:4,class:`binary`},zt=[`placeholder`],Bt={key:6,class:`source-pane`},Vt={key:7,class:`truncated-warning`};function Ht(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`copy-icon`),C=l(`el-tooltip`),w=l(`view-icon`),T=l(`el-tab-pane`),E=l(`code-icon`),D=l(`el-tabs`),O=l(`warning-icon`),k=l(`vue-markdown`),A=l(`file-icon`),j=m(`loading`);return d((v(),s(`div`,kt,[e(`div`,At,[e(`span`,jt,i(t.path||`—`),1),t.size?(v(),s(`span`,Mt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(C,{content:t.$t(`skill.preview.copy`),placement:`bottom`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.$t(`skill.preview.copy`),title:t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[a(S,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])]),t.canRender?(v(),f(D,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(T,{name:`rendered`},{label:p(()=>[a(w,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(T,{name:`source`},{label:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Nt,[t.error?(v(),s(`div`,Pt,[a(O,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(k,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,Ft)):t.kind===`image`?(v(),s(`div`,It,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Lt)])):t.kind===`binary`?(v(),s(`div`,Rt,[a(A,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,zt)),[[u,t.textContent]]):(v(),s(`pre`,Bt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Vt,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[j,t.loading]])}var Ut=U(Ot,[[`render`,Ht],[`__scopeId`,`data-v-ec0a447e`]]),Wt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Gt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function Kt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Gt.has(n)?ae:Wt.has(n)?Be:z}function qt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Jt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Fe},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?Kt(e.path):B},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Yt=[`aria-label`,`title`],Xt={key:1,class:`node-chevron-spacer`},Zt={class:`node-label`},Qt={key:0,class:`children`};function $t(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Xt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Yt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Zt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,Qt,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var en=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:se,FileNode:U(Jt,[[`render`,$t],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return qt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),tn={class:`skill-row-wrapper`},nn=[`aria-label`,`title`],rn={key:1,class:`row-chevron-spacer`},an=[`title`],on={key:0,class:`file-list`};function sn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,tn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,nn)):(v(),s(`span`,rn)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,an)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,on,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var cn=U(en,[[`render`,sn],[`__scopeId`,`data-v-231c2ce1`]]),ln=10*1024*1024,un=/\.(tar\.gz|tgz|tar|zip|md)$/i,dn=y({name:`UploadSkillDialog`,components:{ElDialog:G,ElButton:W,AddFileIcon:He,CloudUploadIcon:ze},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>ln){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!un.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),fn={key:0,class:`dropzone-hint`},pn={key:1,class:`dropzone-file`},mn={class:`dropzone-file-name`},hn={class:`dropzone-file-size`},gn={class:`requirements`},_n={class:`requirements-title`};function vn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`skill.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,pn,[e(`span`,mn,i(o.file.name),1),e(`span`,hn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,fn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,gn,[e(`p`,_n,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var yn=U(dn,[[`render`,vn],[`__scopeId`,`data-v-01ead824`]]),bn=y({name:`WriteSkillDialog`,components:{ElDialog:G,ElButton:W,ElInput:H,CloudUploadIcon:ze},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),xn={class:`hint`};function Sn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`skill.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,xn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var Cn=y({name:`UserSkills`,components:{ConsolePageHeader:Le,ElInput:H,ElSwitch:A,ElTag:me,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:V,AiCreateIcon:pe,DeleteIcon:ue,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:ce,MoreIcon:ne,SearchIcon:le,SkillIcon:se,UploadIcon:fe,WriteIcon:ee,BrowseSkillsDialog:Tt,SkillFilePreview:Ut,SkillRow:cn,UploadSkillDialog:yn,WriteSkillDialog:U(bn,[[`render`,Sn],[`__scopeId`,`data-v-f39aab5d`]])},directives:{loading:q},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await ge.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`skill.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),wn={class:`skills-page`},Tn={class:`skills-shell`},En={class:`left-pane`},Dn={class:`left-header`},On=[`aria-label`,`title`],kn={class:`submenu-trigger`},An={class:`badge-soon`},jn={class:`left-body`},Mn={class:`section`},Nn={key:0,class:`skill-list`},Pn={key:0,class:`empty-row`},Fn={key:0,class:`section`},In={key:0,class:`skill-list`},Ln={class:`right-pane`},Rn={class:`right-header`},zn={class:`right-title`},Bn={class:`right-actions`},Vn=[`aria-label`,`title`],Hn={class:`meta-card`},Un={class:`meta-grid`},Wn={class:`meta-cell`},Gn={class:`meta-label`},Kn={class:`meta-value`},qn={class:`meta-cell`},Jn={class:`meta-label`},Yn={class:`meta-value`},Xn={key:0,class:`meta-cell`},Zn={class:`meta-label`},Qn={class:`meta-tags`},$n={key:0,class:`meta-description`},er={class:`meta-description-label`},tr={class:`meta-label`},nr={class:`preview-card`},rr={key:2,class:`right-empty`};function ir(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),B=m(`loading`);return v(),s(`div`,wn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,Tn,[e(`aside`,En,[e(`header`,Dn,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,An,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,kn,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,On)]),_:1})]),d((v(),s(`div`,jn,[e(`section`,Mn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Nn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Pn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,Fn,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,In,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[B,t.loading]])]),e(`main`,Ln,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,Rn,[e(`h3`,zn,i(t.selectedSkill.slug),1),e(`div`,Bn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Vn)]),_:1}))])]),e(`div`,Hn,[e(`div`,Un,[e(`div`,Wn,[e(`span`,Gn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,Kn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,qn,[e(`span`,Jn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Yn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Xn,[e(`span`,Zn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,Qn,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,$n,[e(`div`,er,[e(`span`,tr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,nr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,rr,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var ar=U(Cn,[[`render`,ir],[`__scopeId`,`data-v-e3209347`]]);export{ar as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-3zeZnDWr.js";import{t as b}from"./upload-BngN7c-y.js";import{t as x}from"./tooltip-CPF0ns2F.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-OSW29aqo.js";import{t as T}from"./drawer-CKa-RvLj.js";import{t as E}from"./input-number-D6pYNASF.js";import{t as D}from"./slider-WaUKHi3z.js";import{t as O}from"./clock-D1-Kt6-f.js";import{a as k,c as A,n as j,o as M,r as N,t as P}from"./pagination-CyddWiCJ.js";import{t as F}from"./info-B1cNmQ-o.js";import{t as ee}from"./trash-2-CO44aulg.js";import{t as te}from"./triangle-alert-QijY2HDu.js";import{t as I}from"./upload-B9LBkWpk.js";import{t as L}from"./wand-sparkles-BxwmnK2z.js";import{dr as R,fr as z,ur as B}from"./constants-DQjc0Ctr.js";import{$t as V,O as H,Pi as U,Qt as W,Xn as G,Zt as K,bi as q,en as J,fn as Y,jr as X,oi as Z,qt as Q,rn as ne,tn as re}from"./index-CD2-hqNW.js";import{t as ie}from"./CopyToClipboard-DVZZKKIn.js";import{t as ae}from"./ReportButton-bTSHZewr.js";import{t as oe}from"./ImagePreview-BnDg8SMo.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-N9Abtlt1.js";import{t as le}from"./ApiCodeButton-CWiYAicH.js";import{t as ue}from"./BotPlaceholder-BHQueIfj.js";import{t as de}from"./ImageWrapper-Jwh0NBdB.js";var fe=_({name:`LayoutFlux`,components:{MagicIcon:L,ElDrawer:T,ElButton:U},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,pe,[e(`div`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var _e=H(fe,[[`render`,ge],[`__scopeId`,`data-v-72e82d52`]]),ve=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`flux-dev`,label:`flux-dev`},{value:`flux-pro`,label:`flux-pro`},{value:`flux-kontext-pro`,label:`flux-kontext-pro`},{value:`flux-kontext-max`,label:`flux-kontext-max`},{value:`flux-2-flex`,label:`flux-2-flex`},{value:`flux-2-pro`,label:`flux-2-pro`},{value:`flux-2-max`,label:`flux-2-max`}]}},computed:{value:{get(){return this.$store.state.flux?.config?.model},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||=z}}),ye={class:`field`},be={class:`title font-bold`};function xe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ye,[e(`h2`,be,i(t.$t(`flux.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Se=H(ve,[[`render`,xe],[`__scopeId`,`data-v-e9b17945`]]),Ce=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:M,ElInputNumber:E},computed:{value:{get(){return this.$store.state.flux?.config?.count},set(e){console.debug(`set count`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,count:e})}}},mounted(){this.value||=1}}),we={class:`flex justify-between`},Te={class:`flex justify-start items-center`},Ee={class:`text-sm font-bold`},De={class:`flex justify-end items-center`},Oe={class:`w-full`};function ke(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return h(),s(`div`,null,[e(`div`,we,[e(`div`,Te,[e(`span`,Ee,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,De,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Oe,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Ae=H(Ce,[[`render`,ke]]),je=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`generate`,label:this.$t(`flux.name.generate`)},{value:`edits`,label:this.$t(`flux.name.edits`)}]}},computed:{value:{get(){return this.$store.state.flux?.config?.action},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,action:e})}}},mounted(){this.value||=R}}),Me={class:`field`},Ne={class:`title font-bold`};function Pe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Me,[e(`h2`,Ne,i(t.$t(`flux.name.task`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Fe=H(je,[[`render`,Pe],[`__scopeId`,`data-v-81fd05e5`]]),Ie=_({name:`ImageUrlInput`,components:{UploadIcon:I,ElUpload:b,ElButton:U,InfoIcon:M,ImagePreview:oe},mixins:[re,J,W,Q],emits:[`change`],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{urls:{handler(e){console.debug(`URLs changed:`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,image_url:e[0]})}}},methods:{onExceed(){w.warning(this.$t(`flux.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`flux.message.uploadStartImageError`))}}}),Le={class:`relative`},Re={class:`flex justify-between`},ze={class:`flex justify-start items-center`},Be={class:`text-sm font-bold`};function Ve(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`image-preview`),g=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`span`,Be,i(t.$t(`flux.name.imageUrl`)),1),a(f,{content:t.$t(`flux.description.imageUrl`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,limit:5,class:`upload-wrapper`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,multiple:!0,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,headers:t.headers},{file:p(({file:e})=>[a(m,{url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])]),default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(g,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`headers`])])}var He=H(Ie,[[`render`,Ve],[`__scopeId`,`data-v-9830e0c3`]]),Ue=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.flux?.config?.prompt},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,prompt:e})}}},mounted(){this.prompt||=``}});function We(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`flux.name.prompt`),info:e.$t(`flux.description.prompt`),placeholder:e.$t(`flux.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ge=H(Ue,[[`render`,We]]),Ke=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:B}},computed:{value:{get(){return this.$store.state.flux?.config?.size},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,size:e})}}},mounted(){this.value||=`1:1`}}),qe={class:`field`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,qe,[e(`h2`,Je,i(t.$t(`flux.name.ratio`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=_({name:`PresetPanel`,components:{MagicIcon:L,ElButton:U,PromptInput:Ge,ModelSelector:Se,CountSelector:Ae,Consumption:ce,ActionSelector:Fe,ImageUrlInput:He,SizeSelector:H(Ke,[[`render`,Ye],[`__scopeId`,`data-v-8c58dc91`]])},emits:[`generate`],computed:{config(){return this.$store.state.flux?.config},consumption(){return ne(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ze={class:`flex flex-col h-full`},Qe={class:`flex-1 overflow-y-auto p-5`},$e={class:`flex flex-col items-center justify-center px-5 pb-5`};function et(t,n,c,u,d,m){let g=l(`action-selector`),_=l(`prompt-input`),v=l(`image-url-input`),y=l(`model-selector`),b=l(`size-selector`),x=l(`count-selector`),S=l(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Ze,[e(`div`,Qe,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.action===`edits`?(h(),f(v,{key:0,class:`mb-4`})):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,$e,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`onClick`])])])}var tt=H(Xe,[[`render`,et]]),nt=_({name:`TaskPreview`,components:{DeleteIcon:ee,ElTooltip:x,ChannelIcon:A,InfoIcon:F,MagicIcon:L,TimeIcon:O,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,ImageWrapper:de,ApiCodeButton:le,ReportButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.flux?.application},config(){return this.$store.state.flux?.config},images(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`flux/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenImage(e){window.open(e,`_blank`)}}}),rt={class:`preview`},it={class:`left`},at={class:`main`},ot={class:`bot`},st={class:`datetime`},ct=[`aria-label`],lt={class:`info`},ut={key:0,class:`prompt mt-2`},dt={key:0},ft={key:0,class:n({content:!0,failed:!0})},pt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},mt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vt={key:1,class:n({content:!0})},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:2,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-wrapper`),C=l(`api-code-button`),w=l(`report-button`),T=l(`channel-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`time-icon`),k=l(`el-alert`),A=l(`warning-icon`),j=l(`info-icon`);return h(),s(`div`,rt,[e(`div`,it,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,at,[e(`div`,ot,[a(y,{capability:`flux`,part:`name`}),e(`span`,st,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ct)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,lt,[n.modelValue?.request?.prompt?(h(),s(`p`,ut,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,dt,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,ft,[e(`div`,pt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(S,{key:t,src:e?.image_url,"raw-src":e?.image_url,"model-value":e},null,8,[`src`,`raw-src`,`model-value`]))),128))]),e(`div`,mt,[a(C,{path:`/flux/images`,body:n.modelValue?.request},null,8,[`body`]),a(w,{service:`flux`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(k,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ht,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,gt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,_t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.success===!1?(h(),s(`div`,vt,[a(k,{closable:!1,class:`failure`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failure`)),1)]),default:p(()=>[e(`p`,yt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,$,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,bt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,xt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.modelValue?.response?o(``,!0):(h(),s(`div`,St,[a(k,{closable:!1,class:`info`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.status.pending`)),1)]),default:p(()=>[e(`p`,Ct,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Tt=_({name:`RecentPanel`,components:{TaskPreview:H(nt,[[`render`,wt],[`__scopeId`,`data-v-7bae4285`]]),BotPlaceholder:ue,NoTasks:N,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.flux?.tasks,items:this.$store.state.flux?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Et={key:0},Dt={key:2,class:`w-full h-full flex items-center justify-center`};function Ot(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Et,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Dt,[a(v)])):o(``,!0)],64)}var kt=_({name:`FluxIndex`,components:{ConfigPanel:tt,Layout:_e,RecentPanel:H(Tt,[[`render`,Ot]])},mixins:[V],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.flux?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.flux?.status?.getTasks===C.Request||this.fetchingTasks},credential(){return this.$store.state.flux?.credential},config(){return this.$store.state.flux?.config},application(){return this.$store.state.flux?.application},tasks(){return this.$store.state.flux?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await P({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`flux/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`flux/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`flux/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!K(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!Y())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`flux.message.startingTask`)),X(`flux`,G.generate(e,{token:t})).then(()=>{w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?w.error(this.$t(`flux.message.usedUp`)):w.error(this.$t(`flux.message.startTaskFailed`)+t?.error?.message)}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function At(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var jt=H(kt,[[`render`,At]]);export{jt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-By5KXS1U.js";import{t as b}from"./upload-Cjls2phY.js";import{t as x}from"./tooltip-PVpDuzzH.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-yTQ4rqqP.js";import{t as T}from"./drawer-BYSZqwf9.js";import{t as E}from"./input-number-DLZvLiIr.js";import{t as D}from"./slider-Bto_Z5Ho.js";import{t as O}from"./clock-ChX1xgIa.js";import{a as k,c as A,n as j,o as M,r as N,t as P}from"./pagination-KA1ofG-e.js";import{t as F}from"./info-DrWjfo9Y.js";import{t as ee}from"./trash-2-CQLSuQ3X.js";import{t as te}from"./triangle-alert-ClpR6g4l.js";import{t as I}from"./upload-KOO0FgHZ.js";import{t as L}from"./wand-sparkles-BLnx2H-s.js";import{dr as R,fr as z,ur as B}from"./constants-CzYWUlOY.js";import{$t as V,O as H,Pi as U,Qt as W,Xn as G,Zt as K,bi as q,en as J,fn as Y,jr as X,oi as Z,qt as Q,rn as ne,tn as re}from"./index-CBKO4rem.js";import{t as ie}from"./CopyToClipboard-BNiTrCI3.js";import{t as ae}from"./ReportButton-BW2lfho9.js";import{t as oe}from"./ImagePreview-D_V9IWmn.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-BV9bmqJy.js";import{t as le}from"./ApiCodeButton-c4MVRYWA.js";import{t as ue}from"./BotPlaceholder-BX5DiQGy.js";import{t as de}from"./ImageWrapper-Y8BiY6mm.js";var fe=_({name:`LayoutFlux`,components:{MagicIcon:L,ElDrawer:T,ElButton:U},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,pe,[e(`div`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var _e=H(fe,[[`render`,ge],[`__scopeId`,`data-v-72e82d52`]]),ve=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`flux-dev`,label:`flux-dev`},{value:`flux-pro`,label:`flux-pro`},{value:`flux-kontext-pro`,label:`flux-kontext-pro`},{value:`flux-kontext-max`,label:`flux-kontext-max`},{value:`flux-2-flex`,label:`flux-2-flex`},{value:`flux-2-pro`,label:`flux-2-pro`},{value:`flux-2-max`,label:`flux-2-max`}]}},computed:{value:{get(){return this.$store.state.flux?.config?.model},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||=z}}),ye={class:`field`},be={class:`title font-bold`};function xe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ye,[e(`h2`,be,i(t.$t(`flux.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Se=H(ve,[[`render`,xe],[`__scopeId`,`data-v-e9b17945`]]),Ce=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:M,ElInputNumber:E},computed:{value:{get(){return this.$store.state.flux?.config?.count},set(e){console.debug(`set count`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,count:e})}}},mounted(){this.value||=1}}),we={class:`flex justify-between`},Te={class:`flex justify-start items-center`},Ee={class:`text-sm font-bold`},De={class:`flex justify-end items-center`},Oe={class:`w-full`};function ke(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return h(),s(`div`,null,[e(`div`,we,[e(`div`,Te,[e(`span`,Ee,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,De,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Oe,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Ae=H(Ce,[[`render`,ke]]),je=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`generate`,label:this.$t(`flux.name.generate`)},{value:`edits`,label:this.$t(`flux.name.edits`)}]}},computed:{value:{get(){return this.$store.state.flux?.config?.action},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,action:e})}}},mounted(){this.value||=R}}),Me={class:`field`},Ne={class:`title font-bold`};function Pe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Me,[e(`h2`,Ne,i(t.$t(`flux.name.task`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Fe=H(je,[[`render`,Pe],[`__scopeId`,`data-v-81fd05e5`]]),Ie=_({name:`ImageUrlInput`,components:{UploadIcon:I,ElUpload:b,ElButton:U,InfoIcon:M,ImagePreview:oe},mixins:[re,J,W,Q],emits:[`change`],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{urls:{handler(e){console.debug(`URLs changed:`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,image_url:e[0]})}}},methods:{onExceed(){w.warning(this.$t(`flux.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`flux.message.uploadStartImageError`))}}}),Le={class:`relative`},Re={class:`flex justify-between`},ze={class:`flex justify-start items-center`},Be={class:`text-sm font-bold`};function Ve(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`image-preview`),g=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`span`,Be,i(t.$t(`flux.name.imageUrl`)),1),a(f,{content:t.$t(`flux.description.imageUrl`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,limit:5,class:`upload-wrapper`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,multiple:!0,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,headers:t.headers},{file:p(({file:e})=>[a(m,{url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])]),default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(g,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`headers`])])}var He=H(Ie,[[`render`,Ve],[`__scopeId`,`data-v-9830e0c3`]]),Ue=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.flux?.config?.prompt},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,prompt:e})}}},mounted(){this.prompt||=``}});function We(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`flux.name.prompt`),info:e.$t(`flux.description.prompt`),placeholder:e.$t(`flux.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ge=H(Ue,[[`render`,We]]),Ke=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:B}},computed:{value:{get(){return this.$store.state.flux?.config?.size},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,size:e})}}},mounted(){this.value||=`1:1`}}),qe={class:`field`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,qe,[e(`h2`,Je,i(t.$t(`flux.name.ratio`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=_({name:`PresetPanel`,components:{MagicIcon:L,ElButton:U,PromptInput:Ge,ModelSelector:Se,CountSelector:Ae,Consumption:ce,ActionSelector:Fe,ImageUrlInput:He,SizeSelector:H(Ke,[[`render`,Ye],[`__scopeId`,`data-v-8c58dc91`]])},emits:[`generate`],computed:{config(){return this.$store.state.flux?.config},consumption(){return ne(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ze={class:`flex flex-col h-full`},Qe={class:`flex-1 overflow-y-auto p-5`},$e={class:`flex flex-col items-center justify-center px-5 pb-5`};function et(t,n,c,u,d,m){let g=l(`action-selector`),_=l(`prompt-input`),v=l(`image-url-input`),y=l(`model-selector`),b=l(`size-selector`),x=l(`count-selector`),S=l(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Ze,[e(`div`,Qe,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.action===`edits`?(h(),f(v,{key:0,class:`mb-4`})):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,$e,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`onClick`])])])}var tt=H(Xe,[[`render`,et]]),nt=_({name:`TaskPreview`,components:{DeleteIcon:ee,ElTooltip:x,ChannelIcon:A,InfoIcon:F,MagicIcon:L,TimeIcon:O,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,ImageWrapper:de,ApiCodeButton:le,ReportButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.flux?.application},config(){return this.$store.state.flux?.config},images(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`flux/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenImage(e){window.open(e,`_blank`)}}}),rt={class:`preview`},it={class:`left`},at={class:`main`},ot={class:`bot`},st={class:`datetime`},ct=[`aria-label`],lt={class:`info`},ut={key:0,class:`prompt mt-2`},dt={key:0},ft={key:0,class:n({content:!0,failed:!0})},pt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},mt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vt={key:1,class:n({content:!0})},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:2,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-wrapper`),C=l(`api-code-button`),w=l(`report-button`),T=l(`channel-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`time-icon`),k=l(`el-alert`),A=l(`warning-icon`),j=l(`info-icon`);return h(),s(`div`,rt,[e(`div`,it,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,at,[e(`div`,ot,[a(y,{capability:`flux`,part:`name`}),e(`span`,st,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ct)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,lt,[n.modelValue?.request?.prompt?(h(),s(`p`,ut,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,dt,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,ft,[e(`div`,pt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(S,{key:t,src:e?.image_url,"raw-src":e?.image_url,"model-value":e},null,8,[`src`,`raw-src`,`model-value`]))),128))]),e(`div`,mt,[a(C,{path:`/flux/images`,body:n.modelValue?.request},null,8,[`body`]),a(w,{service:`flux`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(k,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ht,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,gt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,_t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.success===!1?(h(),s(`div`,vt,[a(k,{closable:!1,class:`failure`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failure`)),1)]),default:p(()=>[e(`p`,yt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,$,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,bt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,xt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.modelValue?.response?o(``,!0):(h(),s(`div`,St,[a(k,{closable:!1,class:`info`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.status.pending`)),1)]),default:p(()=>[e(`p`,Ct,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Tt=_({name:`RecentPanel`,components:{TaskPreview:H(nt,[[`render`,wt],[`__scopeId`,`data-v-7bae4285`]]),BotPlaceholder:ue,NoTasks:N,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.flux?.tasks,items:this.$store.state.flux?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Et={key:0},Dt={key:2,class:`w-full h-full flex items-center justify-center`};function Ot(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Et,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Dt,[a(v)])):o(``,!0)],64)}var kt=_({name:`FluxIndex`,components:{ConfigPanel:tt,Layout:_e,RecentPanel:H(Tt,[[`render`,Ot]])},mixins:[V],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.flux?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.flux?.status?.getTasks===C.Request||this.fetchingTasks},credential(){return this.$store.state.flux?.credential},config(){return this.$store.state.flux?.config},application(){return this.$store.state.flux?.application},tasks(){return this.$store.state.flux?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await P({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`flux/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`flux/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`flux/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!K(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!Y())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`flux.message.startingTask`)),X(`flux`,G.generate(e,{token:t})).then(()=>{w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?w.error(this.$t(`flux.message.usedUp`)):w.error(this.$t(`flux.message.startTaskFailed`)+t?.error?.message)}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function At(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var jt=H(kt,[[`render`,At]]);export{jt as default};
|