@acedatacloud/nexior 3.330.7 → 3.330.8

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 (286) hide show
  1. package/dist/assets/{ApiCodeButton-DIXEBzGs.js → ApiCodeButton-6yNv6GzT.js} +1 -1
  2. package/dist/assets/{Artifacts-DirXYxi2.js → Artifacts-Daj2aW6R.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BrmoW_CU.js → AskUserQuestionCard-D6NWrkca.js} +1 -1
  4. package/dist/assets/{AudioPreview-DOhYa86Z.js → AudioPreview-BwaUx8CQ.js} +1 -1
  5. package/dist/assets/{Auth-Cr3n7N-U.js → Auth-t24ECk8p.js} +1 -1
  6. package/dist/assets/{Bare-kEhQ2CxC.js → Bare-B0r772aH.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-D1PAhJfu.js → BotPlaceholder-CsV6S3zO.js} +1 -1
  8. package/dist/assets/{BottomFooter-Bj9sOQI7.js → BottomFooter-0XO3UTHH.js} +1 -1
  9. package/dist/assets/{Callback-DA_oqSwO.js → Callback-DWFJ3FIS.js} +1 -1
  10. package/dist/assets/{CodeSnippet-BjrjruoT.js → CodeSnippet-DReHcwSF.js} +1 -1
  11. package/dist/assets/{Console-CbnlZqyN.js → Console-ICgTlpIn.js} +1 -1
  12. package/dist/assets/{Consumption-C146g2pG.js → Consumption-NaAGG5D5.js} +1 -1
  13. package/dist/assets/{Conversation-CT0s5lfj.js → Conversation-CvkouZ3M.js} +1 -1
  14. package/dist/assets/{Conversation-DDj-hl7p.js → Conversation-Domb3egF.js} +1 -1
  15. package/dist/assets/CopyToClipboard-DFuxR3Az.js +1 -0
  16. package/dist/assets/Detail-DV-JSHYE.js +2 -0
  17. package/dist/assets/{Extra-D4txQ-j-.js → Extra-BvK6x-Q3.js} +1 -1
  18. package/dist/assets/{FilePreview-BTVizU1K.js → FilePreview-lDiIA4f3.js} +1 -1
  19. package/dist/assets/{Hailuo-B89ik_QX.js → Hailuo-ByNlGaAB.js} +1 -1
  20. package/dist/assets/{History-Brn6ocdZ.js → History-CZNMTW2o.js} +1 -1
  21. package/dist/assets/{ImagePreview-vDExFKx3.js → ImagePreview-BbEGVj7c.js} +1 -1
  22. package/dist/assets/{ImageWrapper-uvdYuFqD.js → ImageWrapper-CZJchffe.js} +1 -1
  23. package/dist/assets/Index-2kWFtnq2.js +1 -0
  24. package/dist/assets/{Index-DseoAZYB2.js → Index-B41YMrlv2.js} +1 -1
  25. package/dist/assets/{Index-DEQ0H-mV.js → Index-BIi2sZ9J.js} +1 -1
  26. package/dist/assets/{Index-rSTlXezW2.js → Index-BSM8qmE12.js} +1 -1
  27. package/dist/assets/Index-BZ0J95Zi.js +1 -0
  28. package/dist/assets/{Index-mGnJ6bmm2.js → Index-Bg6RXp-22.js} +1 -1
  29. package/dist/assets/{Index-DefNEucu.js → Index-BinizDEw.js} +1 -1
  30. package/dist/assets/Index-BpoOIp5T2.js +1 -0
  31. package/dist/assets/Index-BwNpMoFU.js +1 -0
  32. package/dist/assets/{Index-CJy5UVsk.js → Index-CCExcEGK.js} +1 -1
  33. package/dist/assets/{Index-BAwzoFlY.js → Index-CKdU3-kl.js} +1 -1
  34. package/dist/assets/Index-COH2u_8f.css +1 -0
  35. package/dist/assets/Index-CORewMsb.js +1 -0
  36. package/dist/assets/Index-C_PsMoRe2.js +1 -0
  37. package/dist/assets/Index-CdNwVjUJ.js +1 -0
  38. package/dist/assets/{Index-CnIjl-Zv.js → Index-CiKtvMba.js} +1 -1
  39. package/dist/assets/Index-CmTCSoOY.js +1 -0
  40. package/dist/assets/{Index-UV038vyP.js → Index-D1HZkrcj.js} +1 -1
  41. package/dist/assets/{Index-CFZUD08l.js → Index-D92ZwitE.js} +1 -1
  42. package/dist/assets/{Index-Cy7tVOi7.js → Index-D9LzrEzG.js} +1 -1
  43. package/dist/assets/{Index-CP0UkCoH.js → Index-DMezegh3.js} +1 -1
  44. package/dist/assets/{Index-CuNmwWDh.js → Index-DQm-e4Db.js} +1 -1
  45. package/dist/assets/{Index-BZnBZOi8.js → Index-D_tsMe7s.js} +1 -1
  46. package/dist/assets/Index-DbXHxGAA.js +1 -0
  47. package/dist/assets/{Index-BKJiEzQp2.js → Index-DeREZXl82.js} +1 -1
  48. package/dist/assets/{Index-Cr3LnUd-2.js → Index-Dq7ZZB8Q2.js} +2 -2
  49. package/dist/assets/{Index-CIZZS1Qw.js → Index-KJoVmqHA.js} +1 -1
  50. package/dist/assets/{Index-CBF3on53.js → Index-bxOcRAXb.js} +1 -1
  51. package/dist/assets/{Index-BTNXoHBt.js → Index-p850NYjM.js} +1 -1
  52. package/dist/assets/{Index-DV3Q_FPI.js → Index-rHufd-Kr.js} +1 -1
  53. package/dist/assets/Index-wDZvW7UP.js +1 -0
  54. package/dist/assets/{Invitees-DPoj5KXz.js → Invitees-BeYhOGAr.js} +1 -1
  55. package/dist/assets/{List-ISDASBYS.js → List-Br-c5Y7K.js} +1 -1
  56. package/dist/assets/{List-B6QETA-r.js → List-dILUs9ri.js} +1 -1
  57. package/dist/assets/List-sZ4o16vO.js +1 -0
  58. package/dist/assets/{LocalTools-CWwSGQuB.js → LocalTools-CGlok3bS.js} +1 -1
  59. package/dist/assets/{LocalTools-UFyoSfF_.js → LocalTools-Du10Q-KG.js} +1 -1
  60. package/dist/assets/{Main-C0tLTUg8.js → Main-CVHgo6nd.js} +1 -1
  61. package/dist/assets/{Message-6AA25IFV.js → Message-CEGebS3A.js} +2 -2
  62. package/dist/assets/Model-CQsHyzsI.js +1 -0
  63. package/dist/assets/{Navigator-DoCufJsl.js → Navigator-Dys8G60u.js} +3 -3
  64. package/dist/assets/{NotFound-DEqlYLn5.js → NotFound-B8xC3Xkg.js} +1 -1
  65. package/dist/assets/Pay-B9D4VVUj.js +1 -0
  66. package/dist/assets/{Player-ktYT3QrZ.js → Player-B1-y36IF.js} +1 -1
  67. package/dist/assets/{Poivelle-CoIZDp0j2.js → Poivelle-Ch9SG0cc.js} +1 -1
  68. package/dist/assets/{PromptTextarea-n5fFeDCP.js → PromptTextarea-BN5xMkDn.js} +1 -1
  69. package/dist/assets/{RealtimeCall-CRP6bWMq.js → RealtimeCall-HmxNqTRI.js} +1 -1
  70. package/dist/assets/{ScheduledTasks-DHoPxm7t.js → ScheduledTasks-CXkBXL7j.js} +1 -1
  71. package/dist/assets/{Status-CTzS-Ppr.js → Status-BkQ5kopN.js} +1 -1
  72. package/dist/assets/{Subscribe-Dyn9epzG.js → Subscribe-CQAktB9Y.js} +1 -1
  73. package/dist/assets/{TabSwitcher-dWf-9vkp.js → TabSwitcher-DDvB84Ic.js} +1 -1
  74. package/dist/assets/{Tts-BBPiqb2L.js → Tts-BXzjQr0k.js} +1 -1
  75. package/dist/assets/{VideoPlayer-DzPp3pSc.js → VideoPlayer-D0YQE8B0.js} +1 -1
  76. package/dist/assets/{alert-BWDrxIRb.js → alert-BDplJjFH.js} +1 -1
  77. package/dist/assets/arrow-down-Hgc90ZTc.js +1 -0
  78. package/dist/assets/{arrow-down-wide-narrow-DGM6S0zL.js → arrow-down-wide-narrow-DXNmiMs8.js} +1 -1
  79. package/dist/assets/arrow-left-DB6qWRxA.js +1 -0
  80. package/dist/assets/arrow-right-RL8gvSEN.js +1 -0
  81. package/dist/assets/arrow-up-D3niKZHG.js +1 -0
  82. package/dist/assets/{avatar-CAtVB44a.js → avatar-BSLfJakz.js} +1 -1
  83. package/dist/assets/{basic-DRPLMYX9.js → basic-BDepb3x3.js} +1 -1
  84. package/dist/assets/{box-BmF53FhI.js → box-DZV2E00R.js} +1 -1
  85. package/dist/assets/{boxes-DQPZGbXV.js → boxes-Ci-ujGBZ.js} +1 -1
  86. package/dist/assets/{brain-CUHQeFKH.js → brain-CSEkXyaK.js} +1 -1
  87. package/dist/assets/{chart-no-axes-combined-BaHR9ryg.js → chart-no-axes-combined-n7ymo6Xg.js} +1 -1
  88. package/dist/assets/{chat-B1tyuIbC.js → chat-B80d2mNI.js} +1 -1
  89. package/dist/assets/check-sBDe6s27.js +1 -0
  90. package/dist/assets/chevron-down-DiCB7_cE.js +1 -0
  91. package/dist/assets/chevron-right-Qv5p8ju5.js +1 -0
  92. package/dist/assets/circle-check-GlUp7XCt.js +1 -0
  93. package/dist/assets/clock-Wfu3yNCH.js +1 -0
  94. package/dist/assets/{codingBridge-BrQ7PpFx.js → codingBridge-C6l3ZwHz.js} +1 -1
  95. package/dist/assets/{codingBridgeNotify-oXu4uNEs.js → codingBridgeNotify-DD5wHtJU.js} +2 -2
  96. package/dist/assets/{coins-DWzU0U0A.js → coins-Bt77jBiZ.js} +1 -1
  97. package/dist/assets/{collapse-dZqdDEQh.js → collapse-Cdk31esV.js} +1 -1
  98. package/dist/assets/{constants-OjwdsvEy.js → constants-P5wTiWzI.js} +1 -1
  99. package/dist/assets/copy-CU5KsMub.js +1 -0
  100. package/dist/assets/{createTaskActions-D7PO9n8o.js → createTaskActions-CQkmjGbZ.js} +1 -1
  101. package/dist/assets/{digitalhuman-yNPsz7H0.js → digitalhuman-BXlkAcCh.js} +1 -1
  102. package/dist/assets/{dollar-sign-CvQ478yv.js → dollar-sign-BkNO69TI.js} +1 -1
  103. package/dist/assets/{download-jJCK0jRJ.js → download-CZBrzAe9.js} +1 -1
  104. package/dist/assets/{drawer-5KVW_fvf.js → drawer-oMnCzPYd.js} +1 -1
  105. package/dist/assets/{dropdown-B9qdBSwH.js → dropdown-CRdbOUFC.js} +1 -1
  106. package/dist/assets/{dropdown-Ddqg4G6P.js → dropdown-Cx68tM9d.js} +1 -1
  107. package/dist/assets/{ellipsis-CZ0D-kGF.js → ellipsis-VteHkYV-.js} +1 -1
  108. package/dist/assets/{esm-gChAj3qI.js → esm-BduzBH2m.js} +3 -3
  109. package/dist/assets/{esm-CQsDjYV8.js → esm-BhkrvIUo.js} +1 -1
  110. package/dist/assets/esm-BkoueZY1.js +1 -0
  111. package/dist/assets/{esm-DA-VRU6I.js → esm-CH0bYXCY.js} +1 -1
  112. package/dist/assets/{esm-BYiOfxFU.js → esm-CQ2fMwjC.js} +2 -2
  113. package/dist/assets/{esm-DyApnlum.js → esm-CvujFTUm.js} +2 -2
  114. package/dist/assets/{esm-BxrLbBeD.js → esm-Dk72GVDQ.js} +1 -1
  115. package/dist/assets/{external-link-3tgvHJmo.js → external-link-DA8scqfR.js} +1 -1
  116. package/dist/assets/{eye-DAcAn31C.js → eye-BfWxK8aV.js} +1 -1
  117. package/dist/assets/{file-output-DCK7ppti.js → file-output-PWZ63KaJ.js} +1 -1
  118. package/dist/assets/{file-text-Dk2p26ZV.js → file-text-BiCIu3qW.js} +1 -1
  119. package/dist/assets/{fish-DsNA82b-.js → fish-CyjGhFG8.js} +1 -1
  120. package/dist/assets/{flux-BVyqgmU4.js → flux-ChDNRKsU.js} +1 -1
  121. package/dist/assets/{folder-Cy8PCRjN.js → folder-BSdP--wE.js} +1 -1
  122. package/dist/assets/gauge-CbjIJ_jY.js +1 -0
  123. package/dist/assets/{globe-6Zn_LkzK.js → globe-vAb4i-UX.js} +1 -1
  124. package/dist/assets/{grokvideo-Df_mE0jG.js → grokvideo-D9_K18Z6.js} +1 -1
  125. package/dist/assets/{hailuo-CT6pCAPW.js → hailuo-DoG0Xfy6.js} +1 -1
  126. package/dist/assets/{headphones-W-CrviRo.js → headphones-DDtvT1Yz.js} +1 -1
  127. package/dist/assets/{history-s2ZnmrXW.js → history-BJworAx_.js} +1 -1
  128. package/dist/assets/{i18n-DRZmeOLk.js → i18n-m-rMtkos.js} +1 -1
  129. package/dist/assets/{image-KD9eHRQK.js → image-igPYo_Pj.js} +1 -1
  130. package/dist/assets/{index-BS1k95ol.js → index-DjH2rtqz.js} +5 -5
  131. package/dist/assets/{index.browser.esm-CtJvb4-i.js → index.browser.esm-CPzH_DYo.js} +1 -1
  132. package/dist/assets/{index.es-CFkdKlla.js → index.es-x8_I2SBU.js} +1 -1
  133. package/dist/assets/{info-YGlWHYFu.js → info-BvANsMZ5.js} +1 -1
  134. package/dist/assets/{input-number-Dn3BdUuj.js → input-number-i5U8XdBq.js} +1 -1
  135. package/dist/assets/{key-round-DatP-w8V.js → key-round-BhtGMhGK.js} +1 -1
  136. package/dist/assets/{kling-BjY4Kh1M.js → kling-110lI2T2.js} +1 -1
  137. package/dist/assets/{languages-aVg1Op65.js → languages-ChstT9C4.js} +1 -1
  138. package/dist/assets/{laptop-h2pO-DgV.js → laptop-BmLkCJWZ.js} +1 -1
  139. package/dist/assets/{lightbulb-C2sc8MsP.js → lightbulb-DhMN6I26.js} +1 -1
  140. package/dist/assets/{link-CfZAoHEC.js → link-D5hSNwle.js} +1 -1
  141. package/dist/assets/loader-circle-By_qWfck.js +1 -0
  142. package/dist/assets/{luma-lMaaUo_M.js → luma-4spWj8kt.js} +1 -1
  143. package/dist/assets/{maestro-BPd2T6Di.js → maestro-C4KUqcGJ.js} +1 -1
  144. package/dist/assets/{maestro-BSZ85fa3.js → maestro-D3hecJHK.js} +1 -1
  145. package/dist/assets/{mail-Dy0wM5Ua.js → mail-CJWp-hxo.js} +1 -1
  146. package/dist/assets/{message-circle-CkXHdm1x.js → message-circle-yF7cDPPh.js} +1 -1
  147. package/dist/assets/{mic-BtHlNAKk.js → mic-DjAHk5K1.js} +1 -1
  148. package/dist/assets/{midjourney-DmInScju.js → midjourney-BzentxgM.js} +1 -1
  149. package/dist/assets/{mobileLocalExec-CpkWQYEn.js → mobileLocalExec-DfzBb8QQ.js} +2 -2
  150. package/dist/assets/{mouse-pointer-2-Baco6Uie.js → mouse-pointer-2-D5k09eQB.js} +1 -1
  151. package/dist/assets/music-2-DwDkh_mX.js +1 -0
  152. package/dist/assets/{nanobanana-DhII2QQa.js → nanobanana-oEZ9jCdu.js} +1 -1
  153. package/dist/assets/{omni-D1-bNnWe.js → omni-BRXZsrc1.js} +1 -1
  154. package/dist/assets/{openaiimage-B9Pyizp0.js → openaiimage-DIi-WbEx.js} +1 -1
  155. package/dist/assets/{pagination-D1GgrADA.js → pagination-B3irjpSu.js} +1 -1
  156. package/dist/assets/{pagination-Ce0ipXTe.js → pagination-CRTJLrs9.js} +1 -1
  157. package/dist/assets/{palette-b7OoG_FT.js → palette-DXQDwyp1.js} +1 -1
  158. package/dist/assets/{paperclip-CGik_2JE.js → paperclip-Ds_pgdCl.js} +1 -1
  159. package/dist/assets/{pause-CUtmpYN7.js → pause-GVi14-ft.js} +1 -1
  160. package/dist/assets/{pencil-X8BphKSe.js → pencil-DBlQBmAn.js} +1 -1
  161. package/dist/assets/{pika-_wHwf9jy.js → pika-BvVnxn1P.js} +1 -1
  162. package/dist/assets/{pixverse-CjEPnKUL.js → pixverse-r5huU6Ul.js} +1 -1
  163. package/dist/assets/play-loqVd6xQ.js +1 -0
  164. package/dist/assets/plus-5mgK_nZC.js +1 -0
  165. package/dist/assets/{poivelle-BmpvMSNE.js → poivelle-B-4nGG9X.js} +1 -1
  166. package/dist/assets/{poivelle-CE9TcLtQ.js → poivelle-B2wv8kv8.js} +1 -1
  167. package/dist/assets/poivelle-BK46KraW.js +1 -0
  168. package/dist/assets/{poivelle-BKMcFowD.js → poivelle-BU9sXd3Z.js} +1 -1
  169. package/dist/assets/{poivelle-AoUrSPl3.js → poivelle-B_QSOwfv.js} +1 -1
  170. package/dist/assets/poivelle-CVJFwmq5.js +1 -0
  171. package/dist/assets/poivelle-CiKxLOuT.js +1 -0
  172. package/dist/assets/poivelle-Cr6f1XNM.js +1 -0
  173. package/dist/assets/poivelle-Cu8yRgEl.js +1 -0
  174. package/dist/assets/poivelle-CyNOYDy-.js +1 -0
  175. package/dist/assets/poivelle-DDxnUoCb.js +1 -0
  176. package/dist/assets/poivelle-DFAUqjxK.js +1 -0
  177. package/dist/assets/poivelle-DHNobTmI.js +1 -0
  178. package/dist/assets/poivelle-DRT_oBTG.js +1 -0
  179. package/dist/assets/poivelle-DWpiT4AP.js +1 -0
  180. package/dist/assets/poivelle-JFwjJcOn.js +1 -0
  181. package/dist/assets/poivelle-PPNh0mDW.js +1 -0
  182. package/dist/assets/poivelle-pe1Nl83L.js +1 -0
  183. package/dist/assets/poivelle-u9RX9UkY.js +1 -0
  184. package/dist/assets/{popover-BFmiQ3k4.js → popover-Ca6MAZq8.js} +1 -1
  185. package/dist/assets/{producer-S3nA1XUH.js → producer-E_eCaX8O.js} +1 -1
  186. package/dist/assets/{qrart-DQiay6fm.js → qrart-D1rJnCCH.js} +1 -1
  187. package/dist/assets/{realtime-CpV2gFo7.js → realtime-Dd3584bn.js} +1 -1
  188. package/dist/assets/{refresh-cw-B_HO_0ij.js → refresh-cw-ByRXxRtZ.js} +1 -1
  189. package/dist/assets/rotate-ccw-B1jJmco8.js +1 -0
  190. package/dist/assets/rotate-cw-DtZmpRHd.js +1 -0
  191. package/dist/assets/{row-DccUl_sg.js → row-B4KJ5qAM.js} +1 -1
  192. package/dist/assets/search-DilmuF2H.js +1 -0
  193. package/dist/assets/{seedance-CYyaVGq9.js → seedance-B1OWhrfp.js} +1 -1
  194. package/dist/assets/{seedream-PFEKdDkZ.js → seedream-lJ9lgZpf.js} +1 -1
  195. package/dist/assets/{select-DmAsSwJf.js → select-BStvECg1.js} +1 -1
  196. package/dist/assets/{serp-Dud210LU.js → serp-DThQatO3.js} +1 -1
  197. package/dist/assets/{shield-37B0o6X8.js → shield-WWFXGsj1.js} +1 -1
  198. package/dist/assets/{shuffle-CJh3QSLl.js → shuffle-BqYVx2-u.js} +1 -1
  199. package/dist/assets/{slider-LRhTSbeT.js → slider-CuTlFPPR.js} +1 -1
  200. package/dist/assets/{sliders-horizontal-BbSjksdU.js → sliders-horizontal-BtXQ68tz.js} +1 -1
  201. package/dist/assets/{solana-wallets-DvaY4bti.js → solana-wallets-Bw6E39Pm.js} +2 -2
  202. package/dist/assets/{solana-wallets-vue-DywwG4uk.js → solana-wallets-vue-RNIy_HkB.js} +1 -1
  203. package/dist/assets/{sora-C--BQlhg.js → sora-BZIm7ao3.js} +1 -1
  204. package/dist/assets/{sparkles-BFqdzb6l.js → sparkles-iNFqRK4U.js} +1 -1
  205. package/dist/assets/square-CMRoVOCf.js +1 -0
  206. package/dist/assets/{suno-mB5Jgtdc.js → suno-D2u_4X97.js} +1 -1
  207. package/dist/assets/{switch-Dwgc_IC5.js → switch-D5lFTJY5.js} +1 -1
  208. package/dist/assets/{table-oYRFyit9.js → table-CaTq0fbd.js} +1 -1
  209. package/dist/assets/{tabs-Ch8CKzaA.js → tabs-LWySwjmg.js} +1 -1
  210. package/dist/assets/{tag-DFXJIxao.js → tag-pQCbKxcO.js} +1 -1
  211. package/dist/assets/{taskDrawerMixin-BL5Lp5JU.js → taskDrawerMixin-Cl7YxaFY.js} +1 -1
  212. package/dist/assets/terminal-D3j2ijKT.js +1 -0
  213. package/dist/assets/{time-picker-I0J3kqX5.js → time-picker-CyN6mYku.js} +1 -1
  214. package/dist/assets/{tooltip-Bq0H_aQm.js → tooltip-D4EgKm6G.js} +1 -1
  215. package/dist/assets/{trash-2-DW0QDnkJ.js → trash-2-CiaDFmZj.js} +1 -1
  216. package/dist/assets/{triangle-alert-BixkYn-s.js → triangle-alert-C3z70mZA.js} +1 -1
  217. package/dist/assets/{upload-NuNALB22.js → upload-ByNQwXJh.js} +1 -1
  218. package/dist/assets/{upload-DcLOBPB7.js → upload-DGfOhnPA.js} +1 -1
  219. package/dist/assets/user-Bkb9jny8.js +1 -0
  220. package/dist/assets/{veo-3ezE2QE9.js → veo-WhmdJ9EC.js} +1 -1
  221. package/dist/assets/{video-BJkuSzaE.js → video-Dm20ncFf.js} +1 -1
  222. package/dist/assets/{volume-2-CTbSEFCx.js → volume-2-xm5Y_nf-.js} +1 -1
  223. package/dist/assets/{wallet-BZh5Vih3.js → wallet-B_F55Sui.js} +1 -1
  224. package/dist/assets/{wan-sgb33f6M.js → wan-BoOyw4pn.js} +1 -1
  225. package/dist/assets/{wand-sparkles-Cv4Ptiq-.js → wand-sparkles-PLgBR18n.js} +1 -1
  226. package/dist/assets/{web-CuVfSgkp.js → web-C2aaNWU_.js} +1 -1
  227. package/dist/assets/{web-Cfu4N0UZ.js → web-C3PH0T6Z.js} +1 -1
  228. package/dist/assets/{web-DX7c2xEg.js → web-C8GGdKUI.js} +1 -1
  229. package/dist/assets/{web-dyvgbbW1.js → web-CJf39ZmQ.js} +1 -1
  230. package/dist/assets/{web-ClgBfgxj.js → web-D2IogFzY.js} +1 -1
  231. package/dist/assets/{webextrator-C7lVVTZe.js → webextrator-Bxv6PWrj.js} +1 -1
  232. package/dist/assets/{zap-DRfjqbrJ.js → zap-BEYIN2Rm.js} +1 -1
  233. package/dist/index.html +3 -3
  234. package/package.json +1 -1
  235. package/dist/assets/CopyToClipboard-iDVaseXr.js +0 -1
  236. package/dist/assets/Detail-DzBkBYq_.js +0 -2
  237. package/dist/assets/Index-2tKt-g9o.js +0 -1
  238. package/dist/assets/Index-3_SB0Fci.js +0 -1
  239. package/dist/assets/Index-B40M6S69.js +0 -1
  240. package/dist/assets/Index-BO_VUVpE.js +0 -1
  241. package/dist/assets/Index-Bh2W8Xrp.js +0 -1
  242. package/dist/assets/Index-BluCeHJ02.js +0 -1
  243. package/dist/assets/Index-CYZfLD78.js +0 -1
  244. package/dist/assets/Index-CqGu-h9j.css +0 -1
  245. package/dist/assets/Index-Ctq5ISJW.js +0 -1
  246. package/dist/assets/Index-DiHrn55M2.js +0 -1
  247. package/dist/assets/Index-dt4IHSQQ.js +0 -1
  248. package/dist/assets/List-CIa_Lrhl.js +0 -1
  249. package/dist/assets/Model-BzOoTCII.js +0 -1
  250. package/dist/assets/Pay-USGHh7oL.js +0 -1
  251. package/dist/assets/arrow-down-tb0Mezv3.js +0 -1
  252. package/dist/assets/arrow-left-DPbQbqsy.js +0 -1
  253. package/dist/assets/arrow-right-D48eXuJN.js +0 -1
  254. package/dist/assets/arrow-up-DHcNDHPI.js +0 -1
  255. package/dist/assets/check-DhGcRJTH.js +0 -1
  256. package/dist/assets/chevron-down-jcf6lFV5.js +0 -1
  257. package/dist/assets/chevron-right-Dd9V4M2y.js +0 -1
  258. package/dist/assets/circle-check-BfaOJkOq.js +0 -1
  259. package/dist/assets/clock-DtKORAbi.js +0 -1
  260. package/dist/assets/esm-BXHTAX0g.js +0 -1
  261. package/dist/assets/gauge-ot8THhaL.js +0 -1
  262. package/dist/assets/loader-circle-vQnkm53D.js +0 -1
  263. package/dist/assets/music-2-FSRa_9iX.js +0 -1
  264. package/dist/assets/play-D4E_cXq9.js +0 -1
  265. package/dist/assets/plus-CLVbnDjj.js +0 -1
  266. package/dist/assets/poivelle-BhlZnJUI.js +0 -1
  267. package/dist/assets/poivelle-CUJ9z2Rk.js +0 -1
  268. package/dist/assets/poivelle-Cj4WFLcu.js +0 -1
  269. package/dist/assets/poivelle-CvBDibtG.js +0 -1
  270. package/dist/assets/poivelle-CvubMnux.js +0 -1
  271. package/dist/assets/poivelle-DQUkCylV.js +0 -1
  272. package/dist/assets/poivelle-DREcEIlN.js +0 -1
  273. package/dist/assets/poivelle-DSrOWn2t.js +0 -1
  274. package/dist/assets/poivelle-DXcPkB53.js +0 -1
  275. package/dist/assets/poivelle-DprcinPU.js +0 -1
  276. package/dist/assets/poivelle-DpsH0NNJ.js +0 -1
  277. package/dist/assets/poivelle-JICDF0TK.js +0 -1
  278. package/dist/assets/poivelle-TeRada3R.js +0 -1
  279. package/dist/assets/poivelle-Zey-Jm76.js +0 -1
  280. package/dist/assets/poivelle-p-5gNwah.js +0 -1
  281. package/dist/assets/rotate-ccw-C3uN_xbZ.js +0 -1
  282. package/dist/assets/rotate-cw-tPHm28V7.js +0 -1
  283. package/dist/assets/search-DiGQLwSP.js +0 -1
  284. package/dist/assets/square-Dil1Q3RS.js +0 -1
  285. package/dist/assets/terminal-C4QqvyKN.js +0 -1
  286. package/dist/assets/user-Bp5qPj8b.js +0 -1
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-DmAsSwJf.js";import{t as S}from"./upload-NuNALB22.js";import{t as C}from"./tooltip-Bq0H_aQm.js";import{t as w}from"./alert-BWDrxIRb.js";import{t as T}from"./drawer-5KVW_fvf.js";import{n as E}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as D}from"./box-BmF53FhI.js";import{t as O}from"./clock-DtKORAbi.js";import{t as k}from"./CopyToClipboard-iDVaseXr.js";import{t as A}from"./external-link-3tgvHJmo.js";import{r as j,t as M}from"./PromptTextarea-n5fFeDCP.js";import{t as N}from"./image-KD9eHRQK.js";import{t as P}from"./info-YGlWHYFu.js";import{t as F}from"./triangle-alert-BixkYn-s.js";import{t as I}from"./upload-DcLOBPB7.js";import{t as L}from"./wand-sparkles-Cv4Ptiq-.js";import{t as ee}from"./zap-DRfjqbrJ.js";import{Gn as R,Kn as te,Un as ne,Vn as re,Wn as ie}from"./constants-OjwdsvEy.js";import{Bt as ae,E as z,En as B,Gt as V,Ht as H,Mi as U,Ut as W,Vt as G,ai as K,en as q,gr as J,ni as Y,vi as X}from"./index-BS1k95ol.js";import{t as Z}from"./ImagePreview-vDExFKx3.js";import{t as oe}from"./Consumption-C146g2pG.js";import{a as Q,n as se,r as ce,t as le}from"./pagination-Ce0ipXTe.js";import{t as ue}from"./ApiCodeButton-DIXEBzGs.js";import{t as de}from"./BotPlaceholder-D1PAhJfu.js";import{t as fe}from"./ImageWrapper-uvdYuFqD.js";var pe=y({name:`LayoutNanobanana`,components:{MagicIcon:L,ElDrawer:T,ElButton:U},mixins:[E]}),me={class:`main flex flex-row flex-1`},he={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)]`},ge={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function _e(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,me,[e(`div`,he,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,ge,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ve=z(pe,[[`render`,_e],[`__scopeId`,`data-v-6419fc74`]]),ye=y({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function be(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var xe=z(ye,[[`render`,be]]),Se=y({name:`ImageUrlsInput`,components:{UploadIcon:I,ElUpload:S,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[W,G],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.nanobanana?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){X.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){X.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Ce={class:`field mb-[10px] flex items-center justify-between`},we={class:`title m-0 text-[14px] font-bold`},Te={class:`upload-wrapper flex flex-col items-start gap-[8px]`},Ee={class:`controls flex items-center`},De={class:`file-list flex flex-wrap gap-[10px]`};function Oe(t,n,o,c,d,f){let h=u(`upload-icon`),v=u(`el-button`),y=u(`el-upload`),b=u(`info-icon`),x=u(`image-preview`);return _(),s(l,null,[e(`div`,Ce,[e(`h2`,we,i(t.$t(`nanobanana.name.imageUrls`)),1),e(`div`,Te,[e(`div`,Ee,[a(y,{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`,limit:5,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:m(()=>[a(v,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])])])]),e(`div`,De,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var ke=z(Se,[[`render`,Oe]]),Ae=y({name:`AspectRatioSelector`,components:{InfoIcon:Q},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),je={class:`ratio`},Me={class:`header`},Ne={class:`title font-bold`},Pe=[`aria-label`],Fe=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Ie={class:`preview`},Le={class:`name`};function Re(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,je,[e(`div`,Me,[e(`h2`,Ne,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,Ie,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,Le,i(a.label),1)],42,Fe))),128))],8,Pe)])}var ze=z(Ae,[[`render`,Re],[`__scopeId`,`data-v-7131eb97`]]),Be=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Q},data(){return{options:[{value:ne,label:this.$t(`nanobanana.model.nanoBanana`)},{value:R,label:R},{value:te,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:ie,label:this.$t(`nanobanana.model.nanoBanana2`)}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=re}}),Ve={class:`field`},He={class:`label`},Ue={class:`box`},We={class:`title font-bold`};function Ge(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=z(Be,[[`render`,Ge],[`__scopeId`,`data-v-11cb675b`]]),qe=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Q},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),Je={class:`field`},Ye={class:`label`},Xe={class:`box`},Ze={class:`title font-bold`};function Qe(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Je,[e(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var $e=y({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:U,PromptInput:xe,Consumption:oe,ImageUrlsInput:ke,AspectRatioSelector:ze,ModelSelector:Ke,ResolutionSelector:z(qe,[[`render`,Qe],[`__scopeId`,`data-v-7ab9d4d4`]])},emits:[`generate`],computed:{config(){return this.$store.state.nanobanana?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return V({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),et={class:`flex flex-col h-full`},tt={class:`flex-1 overflow-y-auto p-5`},nt={class:`flex flex-col items-center justify-center px-5 pb-5`};function rt(t,n,o,c,l,d){let f=u(`model-selector`),p=u(`resolution-selector`),h=u(`prompt-input`),g=u(`aspect-ratio-selector`),v=u(`image-urls-input`),y=u(`consumption`),b=u(`magic-icon`),x=u(`el-button`);return _(),s(`div`,et,[e(`div`,tt,[a(f,{class:`mb-4`}),a(p,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,nt,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`onClick`])])])}var it=z($e,[[`render`,rt]]),at=y({name:`TaskPreview`,components:{ApplicationIcon:D,ChannelIcon:j,ExternalLinkIcon:A,ImageIcon:N,InfoIcon:P,LightningIcon:ee,MagicIcon:L,TimeIcon:O,WarningIcon:F,CopyToClipboard:k,ElAlert:w,ImageWrapper:fe,ElButton:U,ElTooltip:C,ImagePreview:Z,ApiCodeButton:ue},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},showResult(){let e=this.modelValue?.response;return e?e.success===!0?!0:this.hasImages&&e.success!==!1:!1}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)}}}),ot={class:`preview`},st={class:`left`},ct={class:`main`},lt={class:`bot`},ut={class:`datetime`},dt={class:`info`},ft={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},pt={key:1,class:`prompt mt-2`},mt={key:0},ht={key:0,class:n({content:!0,failed:!0})},gt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},_t={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},vt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Tt={key:1,class:n({content:!0})},Et={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:2,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={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:2,class:n({content:!0})},Pt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function zt(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`image-preview`),x=u(`image-wrapper`),S=u(`el-button`),C=u(`el-tooltip`),w=u(`api-code-button`),T=u(`application-icon`),E=u(`image-icon`),D=u(`external-link-icon`),O=u(`lightning-icon`),k=u(`magic-icon`),A=u(`copy-to-clipboard`),j=u(`time-icon`),M=u(`channel-icon`),N=u(`el-alert`),P=u(`warning-icon`),F=u(`info-icon`);return _(),s(`div`,ot,[e(`div`,st,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,ct,[e(`div`,lt,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,ut,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,dt,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,ft,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,mt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,ht,[e(`div`,gt,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(x,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,_t,[a(C,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(w,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`])]),a(N,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,vt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,yt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,bt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,xt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,St,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(A,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Ct,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,wt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(A,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1||n.modelValue?.response?.error?(_(),s(`div`,Tt,[a(N,{closable:!1,class:`failure`},{template:m(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Et,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Dt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Ot,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(A,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,jt,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(A,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Mt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Nt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(A,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,$,[a(N,{closable:!1,class:`info`},{template:m(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Pt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Ft,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,It,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Lt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Rt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(A,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Bt=y({name:`RecentPanel`,components:{TaskPreview:z(at,[[`render`,zt],[`__scopeId`,`data-v-72fc6dcf`]]),BotPlaceholder:de,NoTasks:ce,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Vt={key:0},Ht={key:2,class:`w-full h-full flex items-center justify-center`};function Ut(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,Vt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,Ht,[a(v)])):o(``,!0)],64)}var Wt=y({name:`NanobananaIndex`,components:{ConfigPanel:it,Layout:ve,RecentPanel:z(Bt,[[`render`,Ut]])},mixins:[H],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===Y.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!ae(this.uploadTracker,e=>this.$t(e),e=>X.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;delete e.action,!t&&`image_urls`in e&&delete e.image_urls,e?.aspect_ratio||delete e.aspect_ratio;let n=e?.model===`nano-banana-2`||e?.model===`nano-banana-pro`;!n&&`resolution`in e&&delete e.resolution,n&&!e?.resolution&&(e.resolution=`1K`);let r={...e,action:t?`edit`:`generate`,async:!0};if(!q())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}X.info(this.$t(`nanobanana.message.startingTask`)),J(`nanobanana`,B.generate(r,{token:i})).then(()=>{X.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?X.error(this.$t(`nanobanana.message.usedUp`)):X.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Gt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return _(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Kt=z(Wt,[[`render`,Gt]]);export{Kt as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,j as f,mt as p,ot as m,rt as h,st as ee,tt as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-NuNALB22.js";import{t as y}from"./checkbox-CeoqKfX8.js";import{t as b}from"./drawer-5KVW_fvf.js";import{n as x,r as S,t as C}from"./dropdown-Ddqg4G6P.js";import{t as w}from"./popover-BFmiQ3k4.js";import{n as T,t as E}from"./skeleton-B3LIGUiE.js";import{t as te}from"./arrow-right-D48eXuJN.js";import{t as D}from"./arrow-up-DHcNDHPI.js";import{t as ne}from"./brain-CUHQeFKH.js";import{t as O}from"./check-DhGcRJTH.js";import{t as re}from"./chevron-down-jcf6lFV5.js";import{n as k,t as ie}from"./CodeSnippet-BjrjruoT.js";import{t as A}from"./CopyToClipboard-iDVaseXr.js";import{t as ae}from"./eye-DAcAn31C.js";import{t as oe}from"./file-text-Dk2p26ZV.js";import{n as j,t as se}from"./shield-37B0o6X8.js";import{t as ce}from"./folder-Cy8PCRjN.js";import{t as M}from"./gauge-ot8THhaL.js";import{t as N}from"./history-s2ZnmrXW.js";import{t as P}from"./info-YGlWHYFu.js";import{t as F}from"./laptop-h2pO-DgV.js";import{t as I}from"./link-CfZAoHEC.js";import{t as L}from"./loader-circle-vQnkm53D.js";import{i as le,n as R,t as ue}from"./AskUserQuestionCard-BrmoW_CU.js";import{t as de}from"./paperclip-CGik_2JE.js";import{t as z}from"./pencil-X8BphKSe.js";import{t as B}from"./plus-CLVbnDjj.js";import{t as V}from"./rotate-cw-tPHm28V7.js";import{t as fe}from"./search-DiGQLwSP.js";import{t as pe}from"./square-Dil1Q3RS.js";import{t as me}from"./terminal-C4QqvyKN.js";import{t as he}from"./trash-2-DW0QDnkJ.js";import{Ci as H,E as U,Mi as W,Ut as ge,Vi as G,_i as _e,ai as ve,fi as ye,gi as K,hi as q,ni as J,qt as be,vi as Y}from"./index-BS1k95ol.js";import"./vendor-highlight-BtIeKitL.js";import{s as xe,t as Se}from"./codingBridgeNotify-oXu4uNEs.js";var Ce=K(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),we=K(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Te=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ee=_({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:L,NotificationIcon:we,NotificationOffIcon:Ce,ElButton:W},data(){return{enabled:!1,busy:!1}},computed:{supported(){return ye()||xe()}},mounted(){this.enabled=!ye()&&Se()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,Y.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,Y.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?Y.warning(this.$t(`codingBridge.notify.denied`)):Y.warning(this.$t(`codingBridge.notify.unsupported`))}catch{Y.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function De(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(g(),f(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:p(()=>[e.busy?(g(),f(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(g(),f(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Oe=_({name:`CodingBridgeNodeList`,components:{AddIcon:B,DeleteIcon:he,DesktopIcon:le,DeveloperIcon:F,RedoIcon:V,ElButton:W,NotificationToggle:U(Ee,[[`render`,De]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onDelete(e){try{await _e.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),Y.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{Y.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),ke={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ae={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},je={class:`flex items-center gap-2 font-medium`},Me={class:`flex items-center gap-1`},Ne={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},Pe={class:`text-[var(--app-text-subtle)]`},Fe={class:`flex-1 overflow-y-auto`},Ie={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Le={class:`mb-3`},Re={key:1,class:`list-none m-0 p-0`},ze=[`onClick`],Be={class:`flex-1 min-w-0`},Ve={class:`flex items-center gap-2`},He={class:`truncate font-medium`},Ue=[`title`],We={class:`text-xs text-[var(--app-text-subtle)] truncate`};function Ge(o,c,d,f,m,ee){let _=u(`developer-icon`),v=u(`notification-toggle`),y=u(`redo-icon`),b=u(`el-button`),x=u(`add-icon`),S=u(`desktop-icon`),C=u(`delete-icon`);return g(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,Me,[a(v),a(b,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(b,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Ne,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,Pe,i(o.connectionLabel),1)]),e(`div`,Fe,[o.nodes.length?(g(),s(`ul`,Re,[(g(!0),s(l,null,h(o.nodes,r=>(g(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(S,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Be,[e(`div`,Ve,[e(`span`,He,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Ue)]),e(`div`,We,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(b,{class:`opacity-0 group-hover:opacity-100`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:p(()=>[a(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,ze))),128))])):(g(),s(`div`,Ie,[e(`p`,Le,i(o.$t(`codingBridge.nodeList.empty`)),1),a(b,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var Ke=U(Oe,[[`render`,Ge]]),qe=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},Je=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:qe(e.input):!1,Ye=e=>({questions:e.input?.questions??[]}),Xe=100,X=4e4,Ze=12e3,Z=6e3,Q=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},Qe=_({name:`CodingBridgeTranscriptItem`,directives:{highlight:be},components:{CloseIcon:q,ConfirmIcon:O,EditIcon:z,FileIcon:j,InfoIcon:P,VueMarkdown:R,CodeSnippet:ie,CopyToClipboard:A},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Q(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Q(n,Z)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?oe:/write|edit|create|update|insert/.test(e)?z:/grep|glob|search|find|list/.test(e)?fe:k},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Q(JSON.stringify(t,null,2),Z)}catch{return Q(String(e),Z)}},thinkingText(){return Q(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Q(this.resultText,Ze)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Q(this.event.text||``,X)},Xe)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Q(this.event.text||``,X)}}}),$e={key:0,class:`group flex items-end justify-end gap-1.5`},et=[`title`,`aria-label`],tt={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},nt=[`src`],rt=[`href`],it=[`src`],at={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},ot={class:`min-w-0 truncate`},st={key:2},ct={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},lt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},ut={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},dt={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},ft={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},pt={key:0,class:`font-medium text-[var(--app-text)]`},mt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},ht={key:1,class:`px-2.5 pb-2`},gt={key:2,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},_t={key:3,class:`px-2.5 pb-2`},vt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},yt={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},bt={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},xt={class:`whitespace-pre-wrap break-words`},St={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function Ct(t,r,c,p,_,v){let y=u(`edit-icon`),b=u(`file-icon`),x=u(`vue-markdown`),S=u(`code-snippet`),C=u(`copy-to-clipboard`),w=u(`close-icon`),T=u(`confirm-icon`),E=u(`info-icon`),te=m(`highlight`);return g(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(g(),s(`div`,$e,[t.editable?(g(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,et)):o(``,!0),e(`div`,tt,[t.event.images&&t.event.images.length?(g(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(g(!0),s(l,null,h(t.event.images,(e,t)=>(g(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,nt))),128))],2)):o(``,!0),t.hasAttachments?(g(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(g(!0),s(l,null,h(t.event.attachments,(t,n)=>(g(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(g(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,it)):(g(),s(`span`,at,[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,ot,i(t.name||t.url),1)],8,rt))),128))],2)):o(``,!0),t.event.text?(g(),s(`span`,st,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(g(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(x,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[te]])],2)):t.event.kind===`thinking`?(g(),s(`div`,ct,i(t.thinkingText),1)):t.event.kind===`tool_use`?(g(),s(`div`,lt,[e(`div`,ut,[(g(),f(ee(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(g(),s(`span`,dt,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(g(),s(`div`,ft,[(g(!0),s(l,null,h(t.questionLines,(t,n)=>(g(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(g(),s(`div`,pt,i(t.header),1)):o(``,!0),e(`div`,mt,i(t.question),1)]))),128))])):t.commandText?(g(),s(`div`,ht,[a(S,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(g(),s(`div`,gt,i(t.filePath),1)):t.inputText?(g(),s(`div`,_t,[a(S,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(g(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(g(),s(`div`,vt,[a(C,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(g(),s(`div`,yt,[t.event.is_error?(g(),f(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(g(),s(`div`,bt,[a(E,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xt,i(t.noticeText),1)])):t.event.kind===`error`?(g(),s(`div`,St,i(t.event.text),1)):o(``,!0)],2)}var wt=U(Qe,[[`render`,Ct],[`__scopeId`,`data-v-2028b19a`]]),Tt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Et=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Dt=60,Ot=1500,kt=28,At=_({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:L},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Et:Tt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Dt)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Ot)):this.scheduleType(Dt)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(kt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Dt)):this.scheduleType(kt))}}}),jt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Mt={class:`cb-thinking__word`},Nt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Pt(t,n,o,c,l,d){let f=u(`loading-icon`);return g(),s(`div`,jt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Mt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Nt,`(`+i(t.elapsed)+`s)`,1)])}var Ft=U(At,[[`render`,Pt],[`__scopeId`,`data-v-ae116215`]]),It=_({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:te,FileIcon:j,FolderIcon:ce,RedoIcon:V,UpIcon:D,ElDialog:H,ElButton:W,ElInput:G},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),Lt={class:`flex flex-col gap-2`},Rt={class:`flex items-center gap-2 min-w-0`},zt={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},Bt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},Vt={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},Ht=[`onClick`],Ut={class:`truncate`,dir:`ltr`},Wt={class:`truncate`,dir:`ltr`},Gt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},Kt={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},qt={class:`flex items-center justify-end gap-2`};function Jt(t,d,m,ee,_,v){let y=u(`up-icon`),b=u(`el-button`),x=u(`continue-icon`),S=u(`el-input`),C=u(`redo-icon`),w=u(`folder-icon`),T=u(`file-icon`),E=u(`el-dialog`);return g(),f(E,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:p(()=>[e(`div`,qt,[a(b,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(b,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:p(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:p(()=>[e(`div`,Lt,[e(`div`,Rt,[a(b,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(S,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:p(()=>[a(b,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(b,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:p(()=>[a(C,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,zt,[t.loading&&!t.listing?(g(),s(`div`,Bt,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(g(),s(`div`,Vt,i(t.listing.error),1)):(g(),s(l,{key:2},[(g(!0),s(l,null,h(t.directories,n=>(g(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(w,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Ut,i(n.name),1)],8,Ht))),128)),(g(!0),s(l,null,h(t.files,t=>(g(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Wt,i(t.name),1)]))),128)),t.isEmpty?(g(),s(`div`,Gt,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(g(),s(`p`,Kt,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var Yt=U(It,[[`render`,Jt]]),Xt=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,Zt=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,Qt=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`,$t=50*1024*1024,$=10,en=60,tn=60,nn={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},rn=_({name:`CodingBridgeSessionView`,components:{AddIcon:B,AiIcon:ne,AttachmentIcon:de,CloseIcon:q,CodeIcon:k,ConfirmIcon:O,DeveloperIcon:F,EditIcon:z,ExpandDownIcon:re,FileIcon:j,FolderOpenIcon:Te,HistoryIcon:N,PerformanceIcon:M,RedoIcon:V,SecurityIcon:se,StopIcon:pe,UpIcon:D,ViewIcon:ae,ElInput:G,ElButton:W,ElPopover:w,ElDropdown:C,ElDropdownMenu:S,ElDropdownItem:x,ElUpload:v,ElCheckbox:y,ElSkeleton:E,ElSkeletonItem:T,TranscriptItem:wt,ThinkingIndicator:Ft,DirectoryDialog:Yt,AskUserQuestionCard:ue,CopyToClipboard:A},mixins:[ge],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:ve()+`/api/v1/files/`,maxAttachments:$,visibleCount:en}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===J.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&Je(t));return t?{request_id:t.request_id,payload:Ye(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&this.connected&&this.nodeOnline},composerHint(){return this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{events(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.scrollToBottom(),this.visibleCount=en,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings()},methods:{requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return nn[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.prompt=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=$?(Y.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$})),!1):e.size>$t?(Y.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){Y.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){Y.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){this.$nextTick(()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)})},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.visibleCount+=tn,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),an={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},on={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},sn={class:`text-sm`},cn={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},ln={class:`flex items-center gap-2 min-w-0`},un=[`title`,`aria-label`],dn={class:`min-w-0`},fn={class:`flex items-center gap-2 font-medium`},pn={class:`truncate`},mn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},hn={key:0,class:`text-[var(--el-color-primary)]`},gn={class:`flex items-center gap-2 flex-none`},_n={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},vn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},yn={class:`opacity-70 flex-none`},bn=[`title`],xn={ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`},Sn={key:0,class:`cb-skeleton`},Cn={class:`flex flex-col gap-4`},wn={class:`flex justify-end`},Tn={class:`flex flex-col gap-1.5`},En={class:`flex justify-end`},Dn={class:`flex flex-col gap-1.5`},On={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},kn=[`title`],An={key:4,class:`flex justify-center pt-1`},jn={key:2,class:`cb-question-dock flex-none px-5`},Mn={class:`border-t border-[var(--app-border-subtle)] p-3`},Nn={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},Pn={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},Fn={class:`inline-flex items-center gap-1.5`},In={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},Ln={key:0,class:`flex flex-wrap gap-2 pb-2`},Rn=[`src`,`alt`],zn={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},Bn=[`title`],Vn={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},Hn=[`title`,`aria-label`,`onClick`],Un={key:1,class:`cb-slash-menu`},Wn=[`onMousedown`,`onMouseenter`],Gn={class:`cb-slash-menu__name`},Kn={key:0,class:`cb-slash-menu__hint`},qn={key:1,class:`cb-slash-menu__desc`},Jn={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},Yn={class:`mt-1.5 flex items-center gap-1.5`},Xn=[`title`,`aria-label`],Zn={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Qn={type:`button`,class:`cb-pill`},$n=[`src`],er={class:`truncate`},tr=[`src`],nr={key:1,class:`ml-1 text-xs opacity-60`},rr={key:1,class:`cb-pill cb-pill--static`},ir=[`src`],ar={class:`truncate`},or={type:`button`,class:`cb-pill`},sr={class:`truncate`},cr={class:`cb-model-menu`},lr={class:`truncate`},ur=[`onClick`],dr={class:`truncate`},fr={key:0,class:`cb-model-custom`},pr={type:`button`,class:`cb-pill`},mr={class:`truncate`},hr={type:`button`,class:`cb-pill`},gr={class:`truncate`},_r={type:`button`,class:`cb-pill`},vr={class:`truncate`},yr=[`title`,`aria-label`],br={key:4,class:`cb-pill cb-pill--static`},xr={class:`truncate`},Sr={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function Cr(d,m,ee,_,v,y){let b=u(`developer-icon`),x=u(`el-button`),S=u(`history-icon`),C=u(`add-icon`),w=u(`copy-to-clipboard`),T=u(`el-skeleton-item`),E=u(`el-skeleton`),te=u(`up-icon`),D=u(`transcript-item`),ne=u(`thinking-indicator`),O=u(`redo-icon`),re=u(`ask-user-question-card`),k=u(`view-icon`),ie=u(`edit-icon`),A=u(`el-checkbox`),ae=u(`file-icon`),oe=u(`close-icon`),j=u(`el-input`),se=u(`el-upload`),ce=u(`attachment-icon`),M=u(`code-icon`),N=u(`expand-down-icon`),P=u(`confirm-icon`),F=u(`el-dropdown-item`),I=u(`el-dropdown-menu`),L=u(`el-dropdown`),le=u(`ai-icon`),R=u(`el-popover`),ue=u(`performance-icon`),de=u(`security-icon`),z=u(`folder-open-icon`),B=u(`stop-icon`),V=u(`directory-dialog`);return g(),s(`div`,an,[d.currentNode?(g(),s(l,{key:1},[e(`div`,cn,[e(`div`,ln,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:m[1]||=e=>d.$emit(`devices`)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,un),e(`div`,dn,[e(`div`,fn,[e(`span`,pn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(g(),s(`div`,mn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(g(),s(`span`,hn,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,gn,[a(x,{size:`small`,round:``,onClick:m[2]||=e=>d.$emit(`history`)},{default:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(g(),f(x,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(g(),s(`div`,_n,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(g(),s(`div`,vn,[(g(!0),s(l,null,h(d.diagnostics,t=>(g(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,yn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,bn),a(w,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,xn,[d.historyLoading&&!d.events.length?(g(),s(`div`,Sn,[a(E,{animated:``},{template:p(()=>[e(`div`,Cn,[e(`div`,wn,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Tn,[a(T,{variant:`text`,style:{width:`55%`}}),a(T,{variant:`text`,style:{width:`88%`}}),a(T,{variant:`text`,style:{width:`70%`}})]),a(T,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,En,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,Dn,[a(T,{variant:`text`,style:{width:`80%`}}),a(T,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(g(),s(`div`,On,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(g(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:m[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(te,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,kn)):o(``,!0),(g(!0),s(l,null,h(d.visibleEvents,e=>(g(),f(D,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(g(),f(ne,{key:3})):o(``,!0),d.canRetry?(g(),s(`div`,An,[a(x,{size:`small`,round:``,onClick:d.onRetry},{default:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],512),d.pendingQuestion?(g(),s(`div`,jn,[(g(),f(re,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,Mn,[d.readonly?(g(),s(`div`,Nn,[a(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(x,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(g(),s(l,{key:1},[d.editingActive?(g(),s(`div`,Pn,[e(`span`,Fn,[a(ie,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(g(),f(A,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":m[4]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:p(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:m[5]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,In,[d.attachmentFileList.length?(g(),s(`div`,Ln,[(g(!0),s(l,null,h(d.attachmentFileList,(t,n)=>(g(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(g(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,Rn)):(g(),s(`span`,zn,[a(ae,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,Bn),d.isAttachmentUploading(t)?(g(),s(`span`,Vn,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(oe,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Hn)]))),128))])):o(``,!0),d.slashMenuVisible?(g(),s(`ul`,Un,[(g(!0),s(l,null,h(d.slashMatches,(r,a)=>(g(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,Gn,`/`+i(r.name),1),r.argument_hint?(g(),s(`span`,Kn,i(r.argument_hint),1)):o(``,!0),r.description?(g(),s(`span`,qn,i(r.description),1)):o(``,!0)],42,Wn))),128))])):o(``,!0),a(j,{modelValue:d.prompt,"onUpdate:modelValue":m[6]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`placeholder`,`onKeydown`]),a(se,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":m[7]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:p(()=>[e(`span`,Jn,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,Yn,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:m[8]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(ce,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xn),e(`div`,Zn,[d.isNewSession?(g(),f(L,{key:0,trigger:`click`,onCommand:m[9]||=e=>d.provider=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.providerOptions,e=>(g(),f(F,{key:e.value,command:e.value,disabled:!e.available},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(g(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,tr)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(g(),s(`span`,nr,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:p(()=>[e(`button`,Qn,[d.providerIcon(d.provider)?(g(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,$n)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,er,i(d.providerName(d.provider)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(g(),s(`span`,rr,[d.providerIcon(d.currentSession?.provider||`claude`)?(g(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,ir)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,ar,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),a(R,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:p(()=>[e(`button`,or,[a(le,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,sr,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[e(`div`,cr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:m[10]||=e=>d.selectModel(``)},[a(P,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,lr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(g(!0),s(l,null,h(d.modelOptions,t=>(g(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(P,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,dr,i(t.label),1)],8,ur))),128)),d.allowCustomModel?(g(),s(`div`,fr,[a(j,{modelValue:d.customModelDraft,"onUpdate:modelValue":m[11]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:p(()=>[a(x,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:p(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512),d.effortOptions.length>1?(g(),f(L,{key:2,trigger:`click`,onCommand:m[12]||=e=>d.effort=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.effortOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,pr,[a(ue,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,mr,i(d.effortLabel(d.effort)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):o(``,!0),a(L,{trigger:`click`,onCommand:m[13]||=e=>d.permissionMode=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.permissionModeOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,hr,[a(de,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,gr,i(d.permissionModeLabel(d.permissionMode)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1}),d.canPickCwd?(g(),f(R,{key:3,trigger:`click`,placement:`top-start`,width:320},{reference:p(()=>[e(`button`,_r,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,vr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[a(j,{modelValue:d.cwd,"onUpdate:modelValue":m[17]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:p(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:m[14]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[m[15]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),m[16]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(z,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,yr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):d.currentSession?.cwd?(g(),s(`span`,br,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xr,i(d.currentSession?.cwd),1)])):o(``,!0)]),d.running?(g(),f(x,{key:0,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:p(()=>[a(B,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(x,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:p(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,Sr,i(d.composerHint),1)],64))])],64)):(g(),s(`div`,on,[a(b,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,sn,i(d.$t(`codingBridge.session.noDevice`)),1),a(x,{class:`md:hidden mt-4`,round:``,onClick:m[0]||=e=>d.$emit(`devices`)},{default:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(V,{visible:d.directoryVisible,"onUpdate:visible":m[18]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var wr=U(rn,[[`render`,Cr],[`__scopeId`,`data-v-05e55dc1`]]),Tr=_({name:`CodingBridgePairDialog`,components:{LinkIcon:I,ElDialog:H,ElInput:G,ElButton:W},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===J.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);Y.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?Y.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?Y.error(this.$t(`codingBridge.pair.usedCode`)):Y.error(this.$t(`codingBridge.pair.failed`))}}}}),Er={class:`content`},Dr={class:`text-sm text-[var(--app-text-subtle)] mb-4`},Or={class:`steps list-none m-0 p-0 mb-4`},kr={class:`flex gap-3 mb-3`},Ar={class:`flex-1 min-w-0`},jr={class:`text-sm mb-1`},Mr={class:`flex gap-3 mb-3`},Nr={class:`flex-1 min-w-0`},Pr={class:`text-sm mb-1`},Fr={class:`flex gap-3`},Ir={class:`flex-1 min-w-0`},Lr={class:`text-sm`};function Rr(t,n,o,s,l,d){let m=u(`el-input`),h=u(`link-icon`),ee=u(`el-button`),_=u(`el-dialog`);return g(),f(_,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Er,[e(`p`,Dr,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,Or,[e(`li`,kr,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,Ar,[e(`p`,jr,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,Mr,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,Nr,[e(`p`,Pr,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,Fr,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,Ir,[e(`p`,Lr,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(m,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(ee,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var zr=U(Tr,[[`render`,Rr],[`__scopeId`,`data-v-54bd85f1`]]),Br=_({name:`CodingBridgePermissionDialog`,components:{CloseIcon:q,CodeIcon:k,ConfirmIcon:O,ElDialog:H,ElButton:W},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!Je(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),Vr={key:0,class:`content`},Hr={class:`text-sm text-[var(--app-text-subtle)] mb-3`},Ur={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Wr={class:`flex items-center gap-2 font-medium`},Gr={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},Kr={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},qr={class:`flex justify-end gap-2`};function Jr(t,n,c,l,d,m){let h=u(`code-icon`),ee=u(`close-icon`),_=u(`el-button`),v=u(`confirm-icon`),y=u(`el-dialog`);return g(),f(y,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:p(()=>[e(`div`,qr,[a(_,{round:``,onClick:t.onDeny},{default:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(_,{type:`primary`,round:``,onClick:t.onAllow},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:p(()=>[t.request?(g(),s(`div`,Vr,[e(`p`,Hr,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,Ur,[e(`div`,Wr,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(g(),s(`p`,Gr,i(t.request.description),1)):o(``,!0),t.hasInput?(g(),s(`pre`,Kr,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Yr=U(Br,[[`render`,Jr]]),Xr={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},Zr=_({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:k,RedoIcon:V,ElDrawer:b,ElButton:W},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===J.Request},sessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)}},methods:{providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return Xr[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),Qr={class:`flex flex-col h-full`},$r={class:`flex items-center justify-between mb-3`},ei={class:`text-xs text-[var(--app-text-subtle)] m-0`},ti={key:0,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ni={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ri={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},ii={key:3,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},ai=[`onClick`],oi={class:`flex items-center gap-2 mb-1`},si=[`src`,`alt`],ci={class:`text-sm font-medium truncate flex-1`},li=[`title`],ui={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},di={key:0},fi={key:1},pi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},mi={key:0},hi={key:1};function gi(t,c,d,m,ee,_){let v=u(`redo-icon`),y=u(`el-button`),b=u(`code-icon`),x=u(`el-drawer`);return g(),f(x,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[0]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Qr,[e(`div`,$r,[e(`p`,ei,i(t.$t(`codingBridge.history.intro`)),1),a(y,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:p(()=>[t.loading?o(``,!0):(g(),f(v,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.currentNodeId?t.loading&&!t.sessions.length?(g(),s(`div`,ni,i(t.$t(`codingBridge.history.loading`)),1)):t.sessions.length?(g(),s(`ul`,ii,[(g(!0),s(l,null,h(t.sessions,r=>(g(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,oi,[t.providerIcon(r.provider)?(g(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,si)):(g(),f(b,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,ci,i(r.title),1),r.running?(g(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,li)):o(``,!0)]),e(`div`,ui,[r.cwd?(g(),s(`span`,di,i(r.cwd),1)):o(``,!0),r.git_branch?(g(),s(`span`,fi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,pi,[r.updated_at?(g(),s(`span`,mi,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(g(),s(`span`,hi,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,ai))),128))])):(g(),s(`div`,ri,i(t.$t(`codingBridge.history.empty`)),1)):(g(),s(`div`,ti,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var _i=_({name:`CodingBridgeIndex`,components:{ElDrawer:b,NodeList:Ke,SessionView:wr,PairDialog:zr,PermissionDialog:Yr,HistoryDrawer:U(Zr,[[`render`,gi],[`__scopeId`,`data-v-af006e93`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),vi={class:`coding-bridge flex flex-row h-full relative`};function yi(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),m=u(`permission-dialog`),h=u(`history-drawer`);return g(),s(`div`,vi,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:p(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(m),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var bi=U(_i,[[`render`,yi],[`__scopeId`,`data-v-2879fe0f`]]);export{bi as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,rt as p,tt as m,x as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-DmAsSwJf.js";import{t as y}from"./upload-NuNALB22.js";import{t as b}from"./alert-BWDrxIRb.js";import{t as x}from"./drawer-5KVW_fvf.js";import{t as S}from"./input-number-Dn3BdUuj.js";import{t as C}from"./slider-LRhTSbeT.js";import{n as w}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as T}from"./clock-DtKORAbi.js";import{t as E}from"./CopyToClipboard-iDVaseXr.js";import{r as D,t as O}from"./PromptTextarea-n5fFeDCP.js";import{t as k}from"./info-YGlWHYFu.js";import{t as A}from"./triangle-alert-BixkYn-s.js";import{t as j}from"./upload-DcLOBPB7.js";import{t as M}from"./wand-sparkles-Cv4Ptiq-.js";import{ar as N,ir as ee,rr as te}from"./constants-OjwdsvEy.js";import{Bt as P,E as F,Gt as I,Ht as L,In as R,Mi as z,Ut as B,Vt as V,ai as H,en as U,gr as W,ni as G,vi as K}from"./index-BS1k95ol.js";import{t as q}from"./ImagePreview-vDExFKx3.js";import{t as J}from"./Consumption-C146g2pG.js";import{a as Y,n as X,r as Z,t as Q}from"./pagination-Ce0ipXTe.js";import{t as ne}from"./ApiCodeButton-DIXEBzGs.js";import{t as re}from"./BotPlaceholder-D1PAhJfu.js";import{t as ie}from"./ImageWrapper-uvdYuFqD.js";var ae=g({name:`LayoutFlux`,components:{MagicIcon:M,ElDrawer:x,ElButton:z},mixins:[w]}),oe={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 le(t,n,r,a,s,d){let p=c(`magic-icon`),g=c(`el-button`),_=c(`el-drawer`);return m(),o(`div`,oe,[e(`div`,se,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,ce,[u(t.$slots,`result`,{},void 0,!0)]),l(i(g,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[h,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ue=F(ae,[[`render`,le],[`__scopeId`,`data-v-72e82d52`]]),de=g({name:`ModelSelector`,components:{ElSelect:_,ElOption:v},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`flux-dev`,label:`flux-dev`},{value:`flux-pro`,label:`flux-pro`},{value:`flux-kontext-pro`,label:`flux-kontext-pro`},{value:`flux-kontext-max`,label:`flux-kontext-max`},{value:`flux-2-flex`,label:`flux-2-flex`},{value:`flux-2-pro`,label:`flux-2-pro`},{value:`flux-2-max`,label:`flux-2-max`}]}},computed:{value:{get(){return this.$store.state.flux?.config?.model},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||=N}}),fe={class:`field`},pe={class:`title font-bold`};function me(t,n,a,l,u,h){let g=c(`el-option`),_=c(`el-select`);return m(),o(`div`,fe,[e(`h2`,pe,r(t.$t(`flux.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:f(()=>[(m(!0),o(s,null,p(t.options,e=>(m(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var he=F(de,[[`render`,me],[`__scopeId`,`data-v-e9b17945`]]),ge=g({name:`CountSelector`,components:{ElSlider:C,InfoIcon:Y,ElInputNumber:S},computed:{value:{get(){return this.$store.state.flux?.config?.count},set(e){console.debug(`set count`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,count:e})}}},mounted(){this.value||=1}}),_e={class:`flex justify-between`},ve={class:`flex justify-start items-center`},ye={class:`text-sm font-bold`},be={class:`flex justify-end items-center`},xe={class:`w-full`};function Se(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-input-number`),p=c(`el-slider`);return m(),o(`div`,null,[e(`div`,_e,[e(`div`,ve,[e(`span`,ye,r(t.$t(`flux.name.numbers`)),1),i(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,be,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,xe,[i(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Ce=F(ge,[[`render`,Se]]),we=g({name:`ActionSelector`,components:{ElSelect:_,ElOption:v},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`generate`,label:this.$t(`flux.name.generate`)},{value:`edits`,label:this.$t(`flux.name.edits`)}]}},computed:{value:{get(){return this.$store.state.flux?.config?.action},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,action:e})}}},mounted(){this.value||=ee}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,a,l,u,h){let g=c(`el-option`),_=c(`el-select`);return m(),o(`div`,Te,[e(`h2`,Ee,r(t.$t(`flux.name.task`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:f(()=>[(m(!0),o(s,null,p(t.options,e=>(m(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Oe=F(we,[[`render`,De],[`__scopeId`,`data-v-81fd05e5`]]),ke=g({name:`ImageUrlInput`,components:{UploadIcon:j,ElUpload:y,ElButton:z,InfoIcon:Y,ImagePreview:q},mixins:[B,V],emits:[`change`],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{urls:{handler(e){console.debug(`URLs changed:`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,image_url:e[0]})}}},methods:{onExceed(){K.warning(this.$t(`flux.message.uploadStartImageExceed`))},onError(){K.error(this.$t(`flux.message.uploadStartImageError`))}}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`};function Pe(t,a,s,l,u,d){let p=c(`info-icon`),h=c(`image-preview`),g=c(`upload-icon`),_=c(`el-button`),v=c(`el-upload`);return m(),o(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,r(t.$t(`flux.name.imageUrl`)),1),i(p,{content:t.$t(`flux.description.imageUrl`)},null,8,[`content`])])]),i(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":a[0]||=e=>t.fileList=e,name:`file`,limit:5,class:`upload-wrapper`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,multiple:!0,"list-type":`picture`,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,headers:t.headers},{file:f(({file:e})=>[i(h,{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:f(()=>[i(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(g,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`headers`])])}var Fe=F(ke,[[`render`,Pe],[`__scopeId`,`data-v-88b2cb07`]]),Ie=g({name:`PromptInput`,components:{PromptTextarea:O},computed:{prompt:{get(){return this.$store.state.flux?.config?.prompt},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Le(e,t,n,r,i,a){let o=c(`prompt-textarea`);return m(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`flux.name.prompt`),info:e.$t(`flux.description.prompt`),placeholder:e.$t(`flux.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Re=F(Ie,[[`render`,Le]]),ze=g({name:`SizeSelector`,components:{ElSelect:_,ElOption:v},data(){return{options:te}},computed:{value:{get(){return this.$store.state.flux?.config?.size},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,size:e})}}},mounted(){this.value||=`1:1`}}),Be={class:`field`},Ve={class:`title font-bold`};function He(t,n,a,l,u,h){let g=c(`el-option`),_=c(`el-select`);return m(),o(`div`,Be,[e(`h2`,Ve,r(t.$t(`flux.name.ratio`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:f(()=>[(m(!0),o(s,null,p(t.options,e=>(m(),d(g,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ue=g({name:`PresetPanel`,components:{MagicIcon:M,ElButton:z,PromptInput:Re,ModelSelector:he,CountSelector:Ce,Consumption:J,ActionSelector:Oe,ImageUrlInput:Fe,SizeSelector:F(ze,[[`render`,He],[`__scopeId`,`data-v-8c58dc91`]])},emits:[`generate`],computed:{config(){return this.$store.state.flux?.config},consumption(){return I(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),We={class:`flex flex-col h-full`},Ge={class:`flex-1 overflow-y-auto p-5`},Ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function qe(t,s,l,u,p,h){let g=c(`action-selector`),_=c(`prompt-input`),v=c(`image-url-input`),y=c(`model-selector`),b=c(`size-selector`),x=c(`count-selector`),S=c(`consumption`),C=c(`magic-icon`),w=c(`el-button`);return m(),o(`div`,We,[e(`div`,Ge,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),t.config?.action===`edits`?(m(),d(v,{key:0,class:`mb-4`})):a(``,!0),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`})]),e(`div`,Ke,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Je=F(Ue,[[`render`,qe]]),Ye=g({name:`TaskPreview`,components:{ChannelIcon:D,InfoIcon:k,MagicIcon:M,TimeIcon:T,WarningIcon:A,CopyToClipboard:E,ElAlert:b,ImageWrapper:ie,ApiCodeButton:ne},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.flux?.application},config(){return this.$store.state.flux?.config},images(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenImage(e){window.open(e,`_blank`)}}}),Xe={class:`preview`},Ze={class:`left`},Qe={class:`main`},$e={class:`bot`},et={class:`datetime`},tt={class:`info`},nt={key:0,class:`prompt mt-2`},rt={key:0},it={key:0,class:t({content:!0,failed:!0})},at={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},ot={class:t({operations:!0,"mt-2":!0,"mb-2":!0})},st={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ut={key:1,class:t({content:!0})},dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mt={key:2,class:t({content:!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function gt(t,l,u,h,g,_){let v=c(`capability-presentation`),y=c(`image-wrapper`),b=c(`api-code-button`),x=c(`channel-icon`),S=c(`magic-icon`),C=c(`copy-to-clipboard`),w=c(`time-icon`),T=c(`el-alert`),E=c(`warning-icon`),D=c(`info-icon`);return m(),o(`div`,Xe,[e(`div`,Ze,[i(v,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,Qe,[e(`div`,$e,[i(v,{capability:`flux`,part:`name`}),e(`span`,et,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,tt,[t.modelValue?.request?.prompt?(m(),o(`p`,nt,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(m(),o(`span`,rt,` - (`+r(t.$t(`flux.status.pending`))+`) `,1))])):a(``,!0)]),t.modelValue?.response?.success===!0?(m(),o(`div`,it,[e(`div`,at,[(m(!0),o(s,null,p(t.images,(e,t)=>(m(),d(y,{key:t,src:e?.image_url,"raw-src":e?.image_url,"model-value":e},null,8,[`src`,`raw-src`,`model-value`]))),128))]),e(`div`,ot,[i(b,{path:`/flux/images`,body:t.modelValue?.request},null,8,[`body`])]),i(T,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,st,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,ct,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),t.modelValue?.elapsed?(m(),o(`p`,lt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(m(),o(`div`,ut,[i(T,{closable:!1,class:`failure`},{template:f(()=>[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.failure`)),1)]),default:f(()=>[e(`p`,dt,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,ft,[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(C,{content:t.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),t.modelValue?.elapsed?(m(),o(`p`,$,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),e(`p`,pt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(C,{content:t.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):a(``,!0),t.modelValue?.response?a(``,!0):(m(),o(`div`,mt,[i(T,{closable:!1,class:`info`},{template:f(()=>[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.status.pending`)),1)]),default:f(()=>[e(`p`,ht,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`flux.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var _t=g({name:`RecentPanel`,components:{TaskPreview:F(Ye,[[`render`,gt],[`__scopeId`,`data-v-5ae22e0b`]]),BotPlaceholder:re,NoTasks:Z,ScrollList:X},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.flux?.tasks,items:this.$store.state.flux?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),vt={key:0},yt={key:2,class:`w-full h-full flex items-center justify-center`};function bt(e,t,n,r,l,u){let h=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return m(),o(s,null,[e.tasks?.items===void 0?(m(),o(`div`,vt,[i(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(m(),d(_,{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:f(()=>[(m(!0),o(s,null,p(e.tasks?.items,e=>(m(),d(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(m(),o(`div`,yt,[i(v)])):a(``,!0)],64)}var xt=g({name:`FluxIndex`,components:{ConfigPanel:Je,Layout:ue,RecentPanel:F(_t,[[`render`,bt]])},mixins:[L],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.flux?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.flux?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.flux?.credential},config(){return this.$store.state.flux?.config},application(){return this.$store.state.flux?.application},tasks(){return this.$store.state.flux?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Q({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`flux/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`flux/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`flux/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!P(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e={...this.config,async:!0};if(!U())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}K.info(this.$t(`flux.message.startingTask`)),W(`flux`,R.generate(e,{token:t})).then(()=>{K.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?K.error(this.$t(`flux.message.usedUp`)):K.error(this.$t(`flux.message.startTaskFailed`)+t?.error?.message)}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function St(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return m(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ct=F(xt,[[`render`,St]]);export{Ct as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-NuNALB22.js";import{t as b}from"./tooltip-Bq0H_aQm.js";import{t as x}from"./alert-BWDrxIRb.js";import{t as S}from"./drawer-5KVW_fvf.js";import{n as C}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as w}from"./box-BmF53FhI.js";import{t as T}from"./clock-DtKORAbi.js";import{t as E}from"./CopyToClipboard-iDVaseXr.js";import{n as D,r as O,t as k}from"./PromptTextarea-n5fFeDCP.js";import{t as A}from"./info-YGlWHYFu.js";import{t as ee}from"./triangle-alert-BixkYn-s.js";import{t as j}from"./upload-DcLOBPB7.js";import{t as M}from"./wand-sparkles-Cv4Ptiq-.js";import{Dt as N,Et as P,St as F,Tt as I,wt as L,xt as R}from"./constants-OjwdsvEy.js";import{Bt as te,E as z,Gt as ne,Ht as B,Mi as V,Ut as H,Vt as U,ai as W,en as G,gr as K,ni as q,vi as J,xn as Y}from"./index-BS1k95ol.js";import{t as X}from"./FilePreview-BTVizU1K.js";import{t as Z}from"./ImagePreview-vDExFKx3.js";import{t as re}from"./Consumption-C146g2pG.js";import{a as Q,n as ie,r as ae,t as oe}from"./pagination-Ce0ipXTe.js";import{t as se}from"./VideoPlayer-DzPp3pSc.js";import{t as ce}from"./ApiCodeButton-DIXEBzGs.js";import{t as le}from"./BotPlaceholder-D1PAhJfu.js";var ue=v({name:`LayoutOmni`,components:{MagicIcon:M,ElDrawer:S,ElButton:V},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:k},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:N,label:`720p`},{value:P,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||=F}}),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:L,label:`16:9`,w:32,h:18},{value:I,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||=R}}),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:V,InfoIcon:Q,ImagePreview:Z,UploadIcon:j},mixins:[H,U],data(){return{fileList:[],uploadUrl:W()+`/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(){J.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){J.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),ze={class:`field mb-[10px] flex items-center justify-between`},Be={class:`title m-0 text-[14px] font-bold`},Ve={class:`upload-wrapper flex flex-col items-start gap-[8px]`},He={class:`controls flex items-center`},Ue={class:`file-list flex flex-wrap gap-[10px]`};function We(t,n,o,u,d,m){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return g(),s(c,null,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`omni.name.referenceImages`)),1),e(`div`,Ve,[e(`div`,He,[a(y,{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`,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(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{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`]),a(b,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])])])]),e(`div`,Ue,[(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))])],64)}var Ge=z(Re,[[`render`,We]]),Ke=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:V,InfoIcon:Q,FilePreview:X,UploadIcon:j},mixins:[U],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){J.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){J.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(J.error(this.$t(`omni.message.uploadVideoSizeExceed`)),!1):(J.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),qe={class:`field flex items-center justify-between`},Je={class:`title font-bold text-[14px] mb-[10px]`},Ye={class:`upload-wrapper flex flex-col items-start gap-[8px]`},Xe={class:`controls flex items-center`},Ze={key:0,class:`file-list flex flex-wrap gap-[10px]`};function Qe(t,n,u,d,f,m){let h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`info-icon`),b=l(`file-preview`);return g(),s(c,null,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`omni.name.referenceVideo`)),1),e(`div`,Ye,[e(`div`,Xe,[a(v,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"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`]),a(y,{content:t.$t(`omni.description.referenceVideo`),class:`ml-2`},null,8,[`content`])])])]),t.videoUrl?(g(),s(`div`,Ze,[a(b,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)],64)}var $e=v({name:`OmniConfigPanel`,components:{ElButton:V,MagicIcon:M,PromptInput:ve,ResolutionSelector:Ee,RatioSelector:Ie,ReferenceImagesInput:Ge,VideoInput:z(Ke,[[`render`,Qe],[`__scopeId`,`data-v-74e85e4f`]]),Consumption:re},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return ne(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),et={class:`flex flex-col h-full`},tt={class:`flex-1 overflow-y-auto p-5`},nt={class:`flex flex-col items-center justify-center px-5 pb-5`};function rt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,et,[e(`div`,tt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,nt,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var it=z($e,[[`render`,rt]]),at=v({name:`OmniTaskPreview`,components:{ApplicationIcon:w,ChannelIcon:O,CopyToClipboard:E,ExpandIcon:D,InfoIcon:A,MagicIcon:M,TimeIcon:T,WarningIcon:ee,ElAlert:x,VideoPlayer:se,ElTooltip:b,ElButton:V,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`)}}}),ot={class:`preview`},st={class:`left`},ct={class:`main`},lt={class:`bot`},ut={class:`datetime`},dt={class:`info`},ft={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},pt={key:1,class:`prompt mt-2`},mt={key:0},ht={key:1},gt={key:0,class:n({content:!0})},_t={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},yt={key:1,class:n({content:!0})},bt={key:0,class:`mb-4`},xt={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},St={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:0},Tt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:2,class:n({content:!0})},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:3,class:n({content:!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Nt(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`,ot,[e(`div`,st,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,ct,[e(`div`,lt,[a(h,{capability:`omni`,part:`name`}),e(`span`,ut,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,dt,[n.inputImage?(g(),s(`div`,ft,[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`,ht,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,mt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,yt,[n.video?.video_url?(g(),s(`div`,bt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,xt,[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`,St,[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`,Ct,[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`,wt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Tt,[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`,Et,[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`,$,[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`,Dt,[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`,Ot,[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`,kt,[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`,At,[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`,jt,[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`,Mt,[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`,gt,[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`,_t,[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`,vt,[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 Pt=v({name:`OmniRecentPanel`,components:{TaskPreview:z(at,[[`render`,Nt],[`__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?.()}}}),Ft={key:0},It={key:2,class:`w-full h-full flex items-center justify-center`};function Lt(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`,Ft,[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`,It,[a(v)])):o(``,!0)],64)}var Rt=v({name:`OmniIndex`,components:{ConfigPanel:it,Layout:he,RecentPanel:z(Pt,[[`render`,Lt]])},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===q.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(!te(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){J.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){J.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}J.info(this.$t(`omni.message.startingTask`)),K(`omni`,Y.generate(t,{token:n})).then(()=>{J.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`omni.message.usedUp`)):J.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function zt(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 Bt=z(Rt,[[`render`,zt]]);export{Bt as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,rt as p,tt as m,x as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-DmAsSwJf.js";import{t as y}from"./upload-NuNALB22.js";import{t as b}from"./tooltip-Bq0H_aQm.js";import{t as x}from"./alert-BWDrxIRb.js";import{n as S,r as C}from"./radio-DgDgyT2l.js";import{t as w}from"./drawer-5KVW_fvf.js";import{t as T}from"./switch-Dwgc_IC5.js";import{n as E}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as D}from"./clock-DtKORAbi.js";import{t as O}from"./CopyToClipboard-iDVaseXr.js";import{r as k,t as A}from"./PromptTextarea-n5fFeDCP.js";import{t as ee}from"./info-YGlWHYFu.js";import{t as j}from"./triangle-alert-BixkYn-s.js";import{t as M}from"./upload-DcLOBPB7.js";import{t as N}from"./wand-sparkles-Cv4Ptiq-.js";import{di as P}from"./constants-OjwdsvEy.js";import{Bt as te,E as F,Gt as I,Ht as L,Mi as R,Ut as z,Vt as B,Wn as V,ai as H,en as U,gr as W,lr as G,ni as K,vi as q}from"./index-BS1k95ol.js";import{t as J}from"./ImagePreview-vDExFKx3.js";import{t as Y}from"./Consumption-C146g2pG.js";import{a as X,n as Z,r as Q,t as ne}from"./pagination-Ce0ipXTe.js";import{t as re}from"./vue-plyr-wiIKa-zl.js";import{t as ie}from"./ApiCodeButton-DIXEBzGs.js";import{t as ae}from"./BotPlaceholder-D1PAhJfu.js";var oe=g({name:`LayoutPika`,components:{MagicIcon:N,ElDrawer:w,ElButton:R},mixins:[E]}),se={class:`main flex flex-row flex-1`},ce={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)]`},le={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ue(t,n,r,a,s,d){let p=c(`magic-icon`),g=c(`el-button`),_=c(`el-drawer`);return m(),o(`div`,se,[e(`div`,ce,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,le,[u(t.$slots,`result`,{},void 0,!0)]),l(i(g,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[h,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var de=F(oe,[[`render`,ue],[`__scopeId`,`data-v-14cc52c3`]]),fe=g({name:`IngredientsSelector`,components:{ElSwitch:T,InfoIcon:X},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){if(!e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0});return}this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,model:`2.0`})}}},mounted(){this.value===void 0&&(this.value=!1)}}),pe={class:`field`},me={class:`label`},he={class:`title font-bold`};function ge(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return m(),o(`div`,pe,[e(`div`,me,[e(`h2`,he,r(t.$t(`pika.name.ingredients`)),1),i(d,{content:t.$t(`pika.description.ingredients`),class:`info`},null,8,[`content`])]),i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var _e=F(fe,[[`render`,ge],[`__scopeId`,`data-v-606e1d1a`]]),ve=g({name:`EffectSelector`,components:{ElSelect:_,ElOption:v},data(){return{}},computed:{options(){return[{value:`Levitate`,label:this.$t(`pika.style.effect1`)},{value:`Decapitate`,label:this.$t(`pika.style.effect2`)},{value:`Eye-pop`,label:this.$t(`pika.style.effect3`)},{value:`Ta-da`,label:this.$t(`pika.style.effect4`)},{value:`Deflate`,label:this.$t(`pika.style.effect5`)},{value:`Crumble`,label:this.$t(`pika.style.effect6`)},{value:`Dissolve`,label:this.$t(`pika.style.effect7`)},{value:`Squish`,label:this.$t(`pika.style.effect8`)},{value:`Inflate`,label:this.$t(`pika.style.effect9`)},{value:`Melt`,label:this.$t(`pika.style.effect10`)},{value:`Cake-ify`,label:this.$t(`pika.style.effect11`)},{value:`Crush`,label:this.$t(`pika.style.effect12`)},{value:`Explode`,label:this.$t(`pika.style.effect13`)}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,effect:e})}}}}),ye={class:`field`},be={class:`title font-bold`},xe={class:`float-left`};function Se(t,n,a,l,u,h){let g=c(`el-option`),_=c(`el-select`);return m(),o(`div`,ye,[e(`h2`,be,r(t.$t(`pika.name.effect`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`),clearable:``},{default:f(()=>[(m(!0),o(s,null,p(t.options,t=>(m(),d(g,{key:t.value,label:t.label,value:t.value},{default:f(()=>[e(`span`,xe,r(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ce=F(ve,[[`render`,Se],[`__scopeId`,`data-v-d1c54475`]]),we=g({name:`IngredientsModelSelector`,components:{ElRadioButton:S,ElRadioGroup:C},data(){return{options:[{label:this.$t(`pika.button.precise`),value:`precise`},{label:this.$t(`pika.button.creative`),value:`creative`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||=P}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,a,l,u,h,g){let _=c(`el-radio-button`),v=c(`el-radio-group`);return m(),o(`div`,Te,[e(`h2`,Ee,r(t.$t(`pika.name.ingredientsModel`)),1),i(v,{modelValue:t.value,"onUpdate:modelValue":a[0]||=e=>t.value=e,class:`quality`},{default:f(()=>[(m(!0),o(s,null,p(t.options,e=>(m(),d(_,{key:e.value,label:e.value},{default:f(()=>[n(r(e.label),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])])}var Oe=F(we,[[`render`,De],[`__scopeId`,`data-v-b72865fa`]]),ke=g({name:`ModelSelector`,components:{ElSelect:_,ElOption:v},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`2.0`,label:`2.0`},{value:`1.5`,label:`1.5`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||=`2.0`}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,a,l,u,h){let g=c(`el-option`),_=c(`el-select`);return m(),o(`div`,Ae,[e(`h2`,je,r(t.$t(`pika.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`)},{default:f(()=>[(m(!0),o(s,null,p(t.options,e=>(m(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=F(ke,[[`render`,Me],[`__scopeId`,`data-v-7b2e870a`]]),Pe=g({name:`ImageUrlInput`,components:{UploadIcon:M,ElUpload:y,ElButton:R,InfoIcon:X,ImagePreview:J},mixins:[z,B],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.pika?.config?.image_url}},mounted(){this.onSetStartImageUrl()},methods:{onExceed(){q.warning(this.$t(`pika.message.uploadStartImageExceed`))},onError(){q.error(this.$t(`pika.message.uploadStartImageError`))},onRemove(){this.onSetStartImageUrl()},onSetStartImageUrl(){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,image_url:this.urls})},onSuccess(){this.onSetStartImageUrl()},onRemovePreview(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartImageUrl()}}}),Fe={class:`field`},Ie={class:`label`},Le={class:`title font-bold`},Re={class:`upload-control`};function ze(t,a,s,l,u,d){let p=c(`info-icon`),h=c(`image-preview`),g=c(`upload-icon`),_=c(`el-button`),v=c(`el-upload`);return m(),o(`div`,Fe,[e(`div`,Ie,[e(`h2`,Le,r(t.$t(`pika.name.imageUrl`)),1),i(p,{content:t.$t(`pika.description.imageUrl`),class:`info`},null,8,[`content`])]),e(`div`,Re,[i(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":a[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value upload-wrapper`,limit:3,multiple:!0,"list-type":`picture`,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[i(h,{url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemovePreview(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])]),default:f(()=>[i(_,{size:`small`,type:`primary`,round:``},{default:f(()=>[i(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])])}var Be=F(Pe,[[`render`,ze],[`__scopeId`,`data-v-c8a81acf`]]),Ve=g({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||=``}});function He(e,t,n,r,i,a){let o=c(`prompt-textarea`);return m(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pika.name.prompt`),info:e.$t(`pika.description.prompt`),placeholder:e.$t(`pika.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ue=g({name:`PresetPanel`,components:{MagicIcon:N,ImageUrlInput:Be,ElButton:R,Consumption:Y,PromptInput:F(Ve,[[`render`,He]]),IngredientsSelector:_e,IngredientsModelSelector:Oe,ModelSelector:Ne,EffectSelector:Ce},emits:[`generate`],computed:{config(){return this.$store.state.pika?.config},consumption(){return I(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),We={class:`flex flex-col h-full`},Ge={class:`flex-1 overflow-y-auto p-5`},Ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function qe(t,s,l,u,p,h){let g=c(`prompt-input`),_=c(`model-selector`),v=c(`ingredients-selector`),y=c(`effect-selector`),b=c(`image-url-input`),x=c(`ingredients-model-selector`),S=c(`consumption`),C=c(`magic-icon`),w=c(`el-button`);return m(),o(`div`,We,[e(`div`,Ge,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),t.config?.ingredients?(m(),d(b,{key:0,class:`mb-4`})):a(``,!0),t.config?.ingredients?(m(),d(x,{key:1,class:`mb-4`})):a(``,!0)]),e(`div`,Ke,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Je=F(Ue,[[`render`,qe]]),Ye=g({name:`VideoPlayer`,components:{VuePlyr:re},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:1080,options:[1080]}}}}}),Xe=[`data-poster`],Ze=[`src`];function Qe(t,n,r,a,s,l){let u=c(`vue-plyr`);return m(),o(`div`,null,[i(u,{options:t.options,class:`video`},{default:f(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,"data-poster":t.modelValue?.image_url},[e(`source`,{size:`1080`,src:t.modelValue?.video_url,type:`video/mp4`},null,8,Ze)],8,Xe)]),_:1},8,[`options`])])}var $e=g({name:`TaskPreview`,components:{ChannelIcon:k,InfoIcon:ee,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:O,ElAlert:x,VideoPlayer:F(Ye,[[`render`,Qe],[`__scopeId`,`data-v-897d9fe0`]]),ElTooltip:b,ElButton:R,ApiCodeButton:ie},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e.length===0&&e.push({}),e}},methods:{isFailure(e){let t=this.modelValue?.response;return t?.success===!1||!!t?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(e){return this.modelValue?.response?this.isFailure(e)||e?.video_url?!1:!e?.state||[`queued`,`pending`,`processing`,`running`].includes(e.state):!0},onDownload(e){console.log(`on download`),window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenVideo(e){window.open(e,`_blank`)}}}),et={class:`left`},tt={class:`main`},nt={class:`bot`},rt={class:`datetime`},it={class:`info`},at={key:0,class:`prompt mt-2`},ot={key:0},st={key:1},ct={key:0,class:t({content:!0,failed:!0})},lt={class:`image-wrapper`},ut={key:0,class:t({operations:!0,"mt-2":!0})},dt={key:0,class:`description`},ft={class:`description`},pt={key:1,class:`description`},mt={key:1,class:t({content:!0})},ht={class:`description`},gt={class:`description`},_t={key:0,class:`description`},vt={class:`description`},yt={key:2,class:t({content:!0})},$={class:`description`};function bt(t,l,u,h,g,_){let v=c(`capability-presentation`),y=c(`VideoPlayer`),b=c(`el-button`),x=c(`el-tooltip`),S=c(`api-code-button`),C=c(`channel-icon`),w=c(`magic-icon`),T=c(`copy-to-clipboard`),E=c(`time-icon`),D=c(`el-alert`),O=c(`warning-icon`),k=c(`info-icon`);return m(!0),o(s,null,p(t.videos,(s,c)=>(m(),o(`div`,{key:c,class:`preview`},[e(`div`,et,[i(v,{capability:`pika`,part:`avatar`,class:`avatar`})]),e(`div`,tt,[e(`div`,nt,[i(v,{capability:`pika`,part:`name`}),e(`span`,rt,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,it,[t.modelValue?.request?.prompt?(m(),o(`p`,at,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(m(),o(`span`,ot,` - (`+r(t.$t(`pika.status.pending`))+`) `,1)),t.modelValue?.response&&t.isWaiting(s)?(m(),o(`span`,st,` - (`+r(t.$t(`pika.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&s?.video_url?(m(),o(`div`,ct,[e(`div`,lt,[i(y,{"model-value":s},null,8,[`model-value`])]),s?(m(),o(`div`,ut,[i(x,{class:`box-item`,effect:`dark`,content:t.$t(`pika.message.downloadVideo`),placement:`top-start`},{default:f(()=>[s?.video_url?(m(),d(b,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:e=>t.onDownload(s?.video_url)},{default:f(()=>[n(r(t.$t(`pika.button.download`)),1)]),_:1},8,[`onClick`])):a(``,!0)]),_:2},1032,[`content`]),i(S,{path:`/pika/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(D,{closable:!1,class:`mt-2 success`},{default:f(()=>[t.modelValue?.request?.model?(m(),o(`p`,dt,[i(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.model`))+`: `+r(t.modelValue?.request?.model),1)])):a(``,!0),e(`p`,ft,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(T,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),t.modelValue?.elapsed?(m(),o(`p`,pt,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.isFailure(s)?(m(),o(`div`,mt,[i(D,{closable:!1,class:`failure`},{template:f(()=>[i(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.failure`)),1)]),default:f(()=>[e(`p`,ht,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(T,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,gt,[i(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(T,{content:t.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),t.modelValue?.elapsed?(m(),o(`p`,_t,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),e(`p`,vt,[i(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(T,{content:t.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):a(``,!0),t.isWaiting(s)?(m(),o(`div`,yt,[i(D,{closable:!1,class:`info`},{template:f(()=>[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(t.modelValue?.response?`pika.status.processing`:`pika.status.pending`)),1)]),default:f(()=>[e(`p`,$,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pika.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(T,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):a(``,!0)])]))),128)}var xt=g({name:`RecentPanel`,components:{TaskPreview:F($e,[[`render`,bt],[`__scopeId`,`data-v-834518b2`]]),BotPlaceholder:ae,NoTasks:Q,ScrollList:Z},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),St={key:0},Ct={key:2,class:`w-full h-full flex items-center justify-center`};function wt(e,t,n,r,l,u){let h=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return m(),o(s,null,[e.tasks?.items===void 0?(m(),o(`div`,St,[i(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(m(),d(_,{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:f(()=>[(m(!0),o(s,null,p(e.tasks?.items,(e,t)=>(m(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(m(),o(`div`,Ct,[i(v)])):a(``,!0)],64)}var Tt=g({name:`PikaIndex`,components:{ConfigPanel:Je,Layout:de,RecentPanel:F(xt,[[`render`,wt]])},mixins:[L],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===K.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===K.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===K.Request},needApply(){return this.$store.state.pika.status.getApplications===K.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ne({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`pika/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pika/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},onApply(){G.create({application:this.application}).then(({data:e})=>{this.application=e,q.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&q.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`pika/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config,async:!0};if(!U())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`pika.message.startingTask`)),W(`pika`,V.generate(e,{token:t})).then(()=>{q.success(this.$t(`pika.message.startTaskSuccess`)),this.$store.commit(`pika/setConfig`,{config:void 0})}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?q.error(this.$t(`pika.message.usedUp`)):q.error(this.$t(`pika.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Et(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return m(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dt=F(Tt,[[`render`,Et],[`__scopeId`,`data-v-fee6c9ea`]]);export{Dt as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-DmAsSwJf.js";import{t as b}from"./upload-NuNALB22.js";import{t as x}from"./tooltip-Bq0H_aQm.js";import{t as S}from"./alert-BWDrxIRb.js";import{t as C}from"./drawer-5KVW_fvf.js";import{t as w}from"./input-number-Dn3BdUuj.js";import{t as T}from"./slider-LRhTSbeT.js";import{n as E}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as D}from"./clock-DtKORAbi.js";import{t as ee}from"./CopyToClipboard-iDVaseXr.js";import{r as O,t as k}from"./PromptTextarea-n5fFeDCP.js";import{t as A}from"./info-YGlWHYFu.js";import{t as j}from"./triangle-alert-BixkYn-s.js";import{t as M}from"./upload-DcLOBPB7.js";import{t as N}from"./wand-sparkles-Cv4Ptiq-.js";import{cr as te,dr as P,lr as F,ur as I}from"./constants-OjwdsvEy.js";import{Bt as L,E as R,Gt as z,Ht as B,Ln as V,Mi as H,Ut as U,Vt as W,ai as G,en as K,gr as q,ni as J,vi as Y}from"./index-BS1k95ol.js";import{t as X}from"./ImagePreview-vDExFKx3.js";import{t as Z}from"./Consumption-C146g2pG.js";import{a as Q,n as ne,r as re,t as ie}from"./pagination-Ce0ipXTe.js";import{t as ae}from"./VideoPlayer-DzPp3pSc.js";import{t as oe}from"./ApiCodeButton-DIXEBzGs.js";import{t as se}from"./BotPlaceholder-D1PAhJfu.js";var ce=_({name:`LayoutPixverse`,components:{MagicIcon:N,ElDrawer:C,ElButton:H},mixins:[E]}),le={class:`main flex flex-row flex-1`},ue={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)]`},de={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function fe(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,le,[e(`div`,ue,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,de,[u(t.$slots,`result`,{},void 0,!0)]),l(i(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:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var pe=R(ce,[[`render`,fe],[`__scopeId`,`data-v-9da6c14b`]]),me=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`v3.5`,label:`v3.5`},{value:`v4`,label:`v4`},{value:`v4.5`,label:`v4.5`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.model},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,model:e})}}},mounted(){this.value||=F}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,he,[e(`h2`,ge,r(t.$t(`pixverse.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=R(me,[[`render`,_e],[`__scopeId`,`data-v-e8f337ca`]]),ye=_({name:`QualitySelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`360p`,label:`360p`},{value:`540p`,label:`540p`},{value:`720p`,label:`720p`},{value:`1080p`,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.quality},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,quality:e})}}},mounted(){this.value||=P}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,be,[e(`h2`,xe,r(t.$t(`pixverse.name.quality`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ce=R(ye,[[`render`,Se],[`__scopeId`,`data-v-64aeaae9`]]),we=_({name:`MotionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`normal`,label:this.$t(`pixverse.name.motion1`)},{value:`fast`,label:this.$t(`pixverse.name.motion2`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.motion},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,motion:e})}}},mounted(){this.value||=I}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Te,[e(`h2`,Ee,r(t.$t(`pixverse.name.motion`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Oe=R(we,[[`render`,De],[`__scopeId`,`data-v-94237408`]]),ke=_({name:`StyleSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`cyberpunk`,label:this.$t(`pixverse.name.style1`)},{value:`anime`,label:this.$t(`pixverse.name.style2`)},{value:`comic`,label:this.$t(`pixverse.name.style3`)},{value:`clay`,label:this.$t(`pixverse.name.style4`)},{value:`3d_animation`,label:this.$t(`pixverse.name.style5`)},{value:`realistic`,label:this.$t(`pixverse.name.style6`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.style},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,style:e})}}},mounted(){this.value||=``}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ae,[e(`h2`,je,r(t.$t(`pixverse.name.style`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=R(ke,[[`render`,Me],[`__scopeId`,`data-v-64e17b3c`]]),Pe=_({name:`SeedSelector`,components:{ElSlider:T,InfoIcon:Q,ElInputNumber:w},computed:{value:{get(){return this.$store.state?.pixverse?.config?.seed},set(e){console.debug(`set seed`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,seed:e})}}},mounted(){this.value||=void 0}}),Fe={class:`flex justify-between`},Ie={class:`flex justify-start items-center`},Le={class:`text-sm font-bold`},Re={class:`flex justify-end items-center`},ze={class:`w-full`};function Be(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-input-number`),p=c(`el-slider`);return h(),o(`div`,null,[e(`div`,Fe,[e(`div`,Ie,[e(`span`,Le,r(t.$t(`pixverse.name.seed`)),1),i(d,{content:t.$t(`pixverse.description.seed`)},null,8,[`content`])]),e(`div`,Re,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,ze,[i(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1e3,step:1},null,8,[`modelValue`])])])}var Ve=R(Pe,[[`render`,Be]]),He=_({name:`DurationSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:5,label:`5s`},{value:8,label:`8s`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.duration},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,duration:e})}}},mounted(){this.value||=5}}),Ue={class:`field`},We={class:`title font-bold`};function Ge(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ue,[e(`h2`,We,r(t.$t(`pixverse.name.duration`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=R(He,[[`render`,Ge],[`__scopeId`,`data-v-065c77ef`]]),qe=_({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`4:3`,label:`4:3`,width:20,height:15},{value:`3:4`,label:`3:4`,width:15,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.pixverse.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,aspect_ratio:e})}}},mounted(){this.value||=te}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,Je,r(n.$t(`pixverse.name.aspectRatio`)),1),e(`div`,Ye,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,Ze,r(i.label),1)],10,Xe))),128))])])}var $e=R(qe,[[`render`,Qe],[`__scopeId`,`data-v-53038264`]]),et=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:b,ElButton:H,InfoIcon:Q,ImagePreview:X},mixins:[U,W],emits:[`change`],data(){return{fileList:[],uploadUrl:G()+`/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?.pixverse?.config?.image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){Y.warning(this.$t(`pixverse.message.uploadReferencesExceed`))},onError(){Y.error(this.$t(`pixverse.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,r(t.$t(`pixverse.name.startImage`)),1),i(g,{content:t.$t(`pixverse.description.uploadStartImage`)},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[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:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{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`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=R(et,[[`render`,at],[`__scopeId`,`data-v-0a7c3c57`]]),st=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.pixverse?.config?.prompt},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ct(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pixverse.name.prompt`),info:e.$t(`pixverse.description.prompt`),placeholder:e.$t(`pixverse.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var lt=_({name:`ConfigPanel`,components:{MagicIcon:N,ElButton:H,PromptInput:R(st,[[`render`,ct]]),ModelSelector:ve,QualitySelector:Ce,MotionSelector:Oe,StyleSelector:Ne,DurationSelector:Ke,StartImage:ot,SeedSelector:Ve,RatioSelector:$e,Consumption:Z},emits:[`generate`],computed:{config(){return this.$store.state.pixverse?.config},consumption(){return z(this.config,this.service?.cost)},service(){return this.$store.state.pixverse?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ut={class:`flex flex-col h-full`},dt={class:`flex-1 overflow-y-auto p-5`},ft={class:`flex flex-col items-center justify-center px-5 pb-5`};function pt(t,a,s,l,u,d){let p=c(`prompt-input`),m=c(`model-selector`),g=c(`style-selector`),_=c(`ratio-selector`),v=c(`motion-selector`),y=c(`quality-selector`),b=c(`start-image`),x=c(`seed-selector`),S=c(`duration-selector`),C=c(`consumption`),w=c(`magic-icon`),T=c(`el-button`);return h(),o(`div`,ut,[e(`div`,dt,[i(p,{class:`mb-4`}),i(m,{class:`mb-4`}),i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`}),i(S,{class:`mb-4`})]),e(`div`,ft,[i(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.generate`)),1)]),_:1},8,[`onClick`])])])}var mt=R(lt,[[`render`,pt]]),ht=_({name:`TaskPreview`,components:{ChannelIcon:O,InfoIcon:A,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ee,ElAlert:S,VideoPlayer:ae,ElTooltip:x,ElButton:H,ApiCodeButton:oe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pixverse?.application},config(){return this.$store.state.pixverse?.config}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),gt={class:`preview`},_t={class:`left`},vt={class:`main`},yt={class:`bot`},bt={class:`datetime`},xt={class:`info`},St={key:0,class:`prompt mt-2`},Ct={key:0},wt={key:1},Tt={key:0,class:t({content:!0,failed:!0})},Et={key:0,class:`mb-4`},$={key:1,class:t({operations:!0,"mt-2":!0})},Dt={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:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:t({content:!0})},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ft(t,s,l,u,p,m){let g=c(`capability-presentation`),_=c(`video-player`),v=c(`el-button`),y=c(`el-tooltip`),b=c(`api-code-button`),x=c(`channel-icon`),S=c(`magic-icon`),C=c(`copy-to-clipboard`),w=c(`time-icon`),T=c(`el-alert`),E=c(`warning-icon`),D=c(`info-icon`);return h(),o(`div`,gt,[e(`div`,_t,[i(g,{capability:`pixverse`,part:`avatar`,class:`avatar`})]),e(`div`,vt,[e(`div`,yt,[i(g,{capability:`pixverse`,part:`name`}),e(`span`,bt,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,xt,[t.modelValue?.request?.prompt?(h(),o(`p`,St,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,Ct,` - (`+r(t.$t(`pixverse.status.pending`))+`) `,1)),t.modelValue?.response?.data&&(t.modelValue?.response?.data[0]?.state===`processing`||t.modelValue?.response?.data[0]?.state===`pending`)?(h(),o(`span`,wt,` - (`+r(t.$t(`pixverse.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&t.modelValue?.response?.data?(h(),o(`div`,Tt,[t.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,Et,[i(_,{src:t.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),t.modelValue?.response.success?(h(),o(`div`,$,[i(y,{class:`box-item`,effect:`dark`,content:t.$t(`pixverse.message.downloadVideo`),placement:`top-start`},{default:f(()=>[t.modelValue?.response?.data[0]?.video_url?(h(),d(v,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:s[0]||=e=>t.onDownload(e,t.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(t.$t(`pixverse.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(b,{path:`/pixverse/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(T,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,Dt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,Ot,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,kt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,At,[i(T,{closable:!1,class:`failure`},{template:f(()=>[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failure`)),1)]),default:f(()=>[e(`p`,jt,[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(C,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),e(`p`,Mt,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,Nt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),t.modelValue?.response?.trace_id?(h(),o(`p`,Pt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(C,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0)])])}var It=_({name:`RecentPanel`,components:{TaskPreview:R(ht,[[`render`,Ft],[`__scopeId`,`data-v-b3ee3fb1`]]),NoTasks:re,BotPlaceholder:se,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pixverse?.tasks,items:this.$store.state.pixverse?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Lt={key:0},Rt={key:2,class:`w-full h-full flex items-center justify-center`};function zt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,Lt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Rt,[i(v)])):a(``,!0)],64)}var Bt=_({name:`PixverseIndex`,components:{ConfigPanel:mt,Layout:pe,RecentPanel:R(It,[[`render`,zt]])},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pixverse?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.pixverse?.status?.getTasks===J.Request||this.fetchingTasks},credential(){return this.$store.state.pixverse.credential},config(){return this.$store.state.pixverse.config},tasks(){return this.$store.state.pixverse.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 ie({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(`pixverse/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pixverse/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`pixverse/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!L(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config,async:!0};if(!K())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}Y.info(this.$t(`pixverse.message.startingTask`)),q(`pixverse`,V.generate(e,{token:t})).then(()=>{Y.success(this.$t(`pixverse.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?Y.error(this.$t(`pixverse.message.usedUp`)):Y.error(this.$t(`pixverse.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Vt(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ht=R(Bt,[[`render`,Vt]]);export{Ht as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-DmAsSwJf.js";import{t as b}from"./upload-NuNALB22.js";import{t as x}from"./alert-BWDrxIRb.js";import{n as S,r as C}from"./radio-DgDgyT2l.js";import{t as w}from"./drawer-5KVW_fvf.js";import{t as T}from"./slider-LRhTSbeT.js";import{t as E}from"./switch-Dwgc_IC5.js";import{n as D}from"./taskDrawerMixin-BL5Lp5JU.js";import{t as O}from"./clock-DtKORAbi.js";import{t as k}from"./CopyToClipboard-iDVaseXr.js";import{t as A}from"./external-link-3tgvHJmo.js";import{r as j,t as M}from"./PromptTextarea-n5fFeDCP.js";import{t as N}from"./info-YGlWHYFu.js";import{t as P}from"./message-circle-CkXHdm1x.js";import{t as F}from"./sparkles-BFqdzb6l.js";import{t as ee}from"./triangle-alert-BixkYn-s.js";import{t as I}from"./upload-DcLOBPB7.js";import{t as L}from"./wand-sparkles-Cv4Ptiq-.js";import{_i as R,bi as z,gi as te,vi as ne,yi as re}from"./constants-OjwdsvEy.js";import{Bt as ie,E as B,Gt as V,Ht as H,Kn as U,Mi as W,Ut as G,Vi as K,Vt as q,ai as J,en as Y,gi as ae,gr as oe,lr as se,ni as X,vi as Z,xi as ce}from"./index-BS1k95ol.js";import{t as le}from"./Status-CTzS-Ppr.js";import{t as ue}from"./ImagePreview-vDExFKx3.js";import{t as de}from"./Consumption-C146g2pG.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-Ce0ipXTe.js";import{t as he}from"./ApiCodeButton-DIXEBzGs.js";import{t as ge}from"./BotPlaceholder-D1PAhJfu.js";import{t as _e}from"./ImageWrapper-uvdYuFqD.js";var ve=ae(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ye=_({name:`LayoutQrart`,components:{MagicIcon:L,ElDrawer:w,ElButton:W},mixins:[D]}),be={class:`main flex flex-row flex-1`},xe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,be,[e(`div`,xe,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[u(t.$slots,`result`,{},void 0,!0)]),l(i(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:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=B(ye,[[`render`,Ce],[`__scopeId`,`data-v-b6a1bb95`]]),Te=_({name:`VersionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{label:this.$t(`qrart.type.text`),value:`text`},{label:this.$t(`qrart.type.link`),value:`link`},{label:this.$t(`qrart.type.email`),value:`email`},{label:this.$t(`qrart.type.phone`),value:`phone`},{label:this.$t(`qrart.type.sms`),value:`sms`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.type},set(e){console.debug(`set type`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,type:e})}}},mounted(){this.value||=(console.debug(`set default type`,z),z)}}),Ee={class:`field`},De={class:`text-sm font-bold title`};function Oe(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ee,[e(`span`,De,r(t.$t(`qrart.name.type`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`qrart.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ke=B(Te,[[`render`,Oe],[`__scopeId`,`data-v-b4bd8f04`]]),Ae=_({name:`AspectRatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:30,height:30},{value:`4:3`,label:`4:3`,width:32,height:24},{value:`3:4`,label:`3:4`,width:24,height:32},{value:`16:9`,label:`16:9`,width:32,height:18},{value:`9:16`,label:`9:16`,width:18,height:32}]}},computed:{active(){return this.options.findIndex(e=>e.value===String(this.value))||0},value:{get(){return this.$store.state.qrart?.config?.aspect_ratio},set(e){console.debug(`set aspect ratio`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),je={class:`text-sm font-bold block mb-2`},Me={class:`items`},Ne=[`onClick`],Pe={class:`name`};function Fe(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,je,r(n.$t(`qrart.name.aspectRatio`)),1),e(`div`,Me,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,Pe,r(i.label),1)],10,Ne))),128))])])}var Ie=B(Ae,[[`render`,Fe],[`__scopeId`,`data-v-b7590ecc`]]),Le=_({name:`QrwSelector`,components:{ElSlider:T,InfoIcon:Q},computed:{value:{get(){return this.$store.state.qrart?.config?.qrw||2},set(e){console.debug(`set qrw`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,qrw:e})}}},mounted(){this.value||=(console.debug(`set default qrw`),2)}}),Re={class:`field`},ze={class:`text-sm font-bold title mb-2`};function Be(t,n,a,s,l,u){let d=c(`el-slider`),f=c(`info-icon`);return h(),o(`div`,Re,[e(`span`,ze,r(t.$t(`qrart.name.qrw`)),1),i(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1.5,max:3,step:.1,class:`value`},null,8,[`modelValue`]),i(f,{content:t.$t(`qrart.description.qrw`),class:`info`},null,8,[`content`])])}var Ve=B(Le,[[`render`,Be],[`__scopeId`,`data-v-8410479c`]]),He=_({name:`StepsSelector`,components:{ElSlider:T,InfoIcon:Q},computed:{value:{get(){return this.$store.state.qrart?.config?.steps||20},set(e){console.debug(`set steps`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,steps:e})}}},mounted(){this.value||=(console.debug(`set default steps`,20),20)}}),Ue={class:`field`},We={class:`text-sm font-bold block mb-2`};function Ge(t,n,a,s,l,u){let d=c(`el-slider`),f=c(`info-icon`);return h(),o(`div`,Ue,[e(`span`,We,r(t.$t(`qrart.name.steps`)),1),i(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:10,max:20,step:1,class:`value`},null,8,[`modelValue`]),i(f,{content:t.$t(`qrart.description.steps`),class:`info`},null,8,[`content`])])}var Ke=B(He,[[`render`,Ge],[`__scopeId`,`data-v-0c88983e`]]),qe=_({name:`AdvancedSelector`,components:{ElSwitch:E},computed:{value:{get(){return this.$store.state.qrart?.config?.advanced},set(e){console.debug(`set advanced`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,advanced:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Je={class:`field`},Ye={class:`title font-bold`};function Xe(t,n,a,s,l,u){let d=c(`el-switch`);return h(),o(`div`,Je,[e(`span`,Ye,r(t.$t(`qrart.name.advanced`)),1),i(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ze=B(qe,[[`render`,Xe],[`__scopeId`,`data-v-f8ddf849`]]),Qe=_({name:`MarkerShapeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:`square`,label:this.$t(`qrart.markerShape.square`)},{value:`circle`,label:this.$t(`qrart.markerShape.circle`)},{value:`plus`,label:this.$t(`qrart.markerShape.plus`)},{value:`box`,label:this.$t(`qrart.markerShape.box`)},{value:`octagon`,label:this.$t(`qrart.markerShape.octagon`)},{value:`tiny-plus`,label:this.$t(`qrart.markerShape.tinyPlus`)},{value:`random`,label:this.$t(`qrart.markerShape.random`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.marker_shape},set(e){console.debug(`set marker_shape`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,marker_shape:e})}}},mounted(){this.value||=te}}),$e={class:`field`},et={class:`text-sm font-bold block mb-2`};function tt(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,$e,[e(`span`,et,r(t.$t(`qrart.name.markerShape`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.markerShape`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var nt=B(Qe,[[`render`,tt],[`__scopeId`,`data-v-de71e0b0`]]),rt=_({name:`SubMarkerSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:`square`,label:this.$t(`qrart.subMarker.square`)},{value:`circle`,label:this.$t(`qrart.subMarker.circle`)},{value:`plus`,label:this.$t(`qrart.subMarker.plus`)},{value:`box`,label:this.$t(`qrart.subMarker.box`)},{value:`random`,label:this.$t(`qrart.subMarker.random`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.sub_marker},set(e){console.debug(`set sub_marker`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,sub_marker:e})}}},mounted(){this.value||=re}}),it={class:`field`},at={class:`text-sm font-bold block mb-2`};function ot(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,it,[e(`span`,at,r(t.$t(`qrart.name.subMarker`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.subMarker`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var st=B(rt,[[`render`,ot],[`__scopeId`,`data-v-51a39efa`]]),ct=_({name:`RotateSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:0,label:0},{value:90,label:90},{value:180,label:180},{value:270,label:270}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.rotate},set(e){console.debug(`set rotate`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,rotate:e})}}},mounted(){this.value||=0}}),lt={class:`field`},ut={class:`text-sm font-bold block mb-2`};function dt(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,lt,[e(`span`,ut,r(t.$t(`qrart.name.rotate`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.rotate`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ft=B(ct,[[`render`,dt],[`__scopeId`,`data-v-72e35835`]]),pt=_({name:`EclSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:`L`,label:`L`},{value:`M`,label:`M`},{value:`Q`,label:`Q`},{value:`H`,label:`H`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.ecl},set(e){console.debug(`set ecl`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,ecl:e})}}},mounted(){this.value||=`H`}}),mt={class:`field`},ht={class:`text-sm font-bold block mb-2`};function gt(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,mt,[e(`span`,ht,r(t.$t(`qrart.name.ecl`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.ecl`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var _t=B(pt,[[`render`,gt],[`__scopeId`,`data-v-b3a5e331`]]),vt=_({name:`MarkerShapeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:`center`,label:this.$t(`qrart.position.center`)},{value:`top`,label:this.$t(`qrart.position.top`)},{value:`right`,label:this.$t(`qrart.position.right`)},{value:`bottom`,label:this.$t(`qrart.position.bottom`)},{value:`left`,label:this.$t(`qrart.position.left`)},{value:`top-left`,label:this.$t(`qrart.position.topLeft`)},{value:`top-right`,label:this.$t(`qrart.position.topRight`)},{value:`bottom-left`,label:this.$t(`qrart.position.bottomLeft`)},{value:`bottom-right`,label:this.$t(`qrart.position.bottomRight`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.position},set(e){console.debug(`set position`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,position:e})}}},mounted(){this.value||=ne}}),yt={class:`field`},bt={class:`title font-bold`};function xt(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,yt,[e(`span`,bt,r(t.$t(`qrart.name.position`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.position`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var St=B(vt,[[`render`,xt],[`__scopeId`,`data-v-54186505`]]),Ct=_({name:`PaddingLevelSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:0,label:0},{value:5,label:5},{value:10,label:10},{value:10,label:10},{value:15,label:15},{value:20,label:20}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.padding_level},set(e){console.debug(`set padding_level`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,padding_level:e})}}},mounted(){this.value||=5}}),wt={class:`field`},Tt={class:`text-sm font-bold block mb-2`};function Et(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,wt,[e(`span`,Tt,r(t.$t(`qrart.name.paddingLevel`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.paddingLevel`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Dt=B(Ct,[[`render`,Et],[`__scopeId`,`data-v-49d801fd`]]),Ot=_({name:`PaddingNoiseSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:0,label:0},{value:.25,label:.25},{value:.5,label:.5},{value:.75,label:.75},{value:1,label:1}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.padding_noise},set(e){console.debug(`set padding_noise`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,padding_noise:e})}}},mounted(){this.value||=0}}),kt={class:`field`},At={class:`text-sm font-bold block mb-2`};function jt(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,kt,[e(`span`,At,r(t.$t(`qrart.name.paddingNoise`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.paddingNoise`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Mt=B(Ot,[[`render`,jt],[`__scopeId`,`data-v-a20833bb`]]),Nt=_({name:`PixelStyleSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:[{value:`square`,label:this.$t(`qrart.pixelStyle.square`)},{value:`rounded`,label:this.$t(`qrart.pixelStyle.rounded`)},{value:`dot`,label:this.$t(`qrart.pixelStyle.dot`)},{value:`squircle`,label:this.$t(`qrart.pixelStyle.squircle`)},{value:`row`,label:this.$t(`qrart.pixelStyle.row`)},{value:`column`,label:this.$t(`qrart.pixelStyle.column`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.pixel_style},set(e){console.debug(`set pixel_style`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,pixel_style:e})}}},mounted(){this.value||=R}}),Pt={class:`field`},Ft={class:`text-sm font-bold block mb-2`};function It(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Pt,[e(`span`,Ft,r(t.$t(`qrart.name.pixelStyle`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.pixelStyle`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Lt=B(Nt,[[`render`,It],[`__scopeId`,`data-v-aca7f79f`]]),Rt=_({name:`SeedInput`,components:{ElInput:K},data(){return{}},computed:{value:{get(){return this.$store.state.qrart?.config?.seed},set(e){console.debug(`set seed`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,seed:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0}}),zt={class:`field`},Bt={class:`text-sm font-bold block mb-2`};function Vt(t,n,a,s,l,u){let d=c(`el-input`);return h(),o(`div`,zt,[e(`span`,Bt,r(t.$t(`qrart.name.seed`)),1),i(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`qrart.placeholder.seed`)},null,8,[`modelValue`,`placeholder`])])}var Ht=B(Rt,[[`render`,Vt],[`__scopeId`,`data-v-d939305d`]]),Ut=_({name:`PresetSelector`,components:{ElImage:ce},data(){return{options:[{value:`sunset`,label:this.$t(`qrart.preset.sunset`),url:`https://cdn.acedata.cloud/rp1h1s.png`},{value:`floral`,label:this.$t(`qrart.preset.floral`),url:`https://cdn.acedata.cloud/upyikx.png`},{value:`snowflakes`,label:this.$t(`qrart.preset.snowflakes`),url:`https://cdn.acedata.cloud/j447da.png`},{value:`feathers`,label:this.$t(`qrart.preset.feathers`),url:`https://cdn.acedata.cloud/d2ctz9.png`},{value:`raindrops`,label:this.$t(`qrart.preset.raindrops`),url:`https://cdn.acedata.cloud/xv2t3s.png`},{value:`ultra-realism`,label:this.$t(`qrart.preset.ultraRealism`),url:`https://cdn.acedata.cloud/nlor4y.png`},{value:`epic-realms`,label:this.$t(`qrart.preset.epicRealms`),url:`https://cdn.acedata.cloud/wwzkvy.png`},{value:`intricate-studio`,label:this.$t(`qrart.preset.intricateStudio`),url:`https://cdn.acedata.cloud/4kzf5y.png`},{value:`symmetric-masterpiece`,label:this.$t(`qrart.preset.symmetricMasterpiece`),url:`https://cdn.acedata.cloud/ff4ii2.png`},{value:`luminous-highway`,label:this.$t(`qrart.preset.luminousHighway`),url:`https://cdn.acedata.cloud/cliodt.png`},{value:`celestial-journey`,label:this.$t(`qrart.preset.celestialJourney`),url:`https://cdn.acedata.cloud/ejellf.png`},{value:`neon-mech`,label:this.$t(`qrart.preset.neonMech`),url:`https://cdn.acedata.cloud/3z0y6z.png`},{value:`ethereal-low-poly`,label:this.$t(`qrart.preset.etherealLowPoly`),url:`https://cdn.acedata.cloud/36o0mm.png`},{value:`golden-vista`,label:this.$t(`qrart.preset.goldenVista`),url:`https://cdn.acedata.cloud/xa0267.png`},{value:`cinematic-expanse`,label:this.$t(`qrart.preset.cinematicExpanse`),url:`https://cdn.acedata.cloud/krl5qp.png`},{value:`cinematic-warm`,label:this.$t(`qrart.preset.cinematicWarm`),url:`https://cdn.acedata.cloud/e1aahg.png`},{value:`desolate-wilderness`,label:this.$t(`qrart.preset.desolateWilderness`),url:`https://cdn.acedata.cloud/9evqqu.png`},{value:`vibrant-palette`,label:this.$t(`qrart.preset.vibrantPalette`),url:`https://cdn.acedata.cloud/3fvsmz.png`},{value:`enigmatic-journey`,label:this.$t(`qrart.preset.enigmaticJourney`),url:`https://cdn.acedata.cloud/l6kku0.png`},{value:`timeless-cinematic`,label:this.$t(`qrart.preset.timelessCinematic`),url:`https://cdn.acedata.cloud/h5mzyn.png`},{value:`regal-galaxy`,label:this.$t(`qrart.preset.regalGalaxy`),url:`https://cdn.acedata.cloud/czkegd.png`},{value:`illustrious-canvas`,label:this.$t(`qrart.preset.illustriousCanvas`),url:`https://cdn.acedata.cloud/m8hwzh.png`},{value:`expressive-mural`,label:this.$t(`qrart.preset.expressiveMural`),url:`https://cdn.acedata.cloud/g4v1rb.png`},{value:`serene-haze`,label:this.$t(`qrart.preset.sereneHaze`),url:`https://cdn.acedata.cloud/3w3ixr.png`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.preset},set(e){console.debug(`set qrw`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,preset:e})}}},mounted(){this.value||=``}}),Wt={class:`field`},Gt={class:`text-sm font-bold block mb-2`},Kt={class:`pane`},qt=[`onClick`],Jt={class:`name`};function Yt(n,a,l,u,d,f){let p=c(`el-image`);return h(),o(`div`,Wt,[e(`span`,Gt,r(n.$t(`qrart.name.preset`)),1),e(`div`,Kt,[(h(!0),o(s,null,m(n.options,(a,s)=>(h(),o(`div`,{key:s,class:t({item:!0,active:n.value===a.value}),onClick:e=>n.value===a.value?n.value=void 0:n.value=a.value},[i(p,{src:a.url,fit:`fill`,class:`preview`},null,8,[`src`]),e(`span`,Jt,r(a.label),1)],10,qt))),128))])])}var Xt=B(Ut,[[`render`,Yt],[`__scopeId`,`data-v-65c34adf`]]),Zt=_({name:`ContentInput`,components:{UploadIcon:I,ElInput:K,ElUpload:b,ElRadioGroup:C,ElButton:W,ElRadioButton:S,ImagePreview:ue},mixins:[G,q],data(){return{inputWay:`input`,fileList:[],uploadUrl:J()+`/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.qrart?.config?.content},set(e){this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,content:e,content_image_url:void 0})}}},mounted(){this.value||=``,this.onSetContentImageUrl()},methods:{onExceed(){Z.warning(this.$t(`qrart.message.uploadDocumentsExceed`))},onError(){Z.error(this.$t(`qrart.message.uploadDocumentsError`))},onSetContentImageUrl(){let e=this.urls?.[0];this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,content:void 0,content_image_url:e})},async onSuccess(){this.onSetContentImageUrl()}}}),Qt={class:`field`},$t={class:`flex justify-between items-center mb-4`},en={class:`text-sm font-bold title`},tn={class:`flex items-center`},nn={key:2,class:`description`};function rn(t,s,l,u,p,m){let g=c(`el-radio-button`),_=c(`el-radio-group`),v=c(`el-input`),y=c(`image-preview`),b=c(`upload-icon`),x=c(`el-button`),S=c(`el-upload`);return h(),o(`div`,Qt,[e(`div`,$t,[e(`span`,en,r(t.$t(`qrart.name.content`)),1),e(`div`,tn,[i(_,{modelValue:t.inputWay,"onUpdate:modelValue":s[0]||=e=>t.inputWay=e},{default:f(()=>[i(g,{label:`input`},{default:f(()=>[n(r(t.$t(`qrart.inputWay.input`)),1)]),_:1}),i(g,{label:`upload`},{default:f(()=>[n(r(t.$t(`qrart.inputWay.upload`)),1)]),_:1})]),_:1},8,[`modelValue`])])]),t.inputWay==`input`?(h(),d(v,{key:0,modelValue:t.value,"onUpdate:modelValue":s[1]||=e=>t.value=e,class:`content`,placeholder:t.$t(`qrart.placeholder.content`)},null,8,[`modelValue`,`placeholder`])):a(``,!0),t.inputWay==`upload`?(h(),d(S,{key:1,ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[2]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`upload upload-wrapper`,limit:1,multiple:!1,"list-type":`picture`,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[i(y,{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:f(()=>[i(x,{size:`small`,type:`primary`,round:``},{default:f(()=>[i(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.button.uploadQr`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])):a(``,!0),t.inputWay==`upload`?(h(),o(`p`,nn,r(t.$t(`qrart.message.uploadQr`)),1)):a(``,!0)])}var an=B(Zt,[[`render`,rn],[`__scopeId`,`data-v-3f03e72c`]]),on=_({name:`PromptInput`,components:{PromptTextarea:M},computed:{value:{get(){return this.$store.state.qrart?.config?.prompt},set(e){this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,prompt:e})}}},mounted(){this.value||=``}});function sn(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,title:e.$t(`qrart.name.prompt`),placeholder:e.$t(`qrart.placeholder.prompt`)},null,8,[`modelValue`,`title`,`placeholder`])}var cn=_({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:W,Consumption:de,TypeSelector:ke,PositionSelector:St,PixelStyleSelector:Lt,PaddingLevelSelector:Dt,SeedInput:Ht,AspectRatioSelector:Ie,QrwSelector:Ve,EclSelector:_t,StepsSelector:Ke,PaddingNoiseSelector:Mt,AdvancedSelector:Ze,MarkerShapeSelector:nt,SubMarkerSelector:st,RotateSelector:ft,PresetSelector:Xt,ContentInput:an,PromptInput:B(on,[[`render`,sn]])},emits:[`generate`],computed:{config(){return this.$store.state.qrart?.config},consumption(){return V(this.config,this.service?.cost)},service(){return this.$store.state.qrart?.service}}}),ln={class:`flex flex-col h-full`},un={class:`flex-1 overflow-y-auto p-5`},dn={class:`flex flex-col items-center justify-center px-5 pb-5`};function fn(t,s,l,u,p,m){let g=c(`type-selector`),_=c(`content-input`),v=c(`prompt-input`),y=c(`aspect-ratio-selector`),b=c(`qrw-selector`),x=c(`preset-selector`),S=c(`position-selector`),C=c(`advanced-selector`),w=c(`steps-selector`),T=c(`seed-input`),E=c(`pixel-style-selector`),D=c(`marker-shape-selector`),O=c(`sub-marker-selector`),k=c(`rotate-selector`),A=c(`ecl-selector`),j=c(`padding-level-selector`),M=c(`padding-noise-selector`),N=c(`consumption`),P=c(`magic-icon`),F=c(`el-button`);return h(),o(`div`,ln,[e(`div`,un,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`}),i(S,{class:`mb-4`}),i(C,{class:`mb-4`}),t.config?.advanced?(h(),d(w,{key:0,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(T,{key:1,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(E,{key:2,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(D,{key:3,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(O,{key:4,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(k,{key:5,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(A,{key:6,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(j,{key:7,class:`mb-4`})):a(``,!0),t.config?.advanced?(h(),d(M,{key:8,class:`mb-4`})):a(``,!0)]),e(`div`,dn,[i(N,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(F,{type:`primary`,class:`btn w-full`,round:``,onClick:s[0]||=e=>t.$emit(`generate`)},{default:f(()=>[i(P,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.button.generate`)),1)]),_:1})])])}var pn=B(cn,[[`render`,fn]]),mn=_({name:`TaskPreview`,components:{ChannelIcon:j,ExternalLinkIcon:A,GrowthIcon:ve,InfoIcon:N,MagicIcon:L,MessageIcon:P,RewardIcon:F,TimeIcon:O,WarningIcon:ee,CopyToClipboard:k,ElAlert:x,ImageWrapper:_e,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.qrart?.application}},methods:{onOpenLink(e){window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenUrl(e){window.open(e,`_blank`)},onDownload(e){let t=document.createElement(`a`);t.href=e,t.download=e.split(`/`).pop(),t.click()}}}),hn={class:`preview w-full h-fit text-left flex flex-row mb-[15px]`},gn={class:`left`},_n={class:`main flex-1 w-[calc(100%-70px)] min-w-0 pt-[10px] pr-[10px] pb-0 pl-[10px]`},vn={class:`bot text-[16px] font-bold text-[var(--el-color-primary)] overflow-hidden text-ellipsis whitespace-nowrap`},yn={class:`datetime text-[12px] font-normal text-[var(--el-text-color-secondary)] ml-[10px]`},bn={class:`info`},xn={key:0,class:`prompt mt-2 text-[14px] font-bold text-[var(--el-text-color-regular)] mb-[10px] overflow-hidden text-ellipsis whitespace-nowrap`},Sn={key:0},Cn={key:0,class:t({content:!0,failed:!0})},wn={class:t({operations:!0,"mt-2":!0,"mb-2":!0})},Tn={class:`description`},En={class:`description`},$={key:0,class:`description`},Dn={key:1,class:`description`},On=[`aria-label`,`title`],kn={key:2,class:`description`},An={key:3,class:`description`},jn={key:1,class:t({content:!0})},Mn={class:`description`},Nn={class:`description`},Pn={key:0,class:`description`},Fn={class:`description`},In={key:2,class:t({content:!0})},Ln={class:`description`};function Rn(t,s,l,u,p,m){let g=c(`capability-presentation`),_=c(`image-wrapper`),v=c(`api-code-button`),y=c(`magic-icon`),b=c(`copy-to-clipboard`),x=c(`reward-icon`),S=c(`message-icon`),C=c(`external-link-icon`),w=c(`growth-icon`),T=c(`time-icon`),E=c(`el-alert`),D=c(`warning-icon`),O=c(`info-icon`),k=c(`channel-icon`);return h(),o(`div`,hn,[e(`div`,gn,[i(g,{capability:`qrart`,part:`avatar`,class:`avatar bg-[var(--el-bg-color)] p-[2px] w-[50px] h-[50px] m-[10px] rounded-full`})]),e(`div`,_n,[e(`div`,vn,[i(g,{capability:`qrart`,part:`name`}),e(`span`,yn,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,bn,[t.modelValue?.request?.prompt?(h(),o(`p`,xn,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,Sn,` - (`+r(t.$t(`qrart.status.pending`))+`) `,1))])):a(``,!0)]),t.modelValue?.response?.success===!0?(h(),o(`div`,Cn,[t.modelValue?.response?.image_url?(h(),d(_,{key:0,src:t.modelValue?.response?.image_url,"raw-src":t.modelValue?.response?.image_url},null,8,[`src`,`raw-src`])):a(``,!0),e(`div`,wn,[i(v,{path:`/qrart/generate`,body:t.modelValue?.request},null,8,[`body`])]),i(E,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,Tn,[i(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(b,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,En,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.type`))+`: `+r(t.$t(`qrart.type.`+t.modelValue?.request?.type))+` `,1),i(b,{content:t.modelValue?.request?.type,class:`btn-copy`},null,8,[`content`])]),t.modelValue?.request?.content?(h(),o(`p`,$,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.content`))+`: `+r(t.modelValue?.request?.content)+` `,1),i(b,{content:t.modelValue?.request?.content,class:`btn-copy`},null,8,[`content`])])):a(``,!0),t.modelValue?.request?.content_image_url?(h(),o(`p`,Dn,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.contentImageUrl`))+`: `,1),e(`button`,{type:`button`,class:`icon-button mr-1 cursor-pointer`,"aria-label":t.$t(`common.button.view`),title:t.$t(`common.button.view`),onClick:s[0]||=e=>t.onOpenLink(t.modelValue?.request?.content_image_url)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,On)])):a(``,!0),t.modelValue?.request?.seed||t.modelValue?.response?.seed?(h(),o(`p`,kn,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.seed`))+`: `+r(t.modelValue?.request?.seed||t.modelValue?.response?.seed)+` `,1),i(b,{content:(t.modelValue?.request?.seed||t.modelValue?.response?.seed).toString(),class:`btn-copy`},null,8,[`content`])])):a(``,!0),t.modelValue?.elapsed?(h(),o(`p`,An,[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,jn,[i(E,{closable:!1,class:`failure`},{template:f(()=>[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.failure`)),1)]),default:f(()=>[e(`p`,Mn,[i(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(b,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Nn,[i(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(b,{content:t.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,Pn,[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),e(`p`,Fn,[i(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(b,{content:t.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):a(``,!0),t.modelValue?.response?a(``,!0):(h(),o(`div`,In,[i(E,{closable:!1,class:`info`},{template:f(()=>[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.failure`)),1)]),default:f(()=>[e(`p`,Ln,[i(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`qrart.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(b,{content:t.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var zn=_({name:`RecentPanel`,components:{TaskPreview:B(mn,[[`render`,Rn],[`__scopeId`,`data-v-a75326ef`]]),BotPlaceholder:ge,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.qrart?.tasks,items:this.$store.state.qrart?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bn={key:0},Vn={key:2,class:`w-full h-full flex items-center justify-center`};function Hn(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,Bn,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{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:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Vn,[i(v)])):a(``,!0)],64)}var Un=_({name:`QrartIndex`,components:{ConfigPanel:pn,Layout:we,ApplicationStatus:le,RecentPanel:B(zn,[[`render`,Hn]])},mixins:[H],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.qrart?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.qrart?.status?.getTasks===X.Request||this.fetchingTasks},service(){return this.$store.state.qrart.service},credential(){return this.$store.state.qrart.credential},config(){return this.$store.state.qrart.config},initializing(){return this.$store.state.qrart.status.getApplications===X.Request},needApply(){return this.$store.state.qrart.status.getApplications===X.Success&&!this.application},application(){return this.$store.state.qrart.application},tasks(){return this.$store.state.qrart.tasks},applications(){return this.$store.state.qrart.applications}},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 me({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(`qrart/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`qrart/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){se.create({application:this.application}).then(({data:e})=>{this.application=e,Z.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&Z.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`qrart/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ie(this.uploadTracker,e=>this.$t(e),e=>Z.warning(e)))return;let e={type:this.config?.type,content:this.config?.content,content_image_url:this.config?.content_image_url,prompt:this.config?.prompt,aspect_ratio:this.config?.aspect_ratio,async:!0,qrw:this.config?.qrw,steps:this.config?.steps,preset:this.config?.preset,...this.config?.advanced?{position:this.config?.position,pixel_style:this.config?.pixel_style,marker_shape:this.config?.marker_shape,sub_marker:this.config?.sub_marker,rotate:this.config?.rotate,ecl:this.config?.ecl,seed:this.config?.seed,padding_level:this.config?.padding_level,padding_noise:this.config?.padding_noise}:{}};if(!Y())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}Z.info(this.$t(`qrart.message.startingTask`)),oe(`qrart`,U.generate(e,{token:t})).then(()=>{Z.success(this.$t(`qrart.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?Z.error(this.$t(`qrart.message.usedUp`)):Z.error(this.$t(`qrart.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Wn(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`application-status`),u=c(`recent-panel`),p=c(`layout`);return h(),d(p,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:`mb-4`,onRefresh:e.onGetApplication,onSelect:t[0]||=t=>e.$store.dispatch(`qrart/setApplication`,t)},null,8,[`initializing`,`application`,`applications`,`service`,`need-apply`,`onRefresh`]),i(u,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Gn=B(Un,[[`render`,Wn],[`__scopeId`,`data-v-f87e6eb4`]]);export{Gn as default};