@acedatacloud/nexior 3.333.1 → 3.334.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/dist/assets/{ApiCodeButton-D_45ZZNZ.js → ApiCodeButton-CItAka6O.js} +1 -1
  2. package/dist/assets/{Artifacts-C7gOhwhl.js → Artifacts-DNdPRlWC.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-D5x9FqY4.js → AskUserQuestionCard-CETKfQVh.js} +2 -2
  4. package/dist/assets/{AudioPreview-CgByAntF.js → AudioPreview-CUZHVg8W.js} +1 -1
  5. package/dist/assets/{Auth-l6vQomeJ.js → Auth-CEXL9yo5.js} +1 -1
  6. package/dist/assets/{Bare-jdxWn_ue.js → Bare-B5Q0QVpe.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-CWvJLsQt.js → BotPlaceholder-CCginKh-.js} +1 -1
  8. package/dist/assets/{BottomFooter-DpZy6lBh.js → BottomFooter-yNkPb746.js} +1 -1
  9. package/dist/assets/{Callback-0ANQ2AST.js → Callback-D3qH_FDt.js} +1 -1
  10. package/dist/assets/{CodeSnippet-BrACxNpQ.js → CodeSnippet-CHRmIM1z.js} +1 -1
  11. package/dist/assets/{Console-DJLV3TGs.js → Console-C-joDjOu.js} +1 -1
  12. package/dist/assets/{Consumption-DvLMdgth.js → Consumption-T_B0x7X7.js} +1 -1
  13. package/dist/assets/{Conversation-DjDgALhy.js → Conversation-B4f4HtiB.js} +1 -1
  14. package/dist/assets/Conversation-BuYBzlIO.js +1 -0
  15. package/dist/assets/{Conversation-BPYeMulu.css → Conversation-C55egwBj.css} +1 -1
  16. package/dist/assets/{CopyToClipboard-zxMSspk6.js → CopyToClipboard-DeNuA2Z0.js} +1 -1
  17. package/dist/assets/{Detail-B08zaag-.js → Detail-B8q-Dkam.js} +2 -2
  18. package/dist/assets/Extra-xNChh2NG.js +1 -0
  19. package/dist/assets/{FilePreview-CIK3LdbH.js → FilePreview-BxvWLfp6.js} +1 -1
  20. package/dist/assets/{Hailuo-DRsP-uM8.js → Hailuo-BXPFwyD8.js} +1 -1
  21. package/dist/assets/{History-wM0JF3Sp.js → History-V8wGPSIe.js} +1 -1
  22. package/dist/assets/{ImagePreview-DI9PzDrr.js → ImagePreview-BAPw_Hzg.js} +1 -1
  23. package/dist/assets/{ImageWrapper-CcXyFr-X.js → ImageWrapper-m7O5n_Mc.js} +1 -1
  24. package/dist/assets/{Index-Bx7kV11t.js → Index-B-I0zW-5.js} +1 -1
  25. package/dist/assets/Index-B-PoMWcM.js +1 -0
  26. package/dist/assets/Index-B1bVe0D62.js +1 -0
  27. package/dist/assets/{Index-DlCnr4HO.css → Index-B6OpWucL.css} +1 -1
  28. package/dist/assets/{Index-B8TCec8i.css → Index-B6wEtI4c.css} +1 -1
  29. package/dist/assets/Index-B7dIuJ3X.js +1 -0
  30. package/dist/assets/{Index-sMB6p2rE.js → Index-BFNhdeI6.js} +1 -1
  31. package/dist/assets/Index-BIgcIy4y.js +1 -0
  32. package/dist/assets/Index-BQ1Sd74U.js +1 -0
  33. package/dist/assets/Index-BRuz_Tgc.js +1 -0
  34. package/dist/assets/{Index-DyifjW6C.css → Index-BfRZmbSG.css} +1 -1
  35. package/dist/assets/Index-BjQAJjkx.js +1 -0
  36. package/dist/assets/{Index-cQvwm4X-.css → Index-BnyqV23u.css} +1 -1
  37. package/dist/assets/{Index-DsmXPjSQ.css → Index-Bp8Y_j7f.css} +1 -1
  38. package/dist/assets/Index-Bp_ZHaLI.js +1 -0
  39. package/dist/assets/{Index-IJs6_lAc.css → Index-C6y-71Fh.css} +1 -1
  40. package/dist/assets/{Index-CJMjKtdv.css → Index-CHWfVJ1w.css} +1 -1
  41. package/dist/assets/Index-CJdoXOJh.js +1 -0
  42. package/dist/assets/Index-CK4f9QYe.js +1 -0
  43. package/dist/assets/Index-COgR8jm1.js +1 -0
  44. package/dist/assets/{Index-DsGi3PKp.js → Index-CWKsgefz.js} +1 -1
  45. package/dist/assets/{Index-CY0oX7qB.css → Index-CcF2d8lL.css} +1 -1
  46. package/dist/assets/Index-Cd08PSVj.js +1 -0
  47. package/dist/assets/{Index-BExMN3GB.css → Index-CfbKxdVl.css} +1 -1
  48. package/dist/assets/{Index-ClbTxfgn.js → Index-ClFe8HOV.js} +1 -1
  49. package/dist/assets/{Index-CwZHHyEs2.js → Index-CpzP5oF22.js} +1 -1
  50. package/dist/assets/Index-DJN3-OcX.js +1 -0
  51. package/dist/assets/Index-DN1ZAt5P2.js +1 -0
  52. package/dist/assets/{Index-r2XRHBTS.js → Index-DZrMfPV1.js} +1 -1
  53. package/dist/assets/Index-DoXeCn4H.js +1 -0
  54. package/dist/assets/{Index-CWc0oZ_j.js → Index-Dxzx6WJe.js} +1 -1
  55. package/dist/assets/{Index-BmmJBCTT.css → Index-EYr49JZ1.css} +1 -1
  56. package/dist/assets/Index-EjT3hNCg2.js +1 -0
  57. package/dist/assets/{Index-BtMrXtRr.js → Index-FFmClcVp.js} +1 -1
  58. package/dist/assets/{Index-DcNRiSlf2.js → Index-GA-ZuEr_2.js} +2 -2
  59. package/dist/assets/{Index-BkOK8NO8.css → Index-IPNeQkLy.css} +1 -1
  60. package/dist/assets/{Index-Dveh9iSJ.css → Index-Iu5kJiXK.css} +1 -1
  61. package/dist/assets/{Index-ClDlvCQ_.css → Index-Le-DjvxB.css} +1 -1
  62. package/dist/assets/Index-S3jFv5-m.js +1 -0
  63. package/dist/assets/Index-UEoEKorh.js +1 -0
  64. package/dist/assets/Index-UxpXmPsa.js +1 -0
  65. package/dist/assets/{Index-BoowhuvA.css → Index-_ResEGqC.css} +1 -1
  66. package/dist/assets/Index-gJYeRpLE2.js +1 -0
  67. package/dist/assets/{Index-Ci10cagJ.css → Index-jJGNOU6J.css} +1 -1
  68. package/dist/assets/{Index-CmHzfeO_.css → Index-sTNZFxN7.css} +1 -1
  69. package/dist/assets/{Index-BXWw6zZx.css → Index-udLg8TKM.css} +1 -1
  70. package/dist/assets/Index-wy3SzIvG2.js +1 -0
  71. package/dist/assets/{Invitees-D1NvbCWH.js → Invitees-ooir0t3Q.js} +1 -1
  72. package/dist/assets/{List-45oD4wPY.js → List-B4jcoCav.js} +1 -1
  73. package/dist/assets/List-CGWwwZ4k.js +1 -0
  74. package/dist/assets/List-D24vJjvS.js +1 -0
  75. package/dist/assets/{LocalTools-DB4bYUoL.js → LocalTools-B7jLGN8B.js} +2 -2
  76. package/dist/assets/{LocalTools-9p-Mbg4t.js → LocalTools-DaMSqhv5.js} +1 -1
  77. package/dist/assets/{Main-COIeEjNb.js → Main-KxL4msIe.js} +1 -1
  78. package/dist/assets/{Message-DvGFhpLW.js → Message-CVFRjjuT.js} +2 -2
  79. package/dist/assets/{Model-B9lD7KRY.js → Model-Di4Qz5c7.js} +1 -1
  80. package/dist/assets/{Navigator-BctuncPy.js → Navigator-DwM7jMEC.js} +4 -4
  81. package/dist/assets/{NotFound-DjXiYqeK.js → NotFound-BxTVfwjl.js} +1 -1
  82. package/dist/assets/{Pay-DIlOZEj-.js → Pay-DC87dJog.js} +1 -1
  83. package/dist/assets/{Player-B2d_QQg3.js → Player-DkPJDG-Z.js} +1 -1
  84. package/dist/assets/{Poivelle-D1YDLQuG.js → Poivelle-CS40QRFG.js} +1 -1
  85. package/dist/assets/{PromptTextarea-CvewN2gz.js → PromptTextarea-O572tUMr.js} +1 -1
  86. package/dist/assets/{RealtimeCall-DvNII0RS.js → RealtimeCall-D-ymbGoF.js} +1 -1
  87. package/dist/assets/ScheduledTasks-D2EX30cz.js +2 -0
  88. package/dist/assets/{Status-CIfPehla.js → Status-BTKBjKD2.js} +1 -1
  89. package/dist/assets/{Subscribe-DmGrP5s-.js → Subscribe-BTwo2DYe.js} +1 -1
  90. package/dist/assets/{TabSwitcher-MOUIMk14.js → TabSwitcher-CbJdMcXO.js} +1 -1
  91. package/dist/assets/Tts-Cgeo9y7f.js +1 -0
  92. package/dist/assets/{VideoPlayer-CuPK2nmG.js → VideoPlayer-COT9I34h.js} +1 -1
  93. package/dist/assets/{alert-WwBUWB1y.js → alert-B2cGSPTQ.js} +1 -1
  94. package/dist/assets/arrow-down-CPa7sowR.js +1 -0
  95. package/dist/assets/{arrow-down-wide-narrow-DyR5jkzj.js → arrow-down-wide-narrow-CnqH-r9M.js} +1 -1
  96. package/dist/assets/arrow-left-Cy2zdbra.js +1 -0
  97. package/dist/assets/arrow-right-f-hXcTXB.js +1 -0
  98. package/dist/assets/arrow-up-BSKVN7Wh.js +1 -0
  99. package/dist/assets/avatar-tdVcQaGR.js +1 -0
  100. package/dist/assets/{basic-BgO7E9WX.js → basic-Bj-cyXXL.js} +1 -1
  101. package/dist/assets/{box-C5_1LyPO.js → box-Bztmdumw.js} +1 -1
  102. package/dist/assets/{boxes-b6XRsAOv.js → boxes---XH7P-r.js} +1 -1
  103. package/dist/assets/{brain-B3YfDy5Q.js → brain-CsFmEOOr.js} +1 -1
  104. package/dist/assets/{chart-no-axes-combined-D4f97aJi.js → chart-no-axes-combined-BO0UknQ0.js} +1 -1
  105. package/dist/assets/{chat-DLl5hCm4.js → chat-u-XZznAF.js} +1 -1
  106. package/dist/assets/check-CfDRLU1j.js +1 -0
  107. package/dist/assets/chevron-down-B1if9tbR.js +1 -0
  108. package/dist/assets/chevron-right-DHMxSx3S.js +1 -0
  109. package/dist/assets/circle-check-VZysE_TC.js +1 -0
  110. package/dist/assets/clock-CoMSt8fg.js +1 -0
  111. package/dist/assets/{codingBridge-CBaUJVEm.js → codingBridge-DmkReyE7.js} +2 -2
  112. package/dist/assets/{codingBridgeNotify-DlKspNq5.js → codingBridgeNotify-BBs8UDmV.js} +2 -2
  113. package/dist/assets/{coins-FIVFzynq.js → coins-MxuxLPCX.js} +1 -1
  114. package/dist/assets/{collapse-BnO2TYLs.js → collapse-DNzaVcCh.js} +1 -1
  115. package/dist/assets/{common-B1HrzxoN.js → common-2NT7RUn_.js} +1 -1
  116. package/dist/assets/{common-D6Ba99-R.js → common-B36JiRNL.js} +1 -1
  117. package/dist/assets/{common-D3GGgXks.js → common-BG-foRMa.js} +1 -1
  118. package/dist/assets/{common-SnTuIh0k.js → common-BMB5Hs9V.js} +1 -1
  119. package/dist/assets/{common-cggix1Qe.js → common-BsWUl0RN.js} +1 -1
  120. package/dist/assets/{common-WVyyb08D.js → common-C5-raB_V.js} +1 -1
  121. package/dist/assets/{common-DMZ9MK8d.js → common-CBolYLgu.js} +1 -1
  122. package/dist/assets/{common-DvhSxGms.js → common-CURFBDUh.js} +1 -1
  123. package/dist/assets/{common-ChZA27gt.js → common-CZqDnsfK.js} +1 -1
  124. package/dist/assets/{common-Bud6GFBO.js → common-CbvMjkdw.js} +1 -1
  125. package/dist/assets/{common-BlSEJksP.js → common-D-ybKGRD.js} +1 -1
  126. package/dist/assets/{common-oTAIhGv-.js → common-DKTWmUT2.js} +1 -1
  127. package/dist/assets/{common-BVMqSc7Q.js → common-DKmJuusT.js} +1 -1
  128. package/dist/assets/{common-C2qRbJzU.js → common-Db7HBQX_.js} +1 -1
  129. package/dist/assets/{common-CDO2IcV6.js → common-DhGPe-2d.js} +1 -1
  130. package/dist/assets/{common-D_1KtHpL.js → common-_hg40rD6.js} +1 -1
  131. package/dist/assets/{common-D38lkqd0.js → common-i94Z95ri.js} +1 -1
  132. package/dist/assets/{common-B9mOCIHb.js → common-p20Ab_12.js} +1 -1
  133. package/dist/assets/{constants-CGPrJer0.js → constants-5aTSGTs4.js} +1 -1
  134. package/dist/assets/{copy-CTuzTNJ5.js → copy-DCoddgz8.js} +1 -1
  135. package/dist/assets/{createTaskActions-CtcbS2iG.js → createTaskActions-BnzBi4WR.js} +1 -1
  136. package/dist/assets/{digitalhuman-BAwQCdro.js → digitalhuman-CNViefoN.js} +1 -1
  137. package/dist/assets/{dollar-sign-CUD504ay.js → dollar-sign-o7RxdPME.js} +1 -1
  138. package/dist/assets/{download-CpGhHJp9.js → download-D_qYTxmq.js} +1 -1
  139. package/dist/assets/{drawer-C56tib0X.js → drawer-CHwutuj3.js} +1 -1
  140. package/dist/assets/{dropdown-CPOlDHck.js → dropdown-BlnSdzbm.js} +1 -1
  141. package/dist/assets/{dropdown-B0r-pxJy.js → dropdown-C57cWsyH.js} +1 -1
  142. package/dist/assets/{ellipsis-BQD5KKiY.js → ellipsis-CqIxFEH0.js} +1 -1
  143. package/dist/assets/{esm-D93ubut2.js → esm-94ZrAF32.js} +2 -2
  144. package/dist/assets/{esm-0Sw9Mj2t.js → esm-B46--PlE.js} +1 -1
  145. package/dist/assets/{esm-HwcazyYj.js → esm-BJ5X10po.js} +1 -1
  146. package/dist/assets/{esm-bIoRnLRd.js → esm-BJti0QP_.js} +1 -1
  147. package/dist/assets/esm-BZc6IzyV.js +1 -0
  148. package/dist/assets/{esm-BDRwDbaX.js → esm-JMVsQmRc.js} +3 -3
  149. package/dist/assets/{esm-Dj2LDcpy.js → esm-PKM5act0.js} +2 -2
  150. package/dist/assets/{external-link-CanGZR_C.js → external-link-BI8PofQV.js} +1 -1
  151. package/dist/assets/{eye-Dy8z7UND.js → eye-DxXko3lE.js} +1 -1
  152. package/dist/assets/{file-output-CRPWKq1R.js → file-output-Chjx2X-x.js} +1 -1
  153. package/dist/assets/{file-text-CByqtAUz.js → file-text-BY121tfS.js} +1 -1
  154. package/dist/assets/{fish-C8syoDkO.js → fish-ChxDYz-Y.js} +1 -1
  155. package/dist/assets/{flux-Bgw_dz1C.js → flux-CUnI9MLP.js} +1 -1
  156. package/dist/assets/{folder-DjLA-Dwt.js → folder-Blm6dATr.js} +1 -1
  157. package/dist/assets/gauge-BcCXNhzI.js +1 -0
  158. package/dist/assets/{globe-BHrNeIhi.js → globe-DiFeIkdL.js} +1 -1
  159. package/dist/assets/{omni-EIKi5Q0J.js → grokvideo--VajfEzL.js} +1 -1
  160. package/dist/assets/{pixverse-D6hvV0FG.js → hailuo-DwNpqtTA.js} +1 -1
  161. package/dist/assets/{headphones-CbwI7Qct.js → headphones-Du8kfEyN.js} +1 -1
  162. package/dist/assets/{history-BRB7u1Js.js → history-DPCPRcVZ.js} +1 -1
  163. package/dist/assets/{house-DTRzclUu.js → house-DCdxFHDh.js} +1 -1
  164. package/dist/assets/{i18n-yqzG0CWr.js → i18n-BypwCSD5.js} +1 -1
  165. package/dist/assets/{image-hOAqdX9u.js → image-CjuVk3RD.js} +1 -1
  166. package/dist/assets/{index-qY8Xwe-x.js → index-F4_39ajo.js} +15 -15
  167. package/dist/assets/{index-Bs9UTL4R.css → index-_kd3UVgo.css} +1 -1
  168. package/dist/assets/{index.browser.esm-BnSpGnA7.js → index.browser.esm-B4csJV5j.js} +1 -1
  169. package/dist/assets/{index.es-CIS0HCG6.js → index.es-sC_8rMnl.js} +1 -1
  170. package/dist/assets/{info-Cf_6Kyvd.js → info-DPUzvj5K.js} +1 -1
  171. package/dist/assets/{input-number-I6Tu7oha.js → input-number-C0dMhfGi.js} +1 -1
  172. package/dist/assets/{key-round-B2iG8DVb.js → key-round-CFKeQVrE.js} +1 -1
  173. package/dist/assets/{kling-jdT7DvkZ.js → kling-yxDwS24J.js} +1 -1
  174. package/dist/assets/{languages-DTEI-Opg.js → languages-Xwxifp3i.js} +1 -1
  175. package/dist/assets/{laptop-BWBCtz00.js → laptop-IeIblL13.js} +1 -1
  176. package/dist/assets/{lightbulb-DXr_ZLfD.js → lightbulb-B-Na-gyz.js} +1 -1
  177. package/dist/assets/{link-CZqGohLa.js → link-CKG5ScIr.js} +1 -1
  178. package/dist/assets/loader-circle-DWdmrTBp.js +1 -0
  179. package/dist/assets/{qrart-Ald10JoH.js → luma-xNNcIv0i.js} +1 -1
  180. package/dist/assets/{maestro-ekbeUVLa.js → maestro-BcmpqLSS.js} +1 -1
  181. package/dist/assets/{maestro-CFILw42y.js → maestro-CwANguqK.js} +1 -1
  182. package/dist/assets/{mail-CLtYhDrg.js → mail-C0zi2ElW.js} +1 -1
  183. package/dist/assets/{message-circle-C0rP6hSD.js → message-circle-CdTLZTXq.js} +1 -1
  184. package/dist/assets/{mic-8QjJnavB.js → mic-CMdRBQtE.js} +1 -1
  185. package/dist/assets/{midjourney-DKGvBIzn.js → midjourney-DbR6m_UY.js} +1 -1
  186. package/dist/assets/{mobileLocalExec-DanF8wU6.js → mobileLocalExec-DpKiIY_Y.js} +2 -2
  187. package/dist/assets/{mouse-pointer-2-Ca__H4dl.js → mouse-pointer-2-Bh857Z92.js} +1 -1
  188. package/dist/assets/music-2-CIMaBDZB.js +1 -0
  189. package/dist/assets/{seedance-22RqVmv3.js → nanobanana-C7Y7gBIc.js} +1 -1
  190. package/dist/assets/{grokvideo-KgpjpZ00.js → omni-4sfrU9Pv.js} +1 -1
  191. package/dist/assets/{openaiimage-DL1iUpvS.js → openaiimage-5IxEIGvi.js} +1 -1
  192. package/dist/assets/{pagination-CCsgYx3G.js → pagination-0Rr0x2e4.js} +2 -2
  193. package/dist/assets/{pagination-Dvjqt2QJ.js → pagination-CDsiohcj.js} +1 -1
  194. package/dist/assets/{palette-CHBLUhBD.js → palette-cONxVZ4X.js} +1 -1
  195. package/dist/assets/{paperclip-BUSdM_1G.js → paperclip-DMQyu3d1.js} +1 -1
  196. package/dist/assets/{pause-D42oW7zb.js → pause-Carc9POt.js} +1 -1
  197. package/dist/assets/{pencil-D1vyGIox.js → pencil-CJh45KqY.js} +1 -1
  198. package/dist/assets/{pika-CpGOuEbo.js → pika-UgWodo3_.js} +1 -1
  199. package/dist/assets/{hailuo-B9d8x00X.js → pixverse-BL6XE0ah.js} +1 -1
  200. package/dist/assets/play-CTp4h_ci.js +1 -0
  201. package/dist/assets/plus-D4YnYTWT.js +1 -0
  202. package/dist/assets/{poivelle-6J5pFpGH.js → poivelle-DkeUauCM.js} +1 -1
  203. package/dist/assets/{popover-C4buuH_b.js → popover-CohFqQEA.js} +1 -1
  204. package/dist/assets/{producer-C6S9dl_X.js → producer-C52tNWRd.js} +1 -1
  205. package/dist/assets/{luma-gHG72Q2f.js → qrart-CpwB_beo.js} +1 -1
  206. package/dist/assets/{realtime-5CjnvVkp.js → realtime-DNTSGqnG.js} +1 -1
  207. package/dist/assets/{refresh-cw--c-QsUoO.js → refresh-cw-BGeEzkQJ.js} +1 -1
  208. package/dist/assets/rotate-ccw-Ds-5JruF.js +1 -0
  209. package/dist/assets/rotate-cw-BWtVG8Y7.js +1 -0
  210. package/dist/assets/{row-CZqDhN3K.js → row-Cxgtnibp.js} +1 -1
  211. package/dist/assets/search-CnWxh0r5.js +1 -0
  212. package/dist/assets/{nanobanana-To1AOFDY.js → seedance-N2Dta1Po.js} +1 -1
  213. package/dist/assets/{seedream-NfsvS6FW.js → seedream-BK-mf1ag.js} +1 -1
  214. package/dist/assets/select-Bxtx9SBZ.js +1 -0
  215. package/dist/assets/serp-DJemPch6.js +1 -0
  216. package/dist/assets/{shield-BzwxLH_6.js → shield-Dsq4tenm.js} +1 -1
  217. package/dist/assets/{shuffle-Dj06pRnb.js → shuffle-DyQvgL1Z.js} +1 -1
  218. package/dist/assets/{slider-BGWhsJ--.js → slider-CU0sv-Q_.js} +1 -1
  219. package/dist/assets/{sliders-horizontal-Jr7q_4Wb.js → sliders-horizontal-D5EHCIyk.js} +1 -1
  220. package/dist/assets/{solana-wallets-RPq8q6P-.js → solana-wallets-CArDFRuf.js} +2 -2
  221. package/dist/assets/{solana-wallets-vue-c9irZ2qs.js → solana-wallets-vue-DL70qKI-.js} +1 -1
  222. package/dist/assets/sora-Cjnz5Z5A.js +1 -0
  223. package/dist/assets/{sparkles-BQO9hMKa.js → sparkles-6a4bRHw4.js} +1 -1
  224. package/dist/assets/square-BzWDgzTr.js +1 -0
  225. package/dist/assets/{suno-HnOsFIRy.js → suno-DlopdgxH.js} +1 -1
  226. package/dist/assets/{switch-Dv11DKLB.js → switch-B6SGJneb.js} +1 -1
  227. package/dist/assets/{table-GxmTVSKX.js → table-Bx8MoH3N.js} +1 -1
  228. package/dist/assets/{tabs-M5PEX0u5.js → tabs-D-iiyRWd.js} +1 -1
  229. package/dist/assets/{tag-DmNwkAEe.js → tag-sr4BotyD.js} +1 -1
  230. package/dist/assets/{taskDrawerMixin-t0oG4ly6.js → taskDrawerMixin-CLp3kPah.js} +1 -1
  231. package/dist/assets/terminal-COGseSXn.js +1 -0
  232. package/dist/assets/{time-picker-BFFqYymG.js → time-picker-CvPTKSGO.js} +1 -1
  233. package/dist/assets/{tooltip-CKybjVoe.js → tooltip-DE550Y8y.js} +1 -1
  234. package/dist/assets/{trash-2-Clo-ZGm4.js → trash-2-CF4A89V4.js} +1 -1
  235. package/dist/assets/{triangle-alert--PIu81za.js → triangle-alert-C8ZH8nPp.js} +1 -1
  236. package/dist/assets/{upload-P7S1oH5l.js → upload-BYdaqPGE.js} +1 -1
  237. package/dist/assets/{upload-UyzbopDC.js → upload-RTQeOx3N.js} +1 -1
  238. package/dist/assets/user-CzRFe9FS.js +1 -0
  239. package/dist/assets/{veo-SznvFUbf.js → veo-BOlyzMN3.js} +1 -1
  240. package/dist/assets/{video-DFqidBFm.js → video-D0Et19A4.js} +1 -1
  241. package/dist/assets/{volume-2-CGazqEkn.js → volume-2-COts5JyW.js} +1 -1
  242. package/dist/assets/{wallet-DcsNSMi5.js → wallet-BW7xKdVG.js} +1 -1
  243. package/dist/assets/wan-oBTF6Tvh.js +1 -0
  244. package/dist/assets/{wand-sparkles-CZEkkfey.js → wand-sparkles-CHAnwUWN.js} +1 -1
  245. package/dist/assets/{web-CGGJs7Y5.js → web-Bqyvz8nn.js} +1 -1
  246. package/dist/assets/{web-CS73aq5P.js → web-CpdBZsxO.js} +1 -1
  247. package/dist/assets/{web-MV6-h32B.js → web-DecQqYrX.js} +1 -1
  248. package/dist/assets/{web-SZ47rKLe.js → web-TOWzDwCI.js} +1 -1
  249. package/dist/assets/{web-B_hasf07.js → web-WouuRxkK.js} +1 -1
  250. package/dist/assets/{webextrator-jKdNExI_.js → webextrator-DGkZMv3P.js} +1 -1
  251. package/dist/assets/{zap-3Q4xYCWy.js → zap-DMHz6hiJ.js} +1 -1
  252. package/dist/index.html +4 -4
  253. package/package.json +1 -1
  254. package/dist/assets/Conversation-Ctt68KJA.js +0 -1
  255. package/dist/assets/Extra-CUzklalK.js +0 -1
  256. package/dist/assets/Index-B7Tt71mm2.js +0 -1
  257. package/dist/assets/Index-BK9W3RSf.js +0 -1
  258. package/dist/assets/Index-BSG-LVi3.js +0 -1
  259. package/dist/assets/Index-BXRzf66p.js +0 -1
  260. package/dist/assets/Index-BeypRXPg.js +0 -1
  261. package/dist/assets/Index-BfQhX4r5.js +0 -1
  262. package/dist/assets/Index-BlRnswJe2.js +0 -1
  263. package/dist/assets/Index-Bw2xxkbt.js +0 -1
  264. package/dist/assets/Index-CMEXadaw2.js +0 -1
  265. package/dist/assets/Index-CTgwKCBb.js +0 -1
  266. package/dist/assets/Index-CgDsMWy_.js +0 -1
  267. package/dist/assets/Index-D1qihpnj.js +0 -1
  268. package/dist/assets/Index-D7AGv1e_.js +0 -1
  269. package/dist/assets/Index-DeagYQWO2.js +0 -1
  270. package/dist/assets/Index-Doeyg3on.js +0 -1
  271. package/dist/assets/Index-Dtd4r77Z.js +0 -1
  272. package/dist/assets/Index-DunBBXOV.js +0 -1
  273. package/dist/assets/Index-DvYsxuR_2.js +0 -1
  274. package/dist/assets/Index-Dz4PtczJ.js +0 -1
  275. package/dist/assets/Index-ICf2rZRv.js +0 -1
  276. package/dist/assets/Index-mZsl2E56.js +0 -1
  277. package/dist/assets/List-BHx97e6F.js +0 -1
  278. package/dist/assets/List-CU9DdA7I.js +0 -1
  279. package/dist/assets/ScheduledTasks-CZFkOb_a.js +0 -2
  280. package/dist/assets/Tts-CTsCW9WE.js +0 -1
  281. package/dist/assets/arrow-down-D2xoss9L.js +0 -1
  282. package/dist/assets/arrow-left-CylEfROC.js +0 -1
  283. package/dist/assets/arrow-right-CFu7qqCw.js +0 -1
  284. package/dist/assets/arrow-up-Dw80TrLN.js +0 -1
  285. package/dist/assets/avatar-qbA9Q0SX.js +0 -1
  286. package/dist/assets/check-7ednhBu6.js +0 -1
  287. package/dist/assets/chevron-down-7JI8KIke.js +0 -1
  288. package/dist/assets/chevron-right-Cz3Q0Pki.js +0 -1
  289. package/dist/assets/circle-check-biRA4mYc.js +0 -1
  290. package/dist/assets/clock-CUWhpM5A.js +0 -1
  291. package/dist/assets/esm-C_4k_1Dn.js +0 -1
  292. package/dist/assets/gauge-C-INojvz.js +0 -1
  293. package/dist/assets/loader-circle-BWFz6arm.js +0 -1
  294. package/dist/assets/music-2-DRg_krpf.js +0 -1
  295. package/dist/assets/play-CrFo2ntQ.js +0 -1
  296. package/dist/assets/plus-AVZIPgTz.js +0 -1
  297. package/dist/assets/rotate-ccw-6FACu8Mm.js +0 -1
  298. package/dist/assets/rotate-cw-B8Qgep6Y.js +0 -1
  299. package/dist/assets/search-XtMlez7y.js +0 -1
  300. package/dist/assets/select-Kj17huxb.js +0 -1
  301. package/dist/assets/serp-yPRURSur.js +0 -1
  302. package/dist/assets/sora-jkhJZAWq.js +0 -1
  303. package/dist/assets/square-BjTtaBh0.js +0 -1
  304. package/dist/assets/terminal-jHeGIoWe.js +0 -1
  305. package/dist/assets/user-XjfvN-de.js +0 -1
  306. package/dist/assets/wan-CZ2nJJD8.js +0 -1
