@acedatacloud/nexior 3.330.18 → 3.330.20

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 (278) hide show
  1. package/dist/assets/{ApiCodeButton-DAerJ0va.js → ApiCodeButton-F0ATxwIJ.js} +1 -1
  2. package/dist/assets/{Artifacts-D92d9HzX.js → Artifacts-J7lPvwCG.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BVEMgpB8.js → AskUserQuestionCard-DnRQ3Xc_.js} +1 -1
  4. package/dist/assets/{AudioPreview-2bqIwv0t.js → AudioPreview-BxqPvf8C.js} +1 -1
  5. package/dist/assets/{Auth-CUDciawF.js → Auth-DYsSyeAZ.js} +1 -1
  6. package/dist/assets/{Bare-BgOwCBhK.js → Bare-W7rPEo9c.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-CAUnu1Lv.js → BotPlaceholder-DkVBzsjz.js} +1 -1
  8. package/dist/assets/{BottomFooter-DiROxlrH.js → BottomFooter-B9b-aBHU.js} +1 -1
  9. package/dist/assets/{Callback-C8Gf_ISI.js → Callback-CEEmXDdt.js} +1 -1
  10. package/dist/assets/{CodeSnippet-BHHR2rxr.js → CodeSnippet-CJ7rhIQl.js} +1 -1
  11. package/dist/assets/{Console-BPJeg4SL.js → Console-DB5PSwUQ.js} +1 -1
  12. package/dist/assets/{Consumption-ClsP4NK3.js → Consumption-BaXzw92y.js} +1 -1
  13. package/dist/assets/{Conversation-BphSvyp7.js → Conversation-C58bgnxr.js} +1 -1
  14. package/dist/assets/Conversation-DMZGxoB1.js +1 -0
  15. package/dist/assets/{Conversation-Bm7jDkWb.css → Conversation-UiaCVlw0.css} +1 -1
  16. package/dist/assets/{CopyToClipboard-Ci7cxzlE.js → CopyToClipboard-CFq4syZL.js} +1 -1
  17. package/dist/assets/{Detail-y6mVEI-d.js → Detail-COP09heH.js} +2 -2
  18. package/dist/assets/{Extra-DKqf1L0Y.js → Extra-ClfHTe2i.js} +1 -1
  19. package/dist/assets/{FilePreview-qsjeLh9w.js → FilePreview-BEMnDzog.js} +1 -1
  20. package/dist/assets/{Hailuo-BasqONZs.js → Hailuo-Cb6FTxJw.js} +1 -1
  21. package/dist/assets/{History-D4bKmVgX.js → History-DTf5Z4mc.js} +1 -1
  22. package/dist/assets/{ImagePreview-Cxt63DK7.js → ImagePreview-GQ5yyc1Y.js} +1 -1
  23. package/dist/assets/{ImageWrapper-C2W3ScDK.js → ImageWrapper-CWaUYW-8.js} +1 -1
  24. package/dist/assets/{Index-D7ktkYK5.js → Index-BCbsbQqR.js} +1 -1
  25. package/dist/assets/{Index-6Q5kx2Rz2.js → Index-BIfiPxA52.js} +1 -1
  26. package/dist/assets/{Index-DjAM-OSF2.js → Index-Bi56yImM2.js} +1 -1
  27. package/dist/assets/{Index-BlVsv-QK2.js → Index-BrhMS48B2.js} +1 -1
  28. package/dist/assets/{Index-HjGuk9y4.js → Index-BsmfyWbN.js} +1 -1
  29. package/dist/assets/{Index-BriGZZYr.js → Index-BuM4H5ll.js} +1 -1
  30. package/dist/assets/{Index-UiW2eW_r.js → Index-BuhtBNTu.js} +1 -1
  31. package/dist/assets/{Index-nHCBIQj3.js → Index-By5CLiSu.js} +1 -1
  32. package/dist/assets/{Index-D4vG94ug.js → Index-C0y2FAbZ.js} +1 -1
  33. package/dist/assets/{Index-BxN81P8a.js → Index-C3yUbi8D.js} +1 -1
  34. package/dist/assets/{Index-2yzTSWNN2.js → Index-CUQYVVis2.js} +1 -1
  35. package/dist/assets/{Index-CzwkSwTK.js → Index-CWAbC4M_.js} +1 -1
  36. package/dist/assets/{Index-CrNQd5dW.js → Index-CgY2KfKA.js} +1 -1
  37. package/dist/assets/{Index-BznwvH3R.js → Index-Cil9jsRs.js} +1 -1
  38. package/dist/assets/{Index-ElVDPvZY.js → Index-D-U_RYqa.js} +1 -1
  39. package/dist/assets/{Index-DIeVpZ5c.js → Index-D1JALjYq.js} +1 -1
  40. package/dist/assets/{Index-7t__zLM0.js → Index-DAYiL7UY.js} +1 -1
  41. package/dist/assets/{Index--CgVa11m.js → Index-DCC5NTlI.js} +1 -1
  42. package/dist/assets/{Index-Bq766IC-.js → Index-DIQeINfi.js} +1 -1
  43. package/dist/assets/{Index-B03xZRhJ.js → Index-DMczhGAR.js} +1 -1
  44. package/dist/assets/{Index-CgWg4Jpc2.js → Index-D_Opld1H2.js} +1 -1
  45. package/dist/assets/{Index-CvA5aVMp.js → Index-DcznIjOE.js} +1 -1
  46. package/dist/assets/{Index-Di1N9Lbm.js → Index-Df0CouI0.js} +1 -1
  47. package/dist/assets/{Index-BMdwvmPm.js → Index-DiZznMVo.js} +1 -1
  48. package/dist/assets/{Index-wxTBQTsR.js → Index-Dk8CdEJs.js} +1 -1
  49. package/dist/assets/{Index-pQR0om8-.js → Index-Qtq6k0qw.js} +1 -1
  50. package/dist/assets/{Index-Dtnjabt32.js → Index-XUJpP9NK2.js} +1 -1
  51. package/dist/assets/{Index-DkEoWkGe2.js → Index-_Mx3IWfL2.js} +1 -1
  52. package/dist/assets/{Index-C2RY8oc2.js → Index-nm-Jft3r.js} +1 -1
  53. package/dist/assets/{Index-Qwgdl8PP.js → Index-phSyTaBu.js} +1 -1
  54. package/dist/assets/{Invitees-Bu-uWbmW.js → Invitees-ZNrcDErx.js} +1 -1
  55. package/dist/assets/{List-CnF46B6P.js → List-BXwtgg0Z.js} +1 -1
  56. package/dist/assets/{List-Peu7mXfH.js → List-Ccm0waeM.js} +1 -1
  57. package/dist/assets/{List-CbDgflRF.js → List-DPdyzvKQ.js} +1 -1
  58. package/dist/assets/{LocalTools-BA9j6ojy.js → LocalTools-Bm7mQ0Am.js} +1 -1
  59. package/dist/assets/{LocalTools-BeyQ4RHf.js → LocalTools-yQkVaw-X.js} +1 -1
  60. package/dist/assets/{Main-DTP5ke2E.js → Main-Brpyh7Do.js} +1 -1
  61. package/dist/assets/{Message-DBok8d5N.js → Message-CBQvrB5t.js} +1 -1
  62. package/dist/assets/{Model-DtxqDeeU.js → Model-CA8uxL2G.js} +1 -1
  63. package/dist/assets/{Navigator-CnEL3Xs1.js → Navigator-ClxSZTmY.js} +3 -3
  64. package/dist/assets/{NotFound-DaBUW98D.js → NotFound-k8VVO0Tt.js} +1 -1
  65. package/dist/assets/{Pay-CRRK-AwK.js → Pay-CPUzShbl.js} +1 -1
  66. package/dist/assets/{Player-0u_iM-P8.js → Player-DNknlB3m.js} +1 -1
  67. package/dist/assets/{Poivelle-DAKsoEHW.js → Poivelle-BsuJ_yEn.js} +1 -1
  68. package/dist/assets/{PromptTextarea-CuOOcgKb.js → PromptTextarea-C0uBKHIV.js} +1 -1
  69. package/dist/assets/{RealtimeCall-CvvpJ2Cj.js → RealtimeCall-XpMARxQX.js} +1 -1
  70. package/dist/assets/{ScheduledTasks-DE8NkzNE.js → ScheduledTasks-Q4RL9lJa.js} +1 -1
  71. package/dist/assets/{Status-CGIkhS0X.js → Status-BCO3QM6K.js} +1 -1
  72. package/dist/assets/{Subscribe-BRNJaFO-.js → Subscribe-KT22pN50.js} +1 -1
  73. package/dist/assets/{TabSwitcher-Carp37ht.js → TabSwitcher-QmywPant.js} +1 -1
  74. package/dist/assets/Tts-Cedzhaoh.css +1 -0
  75. package/dist/assets/Tts-DGsCez_w.js +1 -0
  76. package/dist/assets/{VideoPlayer-CxDMYTsw.js → VideoPlayer-CSNIl2YT.js} +1 -1
  77. package/dist/assets/{alert-C8HgA_KT.js → alert-w1kaGC8r.js} +1 -1
  78. package/dist/assets/arrow-down-bn7O_xPf.js +1 -0
  79. package/dist/assets/{arrow-down-wide-narrow-DKsZjleD.js → arrow-down-wide-narrow-DZlX-4xb.js} +1 -1
  80. package/dist/assets/arrow-left-jVgyWJkz.js +1 -0
  81. package/dist/assets/arrow-right-lLWseFOD.js +1 -0
  82. package/dist/assets/arrow-up-DT1A4R8y.js +1 -0
  83. package/dist/assets/{avatar-CMfVlUbO.js → avatar-kUU1RTwv.js} +1 -1
  84. package/dist/assets/{basic-CsAG71fI.js → basic-wyH1fH1X.js} +1 -1
  85. package/dist/assets/{box-Cz8y8ktW.js → box-CnKpk8us.js} +1 -1
  86. package/dist/assets/{boxes-D1-aw2BA.js → boxes-BoCtD0dH.js} +1 -1
  87. package/dist/assets/{brain-DH1yOKQg.js → brain-Be0vSB1z.js} +1 -1
  88. package/dist/assets/{chart-no-axes-combined-Da1sNUti.js → chart-no-axes-combined-DeGi1dGs.js} +1 -1
  89. package/dist/assets/{chat-DIEfs7zp.js → chat-gWyb26ta.js} +1 -1
  90. package/dist/assets/check-vXkWxIx1.js +1 -0
  91. package/dist/assets/chevron-down-DweTeYuu.js +1 -0
  92. package/dist/assets/chevron-right-DKQXtLOw.js +1 -0
  93. package/dist/assets/circle-check-Bx03arK7.js +1 -0
  94. package/dist/assets/clock-pyQU2aDC.js +1 -0
  95. package/dist/assets/{codingBridge-DCvOnDFl.js → codingBridge-CttYhNYd.js} +1 -1
  96. package/dist/assets/{codingBridgeNotify-DsZ_7p8y.js → codingBridgeNotify-B-LxFn5M.js} +2 -2
  97. package/dist/assets/{coins-DJ57fy17.js → coins-CrrV4j8K.js} +1 -1
  98. package/dist/assets/{collapse-CrGGHBVG.js → collapse-2iDiYifC.js} +1 -1
  99. package/dist/assets/{constants-mcSzdyE5.js → constants-au0ZzCx8.js} +1 -1
  100. package/dist/assets/{copy-CXTUVSVB.js → copy-CYQRBaxa.js} +1 -1
  101. package/dist/assets/{createTaskActions-BbJsZF8J.js → createTaskActions-C7weAXG9.js} +1 -1
  102. package/dist/assets/{digitalhuman-VHzi8067.js → digitalhuman-Db8EEDpt.js} +1 -1
  103. package/dist/assets/{dollar-sign-D4yB3nJ_.js → dollar-sign-BXGGUr9K.js} +1 -1
  104. package/dist/assets/{download-CU4G5hbi.js → download-OvEXtoUG.js} +1 -1
  105. package/dist/assets/{drawer-BB4cIDVl.js → drawer-LC7MaHe8.js} +1 -1
  106. package/dist/assets/{dropdown-Mj_RXudE.js → dropdown-BjvhqOya.js} +1 -1
  107. package/dist/assets/{dropdown-BWaxYGtu.js → dropdown-Dqf_7Uk2.js} +1 -1
  108. package/dist/assets/{ellipsis-A4khBrbD.js → ellipsis-CMh-0drt.js} +1 -1
  109. package/dist/assets/{esm-ikfTfrQE.js → esm-Bj18A5BP.js} +1 -1
  110. package/dist/assets/esm-Cy2SGmGp.js +1 -0
  111. package/dist/assets/{esm-DotVQs0V.js → esm-D8ci_dyT.js} +2 -2
  112. package/dist/assets/{esm-BJbu7SKE.js → esm-DDZDaNtw.js} +1 -1
  113. package/dist/assets/{esm-29rjsUtO.js → esm-DOj69nvn.js} +1 -1
  114. package/dist/assets/{esm-CEvi3txi.js → esm-DVPKLUxx.js} +3 -3
  115. package/dist/assets/{esm-C72hY5k3.js → esm-DhClz816.js} +2 -2
  116. package/dist/assets/{external-link-B9UnO8h9.js → external-link-Da9bVGx7.js} +1 -1
  117. package/dist/assets/{eye-Igd-5IKh.js → eye-Bdl3XRb2.js} +1 -1
  118. package/dist/assets/{file-output-DUeIOql-.js → file-output-DV8o6x9Q.js} +1 -1
  119. package/dist/assets/{file-text-eWKzWjMM.js → file-text-B8wU2fKy.js} +1 -1
  120. package/dist/assets/fish-5CTEKhPw.js +1 -0
  121. package/dist/assets/fish-A5mxP0D7.js +1 -0
  122. package/dist/assets/fish-B2aBA5Lt.js +1 -0
  123. package/dist/assets/fish-B7e2hc0R.js +1 -0
  124. package/dist/assets/fish-BDU-wEQv.js +1 -0
  125. package/dist/assets/fish-BKgfTY5M.js +1 -0
  126. package/dist/assets/fish-Bkj9qqW2.js +1 -0
  127. package/dist/assets/fish-BtmrGK3L.js +1 -0
  128. package/dist/assets/fish-BwYDMmxg.js +1 -0
  129. package/dist/assets/fish-C3-tYns0.js +1 -0
  130. package/dist/assets/fish-ChmBg5_x.js +1 -0
  131. package/dist/assets/fish-DCmeW3O7.js +1 -0
  132. package/dist/assets/{fish-xJvZbCL7.js → fish-DJKfp5nt.js} +1 -1
  133. package/dist/assets/fish-DMr1w3qQ.js +1 -0
  134. package/dist/assets/fish-DjcPWlKC.js +1 -0
  135. package/dist/assets/fish-DvrXivJD.js +1 -0
  136. package/dist/assets/fish-IDhzUnUr.js +1 -0
  137. package/dist/assets/fish-mqGghsJf.js +1 -0
  138. package/dist/assets/fish-oS70vPkk.js +1 -0
  139. package/dist/assets/{flux-C4SwEkvT.js → flux-BJ3A1OJg.js} +1 -1
  140. package/dist/assets/{folder-Df6vmWKq.js → folder-CCYZC_Pi.js} +1 -1
  141. package/dist/assets/gauge-Da_QGwFd.js +1 -0
  142. package/dist/assets/{globe-B1A0sLUZ.js → globe-DtBxMtnQ.js} +1 -1
  143. package/dist/assets/{grokvideo-ELoS64ma.js → grokvideo-BxpSBf7h.js} +1 -1
  144. package/dist/assets/{hailuo-BqKCE07E.js → hailuo-Basxw55S.js} +1 -1
  145. package/dist/assets/{headphones-CTKB00Yi.js → headphones-5dyIi4zI.js} +1 -1
  146. package/dist/assets/{history-B3PCqGqg.js → history-BvplK14v.js} +1 -1
  147. package/dist/assets/{house-D_BJgiTq.js → house-zRlVV2Av.js} +1 -1
  148. package/dist/assets/{i18n-Dxpy-4Gk.js → i18n-CTLRBj_V.js} +1 -1
  149. package/dist/assets/{image-gNa1xZpu.js → image-DlQ3KDwW.js} +1 -1
  150. package/dist/assets/{index-CFsbwwWs.js → index-BZq3jm8a.js} +4 -4
  151. package/dist/assets/{index.browser.esm-BS7AbQYg.js → index.browser.esm-D_AO8T-U.js} +1 -1
  152. package/dist/assets/{index.es-D_cROcA_.js → index.es-t8toyhVJ.js} +1 -1
  153. package/dist/assets/{info-DqIHVScS.js → info-Vuska8HI.js} +1 -1
  154. package/dist/assets/{input-number-CWSjoh3p.js → input-number-D1gEH1Hp.js} +1 -1
  155. package/dist/assets/{key-round-C0asj6so.js → key-round-Bq6QVZmb.js} +1 -1
  156. package/dist/assets/{kling-CQ6EjtWX.js → kling-BgQ0JBn6.js} +1 -1
  157. package/dist/assets/{languages-Dv7S8sy_.js → languages-DPN8cfr2.js} +1 -1
  158. package/dist/assets/{laptop-TeqVspjE.js → laptop-D_5jUyFA.js} +1 -1
  159. package/dist/assets/{lightbulb-D1cMjBAt.js → lightbulb-DbAIuB9Z.js} +1 -1
  160. package/dist/assets/{link-BJ4S90sw.js → link-CPlu7abr.js} +1 -1
  161. package/dist/assets/loader-circle-BcLVzjcN.js +1 -0
  162. package/dist/assets/{luma-bt4o5KgP.js → luma-BySVZzA-.js} +1 -1
  163. package/dist/assets/{maestro-XICLKX3k.js → maestro-CTYoyTMe.js} +1 -1
  164. package/dist/assets/{maestro-BemUNQR8.js → maestro-CrHTxv_4.js} +1 -1
  165. package/dist/assets/{mail-CeI-zAyA.js → mail-CR54sHPh.js} +1 -1
  166. package/dist/assets/{message-circle-D2GGvucd.js → message-circle-CbqHvkbK.js} +1 -1
  167. package/dist/assets/{mic-BOTpPWob.js → mic-B30_UWk0.js} +1 -1
  168. package/dist/assets/{midjourney-BjFPpQYb.js → midjourney-Cj8l-TqE.js} +1 -1
  169. package/dist/assets/{mobileLocalExec-Cv5cbeCb.js → mobileLocalExec-DJOTAIWw.js} +2 -2
  170. package/dist/assets/{mouse-pointer-2-BBjXELDI.js → mouse-pointer-2-B6sJWvaK.js} +1 -1
  171. package/dist/assets/music-2-DK_Dt_4b.js +1 -0
  172. package/dist/assets/{nanobanana-UEakfXiI.js → nanobanana-DHDBNIAB.js} +1 -1
  173. package/dist/assets/{omni-BpGJPTpm.js → omni-CSprgQ9f.js} +1 -1
  174. package/dist/assets/{openaiimage-DcodJ8fz.js → openaiimage-C4uPxmE8.js} +1 -1
  175. package/dist/assets/{pagination-DqGpeZlx.js → pagination-C4lWe3mD.js} +1 -1
  176. package/dist/assets/{pagination-CL8TviK8.js → pagination-CwKSQoIp.js} +1 -1
  177. package/dist/assets/{palette-D9lKhCWe.js → palette-CM7Bnf4f.js} +1 -1
  178. package/dist/assets/{paperclip-DGu3GmwC.js → paperclip-CvsJHqtB.js} +1 -1
  179. package/dist/assets/{pause-D2KrwuQx.js → pause-lnmjStqU.js} +1 -1
  180. package/dist/assets/{pencil-CIpj0T4h.js → pencil-CUgvnzHU.js} +1 -1
  181. package/dist/assets/{pika-DsBQ2v9q.js → pika-V1EaJUks.js} +1 -1
  182. package/dist/assets/{pixverse-DuSRPJy5.js → pixverse-BTEpOleY.js} +1 -1
  183. package/dist/assets/play-BygUicIz.js +1 -0
  184. package/dist/assets/plus-Bgm__ssL.js +1 -0
  185. package/dist/assets/{poivelle-sWx-Ohod.js → poivelle-LEP73XvK.js} +1 -1
  186. package/dist/assets/{popover-B-NKJRbu.js → popover-CdOBfWCL.js} +1 -1
  187. package/dist/assets/{producer-Cxu_i_e5.js → producer--3ecBwMb.js} +1 -1
  188. package/dist/assets/{qrart-CvBlKatG.js → qrart-CHcV77Wp.js} +1 -1
  189. package/dist/assets/{realtime-hs8yQB6U.js → realtime-CuF5f5g2.js} +1 -1
  190. package/dist/assets/{refresh-cw-DDLqu2dp.js → refresh-cw-DMcYrk_3.js} +1 -1
  191. package/dist/assets/rotate-ccw-D44HNrzP.js +1 -0
  192. package/dist/assets/rotate-cw-B6y7qzYj.js +1 -0
  193. package/dist/assets/{row-zv2RYPsp.js → row-Cz0enH0P.js} +1 -1
  194. package/dist/assets/search-DsT-E7jG.js +1 -0
  195. package/dist/assets/{seedance-Cn5iIxl9.js → seedance-15HvaMSh.js} +1 -1
  196. package/dist/assets/{seedream-rH5-XawP.js → seedream-Df72T4We.js} +1 -1
  197. package/dist/assets/{select-B2IH_A2T.js → select-zGPdE0Sk.js} +1 -1
  198. package/dist/assets/{serp-R3OR8B9R.js → serp-Cv0CAKZe.js} +1 -1
  199. package/dist/assets/{shield-eUVETJKY.js → shield-DeUB2z1Z.js} +1 -1
  200. package/dist/assets/{shuffle-ytiTWmh4.js → shuffle-BFcUmSjO.js} +1 -1
  201. package/dist/assets/{slider-DNATiQGM.js → slider-C0DJnIUv.js} +1 -1
  202. package/dist/assets/{sliders-horizontal-CAo_Eikh.js → sliders-horizontal-1Y7y3Q6K.js} +1 -1
  203. package/dist/assets/{solana-wallets-CvVE-Fg5.js → solana-wallets-Bv8rJ1I7.js} +2 -2
  204. package/dist/assets/{solana-wallets-vue-B4fBas-I.js → solana-wallets-vue-xvBEcu3l.js} +1 -1
  205. package/dist/assets/{sora-hvWtU-d8.js → sora-B4Z1G_kz.js} +1 -1
  206. package/dist/assets/{sparkles-HT6AZzS5.js → sparkles-D-1HP7fD.js} +1 -1
  207. package/dist/assets/square-CmIAGfzl.js +1 -0
  208. package/dist/assets/{suno-BpqD8PHZ.js → suno-DoFCAqg8.js} +1 -1
  209. package/dist/assets/{switch-f-rb9Xdl.js → switch-Cs75LPmN.js} +1 -1
  210. package/dist/assets/{table-BsFPK-GY.js → table-CsPs1-4x.js} +1 -1
  211. package/dist/assets/{tabs-BWAC5ytL.js → tabs-n_pKH8G_.js} +1 -1
  212. package/dist/assets/{tag-8UZnjrAK.js → tag-BZ5hTdb5.js} +1 -1
  213. package/dist/assets/{taskDrawerMixin-uEkwMALb.js → taskDrawerMixin-CMlwqOPR.js} +1 -1
  214. package/dist/assets/terminal-CTDCWu48.js +1 -0
  215. package/dist/assets/{time-picker-CS1Od3PK.js → time-picker-Cdzdvuh4.js} +1 -1
  216. package/dist/assets/{tooltip-1kimVXlI.js → tooltip-Cg4lvqxt.js} +1 -1
  217. package/dist/assets/{trash-2-DHsWQnzA.js → trash-2-BrjANKJH.js} +1 -1
  218. package/dist/assets/{triangle-alert-CgYZA69o.js → triangle-alert-BjeTc9sl.js} +1 -1
  219. package/dist/assets/{upload-CsGTsLeD.js → upload-BC6lRzPl.js} +1 -1
  220. package/dist/assets/{upload-CcDcSF_X.js → upload-BPadrurv.js} +1 -1
  221. package/dist/assets/user-0gpscnXo.js +1 -0
  222. package/dist/assets/{veo-e8xX8lkM.js → veo-CywAlhXY.js} +1 -1
  223. package/dist/assets/{video-DFnvJRca.js → video-DL4JCpg1.js} +1 -1
  224. package/dist/assets/{volume-2-i0TdrmUS.js → volume-2-4vdN1DJH.js} +1 -1
  225. package/dist/assets/{wallet-cui3amaR.js → wallet-BTJAf1Lx.js} +1 -1
  226. package/dist/assets/{wan-C1eec_X3.js → wan-BHffY3LL.js} +1 -1
  227. package/dist/assets/{wand-sparkles-C5ruxDvQ.js → wand-sparkles-D-HweR3j.js} +1 -1
  228. package/dist/assets/{web-BNQYpdiG.js → web-7jh8R_H6.js} +1 -1
  229. package/dist/assets/{web-3UHz7mou.js → web-BZvuUrlS.js} +1 -1
  230. package/dist/assets/{web-WjiLXdS1.js → web-BuoR2Dpn.js} +1 -1
  231. package/dist/assets/{web-DtaGjAmb.js → web-ChxEh0ml.js} +1 -1
  232. package/dist/assets/{web-CfdT_-cE.js → web-D_UuTDKk.js} +1 -1
  233. package/dist/assets/{webextrator-B2nJn4Z9.js → webextrator-C6CQxCFR.js} +1 -1
  234. package/dist/assets/{zap-Bfp53Qc4.js → zap-DYASpPZQ.js} +1 -1
  235. package/dist/index.html +3 -3
  236. package/package.json +1 -1
  237. package/dist/assets/Conversation-BkuGAieK.js +0 -1
  238. package/dist/assets/Tts-c2_cnD4h.js +0 -1
  239. package/dist/assets/Tts-kj8c15qm.css +0 -1
  240. package/dist/assets/arrow-down-BCdh_gdK.js +0 -1
  241. package/dist/assets/arrow-left-M-xtuFJN.js +0 -1
  242. package/dist/assets/arrow-right-CPW6Tbu0.js +0 -1
  243. package/dist/assets/arrow-up-BPo1i0Sq.js +0 -1
  244. package/dist/assets/check-C6AF3VyW.js +0 -1
  245. package/dist/assets/chevron-down-BkWvDvuS.js +0 -1
  246. package/dist/assets/chevron-right-DvXMRi59.js +0 -1
  247. package/dist/assets/circle-check-Dju9SuZu.js +0 -1
  248. package/dist/assets/clock-Dq4P7NTm.js +0 -1
  249. package/dist/assets/esm-CiJz4SLS.js +0 -1
  250. package/dist/assets/fish-BAYcXp_z.js +0 -1
  251. package/dist/assets/fish-BIZjlaQe.js +0 -1
  252. package/dist/assets/fish-BVKyhU7B.js +0 -1
  253. package/dist/assets/fish-BixJkppS.js +0 -1
  254. package/dist/assets/fish-BtnRbA1q.js +0 -1
  255. package/dist/assets/fish-Bu_UlZSB.js +0 -1
  256. package/dist/assets/fish-C0GcVbK7.js +0 -1
  257. package/dist/assets/fish-C3IY_4y1.js +0 -1
  258. package/dist/assets/fish-CJEdLISj.js +0 -1
  259. package/dist/assets/fish-CckLrOkF.js +0 -1
  260. package/dist/assets/fish-D04jSyr3.js +0 -1
  261. package/dist/assets/fish-D7Zgx_Nn.js +0 -1
  262. package/dist/assets/fish-DFgCBycH.js +0 -1
  263. package/dist/assets/fish-DK20PA_0.js +0 -1
  264. package/dist/assets/fish-Ddtlq7r2.js +0 -1
  265. package/dist/assets/fish-DwqJEX1m.js +0 -1
  266. package/dist/assets/fish-DxulaawV.js +0 -1
  267. package/dist/assets/fish-V9Uy3Lx-.js +0 -1
  268. package/dist/assets/gauge-CqoxQ199.js +0 -1
  269. package/dist/assets/loader-circle-CfTqIoa1.js +0 -1
  270. package/dist/assets/music-2-DiHygZOr.js +0 -1
  271. package/dist/assets/play-1lz-7Cnr.js +0 -1
  272. package/dist/assets/plus-CQubehjc.js +0 -1
  273. package/dist/assets/rotate-ccw-X3MF7mwB.js +0 -1
  274. package/dist/assets/rotate-cw-BRfNodGi.js +0 -1
  275. package/dist/assets/search-CJu44ezz.js +0 -1
  276. package/dist/assets/square-CggvfbY-.js +0 -1
  277. package/dist/assets/terminal-Dht6hckV.js +0 -1
  278. package/dist/assets/user-D7x7cgwD.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-B2IH_A2T.js";import{t as x}from"./upload-CsGTsLeD.js";import{t as S}from"./tooltip-1kimVXlI.js";import{t as C}from"./alert-C8HgA_KT.js";import{t as w}from"./drawer-BB4cIDVl.js";import{t as T}from"./input-number-CWSjoh3p.js";import{t as E}from"./switch-f-rb9Xdl.js";import{n as D}from"./taskDrawerMixin-uEkwMALb.js";import{t as O}from"./box-Cz8y8ktW.js";import{t as k}from"./clock-Dq4P7NTm.js";import{r as A,t as j}from"./PromptTextarea-CuOOcgKb.js";import{t as M}from"./image-gNa1xZpu.js";import{t as N}from"./info-DqIHVScS.js";import{t as P}from"./triangle-alert-CgYZA69o.js";import{t as ee}from"./upload-CcDcSF_X.js";import{t as F}from"./wand-sparkles-C5ruxDvQ.js";import{t as I}from"./zap-Bfp53Qc4.js";import{An as L,Bn as te,Dn as ne,Fn as re,In as R,Mn as ie,Nn as ae,On as oe,Pn as se,Rn as z,kn as B,zn as V}from"./constants-mcSzdyE5.js";import{Bt as H,E as U,Gt as W,Ht as G,Pi as K,Tn as q,Vt as ce,bi as J,en as le,ii as Y,si as ue,vr as de}from"./index-CFsbwwWs.js";import{t as fe}from"./CopyToClipboard-Ci7cxzlE.js";import{t as X}from"./ImagePreview-Cxt63DK7.js";import{t as pe}from"./Consumption-ClsP4NK3.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-DqGpeZlx.js";import{t as _e}from"./ApiCodeButton-DAerJ0va.js";import{t as ve}from"./BotPlaceholder-CAUnu1Lv.js";import{t as ye}from"./ImageWrapper-C2W3ScDK.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:F,ElDrawer:w,ElButton:K},mixins:[D]}),xe={class:`main flex flex-row flex-1`},Se={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)]`},Ce={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function we(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,xe,[e(`div`,Se,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ce,[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 Te=U(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({name:`PromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(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(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=U(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:K,InfoIcon:Z,ImagePreview:X},mixins:[ce],data(){return{fileList:[],uploadUrl:ue()+`/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.openaiimage?.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(){J.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){J.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.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()}}}),Ae={class:`field flex min-h-8 w-full items-center justify-between gap-3`},je={class:`flex min-w-0 items-center`},Me={class:`title m-0 text-[14px] font-bold`},Ne={class:`file-list flex flex-wrap gap-[10px]`};function Pe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{"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: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(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ne,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),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 Fe=U(ke,[[`render`,Pe]]),Ie=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ie,label:this.$t(`openaiimage.model.gptImage1`)},{value:ae,label:this.$t(`openaiimage.model.gptImage15`)},{value:se,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=L}}),Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`openaiimage.name.model`)),1),a(g,{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(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var He=U(Ie,[[`render`,Ve],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Ue=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:E,ElInputNumber:T,InfoIcon:Z},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return B.includes(this.model)},presets(){return R[this.model]??R[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:z},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:te}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return ne},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:oe.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),We={class:`resolution`},Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`},Ye={class:`field custom-toggle`},Xe={class:`label`},Ze={class:`box`},Qe={class:`title font-bold`},$e={key:0,class:`custom-inputs`},et={class:`row`},tt={class:`row-label`},nt={class:`row`},rt={class:`row-label`},it={key:0,class:`error`};function at(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`suno.gender.auto`),value:t.emptySizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,nt,[e(`span`,rt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,it,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ot=_({name:`ConfigPanel`,components:{MagicIcon:F,ElButton:K,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Fe,ModelSelector:He,ResolutionSelector:U(Ue,[[`render`,at],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return W({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),st={class:`flex flex-col h-full`},ct={class:`flex-1 overflow-y-auto p-5`},lt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ut(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,st,[e(`div`,ct,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,lt,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var dt=U(ot,[[`render`,ut]]),ft=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:I,MagicIcon:F,TimeIcon:k,WarningIcon:P,CopyToClipboard:fe,ElAlert:C,ImageWrapper:ye,ElButton:K,ElTooltip:S,ImagePreview:X,ApiCodeButton:_e},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),pt={class:`preview`},mt={class:`left`},ht={class:`main`},gt={class:`bot`},_t={class:`datetime`},vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:0,class:n({content:!0,failed:!0})},Ct={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},wt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:1,class:n({content:!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Ut(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`image-wrapper`),S=l(`el-button`),C=l(`el-tooltip`),w=l(`api-code-button`),T=l(`application-icon`),E=l(`image-icon`),D=l(`lightning-icon`),O=l(`magic-icon`),k=l(`copy-to-clipboard`),A=l(`time-icon`),j=l(`channel-icon`),M=l(`el-alert`),N=l(`warning-icon`),P=l(`info-icon`);return h(),s(`div`,pt,[e(`div`,mt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,ht,[e(`div`,gt,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,_t,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,vt,[n.referenceImages.length>0?(h(),s(`div`,yt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,St,[e(`div`,Ct,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,wt,[a(C,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(w,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`])]),a(M,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Et,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Dt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ot,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,kt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,At,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,jt,[a(M,{closable:!1,class:`failure`},{template:p(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Mt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Pt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Ft,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(k,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Lt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Rt,[a(M,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(P,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(A,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,zt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Bt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Vt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ht,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Wt=_({name:`RecentPanel`,components:{TaskPreview:U(ft,[[`render`,Ut],[`__scopeId`,`data-v-85516d80`]]),BotPlaceholder:ve,NoTasks:he,ScrollList:me},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Gt={key:0},Kt={key:2,class:`w-full h-full flex items-center justify-center`};function qt(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`,Gt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Kt,[a(v)])):o(``,!0)],64)}var Jt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:dt,Layout:Te,RecentPanel:U(Wt,[[`render`,qt]])},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===Y.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.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 ge({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(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/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(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!H(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){J.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!le())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}J.info(this.$t(`openaiimage.message.startingTask`)),de(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),J.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`openaiimage.message.usedUp`)):J.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).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 Yt(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.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Xt=U(Jt,[[`render`,Yt]]);export{Xt as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-zGPdE0Sk.js";import{t as x}from"./upload-BC6lRzPl.js";import{t as S}from"./tooltip-Cg4lvqxt.js";import{t as C}from"./alert-w1kaGC8r.js";import{t as w}from"./drawer-LC7MaHe8.js";import{t as T}from"./input-number-D1gEH1Hp.js";import{t as E}from"./switch-Cs75LPmN.js";import{n as D}from"./taskDrawerMixin-CMlwqOPR.js";import{t as O}from"./box-CnKpk8us.js";import{t as k}from"./clock-pyQU2aDC.js";import{r as A,t as j}from"./PromptTextarea-C0uBKHIV.js";import{t as M}from"./image-DlQ3KDwW.js";import{t as N}from"./info-Vuska8HI.js";import{t as P}from"./triangle-alert-BjeTc9sl.js";import{t as ee}from"./upload-BPadrurv.js";import{t as F}from"./wand-sparkles-D-HweR3j.js";import{t as I}from"./zap-DYASpPZQ.js";import{An as L,Bn as te,Dn as ne,Fn as re,In as R,Mn as ie,Nn as ae,On as oe,Pn as se,Rn as z,kn as B,zn as V}from"./constants-au0ZzCx8.js";import{Bt as H,E as U,Gt as W,Ht as G,Pi as K,Tn as q,Vt as ce,bi as J,en as le,ii as Y,si as ue,vr as de}from"./index-BZq3jm8a.js";import{t as fe}from"./CopyToClipboard-CFq4syZL.js";import{t as X}from"./ImagePreview-GQ5yyc1Y.js";import{t as pe}from"./Consumption-BaXzw92y.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-C4lWe3mD.js";import{t as _e}from"./ApiCodeButton-F0ATxwIJ.js";import{t as ve}from"./BotPlaceholder-DkVBzsjz.js";import{t as ye}from"./ImageWrapper-CWaUYW-8.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:F,ElDrawer:w,ElButton:K},mixins:[D]}),xe={class:`main flex flex-row flex-1`},Se={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)]`},Ce={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function we(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,xe,[e(`div`,Se,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ce,[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 Te=U(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({name:`PromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(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(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=U(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:K,InfoIcon:Z,ImagePreview:X},mixins:[ce],data(){return{fileList:[],uploadUrl:ue()+`/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.openaiimage?.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(){J.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){J.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.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()}}}),Ae={class:`field flex min-h-8 w-full items-center justify-between gap-3`},je={class:`flex min-w-0 items-center`},Me={class:`title m-0 text-[14px] font-bold`},Ne={class:`file-list flex flex-wrap gap-[10px]`};function Pe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{"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: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(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ne,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),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 Fe=U(ke,[[`render`,Pe]]),Ie=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ie,label:this.$t(`openaiimage.model.gptImage1`)},{value:ae,label:this.$t(`openaiimage.model.gptImage15`)},{value:se,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=L}}),Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`openaiimage.name.model`)),1),a(g,{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(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var He=U(Ie,[[`render`,Ve],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Ue=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:E,ElInputNumber:T,InfoIcon:Z},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return B.includes(this.model)},presets(){return R[this.model]??R[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:z},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:te}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return ne},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:oe.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),We={class:`resolution`},Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`},Ye={class:`field custom-toggle`},Xe={class:`label`},Ze={class:`box`},Qe={class:`title font-bold`},$e={key:0,class:`custom-inputs`},et={class:`row`},tt={class:`row-label`},nt={class:`row`},rt={class:`row-label`},it={key:0,class:`error`};function at(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`suno.gender.auto`),value:t.emptySizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,nt,[e(`span`,rt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,it,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ot=_({name:`ConfigPanel`,components:{MagicIcon:F,ElButton:K,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Fe,ModelSelector:He,ResolutionSelector:U(Ue,[[`render`,at],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return W({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),st={class:`flex flex-col h-full`},ct={class:`flex-1 overflow-y-auto p-5`},lt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ut(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,st,[e(`div`,ct,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,lt,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var dt=U(ot,[[`render`,ut]]),ft=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:I,MagicIcon:F,TimeIcon:k,WarningIcon:P,CopyToClipboard:fe,ElAlert:C,ImageWrapper:ye,ElButton:K,ElTooltip:S,ImagePreview:X,ApiCodeButton:_e},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),pt={class:`preview`},mt={class:`left`},ht={class:`main`},gt={class:`bot`},_t={class:`datetime`},vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:0,class:n({content:!0,failed:!0})},Ct={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},wt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:1,class:n({content:!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Ut(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`image-wrapper`),S=l(`el-button`),C=l(`el-tooltip`),w=l(`api-code-button`),T=l(`application-icon`),E=l(`image-icon`),D=l(`lightning-icon`),O=l(`magic-icon`),k=l(`copy-to-clipboard`),A=l(`time-icon`),j=l(`channel-icon`),M=l(`el-alert`),N=l(`warning-icon`),P=l(`info-icon`);return h(),s(`div`,pt,[e(`div`,mt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,ht,[e(`div`,gt,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,_t,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,vt,[n.referenceImages.length>0?(h(),s(`div`,yt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,St,[e(`div`,Ct,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,wt,[a(C,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(w,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`])]),a(M,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Et,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Dt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ot,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,kt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,At,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,jt,[a(M,{closable:!1,class:`failure`},{template:p(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Mt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Pt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Ft,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(k,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Lt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Rt,[a(M,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(P,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(A,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,zt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Bt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Vt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ht,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Wt=_({name:`RecentPanel`,components:{TaskPreview:U(ft,[[`render`,Ut],[`__scopeId`,`data-v-85516d80`]]),BotPlaceholder:ve,NoTasks:he,ScrollList:me},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Gt={key:0},Kt={key:2,class:`w-full h-full flex items-center justify-center`};function qt(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`,Gt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Kt,[a(v)])):o(``,!0)],64)}var Jt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:dt,Layout:Te,RecentPanel:U(Wt,[[`render`,qt]])},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===Y.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.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 ge({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(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/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(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!H(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){J.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!le())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}J.info(this.$t(`openaiimage.message.startingTask`)),de(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),J.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`openaiimage.message.usedUp`)):J.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).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 Yt(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.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Xt=U(Jt,[[`render`,Yt]]);export{Xt as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,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-CsGTsLeD.js";import{t as b}from"./tooltip-1kimVXlI.js";import{t as x}from"./alert-C8HgA_KT.js";import{t as S}from"./drawer-BB4cIDVl.js";import{n as C}from"./taskDrawerMixin-uEkwMALb.js";import{t as w}from"./box-Cz8y8ktW.js";import{t as T}from"./clock-Dq4P7NTm.js";import{n as E,r as D,t as O}from"./PromptTextarea-CuOOcgKb.js";import{t as k}from"./info-DqIHVScS.js";import{t as A}from"./triangle-alert-CgYZA69o.js";import{t as j}from"./upload-CcDcSF_X.js";import{t as M}from"./wand-sparkles-C5ruxDvQ.js";import{Dt as ee,Et as N,St as P,Tt as F,wt as I,xt as L}from"./constants-mcSzdyE5.js";import{Bt as R,E as z,Gt as te,Ht as ne,Pi as B,Ut as V,Vt as H,bi as U,en as W,ii as G,si as K,vr as q,xn as J}from"./index-CFsbwwWs.js";import{t as Y}from"./CopyToClipboard-Ci7cxzlE.js";import{t as X}from"./FilePreview-qsjeLh9w.js";import{t as Z}from"./ImagePreview-Cxt63DK7.js";import{t as re}from"./Consumption-ClsP4NK3.js";import{a as Q,n as ie,r as ae,t as oe}from"./pagination-DqGpeZlx.js";import{t as se}from"./VideoPlayer-CxDMYTsw.js";import{t as ce}from"./ApiCodeButton-DAerJ0va.js";import{t as le}from"./BotPlaceholder-CAUnu1Lv.js";var ue=v({name:`LayoutOmni`,components:{MagicIcon:M,ElDrawer:S,ElButton:B},mixins:[C]}),de={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)]`},pe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function me(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,de,[e(`div`,fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,pe,[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 he=z(ue,[[`render`,me],[`__scopeId`,`data-v-b76ffabf`]]),ge=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 _e(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 ve=z(ge,[[`render`,_e]]),ye=v({name:`OmniResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:ee,label:`720p`},{value:N,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}}),be={class:`resolution`},xe={class:`header`},Se={class:`title font-bold`},Ce={class:`items`},we=[`onClick`];function Te(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,be,[e(`div`,xe,[e(`h2`,Se,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ce,[(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,we))),128))])])}var Ee=z(ye,[[`render`,Te],[`__scopeId`,`data-v-1f9abe29`]]),De=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}}),Oe={class:`ratio`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`],Ne={class:`preview`},Pe={class:`name`};function Fe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,je,[(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`,Ne,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,Pe,i(r.label),1)],10,Me))),128))])])}var Ie=z(De,[[`render`,Fe],[`__scopeId`,`data-v-1c0c1511`]]),Le=4,Re=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:B,InfoIcon:Q,ImagePreview:Z,UploadIcon:j},mixins:[V,H],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,limit:Le,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(){U.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){U.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()}}}),ze={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Be={class:`flex min-w-0 items-center`},Ve={class:`title m-0 text-[14px] font-bold`},He={class:`file-list flex flex-wrap gap-[10px]`};function Ue(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`,ze,[e(`div`,Be,[e(`h2`,Ve,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`,He,[(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 We=z(Re,[[`render`,Ue]]),Ge=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:B,InfoIcon:Q,FilePreview:X,UploadIcon:j},mixins:[H],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(){U.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){U.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:(U.error(this.$t(`omni.message.uploadVideoSizeExceed`)),!1):(U.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)}}}),Ke={class:`field flex min-h-8 w-full items-center justify-between gap-3`},qe={class:`flex min-w-0 items-center`},Je={class:`title m-0 text-[14px] font-bold`},Ye={key:0,class:`file-list flex flex-wrap gap-[10px]`};function Xe(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`,Ke,[e(`div`,qe,[e(`h2`,Je,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`,Ye,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var Ze=v({name:`OmniConfigPanel`,components:{ElButton:B,MagicIcon:M,PromptInput:ve,ResolutionSelector:Ee,RatioSelector:Ie,ReferenceImagesInput:We,VideoInput:z(Ge,[[`render`,Xe],[`__scopeId`,`data-v-aaecff18`]]),Consumption:re},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return te(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Qe={class:`flex flex-col h-full`},$e={class:`flex-1 overflow-y-auto p-5`},et={class:`flex flex-col items-center justify-center px-5 pb-5`};function tt(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`,Qe,[e(`div`,$e,[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`,et,[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 nt=z(Ze,[[`render`,tt]]),rt=v({name:`OmniTaskPreview`,components:{ApplicationIcon:w,ChannelIcon:D,CopyToClipboard:Y,ExpandIcon:E,InfoIcon:k,MagicIcon:M,TimeIcon:T,WarningIcon:A,ElAlert:x,VideoPlayer:se,ElTooltip:b,ElButton:B,ImagePreview:Z,ApiCodeButton:ce},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:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),it={class:`preview`},at={class:`left`},ot={class:`main`},st={class:`bot`},ct={class:`datetime`},lt={class:`info`},ut={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},dt={key:1,class:`prompt mt-2`},ft={key:0},pt={key:1},mt={key:0,class:n({content:!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_t={key:1,class:n({content:!0})},vt={key:0,class:`mb-4`},yt={key:1,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:0},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:2,class:n({content:!0})},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},kt={key:3,class:n({content:!0})},At={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function jt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`expand-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,it,[e(`div`,at,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,ot,[e(`div`,st,[a(h,{capability:`omni`,part:`name`}),e(`span`,ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,lt,[n.inputImage?(g(),s(`div`,ut,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,dt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,pt,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ft,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,_t,[n.video?.video_url?(g(),s(`div`,vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,yt,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,bt,[a(E,{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`,xt,[a(D,{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`,St,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Ct,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,wt,[a(v,{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`,Tt,[a(O,{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(b,{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`,Et,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Dt,[a(A,{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(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Ot,[a(O,{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(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,kt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,At,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,mt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,ht,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Mt=v({name:`OmniRecentPanel`,components:{TaskPreview:z(rt,[[`render`,jt],[`__scopeId`,`data-v-4cd17d67`]]),BotPlaceholder:le,NoTasks:ae,ScrollList:ie},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?.()}}}),Nt={key:0},Pt={key:2,class:`w-full h-full flex items-center justify-center`};function Ft(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`,Nt,[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`,Pt,[a(v)])):o(``,!0)],64)}var It=v({name:`OmniIndex`,components:{ConfigPanel:nt,Layout:he,RecentPanel:z(Mt,[[`render`,Ft]])},mixins:[ne],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===G.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 oe({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(!R(this.uploadTracker,e=>this.$t(e),e=>U.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){U.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){U.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}U.info(this.$t(`omni.message.startingTask`)),q(`omni`,J.generate(t,{token:n})).then(()=>{U.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?U.error(this.$t(`omni.message.usedUp`)):U.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 Lt(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 Rt=z(It,[[`render`,Lt]]);export{Rt as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,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-BC6lRzPl.js";import{t as b}from"./tooltip-Cg4lvqxt.js";import{t as x}from"./alert-w1kaGC8r.js";import{t as S}from"./drawer-LC7MaHe8.js";import{n as C}from"./taskDrawerMixin-CMlwqOPR.js";import{t as w}from"./box-CnKpk8us.js";import{t as T}from"./clock-pyQU2aDC.js";import{n as E,r as D,t as O}from"./PromptTextarea-C0uBKHIV.js";import{t as k}from"./info-Vuska8HI.js";import{t as A}from"./triangle-alert-BjeTc9sl.js";import{t as j}from"./upload-BPadrurv.js";import{t as M}from"./wand-sparkles-D-HweR3j.js";import{Dt as ee,Et as N,St as P,Tt as F,wt as I,xt as L}from"./constants-au0ZzCx8.js";import{Bt as R,E as z,Gt as te,Ht as ne,Pi as B,Ut as V,Vt as H,bi as U,en as W,ii as G,si as K,vr as q,xn as J}from"./index-BZq3jm8a.js";import{t as Y}from"./CopyToClipboard-CFq4syZL.js";import{t as X}from"./FilePreview-BEMnDzog.js";import{t as Z}from"./ImagePreview-GQ5yyc1Y.js";import{t as re}from"./Consumption-BaXzw92y.js";import{a as Q,n as ie,r as ae,t as oe}from"./pagination-C4lWe3mD.js";import{t as se}from"./VideoPlayer-CSNIl2YT.js";import{t as ce}from"./ApiCodeButton-F0ATxwIJ.js";import{t as le}from"./BotPlaceholder-DkVBzsjz.js";var ue=v({name:`LayoutOmni`,components:{MagicIcon:M,ElDrawer:S,ElButton:B},mixins:[C]}),de={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)]`},pe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function me(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,de,[e(`div`,fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,pe,[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 he=z(ue,[[`render`,me],[`__scopeId`,`data-v-b76ffabf`]]),ge=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 _e(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 ve=z(ge,[[`render`,_e]]),ye=v({name:`OmniResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:ee,label:`720p`},{value:N,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}}),be={class:`resolution`},xe={class:`header`},Se={class:`title font-bold`},Ce={class:`items`},we=[`onClick`];function Te(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,be,[e(`div`,xe,[e(`h2`,Se,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ce,[(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,we))),128))])])}var Ee=z(ye,[[`render`,Te],[`__scopeId`,`data-v-1f9abe29`]]),De=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}}),Oe={class:`ratio`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`],Ne={class:`preview`},Pe={class:`name`};function Fe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,je,[(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`,Ne,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,Pe,i(r.label),1)],10,Me))),128))])])}var Ie=z(De,[[`render`,Fe],[`__scopeId`,`data-v-1c0c1511`]]),Le=4,Re=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:B,InfoIcon:Q,ImagePreview:Z,UploadIcon:j},mixins:[V,H],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,limit:Le,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(){U.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){U.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()}}}),ze={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Be={class:`flex min-w-0 items-center`},Ve={class:`title m-0 text-[14px] font-bold`},He={class:`file-list flex flex-wrap gap-[10px]`};function Ue(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`,ze,[e(`div`,Be,[e(`h2`,Ve,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`,He,[(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 We=z(Re,[[`render`,Ue]]),Ge=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:B,InfoIcon:Q,FilePreview:X,UploadIcon:j},mixins:[H],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(){U.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){U.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:(U.error(this.$t(`omni.message.uploadVideoSizeExceed`)),!1):(U.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)}}}),Ke={class:`field flex min-h-8 w-full items-center justify-between gap-3`},qe={class:`flex min-w-0 items-center`},Je={class:`title m-0 text-[14px] font-bold`},Ye={key:0,class:`file-list flex flex-wrap gap-[10px]`};function Xe(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`,Ke,[e(`div`,qe,[e(`h2`,Je,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`,Ye,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var Ze=v({name:`OmniConfigPanel`,components:{ElButton:B,MagicIcon:M,PromptInput:ve,ResolutionSelector:Ee,RatioSelector:Ie,ReferenceImagesInput:We,VideoInput:z(Ge,[[`render`,Xe],[`__scopeId`,`data-v-aaecff18`]]),Consumption:re},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return te(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Qe={class:`flex flex-col h-full`},$e={class:`flex-1 overflow-y-auto p-5`},et={class:`flex flex-col items-center justify-center px-5 pb-5`};function tt(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`,Qe,[e(`div`,$e,[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`,et,[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 nt=z(Ze,[[`render`,tt]]),rt=v({name:`OmniTaskPreview`,components:{ApplicationIcon:w,ChannelIcon:D,CopyToClipboard:Y,ExpandIcon:E,InfoIcon:k,MagicIcon:M,TimeIcon:T,WarningIcon:A,ElAlert:x,VideoPlayer:se,ElTooltip:b,ElButton:B,ImagePreview:Z,ApiCodeButton:ce},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:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),it={class:`preview`},at={class:`left`},ot={class:`main`},st={class:`bot`},ct={class:`datetime`},lt={class:`info`},ut={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},dt={key:1,class:`prompt mt-2`},ft={key:0},pt={key:1},mt={key:0,class:n({content:!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_t={key:1,class:n({content:!0})},vt={key:0,class:`mb-4`},yt={key:1,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:0},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:2,class:n({content:!0})},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},kt={key:3,class:n({content:!0})},At={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function jt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`expand-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,it,[e(`div`,at,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,ot,[e(`div`,st,[a(h,{capability:`omni`,part:`name`}),e(`span`,ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,lt,[n.inputImage?(g(),s(`div`,ut,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,dt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,pt,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ft,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,_t,[n.video?.video_url?(g(),s(`div`,vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,yt,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,bt,[a(E,{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`,xt,[a(D,{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`,St,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Ct,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,wt,[a(v,{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`,Tt,[a(O,{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(b,{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`,Et,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Dt,[a(A,{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(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Ot,[a(O,{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(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,kt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,At,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,mt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,ht,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Mt=v({name:`OmniRecentPanel`,components:{TaskPreview:z(rt,[[`render`,jt],[`__scopeId`,`data-v-4cd17d67`]]),BotPlaceholder:le,NoTasks:ae,ScrollList:ie},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?.()}}}),Nt={key:0},Pt={key:2,class:`w-full h-full flex items-center justify-center`};function Ft(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`,Nt,[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`,Pt,[a(v)])):o(``,!0)],64)}var It=v({name:`OmniIndex`,components:{ConfigPanel:nt,Layout:he,RecentPanel:z(Mt,[[`render`,Ft]])},mixins:[ne],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===G.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 oe({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(!R(this.uploadTracker,e=>this.$t(e),e=>U.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){U.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){U.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}U.info(this.$t(`omni.message.startingTask`)),q(`omni`,J.generate(t,{token:n})).then(()=>{U.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?U.error(this.$t(`omni.message.usedUp`)):U.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 Lt(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 Rt=z(It,[[`render`,Lt]]);export{Rt as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,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-B2IH_A2T.js";import{t as x}from"./upload-CsGTsLeD.js";import{t as S}from"./tooltip-1kimVXlI.js";import{t as C}from"./alert-C8HgA_KT.js";import{t as w}from"./drawer-BB4cIDVl.js";import{n as T}from"./taskDrawerMixin-uEkwMALb.js";import{t as E}from"./box-Cz8y8ktW.js";import{t as D}from"./clock-Dq4P7NTm.js";import{n as O,r as k,t as A}from"./PromptTextarea-CuOOcgKb.js";import{t as ee}from"./info-DqIHVScS.js";import{t as j}from"./triangle-alert-CgYZA69o.js";import{t as M}from"./upload-CcDcSF_X.js";import{t as N}from"./wand-sparkles-C5ruxDvQ.js";import{At as P,Bt as F,Ft as te,Ht as ne,It as re,Lt as ie,Mt as ae,Pt as oe,Rt as se,Ut as I,jt as L,kt as R,zt as z}from"./constants-mcSzdyE5.js";import{Bt as B,E as V,Gt as H,Ht as U,Pi as W,Sn as G,Ut as K,Vt as q,bi as J,en as ce,ii as Y,si as X,vr as le}from"./index-CFsbwwWs.js";import{t as ue}from"./CopyToClipboard-Ci7cxzlE.js";import{t as Z}from"./ImagePreview-Cxt63DK7.js";import{t as de}from"./Consumption-ClsP4NK3.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-DqGpeZlx.js";import{t as he}from"./VideoPlayer-CxDMYTsw.js";import{t as ge}from"./ApiCodeButton-DAerJ0va.js";import{t as _e}from"./BotPlaceholder-CAUnu1Lv.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:N,ElDrawer:w,ElButton:W},mixins:[T]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=V(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(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(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=V(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`grokvideo.model.default`)},{value:oe,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=R}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.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(`grokvideo.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 Ne=V(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return ne(this.model)},options(){return ae.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.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(`grokvideo.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 Be=V(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`480p`},{value:F,label:`720p`},{value:se,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=L}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(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,Ke))),128))])])}var Je=V(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:ie,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=P}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(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`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=V(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return I(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){J.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){J.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(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 g(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=V(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,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.grokvideo?.config?.reference_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(`grokvideo.message.uploadReferenceExceed`))},onError(){J.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_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()}}}),ht={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},gt={class:`flex min-w-0 items-center`},_t={class:`title m-0 text-[14px] font-bold`},vt={class:`file-list flex flex-wrap gap-[10px]`};function yt(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`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`grokvideo.name.referenceImages`)),1),a(_,{content:t.$t(`grokvideo.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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,vt,[(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 bt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:N,ElButton:W,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:V(mt,[[`render`,yt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!I(this.$store.state.grokvideo?.config?.model)},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,xt,[e(`div`,St,[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`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Ct,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Tt=V(bt,[[`render`,wt]]),Et=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:k,FullscreenIcon:O,InfoIcon:ee,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ue,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:W,ImagePreview:Z,ApiCodeButton:ge},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_url},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:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt={class:`info`},Nt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Pt={key:1,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0})},Rt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Bt={key:1,class:n({content:!0})},Vt={key:0,class:`mb-4`},Ht={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ut={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`},Gt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:0},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yt={key:2,class:n({content:!0})},Xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:3,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function tn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Mt,[n.inputImage?(g(),s(`div`,Nt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Ft,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Bt,[n.video?.video_url?(g(),s(`div`,Vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ht,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Ut,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Wt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Gt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,Kt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,qt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,$,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Jt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{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`,Yt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Xt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Zt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,$t,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,en,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Lt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,Rt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,zt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var nn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:V(Et,[[`render`,tn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),rn={key:0},an={key:2,class:`w-full h-full flex items-center justify-center`};function on(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`,rn,[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`,an,[a(v)])):o(``,!0)],64)}var sn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Tt,Layout:Ce,RecentPanel:V(nn,[[`render`,on]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===Y.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.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 me({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(`grokvideo/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(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(I(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(I(e?.model)&&!t){J.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){J.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!ce())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}J.info(this.$t(`grokvideo.message.startingTask`)),le(`grokvideo`,G.generate(n,{token:r})).then(()=>{J.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`grokvideo.message.usedUp`)):J.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function cn(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 ln=V(sn,[[`render`,cn]]);export{ln as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,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-zGPdE0Sk.js";import{t as x}from"./upload-BC6lRzPl.js";import{t as S}from"./tooltip-Cg4lvqxt.js";import{t as C}from"./alert-w1kaGC8r.js";import{t as w}from"./drawer-LC7MaHe8.js";import{n as T}from"./taskDrawerMixin-CMlwqOPR.js";import{t as E}from"./box-CnKpk8us.js";import{t as D}from"./clock-pyQU2aDC.js";import{n as O,r as k,t as A}from"./PromptTextarea-C0uBKHIV.js";import{t as ee}from"./info-Vuska8HI.js";import{t as j}from"./triangle-alert-BjeTc9sl.js";import{t as M}from"./upload-BPadrurv.js";import{t as N}from"./wand-sparkles-D-HweR3j.js";import{At as P,Bt as F,Ft as te,Ht as ne,It as re,Lt as ie,Mt as ae,Pt as oe,Rt as se,Ut as I,jt as L,kt as R,zt as z}from"./constants-au0ZzCx8.js";import{Bt as B,E as V,Gt as H,Ht as U,Pi as W,Sn as G,Ut as K,Vt as q,bi as J,en as ce,ii as Y,si as X,vr as le}from"./index-BZq3jm8a.js";import{t as ue}from"./CopyToClipboard-CFq4syZL.js";import{t as Z}from"./ImagePreview-GQ5yyc1Y.js";import{t as de}from"./Consumption-BaXzw92y.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-C4lWe3mD.js";import{t as he}from"./VideoPlayer-CSNIl2YT.js";import{t as ge}from"./ApiCodeButton-F0ATxwIJ.js";import{t as _e}from"./BotPlaceholder-DkVBzsjz.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:N,ElDrawer:w,ElButton:W},mixins:[T]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=V(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(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(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=V(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`grokvideo.model.default`)},{value:oe,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=R}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.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(`grokvideo.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 Ne=V(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return ne(this.model)},options(){return ae.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.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(`grokvideo.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 Be=V(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`480p`},{value:F,label:`720p`},{value:se,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=L}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(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,Ke))),128))])])}var Je=V(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:ie,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=P}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(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`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=V(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return I(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){J.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){J.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(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 g(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=V(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,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.grokvideo?.config?.reference_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(`grokvideo.message.uploadReferenceExceed`))},onError(){J.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_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()}}}),ht={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},gt={class:`flex min-w-0 items-center`},_t={class:`title m-0 text-[14px] font-bold`},vt={class:`file-list flex flex-wrap gap-[10px]`};function yt(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`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`grokvideo.name.referenceImages`)),1),a(_,{content:t.$t(`grokvideo.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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,vt,[(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 bt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:N,ElButton:W,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:V(mt,[[`render`,yt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!I(this.$store.state.grokvideo?.config?.model)},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,xt,[e(`div`,St,[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`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Ct,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Tt=V(bt,[[`render`,wt]]),Et=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:k,FullscreenIcon:O,InfoIcon:ee,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ue,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:W,ImagePreview:Z,ApiCodeButton:ge},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_url},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:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt={class:`info`},Nt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Pt={key:1,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0})},Rt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Bt={key:1,class:n({content:!0})},Vt={key:0,class:`mb-4`},Ht={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ut={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`},Gt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:0},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yt={key:2,class:n({content:!0})},Xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:3,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function tn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Mt,[n.inputImage?(g(),s(`div`,Nt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Ft,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Bt,[n.video?.video_url?(g(),s(`div`,Vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ht,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Ut,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Wt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Gt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,Kt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,qt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,$,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Jt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{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`,Yt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Xt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Zt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,$t,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,en,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Lt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,Rt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,zt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var nn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:V(Et,[[`render`,tn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),rn={key:0},an={key:2,class:`w-full h-full flex items-center justify-center`};function on(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`,rn,[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`,an,[a(v)])):o(``,!0)],64)}var sn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Tt,Layout:Ce,RecentPanel:V(nn,[[`render`,on]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===Y.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.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 me({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(`grokvideo/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(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(I(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(I(e?.model)&&!t){J.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){J.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!ce())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}J.info(this.$t(`grokvideo.message.startingTask`)),le(`grokvideo`,G.generate(n,{token:r})).then(()=>{J.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`grokvideo.message.usedUp`)):J.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function cn(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 ln=V(sn,[[`render`,cn]]);export{ln as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-CsGTsLeD.js";import{t as y}from"./tooltip-1kimVXlI.js";import{t as b}from"./alert-C8HgA_KT.js";import{t as x}from"./drawer-BB4cIDVl.js";import{t as S}from"./switch-f-rb9Xdl.js";import{n as C}from"./taskDrawerMixin-uEkwMALb.js";import{t as w}from"./clock-Dq4P7NTm.js";import{r as T,t as E}from"./PromptTextarea-CuOOcgKb.js";import{t as D}from"./info-DqIHVScS.js";import{t as O}from"./triangle-alert-CgYZA69o.js";import{t as k}from"./upload-CcDcSF_X.js";import{t as A}from"./wand-sparkles-C5ruxDvQ.js";import"./constants-mcSzdyE5.js";import{Bt as j,E as M,Gn as N,Gt as P,Ht as ee,Pi as F,Ut as I,Vt as L,bi as R,en as te,ii as z,si as B,vr as V}from"./index-CFsbwwWs.js";import{t as H}from"./CopyToClipboard-Ci7cxzlE.js";import{t as U}from"./FilePreview-qsjeLh9w.js";import{t as W}from"./ImagePreview-Cxt63DK7.js";import{t as G}from"./Consumption-ClsP4NK3.js";import{a as K,n as q,r as J,t as Y}from"./pagination-DqGpeZlx.js";import{t as X}from"./VideoPlayer-CxDMYTsw.js";import{t as Z}from"./ApiCodeButton-DAerJ0va.js";import{t as Q}from"./BotPlaceholder-CAUnu1Lv.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:F},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={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)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[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 se=M(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={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`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=M(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=M(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=M(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:F,ImagePreview:W,InfoIcon:K},mixins:[I,L],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(){R.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){R.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()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(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`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,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 Re=M(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:F,ImagePreview:W,InfoIcon:K},mixins:[I,L],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(){R.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){R.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()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(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`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,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 Ge=M(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:F,InfoIcon:K,FilePreview:U},mixins:[L],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(){R.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){R.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(R.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(R.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,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 Qe=M(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({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 et(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 tt=M($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,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 st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:F,PromptInput:tt,ExtendFromInput:M(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return P(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(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`,ct,[e(`div`,lt,[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`,ut,[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 ft=M(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:T,InfoIcon:D,MagicIcon:A,TimeIcon:w,WarningIcon:O,CopyToClipboard:H,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:F,ApiCodeButton:Z},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:{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`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},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={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,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 g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=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(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{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`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{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(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{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`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{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`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(C,{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`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:M(pt,[[`render`,Pt],[`__scopeId`,`data-v-8bf2a835`]]),NoTasks:J,ScrollList:q},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?.()}}}),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`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,It,[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`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:M(Ft,[[`render`,Rt]])},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 Y({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(!j(this.uploadTracker,e=>this.$t(e),e=>R.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){R.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}R.info(this.$t(`luma.message.startingTask`)),V(`luma`,N.generate(e,{token:t})).then(()=>{R.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?R.error(this.$t(`luma.message.usedUp`)):R.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 Bt(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 Vt=M(zt,[[`render`,Bt]]);export{Vt as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-BC6lRzPl.js";import{t as y}from"./tooltip-Cg4lvqxt.js";import{t as b}from"./alert-w1kaGC8r.js";import{t as x}from"./drawer-LC7MaHe8.js";import{t as S}from"./switch-Cs75LPmN.js";import{n as C}from"./taskDrawerMixin-CMlwqOPR.js";import{t as w}from"./clock-pyQU2aDC.js";import{r as T,t as E}from"./PromptTextarea-C0uBKHIV.js";import{t as D}from"./info-Vuska8HI.js";import{t as O}from"./triangle-alert-BjeTc9sl.js";import{t as k}from"./upload-BPadrurv.js";import{t as A}from"./wand-sparkles-D-HweR3j.js";import"./constants-au0ZzCx8.js";import{Bt as j,E as M,Gn as N,Gt as P,Ht as ee,Pi as F,Ut as I,Vt as L,bi as R,en as te,ii as z,si as B,vr as V}from"./index-BZq3jm8a.js";import{t as H}from"./CopyToClipboard-CFq4syZL.js";import{t as U}from"./FilePreview-BEMnDzog.js";import{t as W}from"./ImagePreview-GQ5yyc1Y.js";import{t as G}from"./Consumption-BaXzw92y.js";import{a as K,n as q,r as J,t as Y}from"./pagination-C4lWe3mD.js";import{t as X}from"./VideoPlayer-CSNIl2YT.js";import{t as Z}from"./ApiCodeButton-F0ATxwIJ.js";import{t as Q}from"./BotPlaceholder-DkVBzsjz.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:F},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={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)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[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 se=M(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={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`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=M(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=M(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=M(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:F,ImagePreview:W,InfoIcon:K},mixins:[I,L],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(){R.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){R.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()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(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`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,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 Re=M(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:F,ImagePreview:W,InfoIcon:K},mixins:[I,L],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(){R.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){R.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()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(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`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,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 Ge=M(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:F,InfoIcon:K,FilePreview:U},mixins:[L],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(){R.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){R.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(R.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(R.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,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 Qe=M(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({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 et(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 tt=M($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,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 st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:F,PromptInput:tt,ExtendFromInput:M(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return P(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(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`,ct,[e(`div`,lt,[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`,ut,[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 ft=M(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:T,InfoIcon:D,MagicIcon:A,TimeIcon:w,WarningIcon:O,CopyToClipboard:H,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:F,ApiCodeButton:Z},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:{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`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},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={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,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 g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=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(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{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`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{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(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{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`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{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`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(C,{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`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:M(pt,[[`render`,Pt],[`__scopeId`,`data-v-8bf2a835`]]),NoTasks:J,ScrollList:q},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?.()}}}),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`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,It,[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`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:M(Ft,[[`render`,Rt]])},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 Y({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(!j(this.uploadTracker,e=>this.$t(e),e=>R.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){R.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}R.info(this.$t(`luma.message.startingTask`)),V(`luma`,N.generate(e,{token:t})).then(()=>{R.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?R.error(this.$t(`luma.message.usedUp`)):R.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 Bt(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 Vt=M(zt,[[`render`,Bt]]);export{Vt as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-CPW6Tbu0.js";import{t as h}from"./check-C6AF3VyW.js";import{t as g}from"./external-link-B9UnO8h9.js";import{t as ee}from"./globe-B1A0sLUZ.js";import{t as te}from"./wand-sparkles-C5ruxDvQ.js";import{A as _,E as v,Pi as y,i as b,in as x,r as S}from"./index-CFsbwwWs.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:y,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||x()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=v(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-lLWseFOD.js";import{t as h}from"./check-vXkWxIx1.js";import{t as g}from"./external-link-Da9bVGx7.js";import{t as ee}from"./globe-DtBxMtnQ.js";import{t as te}from"./wand-sparkles-D-HweR3j.js";import{A as _,E as v,Pi as y,i as b,in as x,r as S}from"./index-BZq3jm8a.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:y,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||x()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=v(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};