@@ -1 +0,0 @@
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,S as c,T as l,at as u,ht as d,j as f,mt as p,ot as m,rt as h,st as g,tt as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-P7S1oH5l.js";import{t as b}from"./checkbox-CeoqKfX8.js";import{t as x}from"./drawer-C56tib0X.js";import{n as S,r as C,t as w}from"./dropdown-CPOlDHck.js";import{t as T}from"./popover-C4buuH_b.js";import{n as E,t as D}from"./skeleton-B3LIGUiE.js";import{t as O}from"./arrow-right-CFu7qqCw.js";import{t as k}from"./arrow-up-Dw80TrLN.js";import{t as ee}from"./brain-B3YfDy5Q.js";import{t as A}from"./check-7ednhBu6.js";import{t as te}from"./chevron-down-7JI8KIke.js";import{n as j,t as ne}from"./CodeSnippet-BrACxNpQ.js";import{t as re}from"./eye-Dy8z7UND.js";import{t as ie}from"./file-text-CByqtAUz.js";import{n as M,t as N}from"./shield-BzwxLH_6.js";import{t as ae}from"./folder-DjLA-Dwt.js";import{t as oe}from"./gauge-C-INojvz.js";import{t as P}from"./history-BRB7u1Js.js";import{t as F}from"./info-Cf_6Kyvd.js";import{t as I}from"./laptop-BWBCtz00.js";import{t as L}from"./link-CZqGohLa.js";import{t as R}from"./loader-circle-BWFz6arm.js";import{i as z,n as se,t as B}from"./AskUserQuestionCard-D5x9FqY4.js";import{t as ce}from"./paperclip-BUSdM_1G.js";import{t as V}from"./pencil-D1vyGIox.js";import{t as H}from"./plus-AVZIPgTz.js";import{t as U}from"./rotate-cw-B8Qgep6Y.js";import{t as le}from"./search-XtMlez7y.js";import{t as ue}from"./square-BjTtaBh0.js";import{t as de}from"./terminal-jHeGIoWe.js";import{t as fe}from"./trash-2-Clo-ZGm4.js";import{E as W,Ei as G,Fi as K,Ut as pe,Wi as q,ai as J,bi as me,ci as he,hi as ge,qt as _e,vi as Y,xi as X,yi as ve}from"./index-qY8Xwe-x.js";import"./vendor-highlight-BtIeKitL.js";import{t as ye}from"./CopyToClipboard-zxMSspk6.js";import{s as be,t as xe}from"./codingBridgeNotify-DlKspNq5.js";var Se=ve(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Ce=ve(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),we=ve(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Te=v({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:R,NotificationIcon:Ce,NotificationOffIcon:Se,ElButton:K},data(){return{enabled:!1,busy:!1}},computed:{supported(){return ge()||be()}},mounted(){this.enabled=!ge()&&xe()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,X.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,X.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?X.warning(this.$t(`codingBridge.notify.denied`)):X.warning(this.$t(`codingBridge.notify.unsupported`))}catch{X.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function Ee(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(_(),f(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:p(()=>[e.busy?(_(),f(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(_(),f(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(_(),f(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var De=v({name:`CodingBridgeNodeList`,components:{AddIcon:H,DeleteIcon:fe,DesktopIcon:z,DeveloperIcon:I,RedoIcon:U,ElButton:K,NotificationToggle:W(Te,[[`render`,Ee]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onDelete(e){try{await me.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),X.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{X.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),Oe={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ke={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},Ae={class:`flex items-center gap-2 font-medium`},je={class:`flex items-center gap-1`},Me={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},Ne={class:`text-[var(--app-text-subtle)]`},Pe={class:`flex-1 overflow-y-auto`},Fe={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Ie={class:`mb-3`},Le={key:1,class:`list-none m-0 p-0`},Re=[`onClick`],ze={class:`flex-1 min-w-0`},Be={class:`flex items-center gap-2`},Ve={class:`truncate font-medium`},He=[`title`],Ue={class:`text-xs text-[var(--app-text-subtle)] truncate`};function We(o,c,d,f,m,g){let v=u(`developer-icon`),y=u(`notification-toggle`),b=u(`redo-icon`),x=u(`el-button`),S=u(`add-icon`),C=u(`desktop-icon`),w=u(`delete-icon`);return _(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,je,[a(y),a(x,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:p(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Me,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,Ne,i(o.connectionLabel),1)]),e(`div`,Pe,[o.nodes.length?(_(),s(`ul`,Le,[(_(!0),s(l,null,h(o.nodes,r=>(_(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(C,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,He)]),e(`div`,Ue,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(x,{class:`opacity-0 group-hover:opacity-100`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:p(()=>[a(w,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,Re))),128))])):(_(),s(`div`,Fe,[e(`p`,Ie,i(o.$t(`codingBridge.nodeList.empty`)),1),a(x,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var Ge=W(De,[[`render`,We]]),Ke=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},qe=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:Ke(e.input):!1,Je=e=>({questions:e.input?.questions??[]}),Ye=100,Z=4e4,Xe=12e3,Ze=6e3,Q=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},Qe=v({name:`CodingBridgeTranscriptItem`,directives:{highlight:_e},components:{CloseIcon:Y,ConfirmIcon:A,EditIcon:V,FileIcon:M,InfoIcon:F,VueMarkdown:se,CodeSnippet:ne,CopyToClipboard:ye},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Q(this.event.text||``,Z),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Q(n,Ze)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.commandText)return de;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?ie:/write|edit|create|update|insert/.test(e)?V:/grep|glob|search|find|list/.test(e)?le:j},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Q(JSON.stringify(t,null,2),Ze)}catch{return Q(String(e),Ze)}},thinkingText(){return Q(this.event.text||``,Z)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Q(this.resultText,Xe)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Q(this.event.text||``,Z)},Ye)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Q(this.event.text||``,Z)}}}),$e={key:0,class:`group flex items-end justify-end gap-1.5`},et=[`title`,`aria-label`],tt={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},nt=[`src`],rt=[`href`],it=[`src`],at={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},ot={class:`min-w-0 truncate`},st={key:2},ct={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},lt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},ut={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},dt={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},ft={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},pt={key:0,class:`font-medium text-[var(--app-text)]`},mt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},ht={key:1,class:`px-2.5 pb-2`},gt={key:2,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},_t={key:3,class:`px-2.5 pb-2`},vt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},yt={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},bt={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},xt={class:`whitespace-pre-wrap break-words`},St={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function Ct(t,r,c,p,v,y){let b=u(`edit-icon`),x=u(`file-icon`),S=u(`vue-markdown`),C=u(`code-snippet`),w=u(`copy-to-clipboard`),T=u(`close-icon`),E=u(`confirm-icon`),D=u(`info-icon`),O=m(`highlight`);return _(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(_(),s(`div`,$e,[t.editable?(_(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,et)):o(``,!0),e(`div`,tt,[t.event.images&&t.event.images.length?(_(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(_(!0),s(l,null,h(t.event.images,(e,t)=>(_(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,nt))),128))],2)):o(``,!0),t.hasAttachments?(_(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(_(!0),s(l,null,h(t.event.attachments,(t,n)=>(_(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(_(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,it)):(_(),s(`span`,at,[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,ot,i(t.name||t.url),1)],8,rt))),128))],2)):o(``,!0),t.event.text?(_(),s(`span`,st,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(_(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(S,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[O]])],2)):t.event.kind===`thinking`?(_(),s(`div`,ct,i(t.thinkingText),1)):t.event.kind===`tool_use`?(_(),s(`div`,lt,[e(`div`,ut,[(_(),f(g(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(_(),s(`span`,dt,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(_(),s(`div`,ft,[(_(!0),s(l,null,h(t.questionLines,(t,n)=>(_(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(_(),s(`div`,pt,i(t.header),1)):o(``,!0),e(`div`,mt,i(t.question),1)]))),128))])):t.commandText?(_(),s(`div`,ht,[a(C,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(_(),s(`div`,gt,i(t.filePath),1)):t.inputText?(_(),s(`div`,_t,[a(C,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(_(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(_(),s(`div`,vt,[a(w,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(_(),s(`div`,yt,[t.event.is_error?(_(),f(T,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(_(),f(E,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(_(),s(`div`,bt,[a(D,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xt,i(t.noticeText),1)])):t.event.kind===`error`?(_(),s(`div`,St,i(t.event.text),1)):o(``,!0)],2)}var wt=W(Qe,[[`render`,Ct],[`__scopeId`,`data-v-2028b19a`]]),Tt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Et=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Dt=60,Ot=1500,kt=28,At=v({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:R},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Et:Tt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Dt)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Ot)):this.scheduleType(Dt)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(kt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Dt)):this.scheduleType(kt))}}}),jt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Mt={class:`cb-thinking__word`},Nt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Pt(t,n,o,c,l,d){let f=u(`loading-icon`);return _(),s(`div`,jt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Mt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Nt,`(`+i(t.elapsed)+`s)`,1)])}var Ft=W(At,[[`render`,Pt],[`__scopeId`,`data-v-ae116215`]]),It=v({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:O,FileIcon:M,FolderIcon:ae,RedoIcon:U,UpIcon:k,ElDialog:G,ElButton:K,ElInput:q},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),Lt={class:`flex flex-col gap-2`},Rt={class:`flex items-center gap-2 min-w-0`},zt={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},Bt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},Vt={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},Ht=[`onClick`],Ut={class:`truncate`,dir:`ltr`},Wt={class:`truncate`,dir:`ltr`},Gt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},Kt={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},qt={class:`flex items-center justify-end gap-2`};function Jt(t,d,m,g,v,y){let b=u(`up-icon`),x=u(`el-button`),S=u(`continue-icon`),C=u(`el-input`),w=u(`redo-icon`),T=u(`folder-icon`),E=u(`file-icon`),D=u(`el-dialog`);return _(),f(D,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:p(()=>[e(`div`,qt,[a(x,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(x,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:p(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:p(()=>[e(`div`,Lt,[e(`div`,Rt,[a(x,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(C,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:p(()=>[a(x,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:p(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(x,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:p(()=>[a(w,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,zt,[t.loading&&!t.listing?(_(),s(`div`,Bt,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(_(),s(`div`,Vt,i(t.listing.error),1)):(_(),s(l,{key:2},[(_(!0),s(l,null,h(t.directories,n=>(_(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(T,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Ut,i(n.name),1)],8,Ht))),128)),(_(!0),s(l,null,h(t.files,t=>(_(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Wt,i(t.name),1)]))),128)),t.isEmpty?(_(),s(`div`,Gt,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(_(),s(`p`,Kt,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var Yt=W(It,[[`render`,Jt]]),Xt=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,Zt=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,Qt=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`,$t=50*1024*1024,$=10,en=60,tn=60,nn={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},rn=v({name:`CodingBridgeSessionView`,components:{AddIcon:H,AiIcon:ee,AttachmentIcon:ce,CloseIcon:Y,CodeIcon:j,ConfirmIcon:A,DeveloperIcon:I,EditIcon:V,ExpandDownIcon:te,FileIcon:M,FolderOpenIcon:we,HistoryIcon:P,PerformanceIcon:oe,RedoIcon:U,SecurityIcon:N,StopIcon:ue,UpIcon:k,ViewIcon:re,ElInput:q,ElButton:K,ElPopover:T,ElDropdown:w,ElDropdownMenu:C,ElDropdownItem:S,ElUpload:y,ElCheckbox:b,ElSkeleton:D,ElSkeletonItem:E,TranscriptItem:wt,ThinkingIndicator:Ft,DirectoryDialog:Yt,AskUserQuestionCard:B,CopyToClipboard:ye},mixins:[pe],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:he()+`/api/v1/files/`,maxAttachments:$,visibleCount:en}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===J.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&qe(t));return t?{request_id:t.request_id,payload:Je(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&this.connected&&this.nodeOnline},composerHint(){return this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{events(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.scrollToBottom(),this.visibleCount=en,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings()},methods:{requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return nn[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.prompt=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=$?(X.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$})),!1):e.size>$t?(X.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){X.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){X.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){this.$nextTick(()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)})},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.visibleCount+=tn,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),an={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},on={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},sn={class:`text-sm`},cn={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},ln={class:`flex items-center gap-2 min-w-0`},un=[`title`,`aria-label`],dn={class:`min-w-0`},fn={class:`flex items-center gap-2 font-medium`},pn={class:`truncate`},mn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},hn={key:0,class:`text-[var(--el-color-primary)]`},gn={class:`flex items-center gap-2 flex-none`},_n={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},vn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},yn={class:`opacity-70 flex-none`},bn=[`title`],xn={ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`},Sn={key:0,class:`cb-skeleton`},Cn={class:`flex flex-col gap-4`},wn={class:`flex justify-end`},Tn={class:`flex flex-col gap-1.5`},En={class:`flex justify-end`},Dn={class:`flex flex-col gap-1.5`},On={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},kn=[`title`],An={key:4,class:`flex justify-center pt-1`},jn={key:2,class:`cb-question-dock flex-none px-5`},Mn={class:`border-t border-[var(--app-border-subtle)] p-3`},Nn={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},Pn={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},Fn={class:`inline-flex items-center gap-1.5`},In={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},Ln={key:0,class:`flex flex-wrap gap-2 pb-2`},Rn=[`src`,`alt`],zn={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},Bn=[`title`],Vn={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},Hn=[`title`,`aria-label`,`onClick`],Un={key:1,class:`cb-slash-menu`},Wn=[`onMousedown`,`onMouseenter`],Gn={class:`cb-slash-menu__name`},Kn={key:0,class:`cb-slash-menu__hint`},qn={key:1,class:`cb-slash-menu__desc`},Jn={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},Yn={class:`mt-1.5 flex items-center gap-1.5`},Xn=[`title`,`aria-label`],Zn={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Qn={type:`button`,class:`cb-pill`},$n=[`src`],er={class:`truncate`},tr=[`src`],nr={key:1,class:`ml-1 text-xs opacity-60`},rr={key:1,class:`cb-pill cb-pill--static`},ir=[`src`],ar={class:`truncate`},or={type:`button`,class:`cb-pill`},sr={class:`truncate`},cr={class:`cb-model-menu`},lr={class:`truncate`},ur=[`onClick`],dr={class:`truncate`},fr={key:0,class:`cb-model-custom`},pr={type:`button`,class:`cb-pill`},mr={class:`truncate`},hr={type:`button`,class:`cb-pill`},gr={class:`truncate`},_r={type:`button`,class:`cb-pill`},vr={class:`truncate`},yr=[`title`,`aria-label`],br={key:4,class:`cb-pill cb-pill--static`},xr={class:`truncate`},Sr={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function Cr(d,m,g,v,y,b){let x=u(`developer-icon`),S=u(`el-button`),C=u(`history-icon`),w=u(`add-icon`),T=u(`copy-to-clipboard`),E=u(`el-skeleton-item`),D=u(`el-skeleton`),O=u(`up-icon`),k=u(`transcript-item`),ee=u(`thinking-indicator`),A=u(`redo-icon`),te=u(`ask-user-question-card`),j=u(`view-icon`),ne=u(`edit-icon`),re=u(`el-checkbox`),ie=u(`file-icon`),M=u(`close-icon`),N=u(`el-input`),ae=u(`el-upload`),oe=u(`attachment-icon`),P=u(`code-icon`),F=u(`expand-down-icon`),I=u(`confirm-icon`),L=u(`el-dropdown-item`),R=u(`el-dropdown-menu`),z=u(`el-dropdown`),se=u(`ai-icon`),B=u(`el-popover`),ce=u(`performance-icon`),V=u(`security-icon`),H=u(`folder-open-icon`),U=u(`stop-icon`),le=u(`directory-dialog`);return _(),s(`div`,an,[d.currentNode?(_(),s(l,{key:1},[e(`div`,cn,[e(`div`,ln,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:m[1]||=e=>d.$emit(`devices`)},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,un),e(`div`,dn,[e(`div`,fn,[e(`span`,pn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(_(),s(`div`,mn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(_(),s(`span`,hn,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,gn,[a(S,{size:`small`,round:``,onClick:m[2]||=e=>d.$emit(`history`)},{default:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(_(),f(S,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(_(),s(`div`,_n,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(_(),s(`div`,vn,[(_(!0),s(l,null,h(d.diagnostics,t=>(_(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,yn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,bn),a(T,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,xn,[d.historyLoading&&!d.events.length?(_(),s(`div`,Sn,[a(D,{animated:``},{template:p(()=>[e(`div`,Cn,[e(`div`,wn,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Tn,[a(E,{variant:`text`,style:{width:`55%`}}),a(E,{variant:`text`,style:{width:`88%`}}),a(E,{variant:`text`,style:{width:`70%`}})]),a(E,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,En,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,Dn,[a(E,{variant:`text`,style:{width:`80%`}}),a(E,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(_(),s(`div`,On,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(_(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:m[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,kn)):o(``,!0),(_(!0),s(l,null,h(d.visibleEvents,e=>(_(),f(k,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(_(),f(ee,{key:3})):o(``,!0),d.canRetry?(_(),s(`div`,An,[a(S,{size:`small`,round:``,onClick:d.onRetry},{default:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],512),d.pendingQuestion?(_(),s(`div`,jn,[(_(),f(te,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,Mn,[d.readonly?(_(),s(`div`,Nn,[a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(S,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(_(),s(l,{key:1},[d.editingActive?(_(),s(`div`,Pn,[e(`span`,Fn,[a(ne,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(_(),f(re,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":m[4]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:p(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:m[5]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,In,[d.attachmentFileList.length?(_(),s(`div`,Ln,[(_(!0),s(l,null,h(d.attachmentFileList,(t,n)=>(_(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(_(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,Rn)):(_(),s(`span`,zn,[a(ie,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,Bn),d.isAttachmentUploading(t)?(_(),s(`span`,Vn,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(M,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Hn)]))),128))])):o(``,!0),d.slashMenuVisible?(_(),s(`ul`,Un,[(_(!0),s(l,null,h(d.slashMatches,(r,a)=>(_(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,Gn,`/`+i(r.name),1),r.argument_hint?(_(),s(`span`,Kn,i(r.argument_hint),1)):o(``,!0),r.description?(_(),s(`span`,qn,i(r.description),1)):o(``,!0)],42,Wn))),128))])):o(``,!0),a(N,{modelValue:d.prompt,"onUpdate:modelValue":m[6]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`placeholder`,`onKeydown`]),a(ae,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":m[7]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:p(()=>[e(`span`,Jn,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,Yn,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:m[8]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(oe,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xn),e(`div`,Zn,[d.isNewSession?(_(),f(z,{key:0,trigger:`click`,onCommand:m[9]||=e=>d.provider=e},{dropdown:p(()=>[a(R,null,{default:p(()=>[(_(!0),s(l,null,h(d.providerOptions,e=>(_(),f(L,{key:e.value,command:e.value,disabled:!e.available},{default:p(()=>[a(I,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(_(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,tr)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(_(),s(`span`,nr,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:p(()=>[e(`button`,Qn,[d.providerIcon(d.provider)?(_(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,$n)):(_(),f(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,er,i(d.providerName(d.provider)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(_(),s(`span`,rr,[d.providerIcon(d.currentSession?.provider||`claude`)?(_(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,ir)):(_(),f(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,ar,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),a(B,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:p(()=>[e(`button`,or,[a(se,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,sr,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[e(`div`,cr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:m[10]||=e=>d.selectModel(``)},[a(I,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,lr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(_(!0),s(l,null,h(d.modelOptions,t=>(_(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(I,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,dr,i(t.label),1)],8,ur))),128)),d.allowCustomModel?(_(),s(`div`,fr,[a(N,{modelValue:d.customModelDraft,"onUpdate:modelValue":m[11]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:p(()=>[a(S,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:p(()=>[a(I,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512),d.effortOptions.length>1?(_(),f(z,{key:2,trigger:`click`,onCommand:m[12]||=e=>d.effort=e},{dropdown:p(()=>[a(R,null,{default:p(()=>[(_(!0),s(l,null,h(d.effortOptions,e=>(_(),f(L,{key:e.value,command:e.value},{default:p(()=>[a(I,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,pr,[a(ce,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,mr,i(d.effortLabel(d.effort)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):o(``,!0),a(z,{trigger:`click`,onCommand:m[13]||=e=>d.permissionMode=e},{dropdown:p(()=>[a(R,null,{default:p(()=>[(_(!0),s(l,null,h(d.permissionModeOptions,e=>(_(),f(L,{key:e.value,command:e.value},{default:p(()=>[a(I,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,hr,[a(V,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,gr,i(d.permissionModeLabel(d.permissionMode)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1}),d.canPickCwd?(_(),f(B,{key:3,trigger:`click`,placement:`top-start`,width:320},{reference:p(()=>[e(`button`,_r,[a(H,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,vr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[a(N,{modelValue:d.cwd,"onUpdate:modelValue":m[17]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:p(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:m[14]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[m[15]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),m[16]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(H,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,yr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):d.currentSession?.cwd?(_(),s(`span`,br,[a(H,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xr,i(d.currentSession?.cwd),1)])):o(``,!0)]),d.running?(_(),f(S,{key:0,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:p(()=>[a(U,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(S,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:p(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,Sr,i(d.composerHint),1)],64))])],64)):(_(),s(`div`,on,[a(x,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,sn,i(d.$t(`codingBridge.session.noDevice`)),1),a(S,{class:`md:hidden mt-4`,round:``,onClick:m[0]||=e=>d.$emit(`devices`)},{default:p(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(le,{visible:d.directoryVisible,"onUpdate:visible":m[18]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var wr=W(rn,[[`render`,Cr],[`__scopeId`,`data-v-05e55dc1`]]),Tr=v({name:`CodingBridgePairDialog`,components:{LinkIcon:L,ElDialog:G,ElInput:q,ElButton:K},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===J.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);X.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?X.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?X.error(this.$t(`codingBridge.pair.usedCode`)):X.error(this.$t(`codingBridge.pair.failed`))}}}}),Er={class:`content`},Dr={class:`text-sm text-[var(--app-text-subtle)] mb-4`},Or={class:`steps list-none m-0 p-0 mb-4`},kr={class:`flex gap-3 mb-3`},Ar={class:`flex-1 min-w-0`},jr={class:`text-sm mb-1`},Mr={class:`flex gap-3 mb-3`},Nr={class:`flex-1 min-w-0`},Pr={class:`text-sm mb-1`},Fr={class:`flex gap-3`},Ir={class:`flex-1 min-w-0`},Lr={class:`text-sm`};function Rr(t,n,o,s,l,d){let m=u(`el-input`),h=u(`link-icon`),g=u(`el-button`),v=u(`el-dialog`);return _(),f(v,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Er,[e(`p`,Dr,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,Or,[e(`li`,kr,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,Ar,[e(`p`,jr,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,Mr,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,Nr,[e(`p`,Pr,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,Fr,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,Ir,[e(`p`,Lr,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(m,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(g,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var zr=W(Tr,[[`render`,Rr],[`__scopeId`,`data-v-54bd85f1`]]),Br=v({name:`CodingBridgePermissionDialog`,components:{CloseIcon:Y,CodeIcon:j,ConfirmIcon:A,ElDialog:G,ElButton:K},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!qe(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),Vr={key:0,class:`content`},Hr={class:`text-sm text-[var(--app-text-subtle)] mb-3`},Ur={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Wr={class:`flex items-center gap-2 font-medium`},Gr={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},Kr={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},qr={class:`flex justify-end gap-2`};function Jr(t,n,c,l,d,m){let h=u(`code-icon`),g=u(`close-icon`),v=u(`el-button`),y=u(`confirm-icon`),b=u(`el-dialog`);return _(),f(b,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:p(()=>[e(`div`,qr,[a(v,{round:``,onClick:t.onDeny},{default:p(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(v,{type:`primary`,round:``,onClick:t.onAllow},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:p(()=>[t.request?(_(),s(`div`,Vr,[e(`p`,Hr,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,Ur,[e(`div`,Wr,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(_(),s(`p`,Gr,i(t.request.description),1)):o(``,!0),t.hasInput?(_(),s(`pre`,Kr,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Yr=W(Br,[[`render`,Jr]]),Xr={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},Zr=v({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:j,RedoIcon:U,ElDrawer:x,ElButton:K},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===J.Request},sessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)}},methods:{providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return Xr[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),Qr={class:`flex flex-col h-full`},$r={class:`flex items-center justify-between mb-3`},ei={class:`text-xs text-[var(--app-text-subtle)] m-0`},ti={key:0,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ni={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ri={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},ii={key:3,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},ai=[`onClick`],oi={class:`flex items-center gap-2 mb-1`},si=[`src`,`alt`],ci={class:`text-sm font-medium truncate flex-1`},li=[`title`],ui={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},di={key:0},fi={key:1},pi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},mi={key:0},hi={key:1};function gi(t,c,d,m,g,v){let y=u(`redo-icon`),b=u(`el-button`),x=u(`code-icon`),S=u(`el-drawer`);return _(),f(S,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[0]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Qr,[e(`div`,$r,[e(`p`,ei,i(t.$t(`codingBridge.history.intro`)),1),a(b,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:p(()=>[t.loading?o(``,!0):(_(),f(y,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.currentNodeId?t.loading&&!t.sessions.length?(_(),s(`div`,ni,i(t.$t(`codingBridge.history.loading`)),1)):t.sessions.length?(_(),s(`ul`,ii,[(_(!0),s(l,null,h(t.sessions,r=>(_(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,oi,[t.providerIcon(r.provider)?(_(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,si)):(_(),f(x,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,ci,i(r.title),1),r.running?(_(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,li)):o(``,!0)]),e(`div`,ui,[r.cwd?(_(),s(`span`,di,i(r.cwd),1)):o(``,!0),r.git_branch?(_(),s(`span`,fi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,pi,[r.updated_at?(_(),s(`span`,mi,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(_(),s(`span`,hi,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,ai))),128))])):(_(),s(`div`,ri,i(t.$t(`codingBridge.history.empty`)),1)):(_(),s(`div`,ti,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var _i=v({name:`CodingBridgeIndex`,components:{ElDrawer:x,NodeList:Ge,SessionView:wr,PairDialog:zr,PermissionDialog:Yr,HistoryDrawer:W(Zr,[[`render`,gi],[`__scopeId`,`data-v-af006e93`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),vi={class:`coding-bridge flex flex-row h-full relative`};function yi(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),m=u(`permission-dialog`),h=u(`history-drawer`);return _(),s(`div`,vi,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:p(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(m),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var bi=W(_i,[[`render`,yi],[`__scopeId`,`data-v-2879fe0f`]]);export{bi as default};
@@ -1 +0,0 @@
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-P7S1oH5l.js";import{t as y}from"./tooltip-CKybjVoe.js";import{t as b}from"./alert-WwBUWB1y.js";import{t as x}from"./drawer-C56tib0X.js";import{t as S}from"./switch-Dv11DKLB.js";import{n as C}from"./taskDrawerMixin-t0oG4ly6.js";import{t as w}from"./clock-CUWhpM5A.js";import{r as T,t as E}from"./PromptTextarea-CvewN2gz.js";import{t as D}from"./info-Cf_6Kyvd.js";import{t as O}from"./trash-2-Clo-ZGm4.js";import{t as k}from"./triangle-alert--PIu81za.js";import{t as A}from"./upload-UyzbopDC.js";import{t as j}from"./wand-sparkles-CZEkkfey.js";import"./constants-CGPrJer0.js";import{Bt as M,E as N,Fi as P,Gt as F,Ht as ee,Kn as I,Ut as L,Vt as R,ai as z,bi as te,ci as B,en as V,xi as H,yr as U}from"./index-qY8Xwe-x.js";import{t as W}from"./CopyToClipboard-zxMSspk6.js";import{t as G}from"./FilePreview-CIK3LdbH.js";import{t as K}from"./ImagePreview-DI9PzDrr.js";import{t as q}from"./Consumption-DvLMdgth.js";import{a as J,n as Y,r as X,t as Z}from"./pagination-CCsgYx3G.js";import{t as Q}from"./VideoPlayer-CuPK2nmG.js";import{t as ne}from"./ApiCodeButton-D_45ZZNZ.js";import{t as re}from"./BotPlaceholder-CWvJLsQt.js";var ie=_({name:`LayoutLuma`,components:{MagicIcon:j,ElDrawer:x,ElButton:P},mixins:[C]}),ae={class:`main flex flex-row flex-1`},oe={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)]`},se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ce(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ae,[e(`div`,oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,se,[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 le=N(ie,[[`render`,ce],[`__scopeId`,`data-v-d13d43a9`]]),ue=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:J},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)}}),de={class:`relative`},fe={class:`flex justify-between`},pe={class:`flex justify-start items-center`},me={class:`text-sm font-bold`},he={class:`flex justify-end items-center`};function ge(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,de,[e(`div`,fe,[e(`div`,pe,[e(`span`,me,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,he,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var _e=N(ue,[[`render`,ge]]),ve=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:J},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)}}),ye={class:`relative`},be={class:`flex justify-between`},xe={class:`flex justify-start items-center`},Se={class:`text-sm font-bold`},Ce={class:`flex justify-end items-center`};function we(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,ye,[e(`div`,be,[e(`div`,xe,[e(`span`,Se,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ce,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Te=N(ve,[[`render`,we]]),Ee=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:J},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)}}),De={class:`relative`},Oe={class:`flex justify-between`},ke={class:`flex justify-start items-center`},Ae={class:`text-sm font-bold`},je={class:`flex justify-end items-center`};function Me(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,De,[e(`div`,Oe,[e(`div`,ke,[e(`span`,Ae,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,je,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ne=N(Ee,[[`render`,Me]]),Pe=_({name:`EndImage`,components:{UploadIcon:A,ElUpload:v,ElButton:P,ImagePreview:K,InfoIcon:J},mixins:[L,R],data(){return{fileList:[],uploadUrl:B()+`/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(){H.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){H.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()}}}),Fe={class:`relative`},Ie={class:`flex justify-between`},Le={class:`flex justify-start items-center`},Re={class:`text-sm font-bold`};function ze(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`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`span`,Re,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,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`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Be=N(Pe,[[`render`,ze],[`__scopeId`,`data-v-e2470a75`]]),Ve=_({name:`StartImage`,components:{UploadIcon:A,ElUpload:v,ElButton:P,ImagePreview:K,InfoIcon:J},mixins:[L,R],data(){return{fileList:[],uploadUrl:B()+`/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(){H.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){H.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()}}}),He={class:`relative`},Ue={class:`flex justify-between`},We={class:`flex justify-start items-center`},Ge={class:`text-sm font-bold`};function Ke(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`,He,[e(`div`,Ue,[e(`div`,We,[e(`span`,Ge,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,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`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var qe=N(Ve,[[`render`,Ke],[`__scopeId`,`data-v-122aced6`]]),Je=_({name:`UploadVideo`,components:{UploadIcon:A,ElUpload:v,ElButton:P,InfoIcon:J,FilePreview:G},mixins:[R],data(){return{fileList:[],uploadUrl:B()+`/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(){H.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){H.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(H.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(H.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()}}}),Ye={class:`relative`},Xe={class:`flex justify-between`},Ze={class:`flex justify-start items-center`},Qe={class:`text-sm font-bold`};function $e(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`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`span`,Qe,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{"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 et=N(Je,[[`render`,$e],[`__scopeId`,`data-v-8d27905e`]]),tt=_({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 nt(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 rt=N(tt,[[`render`,nt]]),it=_({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}}}),at={class:`relative`},ot={class:`flex mb-2`},st={class:`text-sm font-bold`};function ct(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,at,[e(`div`,ot,[e(`span`,st,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 lt=_({name:`ConfigPanel`,components:{MagicIcon:j,LoopSelector:Ne,StartImageInput:qe,EndImageInput:Be,EnhancementSelector:_e,ElButton:P,PromptInput:rt,ExtendFromInput:N(it,[[`render`,ct]]),CustomSelector:Te,UploadVideo:et,Consumption:q},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return F(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ut={class:`flex flex-col h-full`},dt={class:`flex-1 overflow-y-auto p-5`},ft={class:`flex flex-col items-center justify-center px-5 pb-5`};function pt(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`,ut,[e(`div`,dt,[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`,ft,[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 mt=N(lt,[[`render`,pt]]),ht=_({name:`TaskPreview`,components:{DeleteIcon:O,ChannelIcon:T,InfoIcon:D,MagicIcon:j,TimeIcon:w,WarningIcon:k,CopyToClipboard:W,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:P,ApiCodeButton:ne},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 te.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}),H.success(this.$t(`common.message.deleteTaskSuccess`))}catch{H.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`)}}}),gt={class:`preview`},_t={class:`left`},vt={class:`main`},yt={class:`bot`},bt={class:`datetime`},xt=[`aria-label`],St={class:`info`},Ct={key:0,class:`prompt mt-2`},wt={key:0},Tt={key:1},Et={key:0,class:n({content:!0,failed:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:1,class:n({content:!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ft={key:2,class:n({content:!0})},It={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Lt(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(`magic-icon`),C=l(`copy-to-clipboard`),w=l(`time-icon`),T=l(`el-alert`),E=l(`warning-icon`),D=l(`info-icon`),O=l(`channel-icon`);return h(),s(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,vt,[e(`div`,yt,[a(g,{capability:`luma`,part:`name`}),e(`span`,bt,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,xt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,St,[n.modelValue?.request?.prompt?(h(),s(`p`,Ct,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,wt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Tt,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Et,[n.modelValue.response.video_url?(h(),s(`div`,Dt,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Ot,[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`])])):o(``,!0),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,kt,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(w,{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`,jt,[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Mt,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Nt,[a(D,{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(C,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(w,{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`,Pt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(C,{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`,Ft,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(w,{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`,It,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Rt=_({name:`RecentPanel`,components:{BotPlaceholder:re,TaskPreview:N(ht,[[`render`,Lt],[`__scopeId`,`data-v-6411e1a8`]]),NoTasks:X,ScrollList:Y},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?.()}}}),zt={key:0},Bt={key:2,class:`w-full h-full flex items-center justify-center`};function Vt(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`,zt,[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`,Bt,[a(v)])):o(``,!0)],64)}var Ht=_({name:`LumaIndex`,components:{ConfigPanel:mt,Layout:le,RecentPanel:N(Rt,[[`render`,Vt]])},mixins:[ee],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===z.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===z.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 Z({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(!M(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){H.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!V())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}H.info(this.$t(`luma.message.startingTask`)),U(`luma`,I.generate(e,{token:t})).then(()=>{H.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`luma.message.usedUp`)):H.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 Ut(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 Wt=N(Ht,[[`render`,Ut]]);export{Wt as default};
@@ -1 +0,0 @@
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,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-Kj17huxb.js";import{t as S}from"./upload-P7S1oH5l.js";import{t as C}from"./tooltip-CKybjVoe.js";import{t as w}from"./alert-WwBUWB1y.js";import{t as T}from"./drawer-C56tib0X.js";import{n as E}from"./taskDrawerMixin-t0oG4ly6.js";import{t as D}from"./box-C5_1LyPO.js";import{t as O}from"./clock-CUWhpM5A.js";import{t as k}from"./external-link-CanGZR_C.js";import{r as A,t as j}from"./PromptTextarea-CvewN2gz.js";import{t as M}from"./image-hOAqdX9u.js";import{t as N}from"./info-Cf_6Kyvd.js";import{t as P}from"./trash-2-Clo-ZGm4.js";import{t as F}from"./triangle-alert--PIu81za.js";import{t as I}from"./upload-UyzbopDC.js";import{t as L}from"./wand-sparkles-CZEkkfey.js";import{t as ee}from"./zap-3Q4xYCWy.js";import{Gn as R,Kn as z,Un as B,Vn as te,Wn as ne}from"./constants-CGPrJer0.js";import{Bt as re,Dn as ie,E as V,Fi as H,Gt as U,Ht as W,Ut as G,Vt as K,ai as q,bi as J,ci as Y,en as ae,xi as X,yr as oe}from"./index-qY8Xwe-x.js";import{t as se}from"./CopyToClipboard-zxMSspk6.js";import{t as Z}from"./ImagePreview-DI9PzDrr.js";import{t as ce}from"./Consumption-DvLMdgth.js";import{a as Q,n as le,r as ue,t as de}from"./pagination-CCsgYx3G.js";import{t as fe}from"./ApiCodeButton-D_45ZZNZ.js";import{t as pe}from"./BotPlaceholder-CWvJLsQt.js";import{t as me}from"./ImageWrapper-CcXyFr-X.js";var he=y({name:`LayoutNanobanana`,components:{MagicIcon:L,ElDrawer:T,ElButton:H},mixins:[E]}),ge={class:`main flex flex-row flex-1`},_e={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)]`},ve={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ye(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,ge,[e(`div`,_e,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,ve,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var be=V(he,[[`render`,ye],[`__scopeId`,`data-v-6419fc74`]]),xe=y({name:`PromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Se(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ce=V(xe,[[`render`,Se]]),we=y({name:`ImageUrlsInput`,components:{UploadIcon:I,ElUpload:S,ElButton:H,InfoIcon:Q,ImagePreview:Z},mixins:[G,K],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.nanobanana?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){X.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){X.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Te={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Ee={class:`flex min-w-0 items-center`},De={class:`title m-0 text-[14px] font-bold`},Oe={class:`file-list flex flex-wrap gap-[10px]`};function ke(t,n,o,c,d,f){let h=u(`info-icon`),v=u(`upload-icon`),y=u(`el-button`),b=u(`el-upload`),x=u(`image-preview`);return _(),s(`div`,null,[e(`div`,Te,[e(`div`,Ee,[e(`h2`,De,i(t.$t(`nanobanana.name.imageUrls`)),1),a(h,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:5,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:m(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Oe,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ae=V(we,[[`render`,ke]]),je=y({name:`AspectRatioSelector`,components:{InfoIcon:Q},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),Me={class:`ratio`},Ne={class:`header`},Pe={class:`title font-bold`},Fe=[`aria-label`],Ie=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Le={class:`preview`},Re={class:`name`};function ze(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,Le,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,Re,i(a.label),1)],42,Ie))),128))],8,Fe)])}var Be=V(je,[[`render`,ze],[`__scopeId`,`data-v-7131eb97`]]),Ve=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Q},data(){return{options:[{value:B,label:this.$t(`nanobanana.model.nanoBanana`)},{value:R,label:R},{value:z,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:ne,label:this.$t(`nanobanana.model.nanoBanana2`)}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=te}}),He={class:`field`},Ue={class:`label`},We={class:`box`},Ge={class:`title font-bold`};function Ke(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,He,[e(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var qe=V(Ve,[[`render`,Ke],[`__scopeId`,`data-v-11cb675b`]]),Je=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Q},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),Ye={class:`field`},Xe={class:`label`},Ze={class:`box`},Qe={class:`title font-bold`};function $e(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var et=y({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:H,PromptInput:Ce,Consumption:ce,ImageUrlsInput:Ae,AspectRatioSelector:Be,ModelSelector:qe,ResolutionSelector:V(Je,[[`render`,$e],[`__scopeId`,`data-v-7ab9d4d4`]])},emits:[`generate`],computed:{config(){return this.$store.state.nanobanana?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return U({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),tt={class:`flex flex-col h-full`},nt={class:`flex-1 overflow-y-auto p-5`},rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function it(t,n,o,c,l,d){let f=u(`model-selector`),p=u(`resolution-selector`),h=u(`prompt-input`),g=u(`aspect-ratio-selector`),v=u(`image-urls-input`),y=u(`consumption`),b=u(`magic-icon`),x=u(`el-button`);return _(),s(`div`,tt,[e(`div`,nt,[a(f,{class:`mb-4`}),a(p,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,rt,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`onClick`])])])}var at=V(et,[[`render`,it]]),ot=y({name:`TaskPreview`,components:{ApplicationIcon:D,ChannelIcon:A,DeleteIcon:P,ExternalLinkIcon:k,ImageIcon:M,InfoIcon:N,LightningIcon:ee,MagicIcon:L,TimeIcon:O,WarningIcon:F,CopyToClipboard:se,ElAlert:w,ImageWrapper:me,ElButton:H,ElTooltip:C,ImagePreview:Z,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},showResult(){let e=this.modelValue?.response;return e?e.success===!0?!0:this.hasImages&&e.success!==!1:!1}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await J.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(`nanobanana/deleteTask`,{id:e}),X.success(this.$t(`common.message.deleteTaskSuccess`))}catch{X.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),st={class:`preview`},ct={class:`left`},lt={class:`main`},ut={class:`bot`},dt={class:`datetime`},ft=[`aria-label`],pt={class:`info`},mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},ht={key:1,class:`prompt mt-2`},gt={key:0},_t={key:0,class:n({content:!0,failed:!0})},vt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},yt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ft={key:2,class:n({content:!0})},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Vt(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`image-preview`),C=u(`image-wrapper`),w=u(`el-button`),T=u(`api-code-button`),E=u(`application-icon`),D=u(`image-icon`),O=u(`external-link-icon`),k=u(`lightning-icon`),A=u(`magic-icon`),j=u(`copy-to-clipboard`),M=u(`time-icon`),N=u(`channel-icon`),P=u(`el-alert`),F=u(`warning-icon`),I=u(`info-icon`);return _(),s(`div`,st,[e(`div`,ct,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,lt,[e(`div`,ut,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,dt,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:m(()=>[n.modelValue?.id?(_(),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(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ft)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,pt,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,mt,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,ht,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,gt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,_t,[e(`div`,vt,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(C,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,yt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`])]),a(P,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,bt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,xt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,St,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Ct,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,wt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Tt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Et,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1||n.modelValue?.response?.error?(_(),s(`div`,Dt,[a(P,{closable:!1,class:`failure`},{template:m(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Ot,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,At,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Mt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Nt,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,$,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Pt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,Ft,[a(P,{closable:!1,class:`info`},{template:m(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,It,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Lt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Rt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,zt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Bt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Ht=y({name:`RecentPanel`,components:{TaskPreview:V(ot,[[`render`,Vt],[`__scopeId`,`data-v-8a190878`]]),BotPlaceholder:pe,NoTasks:ue,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ut={key:0},Wt={key:2,class:`w-full h-full flex items-center justify-center`};function Gt(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,Ut,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{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:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,Wt,[a(v)])):o(``,!0)],64)}var Kt=y({name:`NanobananaIndex`,components:{ConfigPanel:at,Layout:be,RecentPanel:V(Ht,[[`render`,Gt]])},mixins:[W],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===q.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.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 de({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/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.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!re(this.uploadTracker,e=>this.$t(e),e=>X.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;delete e.action,!t&&`image_urls`in e&&delete e.image_urls,e?.aspect_ratio||delete e.aspect_ratio;let n=e?.model===`nano-banana-2`||e?.model===`nano-banana-pro`;!n&&`resolution`in e&&delete e.resolution,n&&!e?.resolution&&(e.resolution=`1K`);let r={...e,action:t?`edit`:`generate`,async:!0};if(!ae())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}X.info(this.$t(`nanobanana.message.startingTask`)),oe(`nanobanana`,ie.generate(r,{token:i})).then(()=>{X.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?X.error(this.$t(`nanobanana.message.usedUp`)):X.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function qt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return _(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Jt=V(Kt,[[`render`,qt]]);export{Jt as default};
@@ -1 +0,0 @@
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,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-Kj17huxb.js";import{t as x}from"./upload-P7S1oH5l.js";import{t as S}from"./tooltip-CKybjVoe.js";import{t as C}from"./alert-WwBUWB1y.js";import{t as w}from"./drawer-C56tib0X.js";import{t as T}from"./input-number-I6Tu7oha.js";import{t as E}from"./switch-Dv11DKLB.js";import{n as D}from"./taskDrawerMixin-t0oG4ly6.js";import{t as O}from"./box-C5_1LyPO.js";import{t as k}from"./clock-CUWhpM5A.js";import{n as A,r as j,t as M}from"./PromptTextarea-CvewN2gz.js";import{t as N}from"./info-Cf_6Kyvd.js";import{t as P}from"./trash-2-Clo-ZGm4.js";import{t as F}from"./triangle-alert--PIu81za.js";import{t as I}from"./upload-UyzbopDC.js";import{t as L}from"./volume-2-CGazqEkn.js";import{t as R}from"./wand-sparkles-CZEkkfey.js";import{$t as ee,Gt as te,Kt as ne,Qt as re,Xt as ie,Yt as ae,Zt as oe,an as se,cn as z,en as ce,fn as B,in as le,ln as V,nn as ue,on as de,rn as fe,sn as pe,tn as me,un as H}from"./constants-CGPrJer0.js";import{Bt as he,E as U,Fi as W,Gt as ge,Ht as _e,Ut as G,Vt as K,ai as q,bi as ve,ci as J,en as ye,wn as be,xi as Y,yr as xe}from"./index-qY8Xwe-x.js";import{t as Se}from"./CopyToClipboard-zxMSspk6.js";import{t as X}from"./ImagePreview-DI9PzDrr.js";import{t as Ce}from"./Consumption-DvLMdgth.js";import{a as Z,n as we,r as Te,t as Ee}from"./pagination-CCsgYx3G.js";import{t as De}from"./VideoPlayer-CuPK2nmG.js";import{t as Oe}from"./ApiCodeButton-D_45ZZNZ.js";import{t as ke}from"./BotPlaceholder-CWvJLsQt.js";import{t as Ae}from"./ImageWrapper-CcXyFr-X.js";import{n as je,t as Me}from"./AudioPreview-CgByAntF.js";var Ne=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:w,ElButton:W},mixins:[D]}),Pe={class:`main flex flex-row flex-1`},Fe={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)]`},Ie={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[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`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Re=U(Ne,[[`render`,Le],[`__scopeId`,`data-v-ff53dce1`]]),ze=v({name:`SeedancePromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Be(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ve=U(ze,[[`render`,Be]]),He=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ce,label:this.$t(`seedance.model.seedance20`)},{value:me,label:this.$t(`seedance.model.seedance20Fast`)},{value:ue,label:this.$t(`seedance.model.seedance20Mini`)},{value:ee,label:this.$t(`seedance.model.seedance15pro`)},{value:oe,label:this.$t(`seedance.model.seedance10pro`)},{value:re,label:this.$t(`seedance.model.seedance10proFast`)},{value:ie,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ae,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=te}}),Ue={class:`field`},We={class:`label`},Ge={class:`box`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Je=U(He,[[`render`,qe],[`__scopeId`,`data-v-deb4c429`]]),Ye=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Xe={class:`field`},Ze={class:`label`},Qe={class:`box`},$e={class:`title font-bold`};function et(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`h2`,$e,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var tt=U(Ye,[[`render`,et],[`__scopeId`,`data-v-d61cc21b`]]),Q={[V]:0,[H]:1,[z]:2,"4k":3},nt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:V,label:`480p`},{value:H,label:`720p`},{value:z,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),rt={class:`resolution`},it={class:`header`},at={class:`title font-bold`},ot={class:`items`},st=[`onClick`];function ct(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ot,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,st)]),_:2},1032,[`content`,`disabled`]))),128))])])}var lt=U(nt,[[`render`,ct],[`__scopeId`,`data-v-db7e8aff`]]),ut=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:le,label:`16:9`,w:32,h:18},{value:de,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:se,label:`21:9`,w:34,h:14},{value:pe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ne}}),dt={class:`ratio`},ft={class:`header`},pt={class:`title font-bold`},mt={class:`items`},ht=[`onClick`],gt={class:`preview`},_t={key:1,class:`rect rect-auto`},vt={class:`name`};function yt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,dt,[e(`div`,ft,[e(`h2`,pt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,mt,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,gt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,_t,`A`))]),e(`div`,vt,i(r.label),1)],10,ht))),128))])])}var bt=U(ut,[[`render`,yt],[`__scopeId`,`data-v-8ddec2dd`]]),xt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Ot=U(xt,[[`render`,Dt],[`__scopeId`,`data-v-df51dfbd`]]),kt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),At={class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var It=U(kt,[[`render`,Ft],[`__scopeId`,`data-v-ae777d61`]]),Lt=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:W,InfoIcon:Z,ImagePreview:X},mixins:[G,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){Y.warning(this.$t(`seedance.message.uploadExceed`))},onError(){Y.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Rt={key:0,class:`relative`},zt={class:`flex min-h-8 items-center pr-20`},Bt={class:`flex justify-start items-center`},Vt={class:`text-sm font-bold`},Ht={key:0,class:`required-badge`};function Ut(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`span`,Vt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Ht,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},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:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),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(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Wt=U(Lt,[[`render`,Ut],[`__scopeId`,`data-v-580c8fd6`]]),Gt=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:W,ImagePreview:X,InfoIcon:Z},mixins:[G,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){Y.warning(this.$t(`seedance.message.uploadExceed`))},onError(){Y.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Kt={key:0,class:`relative`},qt={class:`flex min-h-8 items-center pr-20`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`};function Xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},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:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),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(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Zt=U(Gt,[[`render`,Xt],[`__scopeId`,`data-v-cfc723b2`]]),Qt=v({name:`SeedanceReferenceImage`,components:{UploadIcon:I,ElUpload:x,ElButton:W,InfoIcon:Z,ImagePreview:X},mixins:[G,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){Y.warning(this.$t(`seedance.message.uploadExceed`))},onError(){Y.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),$t={key:0,class:`relative`},en={class:`flex min-h-8 items-center pr-20`},tn={class:`flex justify-start items-center`},nn={class:`text-sm font-bold`};function rn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,$t,[e(`div`,en,[e(`div`,tn,[e(`span`,nn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},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:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),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(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var an=U(Qt,[[`render`,rn],[`__scopeId`,`data-v-37c817a4`]]),on=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:I,ElUpload:x,ElButton:W,InfoIcon:Z},mixins:[K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){Y.warning(this.$t(`seedance.message.uploadExceed`))},onError(){Y.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),sn={key:0,class:`relative`},cn={class:`flex min-h-8 items-center pr-20`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`};function dn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,sn,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var fn=U(on,[[`render`,dn],[`__scopeId`,`data-v-e8a1ca2b`]]),pn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:I,ElUpload:x,ElButton:W,InfoIcon:Z},mixins:[K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){Y.warning(this.$t(`seedance.message.uploadExceed`))},onError(){Y.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),mn={key:0,class:`relative`},hn={class:`flex min-h-8 items-center pr-20`},gn={class:`flex justify-start items-center`},_n={class:`text-sm font-bold`};function vn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,mn,[e(`div`,hn,[e(`div`,gn,[e(`span`,_n,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var yn=U(pn,[[`render`,vn],[`__scopeId`,`data-v-123c4f63`]]),bn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),xn={key:0,class:`field`},Sn={class:`label`},Cn={class:`box`},wn={class:`title font-bold`},Tn={class:`value`};function En(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,xn,[e(`div`,Sn,[e(`div`,Cn,[e(`h2`,wn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Tn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Dn=U(bn,[[`render`,En],[`__scopeId`,`data-v-edea5451`]]),On=v({name:`SeedanceSeedInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),kn={class:`field`},An={class:`label`},jn={class:`box`},Mn={class:`title font-bold`},Nn={class:`value`};function Pn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,kn,[e(`div`,An,[e(`div`,jn,[e(`h2`,Mn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Nn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Fn=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElButton:W,PromptInput:Ve,ModelSelector:Je,DurationSelector:tt,ResolutionSelector:lt,RatioSelector:bt,GenerateAudioSwitch:Ot,CameraFixedSwitch:It,ReturnLastFrameSwitch:Dn,SeedInput:U(On,[[`render`,Pn],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Wt,LastFrameImage:Zt,ReferenceImage:an,ReferenceAudio:fn,ReferenceVideo:yn,Consumption:Ce},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),In={class:`flex flex-col h-full`},Ln={class:`flex-1 overflow-y-auto p-5`},Rn={class:`flex flex-col items-center justify-center px-5 pb-5`};function zn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,In,[e(`div`,Ln,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Rn,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Bn=U(Fn,[[`render`,zn]]),Vn=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:P,ApplicationIcon:O,ChannelIcon:j,FullscreenIcon:A,InfoIcon:N,MagicIcon:R,TimeIcon:k,VolumeIcon:L,WarningIcon:F,CopyToClipboard:Se,ElAlert:C,VideoPlayer:De,ElTooltip:S,ElButton:W,ImageWrapper:Ae,ImagePreview:X,AudioPreview:Me,VideoPreview:je,ApiCodeButton:Oe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await ve.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(`seedance/deleteTask`,{id:e}),Y.success(this.$t(`common.message.deleteTaskSuccess`))}catch{Y.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Hn={class:`preview`},Un={class:`left`},Wn={class:`main`},Gn={class:`bot`},Kn={class:`datetime`},qn=[`aria-label`],Jn={class:`info`},Yn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xn={key:1,class:`prompt mt-2`},Zn={key:0},Qn={key:1},$n={key:0,class:n({content:!0})},er={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tr={key:1,class:n({content:!0})},nr={key:0,class:`mb-4`},rr={key:1,class:`mb-4`},ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ar={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:0},lr={key:1},ur={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mr={key:2,class:n({content:!0})},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vr={key:3,class:n({content:!0})},yr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},br={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function xr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`application-icon`),P=l(`fullscreen-icon`),F=l(`volume-icon`),I=l(`channel-icon`),L=l(`warning-icon`),R=l(`info-icon`);return g(),s(`div`,Hn,[e(`div`,Un,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Wn,[e(`div`,Gn,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Kn,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?(g(),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,qn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Jn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Yn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Xn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Qn,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Zn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,tr,[n.video?.video_url?(g(),s(`div`,nr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,rr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,ar,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,or,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,cr,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,lr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,ur,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,dr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,fr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,pr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,mr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,hr,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,gr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,_r,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,vr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,yr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,br,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,$n,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,er,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Sr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:U(Vn,[[`render`,xr],[`__scopeId`,`data-v-87665265`]]),BotPlaceholder:ke,NoTasks:Te,ScrollList:we},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Cr={key:0},wr={key:2,class:`w-full h-full flex items-center justify-center`};function Tr(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Cr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,wr,[a(v)])):o(``,!0)],64)}var Er=U(Sr,[[`render`,Tr]]),Dr=new Set(Object.keys(fe)),Or=e=>Array.isArray(e)?e.filter(e=>!!e?.url):[];function kr(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!Dr.has(t.model))return{reject:`modelUnsupported`};let n=B(t.model);t.images=Or(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0;return Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o?{reject:`audioRequiresReference`}:{request:{...t,async:!0}}}var Ar=v({name:`SeedanceIndex`,components:{ConfigPanel:Bn,Layout:Re,RecentPanel:Er},mixins:[_e],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(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 Ee({tasks: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(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!he(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let{request:e,reject:t}=kr(this.config);if(t){Y.warning(this.$t(`seedance.message.${t}`));return}if(!e||!ye())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}Y.info(this.$t(`seedance.message.startingTask`)),xe(`seedance`,be.generate(e,{token:n})).then(()=>{Y.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`seedance.message.usedUp`)):Y.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function jr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),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 Mr=U(Ar,[[`render`,jr]]);export{Mr as default};
@@ -1 +0,0 @@
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-Kj17huxb.js";import{t as b}from"./upload-P7S1oH5l.js";import{t as x}from"./tooltip-CKybjVoe.js";import{t as S}from"./alert-WwBUWB1y.js";import{n as C,r as w}from"./radio-DgDgyT2l.js";import{t as T}from"./drawer-C56tib0X.js";import{t as E}from"./switch-Dv11DKLB.js";import{n as D}from"./taskDrawerMixin-t0oG4ly6.js";import{t as O}from"./clock-CUWhpM5A.js";import{r as k,t as A}from"./PromptTextarea-CvewN2gz.js";import{t as j}from"./info-Cf_6Kyvd.js";import{t as M}from"./trash-2-Clo-ZGm4.js";import{t as ee}from"./triangle-alert--PIu81za.js";import{t as te}from"./upload-UyzbopDC.js";import{t as N}from"./wand-sparkles-CZEkkfey.js";import{di as P}from"./constants-CGPrJer0.js";import{Bt as ne,E as F,Fi as I,Gn as L,Gt as R,Ht as z,Ut as B,Vt as V,ai as H,bi as U,ci as W,en as G,fr as K,xi as q,yr as J}from"./index-qY8Xwe-x.js";import{t as Y}from"./CopyToClipboard-zxMSspk6.js";import{t as X}from"./ImagePreview-DI9PzDrr.js";import{t as Z}from"./Consumption-DvLMdgth.js";import{a as Q,n as re,r as ie,t as ae}from"./pagination-CCsgYx3G.js";import{t as oe}from"./vue-plyr-wiIKa-zl.js";import{t as se}from"./ApiCodeButton-D_45ZZNZ.js";import{t as ce}from"./BotPlaceholder-CWvJLsQt.js";var le=_({name:`LayoutPika`,components:{MagicIcon:N,ElDrawer:T,ElButton:I},mixins:[D]}),ue={class:`main flex flex-row flex-1`},de={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)]`},fe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function pe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ue,[e(`div`,de,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,fe,[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:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var me=F(le,[[`render`,pe],[`__scopeId`,`data-v-14cc52c3`]]),he=_({name:`IngredientsSelector`,components:{ElSwitch:E,InfoIcon:Q},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){if(!e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0});return}this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,model:`2.0`})}}},mounted(){this.value===void 0&&(this.value=!1)}}),ge={class:`field`},_e={class:`label`},ve={class:`title font-bold`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,ge,[e(`div`,_e,[e(`h2`,ve,i(t.$t(`pika.name.ingredients`)),1),a(d,{content:t.$t(`pika.description.ingredients`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var be=F(he,[[`render`,ye],[`__scopeId`,`data-v-606e1d1a`]]),xe=_({name:`EffectSelector`,components:{ElSelect:v,ElOption:y},data(){return{}},computed:{options(){return[{value:`Levitate`,label:this.$t(`pika.style.effect1`)},{value:`Decapitate`,label:this.$t(`pika.style.effect2`)},{value:`Eye-pop`,label:this.$t(`pika.style.effect3`)},{value:`Ta-da`,label:this.$t(`pika.style.effect4`)},{value:`Deflate`,label:this.$t(`pika.style.effect5`)},{value:`Crumble`,label:this.$t(`pika.style.effect6`)},{value:`Dissolve`,label:this.$t(`pika.style.effect7`)},{value:`Squish`,label:this.$t(`pika.style.effect8`)},{value:`Inflate`,label:this.$t(`pika.style.effect9`)},{value:`Melt`,label:this.$t(`pika.style.effect10`)},{value:`Cake-ify`,label:this.$t(`pika.style.effect11`)},{value:`Crush`,label:this.$t(`pika.style.effect12`)},{value:`Explode`,label:this.$t(`pika.style.effect13`)}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,effect:e})}}}}),Se={class:`field`},Ce={class:`title font-bold`},we={class:`float-left`};function Te(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Se,[e(`h2`,Ce,i(t.$t(`pika.name.effect`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`),clearable:``},{default:p(()=>[(h(!0),s(c,null,m(t.options,t=>(h(),f(g,{key:t.value,label:t.label,value:t.value},{default:p(()=>[e(`span`,we,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ee=F(xe,[[`render`,Te],[`__scopeId`,`data-v-d1c54475`]]),De=_({name:`IngredientsModelSelector`,components:{ElRadioButton:C,ElRadioGroup:w},data(){return{options:[{label:this.$t(`pika.button.precise`),value:`precise`},{label:this.$t(`pika.button.creative`),value:`creative`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||=P}}),Oe={class:`field`},ke={class:`title font-bold`};function Ae(t,n,o,u,d,g){let _=l(`el-radio-button`),v=l(`el-radio-group`);return h(),s(`div`,Oe,[e(`h2`,ke,i(t.$t(`pika.name.ingredientsModel`)),1),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`quality`},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.value},{default:p(()=>[r(i(e.label),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])])}var je=F(De,[[`render`,Ae],[`__scopeId`,`data-v-b72865fa`]]),Me=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`2.0`,label:`2.0`},{value:`1.5`,label:`1.5`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||=`2.0`}}),Ne={class:`field`},Pe={class:`title font-bold`};function Fe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Ne,[e(`h2`,Pe,i(t.$t(`pika.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.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 Ie=F(Me,[[`render`,Fe],[`__scopeId`,`data-v-7b2e870a`]]),Le=_({name:`ImageUrlInput`,components:{UploadIcon:te,ElUpload:b,ElButton:I,InfoIcon:Q,ImagePreview:X},mixins:[B,V],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.pika?.config?.image_url}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;let t=this.fileList.filter(e=>!e.response?.file_url),n=(e||[]).map(e=>this.fileList.find(t=>t.response?.file_url===e||t.url===e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}});this.fileList=[...n,...t.filter(e=>!n.includes(e))]}}},methods:{onChange(e){!e.url&&e.raw&&(e.url=URL.createObjectURL(e.raw))},onExceed(){q.warning(this.$t(`pika.message.uploadStartImageExceed`))},onError(){q.error(this.$t(`pika.message.uploadStartImageError`))},onRemove(){this.onSetStartImageUrl()},onSetStartImageUrl(){this.suppressWatch=!0,this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,image_url:this.urls}),this.$nextTick(()=>{this.suppressWatch=!1})},onSuccess(){this.onSetStartImageUrl()},onRemovePreview(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),e.url?.startsWith(`blob:`)&&URL.revokeObjectURL(e.url),this.onSetStartImageUrl()}}}),Re={class:`field`},ze={class:`label`},Be={class:`title font-bold`},Ve={key:0,class:`file-list mt-2 flex flex-wrap gap-[10px]`};function He(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`pika.name.imageUrl`)),1),a(v,{content:t.$t(`pika.description.imageUrl`),class:`info`},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:3,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-change":t.onChange,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-change`,`on-remove`,`on-success`,`headers`])]),t.fileList.length?(h(),s(`div`,Ve,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemovePreview(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Ue=F(Le,[[`render`,He],[`__scopeId`,`data-v-78ca3f20`]]),We=_({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ge(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(`pika.name.prompt`),info:e.$t(`pika.description.prompt`),placeholder:e.$t(`pika.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ke=_({name:`PresetPanel`,components:{MagicIcon:N,ImageUrlInput:Ue,ElButton:I,Consumption:Z,PromptInput:F(We,[[`render`,Ge]]),IngredientsSelector:be,IngredientsModelSelector:je,ModelSelector:Ie,EffectSelector:Ee},emits:[`generate`],computed:{config(){return this.$store.state.pika?.config},consumption(){return R(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),qe={class:`flex flex-col h-full`},Je={class:`flex-1 overflow-y-auto p-5`},Ye={class:`flex flex-col items-center justify-center px-5 pb-5`};function Xe(t,n,c,u,d,m){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`ingredients-selector`),y=l(`effect-selector`),b=l(`image-url-input`),x=l(`ingredients-model-selector`),S=l(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,qe,[e(`div`,Je,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),t.config?.ingredients?(h(),f(b,{key:0,class:`mb-4`})):o(``,!0),t.config?.ingredients?(h(),f(x,{key:1,class:`mb-4`})):o(``,!0)]),e(`div`,Ye,[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(`pika.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Ze=F(Ke,[[`render`,Xe]]),Qe=_({name:`VideoPlayer`,components:{VuePlyr:oe},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:1080,options:[1080]}}}}}),$e=[`data-poster`],et=[`src`];function tt(t,n,r,i,o,c){let u=l(`vue-plyr`);return h(),s(`div`,null,[a(u,{options:t.options,class:`video`},{default:p(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,"data-poster":t.modelValue?.image_url},[e(`source`,{size:`1080`,src:t.modelValue?.video_url,type:`video/mp4`},null,8,et)],8,$e)]),_:1},8,[`options`])])}var nt=_({name:`TaskPreview`,components:{DeleteIcon:M,ChannelIcon:k,InfoIcon:j,MagicIcon:N,TimeIcon:O,WarningIcon:ee,CopyToClipboard:Y,ElAlert:S,VideoPlayer:F(Qe,[[`render`,tt],[`__scopeId`,`data-v-897d9fe0`]]),ElTooltip:x,ElButton:I,ApiCodeButton:se},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){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.length===0&&e.push({}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.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(`pika/deleteTask`,{id:e}),q.success(this.$t(`common.message.deleteTaskSuccess`))}catch{q.error(this.$t(`common.message.deleteTaskFailed`))}}},isFailure(e){let t=this.modelValue?.response;return t?.success===!1||!!t?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(e){return this.modelValue?.response?this.isFailure(e)||e?.video_url?!1:!e?.state||[`queued`,`pending`,`processing`,`running`].includes(e.state):!0},onDownload(e){console.log(`on download`),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;t.src=n.toString()},onOpenVideo(e){window.open(e,`_blank`)}}}),rt={class:`left`},it={class:`main`},at={class:`bot`},ot={class:`datetime`},st=[`aria-label`],ct={class:`info`},lt={key:0,class:`prompt mt-2`},ut={key:0},dt={key:1},ft={key:0,class:n({content:!0,failed:!0})},pt={class:`image-wrapper`},mt={key:0,class:n({operations:!0,"mt-2":!0})},ht={key:0,class:`description`},gt={class:`description`},_t={key:1,class:`description`},vt={key:1,class:n({content:!0})},yt={class:`description`},$={class:`description`},bt={key:0,class:`description`},xt={class:`description`},St={key:2,class:n({content:!0})},Ct={class:`description`};function wt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`VideoPlayer`),C=l(`el-button`),w=l(`api-code-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(!0),s(c,null,m(n.videos,(c,l)=>(h(),s(`div`,{key:l,class:`preview`},[e(`div`,rt,[a(y,{capability:`pika`,part:`avatar`,class:`avatar`})]),e(`div`,it,[e(`div`,at,[a(y,{capability:`pika`,part:`name`}),e(`span`,ot,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,st)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,ct,[n.modelValue?.request?.prompt?(h(),s(`p`,lt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,ut,` - (`+i(n.$t(`pika.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting(c)?(h(),s(`span`,dt,` - (`+i(n.$t(`pika.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&c?.video_url?(h(),s(`div`,ft,[e(`div`,pt,[a(S,{"model-value":c},null,8,[`model-value`])]),c?(h(),s(`div`,mt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`pika.message.downloadVideo`),placement:`top-start`},{default:p(()=>[c?.video_url?(h(),f(C,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:e=>n.onDownload(c?.video_url)},{default:p(()=>[r(i(n.$t(`pika.button.download`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1032,[`content`]),a(w,{path:`/pika/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(k,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,ht,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),e(`p`,gt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},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(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure(c)?(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(`pika.name.failure`)),1)]),default:p(()=>[e(`p`,yt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.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(`pika.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(`pika.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(`pika.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.isWaiting(c)?(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(n.modelValue?.response?`pika.status.processing`:`pika.status.pending`)),1)]),default:p(()=>[e(`p`,Ct,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0)])]))),128)}var Tt=_({name:`RecentPanel`,components:{TaskPreview:F(nt,[[`render`,wt],[`__scopeId`,`data-v-0c3b2346`]]),BotPlaceholder:ce,NoTasks:ie,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.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,t)=>(h(),f(g,{key:t,"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:`PikaIndex`,components:{ConfigPanel:Ze,Layout:me,RecentPanel:F(Tt,[[`render`,Ot]])},mixins:[z],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===H.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===H.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===H.Request},needApply(){return this.$store.state.pika.status.getApplications===H.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.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 ae({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(`pika/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pika/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},onApply(){K.create({application:this.application}).then(({data:e})=>{this.application=e,q.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&q.error(this.$t(`application.message.alreadyApplied`))})},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(`pika/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ne(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config,async:!0};if(!G())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`pika.message.startingTask`)),J(`pika`,L.generate(e,{token:t})).then(()=>{q.success(this.$t(`pika.message.startTaskSuccess`)),this.$store.commit(`pika/setConfig`,{config:void 0})}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?q.error(this.$t(`pika.message.usedUp`)):q.error(this.$t(`pika.message.startTaskFailed`))}).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`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var jt=F(kt,[[`render`,At],[`__scopeId`,`data-v-fee6c9ea`]]);export{jt as default};
@@ -1 +0,0 @@
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,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-P7S1oH5l.js";import{t as b}from"./tooltip-CKybjVoe.js";import{t as x}from"./alert-WwBUWB1y.js";import{t as S}from"./drawer-C56tib0X.js";import{n as C}from"./taskDrawerMixin-t0oG4ly6.js";import{t as w}from"./box-C5_1LyPO.js";import{t as T}from"./clock-CUWhpM5A.js";import{n as E,r as D,t as O}from"./PromptTextarea-CvewN2gz.js";import{t as k}from"./info-Cf_6Kyvd.js";import{t as A}from"./trash-2-Clo-ZGm4.js";import{t as j}from"./triangle-alert--PIu81za.js";import{t as M}from"./upload-UyzbopDC.js";import{t as N}from"./wand-sparkles-CZEkkfey.js";import{Dt as ee,Et as te,St as P,Tt as F,wt as I,xt as L}from"./constants-CGPrJer0.js";import{Bt as ne,E as R,Fi as z,Gt as re,Ht as B,Sn as V,Ut as H,Vt as U,ai as W,bi as G,ci as K,en as q,xi as J,yr as Y}from"./index-qY8Xwe-x.js";import{t as X}from"./CopyToClipboard-zxMSspk6.js";import{t as ie}from"./FilePreview-CIK3LdbH.js";import{t as Z}from"./ImagePreview-DI9PzDrr.js";import{t as ae}from"./Consumption-DvLMdgth.js";import{a as Q,n as oe,r as se,t as ce}from"./pagination-CCsgYx3G.js";import{t as le}from"./VideoPlayer-CuPK2nmG.js";import{t as ue}from"./ApiCodeButton-D_45ZZNZ.js";import{t as de}from"./BotPlaceholder-CWvJLsQt.js";var fe=v({name:`LayoutOmni`,components:{MagicIcon:N,ElDrawer:S,ElButton:z},mixins:[C]}),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`),h=l(`el-drawer`);return g(),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`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var _e=R(fe,[[`render`,ge],[`__scopeId`,`data-v-b76ffabf`]]),ve=v({name:`OmniPromptInput`,components:{PromptTextarea:O},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ye(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var be=R(ve,[[`render`,ye]]),xe=v({name:`OmniResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:ee,label:`720p`},{value:te,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=P}}),Se={class:`resolution`},Ce={class:`header`},we={class:`title font-bold`},Te={class:`items`},Ee=[`onClick`];function De(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Se,[e(`div`,Ce,[e(`h2`,we,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Te,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Ee))),128))])])}var Oe=R(xe,[[`render`,De],[`__scopeId`,`data-v-1f9abe29`]]),ke=v({name:`OmniRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:I,label:`16:9`,w:32,h:18},{value:F,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=L}}),Ae={class:`ratio`},je={class:`header`},Me={class:`title font-bold`},Ne={class:`items`},Pe=[`onClick`],Fe={class:`preview`},Ie={class:`name`};function Le(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,Ne,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Fe,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,Ie,i(r.label),1)],10,Pe))),128))])])}var Re=R(ke,[[`render`,Le],[`__scopeId`,`data-v-1c0c1511`]]),ze=4,Be=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:z,InfoIcon:Q,ImagePreview:Z,UploadIcon:M},mixins:[H,U],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,limit:ze,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.omni?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){J.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){J.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),Ve={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},He={class:`flex min-w-0 items-center`},Ue={class:`title m-0 text-[14px] font-bold`},We={class:`file-list flex flex-wrap gap-[10px]`};function Ge(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,Ve,[e(`div`,He,[e(`h2`,Ue,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,We,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ke=R(Be,[[`render`,Ge]]),qe=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:z,InfoIcon:Q,FilePreview:ie,UploadIcon:M},mixins:[U],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){J.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){J.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(J.error(this.$t(`omni.message.uploadVideoSizeExceed`)),!1):(J.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),Je={class:`field flex min-h-8 w-full items-center justify-between gap-3`},Ye={class:`flex min-w-0 items-center`},Xe={class:`title m-0 text-[14px] font-bold`},Ze={key:0,class:`file-list flex flex-wrap gap-[10px]`};function Qe(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,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},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,Ze,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var $e=v({name:`OmniConfigPanel`,components:{ElButton:z,MagicIcon:N,PromptInput:be,ResolutionSelector:Oe,RatioSelector:Re,ReferenceImagesInput:Ke,VideoInput:R(qe,[[`render`,Qe],[`__scopeId`,`data-v-aaecff18`]]),Consumption:ae},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return re(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),et={class:`flex flex-col h-full`},tt={class:`flex-1 overflow-y-auto p-5`},nt={class:`flex flex-col items-center justify-center px-5 pb-5`};function rt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,et,[e(`div`,tt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,nt,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var it=R($e,[[`render`,rt]]),at=v({name:`OmniTaskPreview`,components:{DeleteIcon:A,ApplicationIcon:w,ChannelIcon:D,CopyToClipboard:X,ExpandIcon:E,InfoIcon:k,MagicIcon:N,TimeIcon:T,WarningIcon:j,ElAlert:x,VideoPlayer:le,ElTooltip:b,ElButton:z,ImagePreview:Z,ApiCodeButton:ue},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await G.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(`omni/deleteTask`,{id:e}),J.success(this.$t(`common.message.deleteTaskSuccess`))}catch{J.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ot={class:`preview`},st={class:`left`},ct={class:`main`},lt={class:`bot`},ut={class:`datetime`},dt=[`aria-label`],ft={class:`info`},pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},mt={key:1,class:`prompt mt-2`},ht={key:0},gt={key:1},_t={key:0,class:n({content:!0})},vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},bt={key:1,class:n({content:!0})},xt={key:0,class:`mb-4`},St={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ot={key:2,class:n({content:!0})},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:3,class:n({content:!0})},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`application-icon`),O=l(`expand-icon`),k=l(`channel-icon`),A=l(`warning-icon`),j=l(`info-icon`);return g(),s(`div`,ot,[e(`div`,st,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,ct,[e(`div`,lt,[a(h,{capability:`omni`,part:`name`}),e(`span`,ut,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?(g(),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,dt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,ft,[n.inputImage?(g(),s(`div`,pt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,mt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,gt,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ht,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,bt,[n.video?.video_url?(g(),s(`div`,xt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,St,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Ct,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,wt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,Tt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,$,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Dt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Ot,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,kt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,At,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Mt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,_t,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,vt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,yt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Ft=v({name:`OmniRecentPanel`,components:{TaskPreview:R(at,[[`render`,Pt],[`__scopeId`,`data-v-2f40a5a9`]]),BotPlaceholder:de,NoTasks:se,ScrollList:oe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Lt={key:2,class:`w-full h-full flex items-center justify-center`};function Rt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,It,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Lt,[a(v)])):o(``,!0)],64)}var zt=v({name:`OmniIndex`,components:{ConfigPanel:it,Layout:_e,RecentPanel:R(Ft,[[`render`,Rt]])},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===W.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===W.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(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 ce({tasks: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(){await this.$store.dispatch(`omni/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ne(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){J.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){J.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!q())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}J.info(this.$t(`omni.message.startingTask`)),Y(`omni`,V.generate(t,{token:n})).then(()=>{J.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`omni.message.usedUp`)):J.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Bt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),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 Vt=R(zt,[[`render`,Bt]]);export{Vt as default};