pcm-agents 0.6.11 → 0.6.13

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 (292) hide show
  1. package/dist/cjs/error-event-J_ZWIqWF.js +33 -0
  2. package/dist/cjs/error-event-J_ZWIqWF.js.map +1 -0
  3. package/dist/cjs/{index-CvEfNyEj.js → index-CRlt8Nv6.js} +53 -3
  4. package/dist/cjs/index-CRlt8Nv6.js.map +1 -0
  5. package/dist/cjs/index-WNdOTXnX.js +11068 -0
  6. package/dist/cjs/index-WNdOTXnX.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +2 -2
  8. package/dist/cjs/loader.cjs.js +3 -5
  9. package/dist/cjs/loader.cjs.js.map +1 -1
  10. package/dist/cjs/message.service-DGUsA-FY.js +135 -0
  11. package/dist/cjs/message.service-DGUsA-FY.js.map +1 -0
  12. package/dist/cjs/{pcm-1zhanshi-mnms-modal_17.cjs.entry.js → pcm-1zhanshi-mnms-modal_21.cjs.entry.js} +3276 -216
  13. package/dist/cjs/pcm-1zhanshi-mnms-modal_21.cjs.entry.js.map +1 -0
  14. package/dist/cjs/pcm-agents.cjs.js +4 -6
  15. package/dist/cjs/pcm-agents.cjs.js.map +1 -1
  16. package/dist/cjs/pcm-message.cjs.entry.js +3 -3
  17. package/dist/cjs/pcm-message.cjs.entry.js.map +1 -1
  18. package/dist/cjs/pcm-message.entry.cjs.js.map +1 -1
  19. package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js +8 -8
  20. package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js.map +1 -1
  21. package/dist/cjs/pcm-mnms-video-modal.entry.cjs.js.map +1 -1
  22. package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js +29 -86
  23. package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js.map +1 -1
  24. package/dist/cjs/pcm-mnms-zp-modal.entry.cjs.js.map +1 -1
  25. package/dist/cjs/{sentry-reporter-BWFtw_aT.js → sentry-reporter-tpI4WdkE.js} +12 -40
  26. package/dist/cjs/sentry-reporter-tpI4WdkE.js.map +1 -0
  27. package/dist/collection/collection-manifest.json +5 -1
  28. package/dist/collection/components/pcm-1zhanshi-mnms-modal/pcm-1zhanshi-mnms-modal.js.map +1 -1
  29. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +986 -986
  30. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +7 -9
  31. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
  32. package/dist/collection/components/pcm-button/pcm-button.css +199 -199
  33. package/dist/collection/components/pcm-button/pcm-button.js +6 -6
  34. package/dist/collection/components/pcm-button/pcm-button.js.map +1 -1
  35. package/dist/collection/components/pcm-card/pcm-card.css +259 -259
  36. package/dist/collection/components/pcm-card/pcm-card.js +1 -1
  37. package/dist/collection/components/pcm-card/pcm-card.js.map +1 -1
  38. package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +554 -554
  39. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +3 -3
  40. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
  41. package/dist/collection/components/pcm-drawer/pcm-drawer.css +102 -102
  42. package/dist/collection/components/pcm-drawer/pcm-drawer.js +1 -1
  43. package/dist/collection/components/pcm-drawer/pcm-drawer.js.map +1 -1
  44. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.css +854 -854
  45. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +5 -7
  46. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
  47. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.css +95 -95
  48. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js +1 -1
  49. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js.map +1 -1
  50. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js +2 -2
  51. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js.map +1 -1
  52. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.css +312 -312
  53. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js +1 -1
  54. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js.map +1 -1
  55. package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js +2 -2
  56. package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js.map +1 -1
  57. package/dist/collection/components/pcm-message/pcm-message.css +64 -64
  58. package/dist/collection/components/pcm-message/pcm-message.js +2 -2
  59. package/dist/collection/components/pcm-message/pcm-message.js.map +1 -1
  60. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.css +1 -1
  61. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js +2 -2
  62. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js.map +1 -1
  63. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +67 -84
  64. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
  65. package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js +2 -2
  66. package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js.map +1 -1
  67. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js +67 -84
  68. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js.map +1 -1
  69. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.css +140 -0
  70. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js +307 -0
  71. package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js.map +1 -0
  72. package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js +25 -0
  73. package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js.map +1 -0
  74. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.css +127 -0
  75. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js +350 -0
  76. package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js.map +1 -0
  77. package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js +25 -0
  78. package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js.map +1 -0
  79. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js +2 -2
  80. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js.map +1 -1
  81. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.css +1 -1
  82. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js +2 -2
  83. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js.map +1 -1
  84. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.css +0 -0
  85. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js +106 -0
  86. package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js.map +1 -0
  87. package/dist/collection/components/pcm-upload/pcm-upload.css +0 -0
  88. package/dist/collection/components/pcm-upload/pcm-upload.js +408 -0
  89. package/dist/collection/components/pcm-upload/pcm-upload.js.map +1 -0
  90. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.css +969 -969
  91. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js +3 -5
  92. package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js.map +1 -1
  93. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +68 -68
  94. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +4 -4
  95. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -1
  96. package/dist/collection/global/global.css +401 -398
  97. package/dist/collection/global/markdown.css +1233 -1233
  98. package/dist/collection/global/message.js.map +1 -1
  99. package/dist/collection/index.js.map +1 -1
  100. package/dist/collection/interfaces/chat.js.map +1 -1
  101. package/dist/collection/interfaces/events.js.map +1 -1
  102. package/dist/collection/services/message.service.js.map +1 -1
  103. package/dist/collection/utils/env.js +3 -0
  104. package/dist/collection/utils/env.js.map +1 -1
  105. package/dist/collection/utils/error-event.js.map +1 -1
  106. package/dist/collection/utils/init.js.map +1 -1
  107. package/dist/collection/utils/sentry-reporter.js.map +1 -1
  108. package/dist/collection/utils/utils.js +48 -24
  109. package/dist/collection/utils/utils.js.map +1 -1
  110. package/dist/components/index.js +3 -5482
  111. package/dist/components/index.js.map +1 -1
  112. package/dist/components/{p-AYWZDCn8.js → p-B0WOTw9J.js} +51 -4
  113. package/dist/components/p-B0WOTw9J.js.map +1 -0
  114. package/dist/components/{p-DUQ46MUh.js → p-BGXbWUJg.js} +3 -3
  115. package/dist/components/{p-DUQ46MUh.js.map → p-BGXbWUJg.js.map} +1 -1
  116. package/dist/{esm/sentry-reporter-BFBS363a.js → components/p-BW3r6Lrf.js} +5 -32
  117. package/dist/components/p-BW3r6Lrf.js.map +1 -0
  118. package/dist/{esm/app-globals-Chti62re.js → components/p-BdiUKin5.js} +9619 -4296
  119. package/dist/components/p-BdiUKin5.js.map +1 -0
  120. package/dist/components/{p-FjtoYPVY.js → p-BywzltXy.js} +10 -9
  121. package/dist/components/p-BywzltXy.js.map +1 -0
  122. package/dist/components/p-C2OsjtRx.js +208 -0
  123. package/dist/components/p-C2OsjtRx.js.map +1 -0
  124. package/dist/components/{p-D2Z8casl.js → p-CuIvbaWY.js} +5 -5
  125. package/dist/components/p-CuIvbaWY.js.map +1 -0
  126. package/dist/components/p-D0ZMoyH8.js +251 -0
  127. package/dist/components/p-D0ZMoyH8.js.map +1 -0
  128. package/dist/components/{p-CjbFHLT7.js → p-De3VHEUn.js} +7 -71
  129. package/dist/components/p-De3VHEUn.js.map +1 -0
  130. package/dist/components/p-Dv8qvK0w.js +2646 -0
  131. package/dist/components/p-Dv8qvK0w.js.map +1 -0
  132. package/dist/components/p-RD3mwuBX.js +226 -0
  133. package/dist/components/p-RD3mwuBX.js.map +1 -0
  134. package/dist/components/p-njngFX_n.js +80 -0
  135. package/dist/components/p-njngFX_n.js.map +1 -0
  136. package/dist/components/pcm-1zhanshi-mnms-modal.js +7 -7
  137. package/dist/components/pcm-1zhanshi-mnms-modal.js.map +1 -1
  138. package/dist/components/pcm-app-chat-modal.js +1 -1
  139. package/dist/components/pcm-button.js +2 -2
  140. package/dist/components/pcm-button.js.map +1 -1
  141. package/dist/components/pcm-card.js +3 -3
  142. package/dist/components/pcm-card.js.map +1 -1
  143. package/dist/components/pcm-chat-message.js +1 -1
  144. package/dist/components/pcm-drawer.js +1 -1
  145. package/dist/components/pcm-hr-chat-modal.js +5 -4
  146. package/dist/components/pcm-hr-chat-modal.js.map +1 -1
  147. package/dist/components/pcm-htws-modal.js +8 -7
  148. package/dist/components/pcm-htws-modal.js.map +1 -1
  149. package/dist/components/pcm-hyzj-modal.js +8 -7
  150. package/dist/components/pcm-hyzj-modal.js.map +1 -1
  151. package/dist/components/pcm-jd-modal.js +8 -7
  152. package/dist/components/pcm-jd-modal.js.map +1 -1
  153. package/dist/components/pcm-jlpp-modal.js +8 -7
  154. package/dist/components/pcm-jlpp-modal.js.map +1 -1
  155. package/dist/components/pcm-message.js +3 -3
  156. package/dist/components/pcm-message.js.map +1 -1
  157. package/dist/components/pcm-mnct-modal.js +8 -7
  158. package/dist/components/pcm-mnct-modal.js.map +1 -1
  159. package/dist/components/pcm-mnms-modal.js +60 -90
  160. package/dist/components/pcm-mnms-modal.js.map +1 -1
  161. package/dist/components/pcm-mnms-video-modal.js +8 -7
  162. package/dist/components/pcm-mnms-video-modal.js.map +1 -1
  163. package/dist/components/pcm-mnms-zp-modal.js +60 -90
  164. package/dist/components/pcm-mnms-zp-modal.js.map +1 -1
  165. package/dist/components/pcm-mobile-input-btn.d.ts +11 -0
  166. package/dist/components/pcm-mobile-input-btn.js +9 -0
  167. package/dist/components/pcm-mobile-input-btn.js.map +1 -0
  168. package/dist/components/pcm-mobile-upload-btn.d.ts +11 -0
  169. package/dist/components/pcm-mobile-upload-btn.js +9 -0
  170. package/dist/components/pcm-mobile-upload-btn.js.map +1 -0
  171. package/dist/components/pcm-msbg-modal.js +8 -7
  172. package/dist/components/pcm-msbg-modal.js.map +1 -1
  173. package/dist/components/pcm-qgqjl-modal.js +8 -7
  174. package/dist/components/pcm-qgqjl-modal.js.map +1 -1
  175. package/dist/components/pcm-time-count-down.d.ts +11 -0
  176. package/dist/components/pcm-time-count-down.js +9 -0
  177. package/dist/components/pcm-time-count-down.js.map +1 -0
  178. package/dist/components/pcm-upload.d.ts +11 -0
  179. package/dist/components/pcm-upload.js +9 -0
  180. package/dist/components/pcm-upload.js.map +1 -0
  181. package/dist/components/pcm-zsk-chat-modal.js +4 -4
  182. package/dist/components/pcm-zsk-chat-modal.js.map +1 -1
  183. package/dist/components/pcm-zygh-modal.js +8 -7
  184. package/dist/components/pcm-zygh-modal.js.map +1 -1
  185. package/dist/esm/error-event-C0FYX2-Z.js +31 -0
  186. package/dist/esm/error-event-C0FYX2-Z.js.map +1 -0
  187. package/dist/esm/{index-GyOE8SlD.js → index-BnNqOUZf.js} +51 -4
  188. package/dist/esm/index-BnNqOUZf.js.map +1 -0
  189. package/dist/esm/index-BuVfV0zo.js +11035 -0
  190. package/dist/esm/index-BuVfV0zo.js.map +1 -0
  191. package/dist/esm/index.js +2 -2
  192. package/dist/esm/loader.js +3 -5
  193. package/dist/esm/loader.js.map +1 -1
  194. package/dist/esm/message.service-DXVhHj6-.js +133 -0
  195. package/dist/esm/message.service-DXVhHj6-.js.map +1 -0
  196. package/dist/esm/{pcm-1zhanshi-mnms-modal_17.entry.js → pcm-1zhanshi-mnms-modal_21.entry.js} +3225 -169
  197. package/dist/esm/pcm-1zhanshi-mnms-modal_21.entry.js.map +1 -0
  198. package/dist/esm/pcm-agents.js +4 -6
  199. package/dist/esm/pcm-agents.js.map +1 -1
  200. package/dist/esm/pcm-message.entry.js +3 -3
  201. package/dist/esm/pcm-message.entry.js.map +1 -1
  202. package/dist/esm/pcm-mnms-video-modal.entry.js +5 -5
  203. package/dist/esm/pcm-mnms-video-modal.entry.js.map +1 -1
  204. package/dist/esm/pcm-mnms-zp-modal.entry.js +28 -85
  205. package/dist/esm/pcm-mnms-zp-modal.entry.js.map +1 -1
  206. package/dist/esm/sentry-reporter-CYzy4_8O.js +70 -0
  207. package/dist/esm/sentry-reporter-CYzy4_8O.js.map +1 -0
  208. package/dist/pcm-agents/index.esm.js +1 -1
  209. package/dist/pcm-agents/loader.esm.js.map +1 -1
  210. package/dist/pcm-agents/p-18a06873.entry.js +2 -0
  211. package/dist/pcm-agents/p-18a06873.entry.js.map +1 -0
  212. package/dist/pcm-agents/p-47e2e1d0.entry.js +2 -0
  213. package/dist/pcm-agents/p-47e2e1d0.entry.js.map +1 -0
  214. package/dist/pcm-agents/{p-3608c0c6.entry.js → p-7a582f00.entry.js} +2 -2
  215. package/dist/pcm-agents/p-7a582f00.entry.js.map +1 -0
  216. package/dist/pcm-agents/p-BhFnI70g.js +2 -0
  217. package/dist/pcm-agents/p-BhFnI70g.js.map +1 -0
  218. package/dist/pcm-agents/p-BuVfV0zo.js +3 -0
  219. package/dist/pcm-agents/p-BuVfV0zo.js.map +1 -0
  220. package/dist/pcm-agents/p-C0FYX2-Z.js +2 -0
  221. package/dist/pcm-agents/p-C0FYX2-Z.js.map +1 -0
  222. package/dist/pcm-agents/p-DXVhHj6-.js +2 -0
  223. package/dist/pcm-agents/p-DXVhHj6-.js.map +1 -0
  224. package/dist/pcm-agents/p-DkeaAFic.js +2 -0
  225. package/dist/pcm-agents/p-DkeaAFic.js.map +1 -0
  226. package/dist/pcm-agents/p-f5f96853.entry.js +245 -0
  227. package/dist/pcm-agents/p-f5f96853.entry.js.map +1 -0
  228. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  229. package/dist/pcm-agents/pcm-agents.esm.js.map +1 -1
  230. package/dist/pcm-agents/pcm-message.entry.esm.js.map +1 -1
  231. package/dist/pcm-agents/pcm-mnms-video-modal.entry.esm.js.map +1 -1
  232. package/dist/pcm-agents/pcm-mnms-zp-modal.entry.esm.js.map +1 -1
  233. package/dist/store/auth.store.js.map +1 -1
  234. package/dist/store/config.store.js.map +1 -1
  235. package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +9 -4
  236. package/dist/types/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.d.ts +9 -4
  237. package/dist/types/components/pcm-mobile-input-btn/pcm-mobile-input-btn.d.ts +36 -0
  238. package/dist/types/components/pcm-mobile-input-btn/uploadNumberSDK.d.ts +9 -0
  239. package/dist/types/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.d.ts +44 -0
  240. package/dist/types/components/pcm-mobile-upload-btn/uploadNumberSDK.d.ts +9 -0
  241. package/dist/types/components/pcm-time-count-down/pcm-time-count-down.d.ts +15 -0
  242. package/dist/types/components/pcm-upload/pcm-upload.d.ts +54 -0
  243. package/dist/types/components/pcm-upload/type.d.ts +4 -0
  244. package/dist/types/components.d.ts +798 -30
  245. package/dist/types/stencil-public-runtime.d.ts +1 -1
  246. package/dist/types/utils/env.d.ts +2 -0
  247. package/dist/types/utils/utils.d.ts +30 -12
  248. package/package.json +70 -69
  249. package/dist/cjs/app-globals-BIO4q6tX.js +0 -5487
  250. package/dist/cjs/app-globals-BIO4q6tX.js.map +0 -1
  251. package/dist/cjs/exports-Dc-pQh4A.js +0 -4087
  252. package/dist/cjs/exports-Dc-pQh4A.js.map +0 -1
  253. package/dist/cjs/index-C_qhED9Z.js +0 -1538
  254. package/dist/cjs/index-C_qhED9Z.js.map +0 -1
  255. package/dist/cjs/index-CvEfNyEj.js.map +0 -1
  256. package/dist/cjs/pcm-1zhanshi-mnms-modal_17.cjs.entry.js.map +0 -1
  257. package/dist/cjs/sentry-reporter-BWFtw_aT.js.map +0 -1
  258. package/dist/components/p-75J0r72D.js +0 -4017
  259. package/dist/components/p-75J0r72D.js.map +0 -1
  260. package/dist/components/p-AYWZDCn8.js.map +0 -1
  261. package/dist/components/p-CR7WLzmM.js +0 -1303
  262. package/dist/components/p-CR7WLzmM.js.map +0 -1
  263. package/dist/components/p-CjbFHLT7.js.map +0 -1
  264. package/dist/components/p-D2Z8casl.js.map +0 -1
  265. package/dist/components/p-FjtoYPVY.js.map +0 -1
  266. package/dist/esm/app-globals-Chti62re.js.map +0 -1
  267. package/dist/esm/exports-Bs-zO1WZ.js +0 -4017
  268. package/dist/esm/exports-Bs-zO1WZ.js.map +0 -1
  269. package/dist/esm/index-Bq0K-WqZ.js +0 -1528
  270. package/dist/esm/index-Bq0K-WqZ.js.map +0 -1
  271. package/dist/esm/index-GyOE8SlD.js.map +0 -1
  272. package/dist/esm/pcm-1zhanshi-mnms-modal_17.entry.js.map +0 -1
  273. package/dist/esm/sentry-reporter-BFBS363a.js.map +0 -1
  274. package/dist/pcm-agents/p-2Gpw8rvH.js +0 -2
  275. package/dist/pcm-agents/p-2Gpw8rvH.js.map +0 -1
  276. package/dist/pcm-agents/p-3608c0c6.entry.js.map +0 -1
  277. package/dist/pcm-agents/p-60d7a0b0.entry.js +0 -2
  278. package/dist/pcm-agents/p-60d7a0b0.entry.js.map +0 -1
  279. package/dist/pcm-agents/p-9e6efc2d.entry.js +0 -2
  280. package/dist/pcm-agents/p-9e6efc2d.entry.js.map +0 -1
  281. package/dist/pcm-agents/p-BUV0S8Cc.js +0 -2
  282. package/dist/pcm-agents/p-BUV0S8Cc.js.map +0 -1
  283. package/dist/pcm-agents/p-Bq0K-WqZ.js +0 -3
  284. package/dist/pcm-agents/p-Bq0K-WqZ.js.map +0 -1
  285. package/dist/pcm-agents/p-Bs-zO1WZ.js +0 -2
  286. package/dist/pcm-agents/p-Bs-zO1WZ.js.map +0 -1
  287. package/dist/pcm-agents/p-CeRTfvY9.js +0 -2
  288. package/dist/pcm-agents/p-CeRTfvY9.js.map +0 -1
  289. package/dist/pcm-agents/p-e6c87a78.entry.js +0 -2
  290. package/dist/pcm-agents/p-e6c87a78.entry.js.map +0 -1
  291. /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/auth.store.d.ts +0 -0
  292. /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/config.store.d.ts +0 -0
@@ -0,0 +1,245 @@
1
+ import{r as e,i as t,f as o,h as i}from"./p-BuVfV0zo.js";import{a as n,c as r,v as s,f as a,s as l,b as d,d as c,u as h,g as p,e as u,P as f,i as m,F as g,h as b}from"./p-DkeaAFic.js";import{E as x}from"./p-C0FYX2-Z.js";import{S as w}from"./p-BhFnI70g.js";import{M as y}from"./p-DXVhHj6-.js";const k="";const v=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const C=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.recordingError=t(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";maxRecordingTime=120;fullscreen=false;customInputs={};uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;recordingError;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.jobDescription=""}else{await s(this.token);this.showChatModal=true}}render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,botId:"3022316191018903",conversationId:this.conversationId,defaultQuery:this.defaultQuery,maxRecordingTime:this.maxRecordingTime,enableTTS:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.uploadedFileInfo?.cos_key,file_name:this.uploadedFileInfo?.file_name},interviewMode:"video"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};C.style=k+v;function z(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let _=z();function I(e){_=e}const j=/[&<>"']/;const S=new RegExp(j.source,"g");const F=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const M=new RegExp(F.source,"g");const T={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const E=e=>T[e];function A(e,t){if(t){if(j.test(e)){return e.replace(S,E)}}else{if(F.test(e)){return e.replace(M,E)}}return e}const $=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function B(e){return e.replace($,((e,t)=>{t=t.toLowerCase();if(t==="colon")return":";if(t.charAt(0)==="#"){return t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1))}return""}))}const D=/(^|[^\[])\^/g;function R(e,t){e=typeof e==="string"?e:e.source;t=t||"";const o={replace:(t,i)=>{i=typeof i==="object"&&"source"in i?i.source:i;i=i.replace(D,"$1");e=e.replace(t,i);return o},getRegex:()=>new RegExp(e,t)};return o}function L(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const O={exec:()=>null};function H(e,t){const o=e.replace(/\|/g,((e,t,o)=>{let i=false;let n=t;while(--n>=0&&o[n]==="\\")i=!i;if(i){return"|"}else{return" |"}})),i=o.split(/ \|/);let n=0;if(!i[0].trim()){i.shift()}if(i.length>0&&!i[i.length-1].trim()){i.pop()}if(t){if(i.length>t){i.splice(t)}else{while(i.length<t)i.push("")}}for(;n<i.length;n++){i[n]=i[n].trim().replace(/\\\|/g,"|")}return i}function P(e,t,o){const i=e.length;if(i===0){return""}let n=0;while(n<i){const o=e.charAt(i-n-1);if(o===t&&true){n++}else{break}}return e.slice(0,i-n)}function U(e,t){if(e.indexOf(t[1])===-1){return-1}let o=0;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++}else if(e[i]===t[0]){o++}else if(e[i]===t[1]){o--;if(o<0){return i}}}return-1}function q(e,t,o,i){const n=t.href;const r=t.title?A(t.title):null;const s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=true;const e={type:"link",raw:o,href:n,title:r,text:s,tokens:i.inlineTokens(s)};i.state.inLink=false;return e}return{type:"image",raw:o,href:n,title:r,text:A(s)}}function N(e,t){const o=e.match(/^(\s+)(?:```)/);if(o===null){return t}const i=o[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(t===null){return e}const[o]=t;if(o.length>=i.length){return e.slice(i.length)}return e})).join("\n")}class W{options;rules;lexer;constructor(e){this.options=e||_}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0){return{type:"space",raw:t[0]}}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:!this.options.pedantic?P(e,"\n"):e}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0];const o=N(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:o}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=P(e,"#");if(this.options.pedantic){e=t.trim()}else if(!t||/ $/.test(t)){e=t.trim()}}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t){return{type:"hr",raw:t[0]}}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=P(t[0].replace(/^ *>[ \t]?/gm,""),"\n");const o=this.lexer.state.top;this.lexer.state.top=true;const i=this.lexer.blockTokens(e);this.lexer.state.top=o;return{type:"blockquote",raw:t[0],tokens:i,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let o=t[1].trim();const i=o.length>1;const n={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:false,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`;if(this.options.pedantic){o=i?o:"[*+-]"}const r=new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="";let a="";let l=false;while(e){let o=false;if(!(t=r.exec(e))){break}if(this.rules.block.hr.test(e)){break}s=t[0];e=e.substring(s.length);let i=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length)));let d=e.split("\n",1)[0];let c=0;if(this.options.pedantic){c=2;a=i.trimStart()}else{c=t[2].search(/[^ ]/);c=c>4?1:c;a=i.slice(c);c+=t[1].length}let h=false;if(!i&&/^ *$/.test(d)){s+=d+"\n";e=e.substring(d.length+1);o=true}if(!o){const t=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const o=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const n=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`);const r=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);while(e){const l=e.split("\n",1)[0];d=l;if(this.options.pedantic){d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(n.test(d)){break}if(r.test(d)){break}if(t.test(d)){break}if(o.test(e)){break}if(d.search(/[^ ]/)>=c||!d.trim()){a+="\n"+d.slice(c)}else{if(h){break}if(i.search(/[^ ]/)>=4){break}if(n.test(i)){break}if(r.test(i)){break}if(o.test(i)){break}a+="\n"+d}if(!h&&!d.trim()){h=true}s+=l+"\n";e=e.substring(l.length+1);i=d.slice(c)}}if(!n.loose){if(l){n.loose=true}else if(/\n *\n *$/.test(s)){l=true}}let p=null;let u;if(this.options.gfm){p=/^\[[ xX]\] /.exec(a);if(p){u=p[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}n.items.push({type:"list_item",raw:s,task:!!p,checked:u,loose:false,text:a,tokens:[]});n.raw+=s}n.items[n.items.length-1].raw=s.trimEnd();n.items[n.items.length-1].text=a.trimEnd();n.raw=n.raw.trimEnd();for(let e=0;e<n.items.length;e++){this.lexer.state.top=false;n.items[e].tokens=this.lexer.blockTokens(n.items[e].text,[]);if(!n.loose){const t=n.items[e].tokens.filter((e=>e.type==="space"));const o=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));n.loose=o}}if(n.loose){for(let e=0;e<n.items.length;e++){n.items[e].loose=true}}return n}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",block:true,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]};return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," ");const o=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"";const i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:o,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2])){return}const e={type:"table",raw:t[0],header:H(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t=e.align.length;let o,i,n,r;for(o=0;o<t;o++){const t=e.align[o];if(t){if(/^ *-+: *$/.test(t)){e.align[o]="right"}else if(/^ *:-+: *$/.test(t)){e.align[o]="center"}else if(/^ *:-+ *$/.test(t)){e.align[o]="left"}else{e.align[o]=null}}}t=e.rows.length;for(o=0;o<t;o++){e.rows[o]=H(e.rows[o],e.header.length).map((e=>({text:e,tokens:[]})))}t=e.header.length;for(i=0;i<t;i++){e.header[i].tokens=this.lexer.inline(e.header[i].text)}t=e.rows.length;for(i=0;i<t;i++){r=e.rows[i];for(n=0;n<r.length;n++){r[n].tokens=this.lexer.inline(r[n].text)}}return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e=t[1].charAt(t[1].length-1)==="\n"?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t){return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}}escape(e){const t=this.rules.inline.escape.exec(e);if(t){return{type:"escape",raw:t[0],text:A(t[1])}}}tag(e){const t=this.rules.inline.tag.exec(e);if(t){if(!this.lexer.state.inLink&&/^<a /i.test(t[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(t[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:t[0]}}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e)){return}const t=P(e.slice(0,-1),"\\");if((e.length-t.length)%2===0){return}}else{const e=U(t[2],"()");if(e>-1){const o=t[0].indexOf("!")===0?5:4;const i=o+t[1].length+e;t[2]=t[2].substring(0,e);t[0]=t[0].substring(0,i).trim();t[3]=""}}let o=t[2];let i="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);if(e){o=e[1];i=e[3]}}else{i=t[3]?t[3].slice(1,-1):""}o=o.trim();if(/^</.test(o)){if(this.options.pedantic&&!/>$/.test(e)){o=o.slice(1)}else{o=o.slice(1,-1)}}return q(t,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:i?i.replace(this.rules.inline._escapes,"$1"):i},t[0],this.lexer)}}reflink(e,t){let o;if((o=this.rules.inline.reflink.exec(e))||(o=this.rules.inline.nolink.exec(e))){let e=(o[2]||o[1]).replace(/\s+/g," ");e=t[e.toLowerCase()];if(!e){const e=o[0].charAt(0);return{type:"text",raw:e,text:e}}return q(o,e,o[0],this.lexer)}}emStrong(e,t,o=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i)return;if(i[3]&&o.match(/[\p{L}\p{N}]/u))return;const n=i[1]||i[2]||"";if(!n||!o||this.rules.inline.punctuation.exec(o)){const o=[...i[0]].length-1;let n,r,s=o,a=0;const l=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;l.lastIndex=0;t=t.slice(-1*e.length+o);while((i=l.exec(t))!=null){n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6];if(!n)continue;r=[...n].length;if(i[3]||i[4]){s+=r;continue}else if(i[5]||i[6]){if(o%3&&!((o+r)%3)){a+=r;continue}}s-=r;if(s>0)continue;r=Math.min(r,r+s+a);const t=[...i[0]][0].length;const l=e.slice(0,o+i.index+t+r);if(Math.min(o,r)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const o=/[^ ]/.test(e);const i=/^ /.test(e)&&/ $/.test(e);if(o&&i){e=e.substring(1,e.length-1)}e=A(e,true);return{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t){return{type:"br",raw:t[0]}}}del(e){const t=this.rules.inline.del.exec(e);if(t){return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,o;if(t[2]==="@"){e=A(t[1]);o="mailto:"+e}else{e=A(t[1]);o=e}return{type:"link",raw:t[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,o;if(t[2]==="@"){e=A(t[0]);o="mailto:"+e}else{let i;do{i=t[0];t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(i!==t[0]);e=A(t[0]);if(t[1]==="www."){o="http://"+t[0]}else{o=t[0]}}return{type:"link",raw:t[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;if(this.lexer.state.inRawBlock){e=t[0]}else{e=A(t[0])}return{type:"text",raw:t[0],text:e}}}}const V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:O,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};V._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;V._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;V.def=R(V.def).replace("label",V._label).replace("title",V._title).getRegex();V.bullet=/(?:[*+-]|\d{1,9}[.)])/;V.listItemStart=R(/^( *)(bull) */).replace("bull",V.bullet).getRegex();V.list=R(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex();V._tag="address|article|aside|base|basefont|blockquote|body|caption"+"|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption"+"|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";V._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;V.html=R(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();V.lheading=R(V.lheading).replace(/bull/g,V.bullet).getRegex();V.paragraph=R(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex();V.blockquote=R(V.blockquote).replace("paragraph",V.paragraph).getRegex();V.normal={...V};V.gfm={...V.normal,table:"^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};V.gfm.table=R(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex();V.gfm.paragraph=R(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",V.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex();V.pedantic={...V.normal,html:R("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:O,tag:"^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:O,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};Q._punctuation="\\p{P}$+<=>`^|~";Q.punctuation=R(Q.punctuation,"u").replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;Q.anyPunctuation=/\\[punct]/g;Q._escapes=/\\([punct])/g;Q._comment=R(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex();Q.emStrong.lDelim=R(Q.emStrong.lDelim,"u").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=R(Q.emStrong.rDelimAst,"gu").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=R(Q.emStrong.rDelimUnd,"gu").replace(/punct/g,Q._punctuation).getRegex();Q.anyPunctuation=R(Q.anyPunctuation,"gu").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=R(Q._escapes,"gu").replace(/punct/g,Q._punctuation).getRegex();Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=R(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=R(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=R(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=R(Q.reflink).replace("label",Q._label).replace("ref",V._label).getRegex();Q.nolink=R(Q.nolink).replace("ref",V._label).getRegex();Q.reflinkSearch=R(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:R(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Q.gfm.url=R(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex();Q.breaks={...Q.gfm,br:R(Q.br).replace("{2,}","*").getRegex(),text:R(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Z{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[];this.tokens.links=Object.create(null);this.options=e||_;this.options.tokenizer=this.options.tokenizer||new W;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const t={block:V.normal,inline:Q.normal};if(this.options.pedantic){t.block=V.pedantic;t.inline=Q.pedantic}else if(this.options.gfm){t.block=V.gfm;if(this.options.breaks){t.inline=Q.breaks}else{t.inline=Q.gfm}}this.tokenizer.rules=t}static get rules(){return{block:V,inline:Q}}static lex(e,t){const o=new Z(t);return o.lex(e)}static lexInline(e,t){const o=new Z(t);return o.inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n");this.blockTokens(e,this.tokens);let t;while(t=this.inlineQueue.shift()){this.inlineTokens(t.src,t.tokens)}return this.tokens}blockTokens(e,t=[]){if(this.options.pedantic){e=e.replace(/\t/g," ").replace(/^ +$/gm,"")}else{e=e.replace(/^( *)(\t+)/gm,((e,t,o)=>t+" ".repeat(o.length)))}let o;let i;let n;let r;while(e){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>{if(o=i.call({lexer:this},e,t)){e=e.substring(o.raw.length);t.push(o);return true}return false}))){continue}if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);if(o.raw.length===1&&t.length>0){t[t.length-1].raw+="\n"}else{t.push(o)}continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);i=t[t.length-1];if(i&&(i.type==="paragraph"||i.type==="text")){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{t.push(o)}continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);i=t[t.length-1];if(i&&(i.type==="paragraph"||i.type==="text")){i.raw+="\n"+o.raw;i.text+="\n"+o.raw;this.inlineQueue[this.inlineQueue.length-1].src=i.text}else if(!this.tokens.links[o.tag]){this.tokens.links[o.tag]={href:o.href,title:o.title}}continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length);t.push(o);continue}n=e;if(this.options.extensions&&this.options.extensions.startBlock){let t=Infinity;const o=e.slice(1);let i;this.options.extensions.startBlock.forEach((e=>{i=e.call({lexer:this},o);if(typeof i==="number"&&i>=0){t=Math.min(t,i)}}));if(t<Infinity&&t>=0){n=e.substring(0,t+1)}}if(this.state.top&&(o=this.tokenizer.paragraph(n))){i=t[t.length-1];if(r&&i.type==="paragraph"){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{t.push(o)}r=n.length!==e.length;e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);i=t[t.length-1];if(i&&i.type==="text"){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{t.push(o)}continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else{throw new Error(t)}}}this.state.top=true;return t}inline(e,t=[]){this.inlineQueue.push({src:e,tokens:t});return t}inlineTokens(e,t=[]){let o,i,n;let r=e;let s;let a,l;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0){while((s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null){if(e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))){r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null){r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null){r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(e){if(!a){l=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>{if(o=i.call({lexer:this},e,t)){e=e.substring(o.raw.length);t.push(o);return true}return false}))){continue}if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length);i=t[t.length-1];if(i&&o.type==="text"&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{t.push(o)}continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);i=t[t.length-1];if(i&&o.type==="text"&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{t.push(o)}continue}if(o=this.tokenizer.emStrong(e,r,l)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length);t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length);t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length);t.push(o);continue}n=e;if(this.options.extensions&&this.options.extensions.startInline){let t=Infinity;const o=e.slice(1);let i;this.options.extensions.startInline.forEach((e=>{i=e.call({lexer:this},o);if(typeof i==="number"&&i>=0){t=Math.min(t,i)}}));if(t<Infinity&&t>=0){n=e.substring(0,t+1)}}if(o=this.tokenizer.inlineText(n)){e=e.substring(o.raw.length);if(o.raw.slice(-1)!=="_"){l=o.raw.slice(-1)}a=true;i=t[t.length-1];if(i&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{t.push(o)}continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else{throw new Error(t)}}}return t}}class J{options;constructor(e){this.options=e||_}code(e,t,o){const i=(t||"").match(/^\S*/)?.[0];e=e.replace(/\n$/,"")+"\n";if(!i){return"<pre><code>"+(o?e:A(e,true))+"</code></pre>\n"}return'<pre><code class="language-'+A(i)+'">'+(o?e:A(e,true))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,o){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,o){const i=t?"ol":"ul";const n=t&&o!==1?' start="'+o+'"':"";return"<"+i+n+">\n"+e+"</"+i+">\n"}listitem(e,t,o){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){if(t)t=`<tbody>${t}</tbody>`;return"<table>\n"+"<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const o=t.header?"th":"td";const i=t.align?`<${o} align="${t.align}">`:`<${o}>`;return i+e+`</${o}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,o){const i=L(e);if(i===null){return o}e=i;let n='<a href="'+e+'"';if(t){n+=' title="'+t+'"'}n+=">"+o+"</a>";return n}image(e,t,o){const i=L(e);if(i===null){return o}e=i;let n=`<img src="${e}" alt="${o}"`;if(t){n+=` title="${t}"`}n+=">";return n}text(e){return e}}class G{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,o){return""+o}image(e,t,o){return""+o}br(){return""}}class X{options;renderer;textRenderer;constructor(e){this.options=e||_;this.options.renderer=this.options.renderer||new J;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new G}static parse(e,t){const o=new X(t);return o.parse(e)}static parseInline(e,t){const o=new X(t);return o.parseInline(e)}parse(e,t=true){let o="";for(let i=0;i<e.length;i++){const n=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=n;const t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){o+=t||"";continue}}switch(n.type){case"space":{continue}case"hr":{o+=this.renderer.hr();continue}case"heading":{const e=n;o+=this.renderer.heading(this.parseInline(e.tokens),e.depth,B(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=n;o+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=n;let t="";let i="";for(let t=0;t<e.header.length;t++){i+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:true,align:e.align[t]})}t+=this.renderer.tablerow(i);let r="";for(let t=0;t<e.rows.length;t++){const o=e.rows[t];i="";for(let t=0;t<o.length;t++){i+=this.renderer.tablecell(this.parseInline(o[t].tokens),{header:false,align:e.align[t]})}r+=this.renderer.tablerow(i)}o+=this.renderer.table(t,r);continue}case"blockquote":{const e=n;const t=this.parse(e.tokens);o+=this.renderer.blockquote(t);continue}case"list":{const e=n;const t=e.ordered;const i=e.start;const r=e.loose;let s="";for(let t=0;t<e.items.length;t++){const o=e.items[t];const i=o.checked;const n=o.task;let a="";if(o.task){const e=this.renderer.checkbox(!!i);if(r){if(o.tokens.length>0&&o.tokens[0].type==="paragraph"){o.tokens[0].text=e+" "+o.tokens[0].text;if(o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"){o.tokens[0].tokens[0].text=e+" "+o.tokens[0].tokens[0].text}}else{o.tokens.unshift({type:"text",text:e+" "})}}else{a+=e+" "}}a+=this.parse(o.tokens,r);s+=this.renderer.listitem(a,n,!!i)}o+=this.renderer.list(s,t,i);continue}case"html":{const e=n;o+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=n;o+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let r=n;let s=r.tokens?this.parseInline(r.tokens):r.text;while(i+1<e.length&&e[i+1].type==="text"){r=e[++i];s+="\n"+(r.tokens?this.parseInline(r.tokens):r.text)}o+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(e);return""}else{throw new Error(e)}}}}return o}parseInline(e,t){t=t||this.renderer;let o="";for(let i=0;i<e.length;i++){const n=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=this.options.extensions.renderers[n.type].call({parser:this},n);if(e!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){o+=e||"";continue}}switch(n.type){case"escape":{const e=n;o+=t.text(e.text);break}case"html":{const e=n;o+=t.html(e.text);break}case"link":{const e=n;o+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=n;o+=t.image(e.href,e.title,e.text);break}case"strong":{const e=n;o+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=n;o+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=n;o+=t.codespan(e.text);break}case"br":{o+=t.br();break}case"del":{const e=n;o+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=n;o+=t.text(e.text);break}default:{const e='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(e);return""}else{throw new Error(e)}}}}return o}}class K{options;constructor(e){this.options=e||_}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}class Y{defaults=z();options=this.setOptions;parse=this.#e(Z.lex,X.parse);parseInline=this.#e(Z.lexInline,X.parseInline);Parser=X;Renderer=J;TextRenderer=G;Lexer=Z;Tokenizer=W;Hooks=K;constructor(...e){this.use(...e)}walkTokens(e,t){let o=[];for(const i of e){o=o.concat(t.call(this,i));switch(i.type){case"table":{const e=i;for(const i of e.header){o=o.concat(this.walkTokens(i.tokens,t))}for(const i of e.rows){for(const e of i){o=o.concat(this.walkTokens(e.tokens,t))}}break}case"list":{const e=i;o=o.concat(this.walkTokens(e.items,t));break}default:{const e=i;if(this.defaults.extensions?.childTokens?.[e.type]){this.defaults.extensions.childTokens[e.type].forEach((i=>{o=o.concat(this.walkTokens(e[i],t))}))}else if(e.tokens){o=o.concat(this.walkTokens(e.tokens,t))}}}}return o}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const o={...e};o.async=this.defaults.async||o.async||false;if(e.extensions){e.extensions.forEach((e=>{if(!e.name){throw new Error("extension name required")}if("renderer"in e){const o=t.renderers[e.name];if(o){t.renderers[e.name]=function(...t){let i=e.renderer.apply(this,t);if(i===false){i=o.apply(this,t)}return i}}else{t.renderers[e.name]=e.renderer}}if("tokenizer"in e){if(!e.level||e.level!=="block"&&e.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const o=t[e.level];if(o){o.unshift(e.tokenizer)}else{t[e.level]=[e.tokenizer]}if(e.start){if(e.level==="block"){if(t.startBlock){t.startBlock.push(e.start)}else{t.startBlock=[e.start]}}else if(e.level==="inline"){if(t.startInline){t.startInline.push(e.start)}else{t.startInline=[e.start]}}}}if("childTokens"in e&&e.childTokens){t.childTokens[e.name]=e.childTokens}}));o.extensions=t}if(e.renderer){const t=this.defaults.renderer||new J(this.defaults);for(const o in e.renderer){const i=e.renderer[o];const n=o;const r=t[n];t[n]=(...e)=>{let o=i.apply(t,e);if(o===false){o=r.apply(t,e)}return o||""}}o.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new W(this.defaults);for(const o in e.tokenizer){const i=e.tokenizer[o];const n=o;const r=t[n];t[n]=(...e)=>{let o=i.apply(t,e);if(o===false){o=r.apply(t,e)}return o}}o.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new K;for(const o in e.hooks){const i=e.hooks[o];const n=o;const r=t[n];if(K.passThroughHooks.has(o)){t[n]=e=>{if(this.defaults.async){return Promise.resolve(i.call(t,e)).then((e=>r.call(t,e)))}const o=i.call(t,e);return r.call(t,o)}}else{t[n]=(...e)=>{let o=i.apply(t,e);if(o===false){o=r.apply(t,e)}return o}}}o.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens;const i=e.walkTokens;o.walkTokens=function(e){let o=[];o.push(i.call(this,e));if(t){o=o.concat(t.call(this,e))}return o}}this.defaults={...this.defaults,...o}}));return this}setOptions(e){this.defaults={...this.defaults,...e};return this}lexer(e,t){return Z.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}#e(e,t){return(o,i)=>{const n={...i};const r={...this.defaults,...n};if(this.defaults.async===true&&n.async===false){if(!r.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}r.async=true}const s=this.#t(!!r.silent,!!r.async);if(typeof o==="undefined"||o===null){return s(new Error("marked(): input parameter is undefined or null"))}if(typeof o!=="string"){return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"))}if(r.hooks){r.hooks.options=r}if(r.async){return Promise.resolve(r.hooks?r.hooks.preprocess(o):o).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(this.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s)}try{if(r.hooks){o=r.hooks.preprocess(o)}const i=e(o,r);if(r.walkTokens){this.walkTokens(i,r.walkTokens)}let n=t(i,r);if(r.hooks){n=r.hooks.postprocess(n)}return n}catch(e){return s(e)}}}#t(e,t){return o=>{o.message+="\nPlease report this to https://github.com/markedjs/marked.";if(e){const e="<p>An error occurred:</p><pre>"+A(o.message+"",true)+"</pre>";if(t){return Promise.resolve(e)}return e}if(t){return Promise.reject(o)}throw o}}}const ee=new Y;function te(e,t){return ee.parse(e,t)}te.options=te.setOptions=function(e){ee.setOptions(e);te.defaults=ee.defaults;I(te.defaults);return te};te.getDefaults=z;te.defaults=_;te.use=function(...e){ee.use(...e);te.defaults=ee.defaults;I(te.defaults);return te};te.walkTokens=function(e,t){return ee.walkTokens(e,t)};te.parseInline=ee.parseInline;te.Parser=X;te.parser=X.parse;te.Renderer=J;te.TextRenderer=G;te.Lexer=Z;te.lexer=Z.lex;te.Tokenizer=W;te.Hooks=K;te.parse=te;const oe=":host{display:block;font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0;position:absolute;width:100%;height:100%}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;margin-bottom:20px}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-container{background-image:url(https://pub.pincaimao.com/static/web/images/login/bg_login_m.png);background-size:100%;height:100%;border-radius:0px 0px 8px 8px}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:400px}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{width:38px;height:38px;border-radius:16px;background:#0d75fb;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color 0.2s ease}.send-button img{width:24px;height:24px}.send-button:hover{background:#0a62d6}.send-button.disabled{background:#d9d9d9;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:10px 20px 0px 20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-color:#0D75FB;border-radius:6px;width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:0px 16px 16px 16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:end;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:10px;border:1px solid #d9d9d9;border-radius:6px}.toolbar-actions:hover{background-color:#f0f0f0}.toolbar-button{background:transparent;border:none;color:#666;cursor:pointer;padding:0;margin:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.toolbar-button>div,.toolbar-button>svg{display:flex;justify-content:center;align-items:center}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}.toolbar-button.recording{background-color:rgba(255, 0, 0, 0.1);color:#ff3b30;animation:pulse 1.5s infinite}.toolbar-button.converting{background-color:rgba(0, 122, 255, 0.1);color:#007aff}.toolbar-button .recording-time{font-size:12px;margin-left:4px}.converting-indicator{display:flex;justify-content:center;align-items:center}.converting-indicator svg{animation:spin 1.5s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0.4)}70%{box-shadow:0 0 0 6px rgba(255, 0, 0, 0)}100%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0)}}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:0}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.workspace-section{width:100%;padding:0px 16px 16px}.workspace-toolbar{display:flex;justify-content:end;align-items:center;gap:12px}.workspace-button{display:flex;align-items:center;gap:6px;padding:8px 16px;border:1px solid #d9d9d9;border-radius:6px;background:white;color:#666;font-size:14px;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.workspace-button:hover{border-color:#4096ff;color:#4096ff;box-shadow:0 2px 4px rgba(64, 150, 255, 0.1)}.workspace-button svg{flex-shrink:0}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-item.active{background:#e6f7ff;border-color:#1890ff}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.current-indicator{flex-shrink:0;color:#1890ff;margin-left:8px}";const ie='.markdown-body{--base-size-4:4px;--base-size-8:8px;--base-size-16:16px;--base-size-24:24px;--base-size-40:40px;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}';const ne=class{modalTitle="在线客服";token;isOpen=false;messages=[];modalClosed;icon;zIndex;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;isUploading=false;defaultQuery="你好!聘才猫";maxRecordingTime=120;countdownWarningTime=30;isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=10;videoRef=null;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;showCountdownWarning=false;fullscreen=false;isUploadingVideo=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableTTS=false;enableVoice=false;interviewMode="video";textAnswer="";isSubmittingText=false;customInputs={};botId;isRecordingAudio=false;audioRecorder=null;audioChunks=[];isConvertingAudio=false;audioRecordingTimeLeft=60;audioRecordingTimer=null;audioRecordingStartTime=0;maxAudioRecordingTime=60;userAvatar="https://pub.pincaimao.com/static/common/i_pcm_logo.png";assistantAvatar;agentLogo="";isTaskCompleted=false;tokenInvalidListener;showCopyButton=true;showFeedbackButtons=true;filePreviewMode="window";showWorkspaceHistory=false;isDrawerOpen=false;previewUrl="";previewFileName="";previewContentType="file";previewContent="";isUserScrolling=false;deviceError=null;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(this,"tokenInvalid");te.setOptions({breaks:true,gfm:true})}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}else{const e=r.getItem("modal-zIndex");if(e){this.zIndex=e}else{this.zIndex=1e3;r.setItem("modal-zIndex",1e3)}}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);if(!this.customInputs){this.customInputs={}}if(!this.assistantAvatar&&this.botId){this.fetchAgentLogo()}if(this.isOpen){if(this.conversationId){setTimeout((()=>this.loadHistoryMessages()),0)}else{setTimeout((()=>{this.sendMessageToAPI(this.defaultQuery)}),0)}}}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};async fetchAgentLogo(){if(!this.botId)return;try{const e=await a(this.botId);if(e&&e.logo){this.agentLogo=e.logo}}catch(e){w.captureError(e,{action:"fetchAgentLogo",component:"pcm-app-chat-modal",title:"获取智能体信息失败"});x.emitError({error:e,message:"获取智能体信息失败"})}}async sendMessageToAPI(e,t){this.isLoading=true;let o="";let i="";const n=new Date;const r=`${n.getHours()}:${n.getMinutes().toString().padStart(2,"0")}`;const s=e.trim()||"请开始";if(t){this.customInputs={...this.customInputs,video_url:t}}const a={id:`temp-${Date.now()}`,conversation_id:this.conversationId,parent_message_id:"00000000-0000-0000-0000-000000000000",inputs:this.customInputs||{},query:s,answer:"",message_files:[],feedback:{},retriever_resources:[],created_at:Math.floor(Date.now()/1e3).toString(),agent_thoughts:[],status:"normal",error:null,time:r,isStreaming:true};this.currentStreamingMessage=a;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);const d={response_mode:"streaming",conversation_id:this.conversationId,query:s,bot_id:this.botId};d.inputs={...this.customInputs};await l({url:"/sdk/v1/chat/chat-messages",method:"POST",data:d,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){i=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("聘才猫任务结束")){this.isTaskCompleted=true;const e=i||o||this.currentStreamingMessage?.answer||"";this.interviewComplete.emit({conversation_id:this.conversationId,current_question_number:this.currentQuestionNumber,ai_response:e})}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){o+=e.answer;const t={...this.currentStreamingMessage,answer:o,id:e.message_id||this.currentStreamingMessage.id,isStreaming:true,parent_message_id:e.parent_message_id||this.currentStreamingMessage.parent_message_id,retriever_resources:e.retriever_resources||this.currentStreamingMessage.retriever_resources,agent_thoughts:e.agent_thoughts||this.currentStreamingMessage.agent_thoughts};this.currentStreamingMessage=t;this.scrollToBottom()}}}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:e=>{console.error("发生错误:",e);x.emitError({error:e,message:"消息发送失败,请稍后再试"});w.captureError(e,{action:"sendMessageToAPI",component:"pcm-app-chat-modal",title:"消息发送失败"});this.messages=[...this.messages,{...a,answer:"抱歉,发生了错误,请稍后再试。",error:e,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];this.currentQuestionNumber++;if(this.isTaskCompleted){return}if(e&&e.answer){const t=i||e.answer;if(t&&this.enableTTS){const e=await c(t);if(this.enableVoice){await this.playAudio(e);if(this.interviewMode==="video"){this.startWaitingToRecord()}}else{this.audioUrl=e}}else if(this.interviewMode==="video"){this.startWaitingToRecord()}}}})}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:o,clientHeight:i}=e;const n=o-t-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){if(!this.shouldAutoScroll)return;const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await d({url:`/sdk/v1/chat/conversation`,method:"GET",data:{conversation_id:this.conversationId}});if(t.success&&t.data&&t.data.run_status=="结束"){e=true}const o=await d({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:this.botId,limit:20}});if(o.success&&o.data){const e=o.data.data||[];const t=e.map((e=>{const t=new Date(parseInt(e.created_at)*1e3);const o=t.getHours().toString().padStart(2,"0");const i=t.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;return{id:e.id,conversation_id:e.conversation_id,parent_message_id:e.parent_message_id||"00000000-0000-0000-0000-000000000000",inputs:e.inputs||{},query:e.query||"",answer:e.answer||"",message_files:e.message_files||[],feedback:e.feedback||{},retriever_resources:e.retriever_resources||[],created_at:e.created_at,agent_thoughts:e.agent_thoughts||[],status:e.status||"normal",error:e.error,time:n,isStreaming:false}}));this.messages=t}}catch(e){console.error("加载历史消息或会话状态失败:",e);w.captureError(e,{action:"loadHistoryMessages",component:"pcm-app-chat-modal",title:"加载历史消息失败"});x.emitError({error:e,message:"加载历史消息失败,请刷新重试"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableTTS){const t=await c(e.answer);if(this.enableVoice){await this.playAudio(t);if(this.interviewMode==="video"){this.startWaitingToRecord()}}else{this.audioUrl=t}}else if(!this.enableTTS&&this.interviewMode==="video"){this.startWaitingToRecord()}}else if(e){this.isTaskCompleted=true}}),200)}}startWaitingToRecord(){if(this.interviewMode!=="video"){return}if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=10;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.deviceError=null;this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let o;try{o=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{o=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{o=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=o;const i=[];o.ondataavailable=e=>{if(e.data.size>0){i.push(e.data)}};o.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};o.onstop=()=>{try{const e=t||"video/mp4";const o=new Blob(i,{type:e});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;w.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;w.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);let t="设备访问失败";if(e.name==="NotAllowedError"){t="请允许访问摄像头和麦克风权限"}else if(e.name==="NotFoundError"){t="未检测到摄像头或麦克风设备"}else if(e.name==="NotReadableError"){t="设备正在被其他应用程序使用"}else if(e.name==="OverconstrainedError"){t="摄像头不支持指定的配置"}else{t="无法访问摄像头或麦克风,请检查设备连接"}this.deviceError=t;this.showRecordingUI=false;x.emitError({error:e,message:t});w.captureError(e,{action:"startRecording",component:"pcm-app-chat-modal",title:t})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);w.captureError(e,{action:"setupVideoPreview",component:"pcm-app-chat-modal",title:"视频播放失败"});x.emitError({error:e,message:"视频播放失败"})}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(e);t.src=o;t.onended=()=>{URL.revokeObjectURL(o)}}catch(e){console.error("创建对象URL失败:",e);w.captureError(e,{action:"setupVideoPreview",component:"pcm-app-chat-modal",title:"创建对象URL失败"});x.emitError({error:e,message:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async convertAudioToText(e){try{const t=await d({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:e}});if(t.success&&t.data&&t.data.text){return t.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(e){console.error("音频转文字错误:",e);w.captureError(e,{action:"convertAudioToText",component:"pcm-app-chat-modal",title:"音频转文字错误"});x.emitError({error:e,message:"音频转文字错误"});return null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const o=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const i=await h(o,{},{tags:["other"]});const n=await this.convertAudioToText(i.cos_key);this.sendMessageToAPI(n||"下一题",i.cos_key)}catch(e){console.error("视频上传或处理错误:",e);w.captureError(e,{action:"uploadRecordedVideo",component:"pcm-app-chat-modal",title:"视频上传或处理失败"});x.emitError({error:e,message:"视频上传或处理失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;x.emitError({error:"音频播放错误",message:"音频播放错误"});w.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;x.emitError({error:e,message:"音频播放失败"});w.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}this.stopRecording();this.stopAudioRecording()}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);if(this.interviewMode==="video"){this.startWaitingToRecord()}}};handleTextInputChange=e=>{const t=e.target;this.textAnswer=t.value};handleKeyDown=e=>{if(e.key==="Enter"){if(e.ctrlKey){const t=e.target;const o=t.selectionStart;const i=this.textAnswer.substring(0,o);const n=this.textAnswer.substring(o);this.textAnswer=i+"\n"+n;e.preventDefault();setTimeout((()=>{const e=o+1;t.setSelectionRange(e,e)}),0);return}else{e.preventDefault();if(this.textAnswer.trim()&&!this.isSubmittingText&&!this.isLoading&&!this.currentStreamingMessage&&!this.waitingToRecord&&!this.isPlayingAudio){this.submitTextAnswer()}}}};submitTextAnswer=async()=>{if(!this.textAnswer.trim()||this.isSubmittingText){return}this.isSubmittingText=true;try{const e=this.textAnswer;this.textAnswer="";await this.sendMessageToAPI(e)}catch(e){console.error("提交文本回答失败:",e);w.captureError(e,{action:"submitTextAnswer",component:"pcm-app-chat-modal",title:"提交文本回答失败"});x.emitError({error:e,message:"提交文本回答失败"})}finally{this.isSubmittingText=false}};handleVoiceInputClick=()=>{if(this.isRecordingAudio){this.stopAudioRecording()}else{navigator.mediaDevices.getUserMedia({audio:true}).then((e=>{this.startRecordingWithStream(e)})).catch((e=>{console.error("麦克风权限请求失败:",e);w.captureError(e,{action:"handleVoiceInputClick",component:"pcm-app-chat-modal",title:"麦克风权限请求失败"});x.emitError({error:e,message:"麦克风权限请求失败"})}))}};startRecordingWithStream(e){try{const t=this.getSupportedAudioMimeType();let o;try{o=new MediaRecorder(e,{mimeType:t})}catch(t){console.warn("指定的音频MIME类型不受支持,使用默认设置:",t);try{o=new MediaRecorder(e)}catch(t){e.getTracks().forEach((e=>e.stop()));console.error("无法创建音频录制器:",t);w.captureError(t,{action:"startRecordingWithStream",component:"pcm-app-chat-modal",title:"无法创建音频录制器"});x.emitError({error:t,message:"无法创建音频录制器"});return}}this.audioRecorder=o;this.audioChunks=[];this.isRecordingAudio=true;this.audioRecordingStartTime=Date.now();this.audioRecordingTimeLeft=this.maxAudioRecordingTime;o.ondataavailable=e=>{if(e.data.size>0){this.audioChunks.push(e.data)}};o.onstop=()=>{e.getTracks().forEach((e=>e.stop()));this.processAudioRecording()};o.start(100);this.audioRecordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.audioRecordingStartTime)/1e3);this.audioRecordingTimeLeft=Math.max(0,this.maxAudioRecordingTime-e);if(this.audioRecordingTimeLeft<=0){this.stopAudioRecording()}}),1e3)}catch(t){e.getTracks().forEach((e=>e.stop()));console.error("开始录音失败:",t);w.captureError(t,{action:"startRecordingWithStream",component:"pcm-app-chat-modal",title:"开始录音失败"});x.emitError({error:t,message:"开始录音失败,请确保麦克风设备正常工作"})}}async processAudioRecording(){if(this.audioChunks.length===0){console.warn("没有录制到音频数据");return}try{this.isConvertingAudio=true;const e=this.getSupportedAudioMimeType()||"audio/webm";const t=new Blob(this.audioChunks,{type:e});if(t.size===0){console.warn("录制的音频为空");this.isConvertingAudio=false;return}const o=e.includes("webm")?"webm":"mp3";const i=`audio_input.${o}`;const n=new File([t],i,{type:e});const r=await h(n,{},{tags:["audio"]});const s=await this.convertAudioToText(r.cos_key);if(s){const e=this.hostElement.shadowRoot?.querySelector(".text-answer-input");const t=e?.selectionStart||this.textAnswer.length;const o=this.textAnswer.substring(0,t);const i=this.textAnswer.substring(t);const n=o.length>0&&!o.endsWith(" ")?" ":"";this.textAnswer=o+n+s+i;setTimeout((()=>{if(e){const o=t+n.length+s.length;e.focus();e.setSelectionRange(o,o)}}),0)}else{console.warn("未能识别语音内容");alert("未能识别语音内容,请重试或直接输入文字")}}catch(e){console.error("处理音频录制失败:",e);w.captureError(e,{action:"processAudioRecording",component:"pcm-app-chat-modal",title:"处理音频录制失败"});x.emitError({error:e,message:"语音识别失败,请重试"})}finally{this.isConvertingAudio=false;this.audioChunks=[]}}getSupportedAudioMimeType(){const e=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查音频MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""}stopAudioRecording(){if(this.audioRecorder&&this.isRecordingAudio){this.audioRecorder.stop();this.isRecordingAudio=false;if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}}}handleHistoryClick=()=>{this.isHistoryDrawerOpen=true;this.loadHistoryConversations()};async loadHistoryConversations(){if(!this.botId){console.warn("没有提供botId,无法获取历史会话");return}this.isLoadingConversations=true;try{const e=await d({url:"/sdk/v1/chat/conversations",method:"GET",data:{bot_id:this.botId,limit:50,page:1}});if(e.success&&e.data){const t=e.data.data||[];this.historyConversations=t.map((e=>{let t;let o="未知时间";try{const i=typeof e.created_at==="string"?parseInt(e.created_at):e.created_at;if(isNaN(i)||i<=0){console.warn("无效的时间戳:",e.created_at);t=new Date}else{t=new Date(i*1e3)}if(isNaN(t.getTime())){console.warn("无效的日期对象:",e.created_at);t=new Date}const n=new Date;const r=n.getTime()-t.getTime();const s=Math.floor(r/(1e3*60*60*24));if(s===0){o=`今天 ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}else if(s===1){o=`昨天 ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}else if(s>0&&s<7){const e=["周日","周一","周二","周三","周四","周五","周六"];o=`${e[t.getDay()]} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}else if(s<0){o=`${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}else{o=`${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}}catch(t){console.error("时间格式化错误:",t,e.created_at);o="时间解析失败"}return{id:e.id,name:e.name||"新会话",created_at:e.created_at,updated_at:e.updated_at,status:e.status,message_count:e.message_count||0,timeDisplay:o}}))}}catch(e){console.error("获取历史会话失败:",e);w.captureError(e,{action:"loadHistoryConversations",component:"pcm-app-chat-modal",title:"获取历史会话失败"});x.emitError({error:e,message:"获取历史会话失败"})}finally{this.isLoadingConversations=false}}handleSwitchConversation=e=>{if(e===this.conversationId){this.isHistoryDrawerOpen=false;return}this.conversationId=e;this.messages=[];this.currentStreamingMessage=null;this.isTaskCompleted=false;this.currentQuestionNumber=0;this.isHistoryDrawerOpen=false;this.loadHistoryMessages()};handleFilePreviewRequest=e=>{const{url:t,fileName:o,content:i,contentType:n}=e.detail;this.previewFileName=o||"内容预览";this.previewContentType=n;this.previewUrl=t;this.previewContent=i||"";this.isDrawerOpen=true};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=()=>i("div",{class:"video-preview"},i("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),i("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},i("span",{class:"recording-dot"}),i("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const r=()=>{if(this.deviceError){return i("div",{class:"placeholder-status error-status"},i("p",null,this.deviceError),i("div",{class:"error-suggestions"},i("p",null,"请尝试以下解决方案:"),i("ul",null,i("li",null,"更换有摄像头和麦克风的设备"),i("li",null,"确保已允许浏览器访问摄像头和麦克风"),i("li",null,"关闭其他正在使用摄像头/麦克风的应用"))))}if(this.isTaskCompleted){return i("div",{class:"placeholder-status"},i("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return i("div",{class:"placeholder-status"},i("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return i("div",{class:"placeholder-status"},i("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return i("div",{class:"placeholder-status"},i("p",null,"请等待题目..."))}if(this.waitingToRecord){return i("div",{class:"placeholder-status"},i("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return i("div",{class:"placeholder-status default-status"},i("p",null,"准备中..."))};const s=()=>i("div",{class:"text-input-area"},i("textarea",{class:"text-answer-input",placeholder:this.isTaskCompleted?"会话已结束":"发消息",value:this.textAnswer,onInput:this.handleTextInputChange,onKeyDown:this.handleKeyDown,disabled:this.isTaskCompleted||this.isRecordingAudio||this.isConvertingAudio}),i("div",{class:"input-toolbar"},i("div",{class:"toolbar-actions"},i("button",{class:{"toolbar-button":true,recording:this.isRecordingAudio,converting:this.isConvertingAudio},title:this.isRecordingAudio?"点击停止录音":this.isConvertingAudio?"正在识别语音...":"语音输入",onClick:this.handleVoiceInputClick,disabled:this.isTaskCompleted||this.isConvertingAudio||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio},this.isRecordingAudio?i("div",null,i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}),i("circle",{cx:"12",cy:"11",r:"4",fill:"red"}))):this.isConvertingAudio?i("div",{class:"converting-indicator"},i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}))):i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})))),i("div",{class:{"send-button":true,disabled:this.isTaskCompleted||!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio||this.isRecordingAudio||this.isConvertingAudio},onClick:()=>{if(this.isTaskCompleted||!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio||this.isRecordingAudio||this.isConvertingAudio){return}this.submitTextAnswer()}},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/i_send.png",alt:"发送"}))));const a=this.assistantAvatar||this.agentLogo;return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),i("div",{class:"chat-container"},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((e=>i("div",{id:`message_${e.id}`,key:e.id},i("pcm-chat-message",{botId:this.botId,message:e,userAvatar:this.userAvatar,assistantAvatar:a,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,filePreviewMode:this.filePreviewMode,onFilePreviewRequest:this.handleFilePreviewRequest,onMessageChange:t=>{const o=this.messages.map((o=>o.id===e.id?{...o,...t.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{botId:this.botId,message:this.currentStreamingMessage,userAvatar:this.userAvatar,assistantAvatar:a,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,filePreviewMode:this.filePreviewMode,onFilePreviewRequest:this.handleFilePreviewRequest})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},i("p",null,"正在准备面试...")))),i("div",{class:"recording-section"},i("div",{class:"recording-container"},this.showWorkspaceHistory&&i("div",{class:"workspace-section"},i("div",{class:"workspace-toolbar"},i("button",{class:"workspace-button history-button",onClick:()=>this.handleHistoryClick()},i("span",null,"历史会话")))),this.interviewMode==="text"&&s(),this.interviewMode==="video"&&i("div",{class:"video-container"},i("div",{class:"video-area"},this.showRecordingUI?n():i("div",{class:"video-preview placeholder"},r())),i("div",{class:"recording-controls"},this.showRecordingUI?i("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):i("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return i("div",{class:"play-audio-container",onClick:this.handlePlayAudio},i("p",null,i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},i("path",{d:"M8 5v14l11-7z"})),i("span",{style:{verticalAlign:"middle"}},"播放题目")))}return i("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))),i("pcm-drawer",{isOpen:this.isDrawerOpen,drawerTitle:this.previewFileName,width:"80%",onClosed:()=>{this.isDrawerOpen=false;this.previewUrl="";this.previewContent=""}},this.previewContentType==="file"&&this.previewUrl&&i("div",{class:"file-preview-container"},i("iframe",{src:this.previewUrl,frameborder:"0",width:"100%",height:"100%",style:{border:"none",height:"calc(100vh - 120px)"}})),this.previewContentType==="markdown"&&this.previewContent&&i("div",{class:"markdown-preview-container markdown-body",innerHTML:te(this.previewContent)}),this.previewContentType==="text"&&this.previewContent&&i("div",{class:"text-preview-container"},i("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word"}},this.previewContent))),i("pcm-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},i("div",{class:"history-drawer-content"},i("div",{class:"conversation-list"},this.isLoadingConversations?i("div",{class:"loading-conversations"},i("div",{class:"loading-spinner-small"}),i("p",null,"加载中...")):this.historyConversations.length===0?i("div",{class:"empty-conversations"},i("p",null,"暂无历史会话")):this.historyConversations.map((e=>i("div",{key:e.id,class:{"conversation-item":true,active:e.id===this.conversationId},onClick:()=>this.handleSwitchConversation(e.id)},i("div",{class:"conversation-info"},i("div",{class:"conversation-title"},e.name),i("div",{class:"conversation-meta"},i("span",{class:"conversation-time"},e.timeDisplay),e.message_count>0&&i("span",{class:"message-count"},e.message_count,"条消息"),e.status&&i("span",{class:{"conversation-status":true,completed:e.status==="结束",running:e.status==="进行中"}},e.status))),e.id===this.conversationId&&i("div",{class:"current-indicator"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})))))))))))}static get watchers(){return{token:["handleTokenChange"]}}};ne.style=oe+ie;const re=":host{display:inline-block}.pcm-button{display:inline-flex;align-items:center;justify-content:center;font-weight:400;white-space:nowrap;text-align:center;background-image:none;border:1px solid transparent;cursor:pointer;transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);user-select:none;touch-action:manipulation;height:32px;padding:0 15px;font-size:14px;border-radius:4px;color:rgba(0, 0, 0, 0.85);background-color:white;border-color:#d9d9d9;outline:none}.pcm-button:hover{border-color:#40a9ff;color:#40a9ff}.pcm-button:active{border-color:#096dd9;color:#096dd9}.pcm-button-default{background-color:white;border-color:#d9d9d9;color:rgba(0, 0, 0, 0.85)}.pcm-button-primary{background-color:#1677FF;border-color:#1677FF;color:white}.pcm-button-primary:hover{background-color:#40a9ff;border-color:#40a9ff;color:white}.pcm-button-primary:active{background-color:#096dd9;border-color:#096dd9;color:white}.pcm-button-dashed{background-color:white;border-color:#d9d9d9;border-style:dashed}.pcm-button-text{background-color:transparent;border-color:transparent;color:rgba(0, 0, 0, 0.85);box-shadow:none}.pcm-button-text:hover{background-color:rgba(0, 0, 0, 0.05);border-color:transparent;color:rgba(0, 0, 0, 0.85)}.pcm-button-link{background-color:transparent;border-color:transparent;color:#1677FF;box-shadow:none}.pcm-button-link:hover{color:#40a9ff;background-color:transparent;border-color:transparent}.pcm-button-large{height:40px;padding:0 20px;font-size:16px}.pcm-button-small{height:24px;padding:0 7px;font-size:12px}.pcm-button-circle{min-width:32px;padding:0;border-radius:50%}.pcm-button-large.pcm-button-circle{min-width:40px}.pcm-button-small.pcm-button-circle{min-width:24px}.pcm-button-round{border-radius:40px}.pcm-button-loading{opacity:0.65;cursor:default}.loading-icon{width:14px;height:14px;margin-right:8px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:loading-spin 1s infinite linear;display:inline-block}@keyframes loading-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.pcm-button-disabled{cursor:not-allowed;opacity:0.65}.pcm-button-disabled:hover,.pcm-button-disabled:active{color:rgba(0, 0, 0, 0.25);background-color:#f5f5f5;border-color:#d9d9d9}.pcm-button-primary.pcm-button-disabled:hover,.pcm-button-primary.pcm-button-disabled:active{background-color:#1677FF;border-color:#1677FF;color:white}.button-icon{margin-right:8px;display:inline-flex;align-items:center}.button-icon img{width:16px;height:16px}.pcm-button-small .button-icon img{width:12px;height:12px}.pcm-button-large .button-icon img{width:18px;height:18px}.pcm-button-block{width:100%;display:flex}";const se=class{constructor(t){e(this,t)}type="default";size="middle";loading=false;disabled=false;icon="https://pub.pincaimao.com/static/common/i_pcm_logo.png";shape="default";backgroundColor="";textColor="";borderColor="";borderRadius=null;width="";block=false;borderStyle="solid";render(){const e={"pcm-button":true,[`pcm-button-${this.type}`]:true,[`pcm-button-${this.size}`]:true,[`pcm-button-${this.shape}`]:true,"pcm-button-loading":this.loading,"pcm-button-disabled":this.disabled,"pcm-button-block":this.block};const t={};if(this.backgroundColor){t["backgroundColor"]=this.backgroundColor}if(this.textColor){t["color"]=this.textColor}if(this.borderColor){t["borderColor"]=this.borderColor}if(this.borderRadius!==null){t["borderRadius"]=`${this.borderRadius}px`}if(this.width){t["width"]=this.width}if(this.borderStyle){t["borderStyle"]=this.borderStyle}return i("button",{key:"370d4d7a0676a5d6abdeec7c14b3d15ba3ce9410",class:Object.keys(e).filter((t=>e[t])).join(" "),style:t,disabled:this.disabled,type:"button"},this.loading&&i("span",{key:"c9624a3e95ffb9a325fd3b606689b9176e82930c",class:"loading-icon"}),this.icon&&!this.loading&&i("span",{key:"d2061865c930901f83b0ffc2adc535c13a8c6220",class:"button-icon"},i("img",{key:"63a726785f5ffe74283915bd69b26a8552c1a593",src:this.icon,alt:""})),i("slot",{key:"e57fecba739bce61f48ffc18c052a5b5923e63d5"}))}};se.style=re;const ae=":host{display:block}.loading-container,.error-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;width:100%;color:#86909C;font-size:14px;text-align:center}.loading-spinner{width:32px;height:32px;border:3px solid #f3f3f3;border-top:3px solid #1677FF;border-radius:50%;margin-bottom:12px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.error-icon{width:32px;height:32px;background-color:#FFF0F0;color:#F53F3F;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:bold;margin-bottom:12px}.error-message{color:#86909C;max-width:80%}.card-container{border-radius:8px;padding:16px;cursor:pointer;transition:all 0.2s ease;display:flex;flex-direction:column;background-color:#ffffff;border:1px solid #E5E6EB;position:relative;height:100%;min-width:300px}.card-container:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0, 21, 41, 0.08)}.card-header{display:flex;width:100%;padding-bottom:16px;gap:12px}.card-icon{width:64px;height:64px;margin-right:12px;flex-shrink:0;overflow:hidden;border-radius:2px;background-color:#f8f9fa}.card-icon img{width:100%;height:100%;object-fit:contain}.card-info{flex:1;display:flex;flex-direction:column;overflow:hidden}.title-row{display:flex;align-items:center}.title-wrapper{flex:1;margin-right:8px;overflow:hidden}.card-title{font-size:18px;font-weight:700;color:#1D2129;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%}.chat-tag{display:flex;align-items:center;justify-content:center;height:24px;padding:0 8px;background-color:#F2F7E8;color:#56961F;font-size:12px;border-radius:4px;font-weight:500;flex-shrink:0}.author-row{display:flex;align-items:center;margin-top:8px}.author-avatar{width:16px;height:16px;border-radius:50%;margin-right:4px;background-color:#f8f9fa;overflow:hidden}.author-name{font-size:12px;color:#86909C}.card-description{font-size:12px;color:#86909C;margin-top:8px;line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:pre-line;word-break:break-word}.card-footer{padding-top:16px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #E5E6EB}.stats-container{display:flex;align-items:center;flex:1}.stat-item{display:flex;align-items:center;margin-right:8px;color:#86909C}.stat-icon{width:16px;height:16px;margin-right:4px;background-repeat:no-repeat;background-position:center;background-size:contain}.user-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath d='M12 14c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6Zm0-10C9.8 4 8 5.8 8 8s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4Z' fill='currentColor'%3E%3C/path%3E%3Cpath d='M21.9 20.6c-.1-.2-2.3-5.6-9.9-5.6-7.6 0-9.8 5.4-9.9 5.6-.2.5 0 1.1.6 1.3.5.2 1.1 0 1.3-.5 0-.2 1.8-4.4 8-4.4s8 4.2 8.1 4.4c.2.5.8.8 1.3.5.5-.2.7-.8.5-1.3Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.star-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5.03 9.57 9.1c-.17.3-.46.5-.8.55l-4.3.79 3 3.46c.22.26.32.6.28.93l-.62 4.46 4.41-1.9c.3-.12.63-.12.92 0l4.4 1.9-.6-4.46c-.05-.34.05-.67.27-.93l3-3.46-4.3-.79a1.17 1.17 0 0 1-.8-.55L12 5.03Zm-1-2.46a1.16 1.16 0 0 1 2 0l3.03 5.07 5.51 1c.89.17 1.26 1.24.68 1.92l-3.8 4.4.77 5.71c.13.9-.78 1.6-1.61 1.23L12 19.5l-5.58 2.4a1.17 1.17 0 0 1-1.61-1.23l.78-5.7-3.8-4.4a1.17 1.17 0 0 1 .67-1.92l5.51-1L11 2.56Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.video-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 2a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H4Zm0 2h16v16H4V4Zm5.5 3.13A1 1 0 0 0 8 8v8a1 1 0 0 0 1.5.87l7-4a1 1 0 0 0 0-1.74l-7-4ZM13.98 12 10 14.28V9.72L13.98 12Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.stat-value{font-size:12px}.use-button{font-size:12px;color:#86909C;cursor:pointer;white-space:nowrap}.use-button:hover{color:#1677FF}@media screen and (max-width: 768px){.card-container{padding:12px}.card-header{gap:8px;padding-bottom:12px}.card-icon{width:48px;height:48px}.card-title{font-size:16px;line-height:20px}.card-description{font-size:12px;line-height:16px;height:48px}}";const le=class{constructor(o){e(this,o);this.tokenInvalid=t(this,"tokenInvalid")}token;cardTitle="";description="";iconUrl="";author="";authorAvatarUrl="";showChatTag=false;customChatTag="";useButtonText="立即使用";botId="";botData=null;loading=false;error="";tokenInvalid;tokenInvalidListener;watchBotIdHandler(e){if(e){this.fetchBotData()}}handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.token){n.setToken(this.token)}if(this.botId){this.fetchBotData()}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener)}async fetchBotData(){if(!this.botId)return;this.loading=true;this.error="";try{const e=await d({url:`/sdk/v1/agent/${this.botId}/info`,method:"GET"});if(e.success&&e.data){this.botData=e.data}else{throw new Error(e.message||"获取智能体信息失败")}}catch(e){this.error=e.message||"获取智能体信息失败";console.error("获取智能体信息失败:",e)}finally{this.loading=false}}render(){const e=this.cardTitle||(this.botData?.title||"");const t=this.description||(this.botData?.description||"");const o=this.botData?.icon||this.botData?.iconUrl||this.botData?.logo||"";const n=this.iconUrl||o;const r=this.author||(this.botData?.author_name||"");const s=this.authorAvatarUrl||(this.botData?.author_avatar||"");const a=this.customChatTag||(this.botData?.flag||"");const l=this.botData?.use_count||0;const d=this.botData?.follow_count||0;const c=this.botData?.view_count||0;return i("div",{key:"97827af60487bae41aeb80fcea46d8e2dd4b072a",class:"card-container"},this.loading?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("div",null,"加载中...")):this.error?i("div",{class:"error-container"},i("div",{class:"error-icon"},"!"),i("div",{class:"error-message"},this.error)):i("div",null,i("div",{class:"card-header"},n&&i("div",{class:"card-icon"},i("img",{src:n,alt:e})),i("div",{class:"card-info"},i("div",{class:"title-row"},i("div",{class:"title-wrapper"},i("div",{class:"card-title"},e)),this.showChatTag&&a&&i("div",{class:"chat-tag"},a)),r&&i("div",{class:"author-row"},s&&i("img",{class:"author-avatar",src:s,alt:r}),i("div",{class:"author-name"},r)),t&&i("div",{class:"card-description"},t))),i("div",{class:"card-footer"},i("div",{class:"stats-container"},i("div",{class:"stat-item"},i("span",{class:"stat-icon user-icon"}),i("div",{class:"stat-value"},l)),i("div",{class:"stat-item"},i("span",{class:"stat-icon star-icon"}),i("div",{class:"stat-value"},d)),i("div",{class:"stat-item"},i("span",{class:"stat-icon video-icon"}),i("div",{class:"stat-value"},c))),i("div",{class:"use-button"},this.useButtonText||"立即使用"))))}static get watchers(){return{botId:["watchBotIdHandler"],token:["handleTokenChange"]}}};le.style=ae;function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var ce;var he;function pe(){if(he)return ce;he=1;function e({interruptPatterns:e=[],skipEmptyRows:i=true}={}){return{extensions:[{name:"spanTable",level:"block",start(e){return e.match(/\n *([^\n ].*\|.*)\n/m)?.index},tokenizer(t,n){let r="^ *([^\\n ].*\\|.*\\n(?: *[^\\s].*\\n)*?)"+" {0,3}(?:\\| *)?(:?-+(?: *(?:100|[1-9][0-9]?%) *-+)?:? *(?:\\| *:?-+(?: *(?:100|[1-9][0-9]?%) *-+)?:? *)*)(?:\\| *)?"+"(?:\\n((?:(?! *\\n| {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})"+"(?:\\n+|$)| {0,3}#{1,6}(?:\\s|$)| {0,3}>| {4}[^\\n]| {0,3}(?:`{3,}"+"(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n| {0,3}(?:[*+-]|1[.)]) |"+"<\\/?(?:address|article|aside|base|basefont|blockquote|body"+"|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt"+"|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]"+"|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem"+"|meta|nav|noframes|ol|optgroup|option|p|param|section|source"+"|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)"+"(?: +|\\n|\\/?>)|<(?:script|pre|style|textarea|!--)endRegex).*(?:\\n|$))*)\\n*|$)";r=r.replace("endRegex",e.map((e=>`|(?:${e})`)).join(""));const s=/ *(?:100|[1-9][0-9]?%) */g;const a=new RegExp(r);const l=a.exec(t);if(l){const e={type:"spanTable",header:l[1].replace(/\n$/,"").split("\n"),align:l[2].replace(s,"").replace(/^ *|\| *$/g,"").split(/ *\| */),rows:l[3]?.trim()?l[3].replace(/\n[ \t]*$/,"").split("\n"):[],width:l[2].replace(/:/g,"").replace(/-+| /g,"").split("|")};e.header[0]=o(e.header[0]);const t=e.header[0].reduce(((e,t)=>e+t.colspan),0);if(t===e.align.length){e.raw=l[0];let n,r,s,a;let d=e.align.length;for(n=0;n<d;n++){if(/^ *-+: *$/.test(e.align[n])){e.align[n]="right"}else if(/^ *:-+: *$/.test(e.align[n])){e.align[n]="center"}else if(/^ *:-+ *$/.test(e.align[n])){e.align[n]="left"}else{e.align[n]=null}}d=e.header.length;for(n=1;n<d;n++){e.header[n]=o(e.header[n],t,e.header[n-1],i)}d=e.rows.length;for(n=0;n<d;n++){e.rows[n]=o(e.rows[n],t,e.rows[n-1],i)}d=e.header.length;for(r=0;r<d;r++){a=e.header[r];for(s=0;s<a.length;s++){a[s].tokens=[];this.lexer.inline(a[s].text,a[s].tokens)}}d=e.rows.length;for(r=0;r<d;r++){a=e.rows[r];for(s=0;s<a.length;s++){a[s].tokens=[];this.lexer.inline(a[s].text,a[s].tokens)}}return e}}},renderer(e){let o,i,n,r,s,a;let l="<table>";l+="<thead>";for(o=0;o<e.header.length;o++){n=e.header[o];let s=0;l+="<tr>";for(i=0;i<n.length;i++){r=n[i];a=this.parser.parseInline(r.tokens);l+=t(a,r,"th",e.align[s],e.width[s]);s+=r.colspan}l+="</tr>"}l+="</thead>";if(e.rows.length){l+="<tbody>";for(o=0;o<e.rows.length;o++){n=e.rows[o];s=0;if(!n[0].emptyRow){l+="<tr>";for(i=0;i<n.length;i++){r=n[i];a=this.parser.parseInline(r.tokens);l+=t(a,r,"td",e.align[s],e.width[s]);s+=r.colspan}l+="</tr>"}}l+="</tbody>"}l+="</table>";return l}}]}}const t=(e,t,o,i,n)=>{if(!t.rowspan){return""}const r=`<${o}`+`${t.colspan>1?` colspan=${t.colspan}`:""}`+`${t.rowspan>1?` rowspan=${t.rowspan}`:""}`+`${i?` align=${i}`:""}`+`${n?` width=${n}`:""}>`;return`${r+e}</${o}>\n`};const o=(e,t,o=[],i)=>{const n=[...e.trim().matchAll(/(?:[^|\\]|\\.?)+(?:\|+|$)/g)].map((e=>e[0]));if(!n[0]?.trim()){n.shift()}if(!n[n.length-1]?.trim()){n.pop()}let r=0;let s,a,l,d,c;for(s=0;s<n.length;s++){l=n[s].split(/\|+$/)[0];n[s]={rowspan:1,colspan:Math.max(n[s].length-l.length,1),text:l.trim().replace(/\\\|/g,"|")};if(l.slice(-1)==="^"&&o.length){c=0;for(a=0;a<o.length;a++){d=o[a];if(c===r&&d.colspan===n[s].colspan){n[s].rowSpanTarget=d.rowSpanTarget??d;n[s].rowSpanTarget.text+=` ${n[s].text.slice(0,-1)}`;n[s].rowSpanTarget.rowspan+=1;n[s].rowspan=0;break}c+=d.colspan;if(c>r){break}}}r+=n[s].colspan}if(n.length>0&&i&&n.length===n.filter((e=>e.rowspan===0)).length){n[0].emptyRow=true;for(s=0;s<n.length;s++){n[s].rowSpanTarget.rowspan-=1}}if(r>t){n.splice(t)}else{while(r<t){n.push({rowspan:1,colspan:1,text:""});r+=1}}return n};ce=e;return ce}var ue=pe();var fe=de(ue);const me='.markdown-body{--base-size-4:4px;--base-size-8:8px;--base-size-16:16px;--base-size-24:24px;--base-size-40:40px;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}';const ge=":host{display:block;width:100%}.message-round{margin-bottom:16px;width:100%}.user-message-container{display:flex;flex-direction:row-reverse;align-items:flex-start;margin-bottom:15px;position:relative}.assistant-message-container{display:flex;flex-direction:row;align-items:flex-start;margin-bottom:15px;position:relative}.message-bubble{max-width:85%;position:relative}.user-message{padding:5px 10px;background:#f5f7ff;font-size:14px;color:#1F2328;border-radius:6px;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.1)}.assistant-message{padding:15px 10px;background-color:#fff;border-radius:6px;font-size:14px;color:#1F2328;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.05)}.message-time{font-size:12px;color:#999;margin-top:4px}.user-message-container .message-time{color:rgba(255, 255, 255, 0.7)}.loading-dots{display:flex;align-items:center;padding:12px 16px;background-color:#f0f0f0;border-radius:18px;border-top-left-radius:4px}.loading-dots span{width:8px;height:8px;margin:0 3px;background-color:#999;border-radius:50%;display:inline-block;animation:dot-pulse 1.5s infinite ease-in-out}.loading-dots span:nth-child(2){animation-delay:0.2s}.loading-dots span:nth-child(3){animation-delay:0.4s}@keyframes dot-pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.2);opacity:1}}.file-view{margin-top:8px;padding:12px;background-color:#f8f9fa;border:1px solid #e9ecef;border-radius:6px;font-size:14px;word-break:break-all;color:#2c3e50;line-height:1.5;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.input-view{margin-top:8px;margin-bottom:10px;padding-bottom:10px;border:1px solid #e9ecef;border-radius:6px;overflow:hidden;background-color:#ffffff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.input-label-container{display:flex;align-items:center;margin-bottom:4px;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.copy-input-button{background:transparent;border:none;cursor:pointer;padding:2px;display:flex;align-items:center;justify-content:center;color:#8c8c8c;opacity:0.7;transition:opacity 0.2s ease;margin-left:5px}.copy-input-button:hover{opacity:1;color:#1677ff}.input-label{font-size:13px;font-weight:600;color:#495057}.input-value{padding:12px 12px 0px;font-size:14px;line-height:1.5;color:#2c3e50;background-color:#ffffff;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.input-metadata{font-size:13px;margin-top:8px}.message-actions{display:flex;align-items:center;gap:8px;transition:opacity 0.2s ease;margin-top:15px}.action-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d9d9d9;border-radius:6px;padding:4px 15px;font-size:14px;height:32px;background-color:white;cursor:pointer;color:rgba(0, 0, 0, 0.88);transition:all 0.2s}.action-button:hover{color:#1677ff;border-color:#1677ff}.action-button.primary{color:#1677ff;border-color:#1677ff}.action-button.primary:hover{color:#4096ff;border-color:#4096ff}.action-button.icon-only{padding:4px 8px;margin-right:9px}.button-icon{margin-right:8px;display:flex;align-items:center;justify-content:center}.icon-only .button-icon{margin-right:0}.file-list{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px}.file-item{display:flex;flex-direction:column;align-items:center;width:80px;cursor:pointer;padding:8px;border-radius:4px;transition:background-color 0.3s;margin:5px 10px}.file-item:hover{background-color:rgba(0, 0, 0, 0.04)}.file-icon{margin-bottom:4px}.file-name{font-size:12px;text-align:center;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8B4513}.action-button.active{color:#1677ff;background-color:rgba(22, 119, 255, 0.1)}.action-button.active .button-icon svg{stroke:#1677ff}.inputs-container{margin-top:8px;display:flex;flex-direction:column;gap:8px}.file-list{display:flex;flex-direction:column;gap:8px}.file-item{display:flex;align-items:center;padding:8px 12px;background-color:#f5f5f5;border-radius:6px;cursor:pointer;transition:background-color 0.2s}.file-item:hover{background-color:#e8e8e8}.file-icon{margin-right:8px}.file-name{font-size:14px;color:#333;word-break:break-word}.input-view{background-color:#f9f9f9;border-radius:8px;padding:12px;border:1px solid #e8e8e8}.input-label-container{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.input-label{font-weight:500;color:#333}.input-value{color:#666;line-height:1.5;word-break:break-word;max-height:200px;overflow-y:auto}.copy-input-button{background:none;border:none;cursor:pointer;color:#1677ff;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.copy-input-button:hover{background-color:rgba(22, 119, 255, 0.1)}.input-metadata{font-size:14px;color:#666;padding:4px 0}.file-card{display:flex;align-items:center;padding:12px;background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 200px 100px no-repeat, #fff;border-radius:8px;cursor:pointer;transition:background-color 0.2s;border:1px solid #e8e8e8;margin-top:8px}.file-card:hover{background-color:#f0f0f0}.file-card-icon{margin-right:12px;flex-shrink:0;border-radius:12px;background:#0d75fb;width:48px;height:48px;display:flex;align-items:center;justify-content:center}.file-card-icon img{width:40px;height:40px}.file-card-content{display:flex;flex-direction:column;flex:1;min-width:0}.file-card-type{font-size:14px;color:#8c8c8c;margin-bottom:4px}.file-card-name{font-size:16px;font-weight:500;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.copy-card-button{background:none;border:none;cursor:pointer;color:#8c8c8c;padding:8px;border-radius:4px;display:flex;align-items:center;justify-content:center;margin-left:8px;transition:color 0.2s}.copy-card-button:hover{color:#1677ff}.avatar{width:32px;height:32px;border-radius:50%;overflow:hidden;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover}.user-avatar{margin-left:8px}.assistant-avatar{margin-right:8px}.retry-button{background-color:#ff6b35 !important;color:white !important;border:none !important}.retry-button:hover{background-color:#e55a2b !important}.retry-button .button-icon{margin-right:4px}.video-inputs-container{display:flex;flex-direction:column;align-items:end}.video-container{margin-top:0px;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);background-color:#000;width:250px;height:auto;max-height:250px;transition:transform 0.2s ease, box-shadow 0.2s ease}.video-container:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.15)}.video-container video{display:block;width:100%;max-width:500px;height:auto;border-radius:8px}.video-container video:focus{outline:none}.video-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;background-color:#f8f9fa;border-radius:8px;color:#666;font-size:14px}.loading-spinner{width:24px;height:24px;border:2px solid #e9ecef;border-top:2px solid #1677ff;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:12px}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@media (max-width: 768px){.video-container{width:100%;max-width:300px}}";const be=class{message;showFeedbackButtons=true;botId;messageChange;get hostElement(){return o(this)}feedbackStatus=null;videoUrls={};userAvatar;assistantAvatar;showCopyButton=true;filePreviewMode="window";filePreviewRequest;retryRequest;constructor(o){e(this,o);this.messageChange=t(this,"messageChange");this.filePreviewRequest=t(this,"filePreviewRequest");this.retryRequest=t(this,"retryRequest");te.use(fe);te.setOptions({breaks:true,gfm:true})}componentWillLoad(){if(this.message&&this.message.feedback){this.feedbackStatus=this.message.feedback.rating}}copyMessageContent(){if(this.message.answer){navigator.clipboard.writeText(this.message.answer).then((()=>{alert("内容已复制到剪贴板")})).catch((e=>{x.emitError({error:e,message:"复制内容失败"});console.error("复制失败:",e)}))}}renderUserMessage(){if(!this.message?.query?.trim())return null;const e=this.message.query?te(this.message.query):"";return i("div",{class:{"user-message-container":true}},this.userAvatar&&i("div",{class:"avatar user-avatar"},i("img",{src:this.userAvatar,alt:"用户头像"})),i("div",{class:"message-bubble user-message"},i("div",{innerHTML:e}),this.renderInputs()))}renderAssistantMessage(){if(!this.message.answer&&!this.message.isStreaming)return null;const e=this.message.isStreaming&&!this.message.answer;const t=this.message.answer?te(this.message.answer):"";return i("div",{class:{"assistant-message-container":true}},this.assistantAvatar&&i("div",{class:"avatar assistant-avatar"},i("img",{src:this.assistantAvatar,alt:"助手头像"})),i("div",{class:"message-bubble "},i("div",{class:"assistant-message"},i("div",{class:"markdown-content markdown-body",innerHTML:e?`请稍等...`:t})),!e&&this.message.answer&&!this.message.isStreaming&&i("div",{class:"message-actions"},this.message.showRetryButton&&i("button",{class:"action-button retry-button",onClick:()=>this.handleRetry(),title:"重试"},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("polyline",{points:"23 4 23 10 17 10"}),i("polyline",{points:"1 20 1 14 7 14"}),i("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"}))),"重试"),this.showCopyButton&&i("button",{class:"action-button",onClick:()=>this.copyMessageContent(),title:"复制内容"},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),"复制"),this.showFeedbackButtons&&i(i.Fragment,null,i("button",{class:`action-button icon-only ${this.feedbackStatus==="like"?"active":""}`,title:"赞",onClick:()=>this.handleLike()},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})))),i("button",{class:`action-button icon-only ${this.feedbackStatus==="dislike"?"active":""}`,title:"踩",onClick:()=>this.handleDislike()},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"}))))))))}getFileName(e){const t=e.split("/");return t[t.length-1]}handleContentClick(e,t,o="text"){this.filePreviewRequest.emit({fileName:e,content:t,contentType:o})}async loadVideoUrl(e){if(this.videoUrls[e]){return}const t=await p(e);if(t){this.videoUrls={...this.videoUrls,[e]:t}}}async handleFileClick(e,t){const o=await u(e);if(o){if(this.filePreviewMode==="drawer"){this.filePreviewRequest.emit({url:o,fileName:t,contentType:"file"})}else{window.open(o,"_blank")}}else{console.error("无法获取预览URL");w.captureError("无法获取预览URL",{action:"handleFileClick",component:"pcm-chat-message",title:"无法获取预览URL"});x.emitError({error:"无法获取预览URL",message:"无法获取预览URL"})}}renderFileItem(e,t,o){return i("div",{key:o,class:"file-card",onClick:()=>this.handleFileClick(t,e)},i("div",{class:"file-card-icon",style:{background:"linear-gradient(45deg, #ff5600, #ff8344)"}},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_file.png"})),i("div",{class:"file-card-content"},i("div",{class:"file-card-type"},"[附件信息]"),i("div",{class:"file-card-name"},e)))}renderInputs(){if(!this.message.inputs)return null;const e=Object.keys(this.message.inputs).some((e=>{const t=this.message.inputs[e];return t!==null&&t!==undefined&&t!==""&&!e.startsWith("hide_")&&e!=="answer"}));if(!e)return null;return i("div",{class:"inputs-container"},Object.keys(this.message.inputs).map(((e,t)=>{const o=this.message.inputs[e];if(o&&!e.startsWith("hide_")&&e!=="answer"){if(e==="video_url"){const e=o;const n=this.videoUrls[e];if(!n){this.loadVideoUrl(e)}return i("div",{class:"video-inputs-container"},i("div",{key:t,class:"video-container"},n?i("video",{key:e,controls:true,preload:"metadata",onLoadedMetaData:e=>{const t=e.target;t.currentTime=.01},controlsList:"nodownload",style:{width:"250px",height:"auto",maxHeight:"250px",borderRadius:"8px",marginTop:"8px"}},i("source",{src:n,type:"video/webm"}),i("source",{src:n,type:"video/mp4"}),i("source",{src:n,type:"video/ogg"}),"您的浏览器不支持视频播放。"):i("div",{class:"video-loading"},i("div",{class:"loading-spinner"}),i("span",null,"正在加载视频..."))))}else if(e==="file_url"){const e=this.message.inputs.file_name||this.getFileName(o);return this.renderFileItem(e,o,t)}else if(e==="file_urls"){const e=typeof o==="string"?o.split(","):[o.toString()];const n=this.message.inputs.file_names?typeof this.message.inputs.file_names==="string"?this.message.inputs.file_names.split(","):[this.message.inputs.file_names.toString()]:[];return i("div",{key:t},e.map(((e,t)=>{const o=n[t]||this.getFileName(e);return this.renderFileItem(o,e,t)})))}else if(e==="job_info"||e==="rule"){const n=e==="job_info"?"职位信息":"评估规则";const r=typeof o==="string"?o:JSON.stringify(o,null,2);return i("div",{key:t,class:"file-card",onClick:()=>this.handleContentClick(n,r)},i("div",{class:"file-card-icon",style:{background:"#0d75fb"}},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_position.png"})),i("div",{class:"file-card-content"},i("div",{class:"file-card-type"},"[",n,"]"),i("div",{class:"file-card-name"},r.length>50?r.substring(0,50)+"...":r)))}else if(e==="input"){return i("div",{key:t,class:"input-metadata"},`${o}`)}}return null})))}async handleLike(){const e=this.feedbackStatus==="like"?null:"like";await this.submitFeedback(e)}async handleDislike(){const e=this.feedbackStatus==="dislike"?null:"dislike";await this.submitFeedback(e)}async submitFeedback(e){if(!this.message.id){console.error("消息ID不存在,无法提交反馈");w.captureError("消息ID不存在,无法提交反馈",{action:"submitFeedback",component:"pcm-chat-message",title:"无法提交反馈"});x.emitError({error:"消息ID不存在,无法提交反馈",message:"消息ID不存在,无法提交反馈"});return}try{const t=await d({url:`/sdk/v1/chat/messages/${this.message.id}/feedbacks`,method:"POST",data:{rating:e,bot_id:this.botId,content:""}});if(t.success){this.feedbackStatus=e;if(this.message&&this.message.feedback){this.message={...this.message,feedback:{...this.message.feedback,rating:e}}}}else{console.error("反馈提交失败:",t.message)}}catch(e){console.error("提交反馈时发生错误:",e);w.captureError(e,{action:"submitFeedback",component:"pcm-chat-message",title:"提交反馈失败"})}}handleRetry(){if(this.message.id){this.retryRequest.emit(this.message.id)}}render(){return i("div",{key:"c337dbb59e5236ac112554ec34da6355e63d806f",class:"message-round"},this.renderUserMessage(),this.renderAssistantMessage())}};be.style=me+ge;const xe=":host{display:block}.drawer-container{position:fixed;top:0;left:0;width:0;height:0;overflow:visible}.drawer-mask{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.45);opacity:0;visibility:hidden;transition:opacity 0.3s ease, visibility 0.3s ease}.mask-visible{opacity:1;visibility:visible}.drawer-content{position:fixed;top:0;right:0;bottom:0;display:flex;flex-direction:column;background-color:#fff;box-shadow:-2px 0 8px rgba(0, 0, 0, 0.15);transform:translateX(100%);transition:transform 0.3s cubic-bezier(0.23, 1, 0.32, 1)}.drawer-content-visible{transform:translateX(0)}.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;color:rgba(0, 0, 0, 0.85);border-bottom:1px solid #f0f0f0}.drawer-title{flex:1;margin:0;font-size:16px;line-height:22px;font-weight:500;color:rgba(0, 0, 0, 0.85);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-close{padding:0;background:transparent;border:none;outline:none;cursor:pointer;font-size:16px;color:rgba(0, 0, 0, 0.45);transition:color 0.3s}.drawer-close:hover{color:rgba(0, 0, 0, 0.85)}.drawer-body{flex:1;padding:24px;overflow:auto}@media (max-width: 768px){.drawer-content{width:100% !important}.drawer-header{padding:12px 16px}.drawer-body{padding:16px}}";const we=class{constructor(o){e(this,o);this.closed=t(this,"closed");this.afterOpen=t(this,"afterOpen");this.afterClose=t(this,"afterClose")}isOpen=false;drawerTitle="";width="378px";height="378px";closable=true;maskClosable=true;mask=true;closed;afterOpen;afterClose;get hostElement(){return o(this)}zIndex=1e3;bodyOverflowBeforeOpen="";transitionEndHandler;async open(){this.isOpen=true}async close(){this.isOpen=false}visibleChanged(e){if(e){this.bodyOverflowBeforeOpen=document.body.style.overflow;document.body.style.overflow="hidden";const e=this.hostElement.shadowRoot.querySelector(".drawer-content");if(e){this.transitionEndHandler=()=>{this.afterOpen.emit()};e.addEventListener("transitionend",this.transitionEndHandler,{once:true})}}else{document.body.style.overflow=this.bodyOverflowBeforeOpen;const e=this.hostElement.shadowRoot.querySelector(".drawer-content");if(e){this.transitionEndHandler=()=>{this.afterClose.emit()};e.addEventListener("transitionend",this.transitionEndHandler,{once:true})}}}componentWillLoad(){const e=r.getItem("modal-zIndex");if(e){this.zIndex=e}}disconnectedCallback(){if(this.isOpen){document.body.style.overflow=this.bodyOverflowBeforeOpen}const e=this.hostElement.shadowRoot?.querySelector(".drawer-content");if(e&&this.transitionEndHandler){e.removeEventListener("transitionend",this.transitionEndHandler)}}handleMaskClick=()=>{if(this.maskClosable){this.handleClose()}};handleClose=()=>{this.isOpen=false;this.closed.emit()};render(){const e={width:this.width,zIndex:`${this.zIndex+1}`};const t={zIndex:`${this.zIndex}`};return i("div",{key:"5ca0630697aaf594d75095a631163a19ed8e4a9b",class:{"drawer-container":true,"drawer-open":this.isOpen}},this.mask&&i("div",{key:"59e9f9f1d48dca079d76ff3ac4f3d4e2f7132bae",class:{"drawer-mask":true,"mask-visible":this.isOpen},style:t,onClick:this.handleMaskClick}),i("div",{key:"c9138ac3ff9139d2a199abba971481842eb78ee3",class:{"drawer-content":true,"drawer-content-visible":this.isOpen},style:e},i("div",{key:"fbcffe58c697b95b188609733afafc1531a87e5f",class:"drawer-header"},this.drawerTitle&&i("div",{key:"7f57ebafc446670961a05c0714a25f2650183e32",class:"drawer-title"},this.drawerTitle),this.closable&&i("button",{key:"9d6ec03e600639be9c44fd87da0687b1777d0d92",class:"drawer-close",onClick:this.handleClose},i("svg",{key:"8960f8ce5325339ed8c06b40043f19e17c45aa52",viewBox:"64 64 896 896",focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},i("path",{key:"0dede2ac0608601edde40bee26720ee938a8f7d9",d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})))),i("div",{key:"28d0ee3ededd2b7ee4b00747acc820227629f91d",class:"drawer-body"},i("slot",{key:"bbbd99d68c216d10afa4458fe9e4f384f17cb563"}))))}static get watchers(){return{isOpen:["visibleChanged"]}}};we.style=xe;const ye=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:16px;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}";const ke=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.someErrorEvent=t(this,"someErrorEvent");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(this,"tokenInvalid")}modalTitle="金牌HR大赛";token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;someErrorEvent;selectedFile=null;isUploading=false;uploadedFileInfo=[];aiException=false;defaultQuery="请开始出题";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=15;videoRef=null;totalQuestions=2;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;toEmail="";callbackUrl="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableVoice=true;enableAudio=true;displayContentStatus=true;isTaskCompleted=false;tokenInvalidListener;isUserScrolling=false;isPageFocused=true;isWindowVisible=true;visibilityChangeListener;blurListener;focusListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const e=!document.hidden;this.isWindowVisible=e;if(!e){w.captureMessage("用户失去焦点 - 页面隐藏",{action:"visibilityChange",component:"pcm-hr-chat-modal",type:"visibility_hidden",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})}};this.blurListener=()=>{this.isPageFocused=false;w.captureMessage("用户失去焦点 - 窗口失焦",{action:"windowBlur",component:"pcm-hr-chat-modal",type:"window_blur",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})};this.focusListener=()=>{this.isPageFocused=true};document.addEventListener("visibilitychange",this.visibilityChangeListener);window.addEventListener("blur",this.blurListener);window.addEventListener("focus",this.focusListener)}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};handleFileChange=async e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["resume"]});if(e){this.uploadedFileInfo=[{cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}]}}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();this.someErrorEvent.emit({error:e,message:"文件上传失败,请重试"});w.captureError(e,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async sendMessageToAPI(e){this.isLoading=true;let t="";let o="";const i=new Date;const n=`${i.getHours()}:${i.getMinutes().toString().padStart(2,"0")}`;const r=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const s=this.messages.length>0?this.messages[this.messages.length-1]:null;if(s&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,s.answer,r)}const a=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const d={id:`temp-${Date.now()}`,time:n,query:r,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=d;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(a){this.messages=[...this.messages,d];this.currentStreamingMessage=null;this.isLoading=false;this.currentQuestionNumber++;this.isTaskCompleted=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const h={response_mode:"streaming",conversation_id:this.conversationId,query:r,bot_id:"3022316191018880"};h.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.toEmail,callback_url:this.callbackUrl,display_content_status:this.displayContentStatus?"1":"0"};if(this.uploadedFileInfo.length>0){const e=this.uploadedFileInfo.map((e=>e.cos_key)).join(",");h.inputs.file_urls=e}await l({url:"/sdk/v1/chat/chat-messages",method:"POST",data:h,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){o=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("题号赋值")){this.currentQuestionNumber=e.data.process_data.questions_number-1}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const o={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=o;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:t=>{console.error("发生错误:",t);this.someErrorEvent.emit({error:t,message:"消息发送失败,请稍后再试"});w.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...d,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];if(!this.aiException){if(this.enableAudio&&e&&e.answer){const t=o||e.answer;if(t){const e=await c(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,o){try{await d({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:o}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});w.captureError(t,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:e,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:o,clientHeight:i}=e;const n=o-t-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await d({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const o=await d({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(o.success&&o.data){const e=o.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const o=t.getHours().toString().padStart(2,"0");const i=t.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;const{inputs:r,...s}=e;return{...s,time:n,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const i=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=i.length>0?i.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});w.captureError(e,{action:"loadHistoryMessages",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"加载历史消息失败"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableAudio){const t=await c(e.answer);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(e){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(e){if(e){await s(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=e=>{this.selectedJobCategory=e};handleDimensionSelect=e=>{if(this.selectedDimensions.includes(e)){this.selectedDimensions=this.selectedDimensions.filter((t=>t!==e))}else{this.selectedDimensions=[...this.selectedDimensions,e]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=15;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let o;try{o=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{o=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{o=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=o;const i=[];o.ondataavailable=e=>{if(e.data.size>0){i.push(e.data)}};o.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};o.onstop=()=>{try{const e=t||"video/mp4";const o=new Blob(i,{type:e});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;w.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;w.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:e});w.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);this.someErrorEvent.emit({error:e,message:"视频播放失败"});w.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(e);t.src=o;t.onended=()=>{URL.revokeObjectURL(o)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});w.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const o=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const i=await h(o,{},{tags:["other"]});if(i){await this.saveVideoAnswer(i.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});w.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(e){if(!this.conversationId)return;try{const t=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!t)return;await d({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:t.answer,file_url:e}})}catch(e){console.error("保存视频答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存视频答案失败"});w.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await d({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});w.captureError(e,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});w.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:e,message:"音频播放失败"});w.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording();if(this.visibilityChangeListener){document.removeEventListener("visibilitychange",this.visibilityChangeListener)}if(this.blurListener){window.removeEventListener("blur",this.blurListener)}if(this.focusListener){window.removeEventListener("focus",this.focusListener)}}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};handleRetryRequest=e=>{const t=this.messages.find((t=>t.id===e));if(t){this.aiException=false;const o=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=o;this.sendMessageToAPI(t.query)}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=()=>i("div",{class:"video-preview"},i("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),i("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},i("span",{class:"recording-dot"}),i("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const r=()=>{if(this.isTaskCompleted){return i("div",{class:"placeholder-status"},i("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return i("div",{class:"placeholder-status"},i("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return i("div",{class:"placeholder-status"},i("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return i("div",{class:"placeholder-status"},i("p",null,"请等待题目..."))}if(this.waitingToRecord){return i("div",{class:"placeholder-status"},i("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return i("div",{class:"placeholder-status default-status"},i("p",null,"准备中..."))};return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),this.showInitialUpload?i("div",{class:"initial-upload"},i("div",{class:"upload-section"},this.requireResume&&i(i.Fragment,null,i("h3",null,"开始前,请上传您的简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),i("div",{class:"category-select"},i("h3",null,"请选择您的职能类别(单选)"),i("div",{class:"category-options"},this.jobCategories.map((e=>i("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),i("div",{class:"dimension-select"},i("h3",null,"请选择关注的模块(可多选)"),i("div",{class:"dimension-options"},this.dimensions.map((e=>i("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),i("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&i("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):i("div",{style:{height:"100%"}},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((e=>i("div",{id:`message_${e.id}`,key:e.id},i("pcm-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false,onMessageChange:t=>{const o=this.messages.map((o=>o.id===e.id?{...o,...t.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},i("p",null,"请上传简历开始面试")))),i("div",{class:"recording-section"},i("div",{class:"recording-container"},i("div",{class:"video-area"},this.showRecordingUI?n():i("div",{class:"video-preview placeholder"},r())),i("div",{class:"progress-container"},i("div",{class:"progress-bar-container"},i("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),i("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),i("div",{class:"recording-controls"},this.showRecordingUI?i("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):i("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return i("div",{class:"play-audio-container",onClick:this.handlePlayAudio},i("p",null,i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},i("path",{d:"M8 5v14l11-7z"})),i("span",{style:{verticalAlign:"middle"}},"播放题目")))}return i("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};ke.style=ye;const ve=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}";const Ce=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const ze=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="劳动合同卫士";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}isSubmitting=false;inputMode="upload";freeInputText="";tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-htws-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleToggleInput=()=>{this.inputMode=this.inputMode==="upload"?"free":"upload"};handleFreeInputChange=e=>{const t=e.target;this.freeInputText=t.value};handleStartInterview=async()=>{if(this.inputMode==="upload"&&!this.selectedFile){alert("请上传合同文件");return}if(this.inputMode==="free"&&!this.freeInputText.trim()){alert("请输入合同内容");return}this.isSubmitting=true;try{if(this.inputMode==="upload"){if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}}this.showChatModal=true}catch(e){console.error("开始分析时出错:",e);w.captureError(e,{action:"handleStartInterview",component:"pcm-htws-modal",title:"开始分析时出错"});x.emitError({error:e,message:"开始分析时出错,请重试"})}finally{this.isSubmitting=false}};async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false;this.freeInputText="";this.inputMode="upload"}else{if(this.customInputs&&this.customInputs.input){this.inputMode="free";this.freeInputText=this.customInputs.input}await s(this.token);if(this.conversationId){this.showChatModal=true}}}render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&i("div",{class:"input-container"},i("div",{class:"input-mode-toggle"},i("span",null,"合同内容"),i("button",{class:"toggle-button",onClick:this.handleToggleInput},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="upload"&&i("div",{class:"resume-upload-section"},i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传合同"),i("p",{class:"upload-hint"},"支持markdown、pdf、docx、doc、md 格式")))),this.inputMode==="free"&&i("div",{class:"free-input"},i("div",{class:"textarea-container"},i("textarea",{id:"free-input-text",placeholder:"请输入合同内容",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),i("div",{class:"input-guide"},i("div",{class:"guide-title"},"输入提示:"),i("div",{class:"guide-content"},i("div",null,"• 请输入完整的劳动合同内容"),i("div",null,"• 包括甲方(公司)、乙方(员工)信息"),i("div",null,"• 合同期限、工作内容、工作地点"),i("div",null,"• 工作时间、休息休假、劳动报酬"),i("div",null,"• 社会保险、劳动保护、劳动条件"),i("div",null,"• 合同变更、解除和终止条件等")))),i("button",{class:"submit-button",disabled:this.inputMode==="upload"&&!this.selectedFile||this.inputMode==="free"&&!this.freeInputText.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018882",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.inputMode==="upload"?this.uploadedFileInfo?.cos_key:undefined,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,input:this.inputMode==="free"?this.freeInputText:undefined},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};ze.style=ve+Ce;const _e="";const Ie=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const je=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="会议总结助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始总结";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false}else{await s(this.token);if(this.conversationId||this.customInputs?.file_url){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-hyzj-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传面试内容");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始面试时出错:",e);w.captureError(e,{action:"handleStartInterview",component:"pcm-hyzj-modal",title:"开始面试时出错"});x.emitError({error:e,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.file_url);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!r&&i("div",{class:"input-container"},i("div",{class:"resume-upload-section"},i("label",null,"上传会议纪要"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传会议纪要"),i("p",{class:"upload-hint"},"支持 mp3、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!this.selectedFile||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018885",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};je.style=_e+Ie;const Se=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.toggle-button:disabled{opacity:0.5;cursor:not-allowed}.structured-input{width:100%}.job-name-input{margin-bottom:20px}.job-name-input label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-name-input input{width:95%;padding:10px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#f9f9f9}.job-name-input input:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.button-container{display:flex;justify-content:center;margin-top:24px;gap:12px;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.next-button{background-color:#2E6EDF;color:white}.next-button:hover{background-color:#2457b8}.next-button:disabled{background-color:#a0c0e8;cursor:not-allowed}.prev-button{background-color:#f0f0f0 !important;color:#333 !important}.prev-button:hover{background-color:#e0e0e0}.tag-selection{width:100%}.tag-selection-content{width:100%}.section-title{font-weight:600;color:#333;margin-bottom:12px;font-size:16px}.ai-tags-section,.basic-tags-section{margin-bottom:24px}.tag-group{margin-bottom:16px}.tag-title{color:#555;margin-bottom:8px;font-weight:500}.tag-container{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;box-sizing:border-box}.tag{display:inline-flex;align-items:center;padding:6px 12px;border-radius:4px;background-color:#f5f5f5;border:1px solid #e0e0e0;color:#333;font-size:13px;cursor:pointer;transition:all 0.2s;max-width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tag:hover{background-color:#e8e8e8}.tag-selected{background-color:#e6f0ff;border-color:#2E6EDF;color:#2E6EDF}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 0;background-color:#f9f9f9;border-radius:8px;margin:20px 0;max-width:100%;box-sizing:border-box}.loading-spinner{width:40px;height:40px;border:3px solid rgba(46, 110, 223, 0.2);border-radius:50%;border-top-color:#2E6EDF;animation:spin 1s linear infinite;margin-bottom:16px}@keyframes spin{to{transform:rotate(360deg)}}.loading-text{text-align:center;color:#333;font-weight:500}.loading-subtext{color:#888;font-size:14px;margin-top:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}@media (max-width: 768px){.tag-container{gap:7px}.tag{padding:4px 8px;font-size:12px}}@media (max-width: 480px){.button-container{flex-direction:column;align-items:center}.next-button,.prev-button,.submit-button{width:100%;margin-bottom:8px}.tag{max-width:calc(50% - 8px)}}.tag-selection,.tag-selection-content,.ai-tags-section,.basic-tags-section,.structured-input,.free-input{max-width:100%;box-sizing:border-box}";const Fe=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Me=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="职位生成";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我生成职位信息";fullscreen=false;customInputs={};showWorkspaceHistory=false;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";showChatModal=false;get hostElement(){return o(this)}inputMode="structured";step="input";jobName="";freeInputText="";isLoading=false;isSubmitting=false;tagGroups=[];shuffledTagGroups=[];selectedAITags={};selectedTags={salary:"",benefits:[],education:""};tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}salaryRanges=[{text:"3k-5k",value:"3k_5k"},{text:"5k-8k",value:"5k_8k"},{text:"8k-12k",value:"8k_12k"},{text:"12k-15k",value:"12k_15k"},{text:"15k-20k",value:"15k_20k"},{text:"20k以上",value:"above_20k"}];benefits=[{text:"五险一金",value:"五险一金"},{text:"年终奖",value:"年终奖"},{text:"带薪年假",value:"带薪年假"},{text:"加班补贴",value:"加班补贴"},{text:"餐补",value:"餐补"},{text:"交通补贴",value:"交通补贴"},{text:"节日福利",value:"节日福利"},{text:"团队建设",value:"团队建设"}];educationRequirements=[{text:"大专",value:"大专"},{text:"本科",value:"本科"},{text:"硕士",value:"硕士"},{text:"博士",value:"博士"},{text:"学历不限",value:"学历不限"}];handleClose=()=>{this.modalClosed.emit()};handleToggleInput=()=>{this.inputMode=this.inputMode==="structured"?"free":"structured"};handleJobNameChange=e=>{const t=e.target;this.jobName=t.value};handleFreeInputChange=e=>{const t=e.target;this.freeInputText=t.value};handleNextStep=async()=>{if(!this.jobName.trim()){alert("请输入职位名称");return}this.step="review";await this.handlePositionAnalysis(this.jobName)};handlePrevStep=()=>{this.step="input"};async handlePositionAnalysis(e){if(!e.trim())return;this.isLoading=true;try{const t=await d({url:"/sdk/v1/chat/workflow/block-run",method:"POST",data:{inputs:{input_info:e},workflow_code:"generate_jd_tags"}});if(t.success&&t.data?.data.outputs?.text){try{const e=JSON.parse(t.data.data.outputs.text);this.tagGroups=e.tagGroup||[];const o={};const i=(e.tagGroup||[]).map((e=>{const t=[...e.defaultTags||[],...e.optionalTags||[]];for(let e=t.length-1;e>0;e--){const o=Math.floor(Math.random()*(e+1));[t[e],t[o]]=[t[o],t[e]]}if(e.defaultTags&&e.defaultTags.length>0){o[e.dimensionName]=[...e.defaultTags]}return{dimensionName:e.dimensionName,tags:t}}));this.shuffledTagGroups=i;this.selectedAITags=o}catch(e){w.captureError(e,{action:"handlePositionAnalysis",component:"pcm-jd-modal",title:"解析前置标签时错误"});x.emitError({error:e,message:"解析前置标签时错误"})}}}catch(e){console.error("工作流运行错误:",e)}finally{this.isLoading=false}}handleTagClick=(e,t)=>{if(e==="benefits"){const e=[...this.selectedTags.benefits];const o=e.includes(t)?e.filter((e=>e!==t)):[...e,t];this.selectedTags={...this.selectedTags,benefits:o}}else{this.selectedTags={...this.selectedTags,[e]:this.selectedTags[e]===t?"":t}}};handleAITagClick=(e,t)=>{const o=this.selectedAITags[e]||[];const i=o.includes(t)?o.filter((e=>e!==t)):[...o,t];this.selectedAITags={...this.selectedAITags,[e]:i}};handleSubmitStructured=async()=>{this.isSubmitting=true;try{let e="";if(this.selectedTags.salary){const t=this.salaryRanges.find((e=>e.value===this.selectedTags.salary));if(t){e=t.text}}const t=this.selectedTags.benefits.join("、");let o="";if(this.selectedTags.education){const e=this.educationRequirements.find((e=>e.value===this.selectedTags.education));if(e){o=e.text}}let i=`职位名称:${this.jobName}\n`;if(e){i+=`薪资范围:${e}\n`}if(t){i+=`福利待遇:${t}\n`}if(o){i+=`学历要求:${o}\n`}Object.entries(this.selectedAITags).forEach((([e,t])=>{if(t.length>0){i+=`${e}:${t.join("、")}\n`}}));this.showChatModal=true;this.jobDescription=i}catch(e){console.error("提交结构化数据时出错:",e);w.captureError(e,{action:"handleSubmitStructured",component:"pcm-jd-modal",title:"提交数据时出错"});x.emitError({error:e,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};handleSubmitFree=async()=>{if(!this.freeInputText.trim()){alert("请输入职位需求信息");return}this.isSubmitting=true;try{this.jobDescription=this.freeInputText;this.showChatModal=true}catch(e){console.error("提交自由输入数据时出错:",e);w.captureError(e,{action:"handleSubmitFree",component:"pcm-jd-modal",title:"提交数据时出错"});x.emitError({error:e,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};jobDescription="";async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.jobDescription="";this.jobName="";this.freeInputText="";this.step="input";this.inputMode="structured";this.tagGroups=[];this.shuffledTagGroups=[];this.selectedAITags={};this.selectedTags={salary:"",benefits:[],education:""}}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info;this.inputMode="free";this.freeInputText=this.customInputs.job_info}await s(this.token);if(this.conversationId){this.showChatModal=true}}}renderTagGroup(e,t,o){return i("div",{class:"tag-group"},i("div",{class:"tag-title"},e),i("div",{class:"tag-container"},t.map((e=>{const t=o==="benefits"?this.selectedTags.benefits.includes(e.value):this.selectedTags[o]===e.value;return i("div",{class:{tag:true,"tag-selected":t},onClick:()=>this.handleTagClick(o,e.value)},e.text)}))))}renderAITagGroups(){return i("div",{class:"ai-tag-groups"},this.shuffledTagGroups.map((e=>i("div",{class:"tag-group"},i("div",{class:"tag-title"},e.dimensionName),i("div",{class:"tag-container"},e.tags.map((t=>{const o=(this.selectedAITags[e.dimensionName]||[]).includes(t);return i("div",{class:{tag:true,"tag-selected":o},onClick:()=>this.handleAITagClick(e.dimensionName,t)},t)})))))))}renderLoadingState(){return i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("div",{class:"loading-text"},i("div",null,"AI 正在分析职位信息"),i("div",{class:"loading-subtext"},"请稍候...")))}render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&true&&i("div",{class:"input-container"},i("div",{class:"input-mode-toggle"},i("span",null,"职位需求信息"),i("button",{class:"toggle-button",onClick:this.handleToggleInput,disabled:this.isLoading},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="structured"&&i("div",{class:"structured-input"},this.step==="input"&&i("div",{class:"job-name-input"},i("label",{htmlFor:"job-name"},"职位名称 ",i("span",{class:"required"},"*")),i("input",{id:"job-name",type:"text",placeholder:"请输入职位名称",value:this.jobName,onInput:this.handleJobNameChange,disabled:this.isLoading}),i("div",{class:"button-container"},i("button",{class:"submit-button next-button",onClick:this.handleNextStep,disabled:!this.jobName.trim()||this.isLoading},"下一步"))),this.step==="review"&&i("div",{class:"tag-selection"},this.isLoading?this.renderLoadingState():i("div",{class:"tag-selection-content"},this.tagGroups.length>0&&i("div",{class:"ai-tags-section"},i("div",{class:"section-title"},"AI 推荐标签"),this.renderAITagGroups()),this.tagGroups.length>0&&i("div",{class:"basic-tags-section"},this.renderTagGroup("月薪范围",this.salaryRanges,"salary"),this.renderTagGroup("福利待遇",this.benefits,"benefits"),this.renderTagGroup("学历要求",this.educationRequirements,"education")),i("div",{class:"button-container"},i("button",{class:"submit-button prev-button",onClick:this.handlePrevStep},"上一步"),i("button",{class:"submit-button",onClick:this.handleSubmitStructured,disabled:this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))))),this.inputMode==="free"&&i("div",{class:"free-input"},i("div",{class:"textarea-container"},i("label",{htmlFor:"free-input-text"},"JD信息 ",i("span",{class:"required"},"*")),i("textarea",{id:"free-input-text",placeholder:"请按照下方提示格式输入职位需求信息",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),i("div",{class:"input-guide"},i("div",{class:"guide-title"},"输入格式参考:"),i("div",{class:"guide-content"},i("div",null,"• 职位名称 - 明确定义职位的名称"),i("div",null,"• 薪资范围 - 明确该岗位的月薪或年薪"),i("div",null,"• 福利待遇 - 该职位的福利待遇,如:五险一金、年休假、下午茶等"),i("div",null,"• 工作职责 - 描述工作内容"),i("div",null,"• 任职资格 - 包括学历、经验和技术要求"),i("div",null,"• 工作地点与性质 - 全职/兼职、远程/办公室"))),i("div",{class:"button-container"},i("button",{class:"submit-button",onClick:this.handleSubmitFree,disabled:!this.freeInputText.trim()||this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018873",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Me.style=Se+Fe;const Te="";const Ee=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ae=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="简历剖析助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;jobDescription="";isSubmitting=false;get hostElement(){return o(this)}tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-jlpp-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartAnalysis=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始分析时出错:",e);w.captureError(e,{action:"handleStartAnalysis",component:"pcm-jlpp-modal",title:"开始分析时出错"});x.emitError({error:e,message:"开始分析时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartAnalysis},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableTTS:false,filePreviewMode:this.filePreviewMode,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018881",customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Ae.style=Te+Ee;const $e="";const Be=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const De=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="面试出题大师";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始出题";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-mnct-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始面试时出错:",e);w.captureError(e,{action:"handleStartInterview",component:"pcm-mnct-modal",title:"开始面试时出错"});x.emitError({error:e,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018876",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};De.style=$e+Be;const Re="";const Le=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Oe=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.recordingError=t(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";fullscreen=false;customInputs={};showWorkspaceHistory=false;mobileJdInputAble=false;mobileUploadAble=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";interviewMode="text";recordingError;showCopyButton=true;showFeedbackButtons=true;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if((this.customInputs?.file_url||this.customInputs?.resume_content)&&this.customInputs?.job_info||this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handleStartInterview=async()=>{if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;if(await(this.pcmUploadRef?.getIsUploading?.())){y.info("文件上传中,请稍后");return}this.showChatModal=true};pcmUploadRef;render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const a=Boolean((this.customInputs?.file_url||this.customInputs?.resume_content)&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!!this.mobileJdInputAble&&i("pcm-mobile-input-btn",{name:"职位描述",onOk:e=>{this.jobDescription=e.detail}}),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:this.mobileUploadAble,labelText:"上传简历(选填)",acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}}),i("button",{class:"submit-button",disabled:!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018884",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableTTS:false,filePreviewMode:this.filePreviewMode,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,resume_content:this.customInputs?.resume_content},interviewMode:this.interviewMode}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Oe.style=Re+Le;
2
+ /**
3
+ * @module QRCode
4
+ * @package @nuintun/qrcode
5
+ * @license MIT
6
+ * @version 5.0.2
7
+ * @author nuintun <nuintun@qq.com>
8
+ * @description A pure JavaScript QRCode encode and decode library.
9
+ * @see https://github.com/nuintun/qrcode#readme
10
+ */const He=new Map;class Pe{#o;#i;static CP437=new Pe("cp437",2,0);static ISO_8859_1=new Pe("iso-8859-1",3,1);static ISO_8859_2=new Pe("iso-8859-2",4);static ISO_8859_3=new Pe("iso-8859-3",5);static ISO_8859_4=new Pe("iso-8859-4",6);static ISO_8859_5=new Pe("iso-8859-5",7);static ISO_8859_6=new Pe("iso-8859-6",8);static ISO_8859_7=new Pe("iso-8859-7",9);static ISO_8859_8=new Pe("iso-8859-8",10);static ISO_8859_9=new Pe("iso-8859-9",11);static ISO_8859_10=new Pe("iso-8859-10",12);static ISO_8859_11=new Pe("iso-8859-11",13);static ISO_8859_13=new Pe("iso-8859-13",15);static ISO_8859_14=new Pe("iso-8859-14",16);static ISO_8859_15=new Pe("iso-8859-15",17);static ISO_8859_16=new Pe("iso-8859-16",18);static SHIFT_JIS=new Pe("shift-jis",20);static CP1250=new Pe("cp1250",21);static CP1251=new Pe("cp1251",22);static CP1252=new Pe("cp1252",23);static CP1256=new Pe("cp1256",24);static UTF_16BE=new Pe("utf-16be",25);static UTF_8=new Pe("utf-8",26);static ASCII=new Pe("ascii",27);static BIG5=new Pe("big5",28);static GB2312=new Pe("gb2312",29);static EUC_KR=new Pe("euc-kr",30);static GBK=new Pe("gbk",31);static GB18030=new Pe("gb18030",32);static UTF_16LE=new Pe("utf-16le",33);static UTF_32BE=new Pe("utf-32be",34);static UTF_32LE=new Pe("utf-32le",35);static ISO_646_INV=new Pe("iso-646-inv",170);static BINARY=new Pe("binary",899);constructor(e,...t){this.#o=e;this.#i=Object.freeze(t);for(const e of t){if(e>=0&&e<=999999&&Number.isInteger(e)){He.set(e,this)}else{throw new Error("illegal extended channel interpretation value")}}}get label(){return this.#o}get values(){return this.#i}}
11
+ /**
12
+ * @module QRCode
13
+ * @package @nuintun/qrcode
14
+ * @license MIT
15
+ * @version 5.0.2
16
+ * @author nuintun <nuintun@qq.com>
17
+ * @description A pure JavaScript QRCode encode and decode library.
18
+ * @see https://github.com/nuintun/qrcode#readme
19
+ */function Ue(e){return e&1}function qe(e){return e|0}function Ne(e){return 1<<We(e)}function We(e){return e&31}function Ve(e){return 32-Math.clz32(e)}function Qe(e,t){const o=Ve(t);e<<=o-1;while(Ve(e)>=o){e^=t<<Ve(e)-o}return e}
20
+ /**
21
+ * @module QRCode
22
+ * @package @nuintun/qrcode
23
+ * @license MIT
24
+ * @version 5.0.2
25
+ * @author nuintun <nuintun@qq.com>
26
+ * @description A pure JavaScript QRCode encode and decode library.
27
+ * @see https://github.com/nuintun/qrcode#readme
28
+ */const Ze=new Map;class Je{#n;#r;static TERMINATOR=new Je([0,0,0],0);static NUMERIC=new Je([10,12,14],1);static ALPHANUMERIC=new Je([9,11,13],2);static STRUCTURED_APPEND=new Je([0,0,0],3);static BYTE=new Je([8,16,16],4);static ECI=new Je([0,0,0],7);static KANJI=new Je([8,10,12],8);static FNC1_FIRST_POSITION=new Je([0,0,0],5);static FNC1_SECOND_POSITION=new Je([0,0,0],9);static HANZI=new Je([8,10,12],13);constructor(e,t){this.#n=t;this.#r=new Int32Array(e);Ze.set(t,this)}get bits(){return this.#n}getCharacterCountBits({version:e}){let t;if(e<=9){t=0}else if(e<=26){t=1}else{t=2}return this.#r[t]}}
29
+ /**
30
+ * @module QRCode
31
+ * @package @nuintun/qrcode
32
+ * @license MIT
33
+ * @version 5.0.2
34
+ * @author nuintun <nuintun@qq.com>
35
+ * @description A pure JavaScript QRCode encode and decode library.
36
+ * @see https://github.com/nuintun/qrcode#readme
37
+ */const Ge=3;const Xe=3;const Ke=40;const Ye=10;function et(e,t,o){return e.get(t,o)===1}function tt(e,t){let o=0;const{size:i}=e;for(let n=0;n<i;n++){let r=-1;let s=0;for(let a=0;a<i;a++){const i=t?e.get(n,a):e.get(a,n);if(i===r){s++}else{if(s>=5){o+=Ge+(s-5)}r=i;s=1}}if(s>=5){o+=Ge+(s-5)}}return o}function ot(e){return tt(e)+tt(e,true)}function it(e){let t=0;const o=e.size-1;for(let i=0;i<o;i++){for(let n=0;n<o;n++){const o=e.get(n,i);if(o===e.get(n+1,i)&&o===e.get(n,i+1)&&o===e.get(n+1,i+1)){t+=Xe}}}return t}function nt(e,t,o,i,n){if(o<0||i>e.size){return false}for(let r=o;r<i;r++){if(n?et(e,t,r):et(e,r,t)){return false}}return true}function rt(e){let t=0;const{size:o}=e;for(let i=0;i<o;i++){for(let n=0;n<o;n++){if(n+6<o&&et(e,n,i)&&!et(e,n+1,i)&&et(e,n+2,i)&&et(e,n+3,i)&&et(e,n+4,i)&&!et(e,n+5,i)&&et(e,n+6,i)&&(nt(e,i,n-4,n)||nt(e,i,n+7,n+11))){t++}if(i+6<o&&et(e,n,i)&&!et(e,n,i+1)&&et(e,n,i+2)&&et(e,n,i+3)&&et(e,n,i+4)&&!et(e,n,i+5)&&et(e,n,i+6)&&(nt(e,n,i-4,i,true)||nt(e,n,i+7,i+11,true))){t++}}}return t*Ke}function st(e){let t=0;const{size:o}=e;for(let i=0;i<o;i++){for(let n=0;n<o;n++){if(et(e,n,i)){t++}}}const i=o*o;const n=qe(Math.abs(t*2-i)*10/i);return n*Ye}function at(e){return ot(e)+it(e)+rt(e)+st(e)}function lt(e,t,o){let i;let n;switch(e){case 0:n=o+t&1;break;case 1:n=o&1;break;case 2:n=t%3;break;case 3:n=(o+t)%3;break;case 4:n=qe(o/2)+qe(t/3)&1;break;case 5:i=o*t;n=(i&1)+i%3;break;case 6:i=o*t;n=(i&1)+i%3&1;break;case 7:n=o*t%3+(o+t&1)&1;break;default:throw new Error(`illegal mask: ${e}`)}return n===0}
38
+ /**
39
+ * @module QRCode
40
+ * @package @nuintun/qrcode
41
+ * @license MIT
42
+ * @version 5.0.2
43
+ * @author nuintun <nuintun@qq.com>
44
+ * @description A pure JavaScript QRCode encode and decode library.
45
+ * @see https://github.com/nuintun/qrcode#readme
46
+ */const dt=new Map;class ct{#s;#n;#a;static L=new ct("L",0,1);static M=new ct("M",1,0);static Q=new ct("Q",2,3);static H=new ct("H",3,2);constructor(e,t,o){this.#n=o;this.#s=e;this.#a=t;dt.set(o,this)}get bits(){return this.#n}get name(){return this.#s}get level(){return this.#a}}
47
+ /**
48
+ * @module QRCode
49
+ * @package @nuintun/qrcode
50
+ * @license MIT
51
+ * @version 5.0.2
52
+ * @author nuintun <nuintun@qq.com>
53
+ * @description A pure JavaScript QRCode encode and decode library.
54
+ * @see https://github.com/nuintun/qrcode#readme
55
+ */class ht{#l;#d;constructor(e,t){this.#l=e;this.#d=t}get count(){return this.#l}get numDataCodewords(){return this.#d}}
56
+ /**
57
+ * @module QRCode
58
+ * @package @nuintun/qrcode
59
+ * @license MIT
60
+ * @version 5.0.2
61
+ * @author nuintun <nuintun@qq.com>
62
+ * @description A pure JavaScript QRCode encode and decode library.
63
+ * @see https://github.com/nuintun/qrcode#readme
64
+ */class pt{#c;#h;#p;#u;#f;constructor(e,...t){let o=0;let i=0;for(const{count:e,numDataCodewords:n}of t){o+=e;i+=n*e}const n=e*o;this.#c=t;this.#p=n;this.#u=i;this.#f=e;this.#h=i+n}get ecBlocks(){return this.#c}get numTotalCodewords(){return this.#h}get numTotalECCodewords(){return this.#p}get numTotalDataCodewords(){return this.#u}get numECCodewordsPerBlock(){return this.#f}}
65
+ /**
66
+ * @module QRCode
67
+ * @package @nuintun/qrcode
68
+ * @license MIT
69
+ * @version 5.0.2
70
+ * @author nuintun <nuintun@qq.com>
71
+ * @description A pure JavaScript QRCode encode and decode library.
72
+ * @see https://github.com/nuintun/qrcode#readme
73
+ */class ut{#m;#g;#c;#b;constructor(e,t,...o){this.#g=e;this.#c=o;this.#m=17+4*e;this.#b=t}get size(){return this.#m}get version(){return this.#g}get alignmentPatterns(){return this.#b}getECBlocks({level:e}){return this.#c[e]}}const ft=[new ut(1,[],new pt(7,new ht(1,19)),new pt(10,new ht(1,16)),new pt(13,new ht(1,13)),new pt(17,new ht(1,9))),new ut(2,[6,18],new pt(10,new ht(1,34)),new pt(16,new ht(1,28)),new pt(22,new ht(1,22)),new pt(28,new ht(1,16))),new ut(3,[6,22],new pt(15,new ht(1,55)),new pt(26,new ht(1,44)),new pt(18,new ht(2,17)),new pt(22,new ht(2,13))),new ut(4,[6,26],new pt(20,new ht(1,80)),new pt(18,new ht(2,32)),new pt(26,new ht(2,24)),new pt(16,new ht(4,9))),new ut(5,[6,30],new pt(26,new ht(1,108)),new pt(24,new ht(2,43)),new pt(18,new ht(2,15),new ht(2,16)),new pt(22,new ht(2,11),new ht(2,12))),new ut(6,[6,34],new pt(18,new ht(2,68)),new pt(16,new ht(4,27)),new pt(24,new ht(4,19)),new pt(28,new ht(4,15))),new ut(7,[6,22,38],new pt(20,new ht(2,78)),new pt(18,new ht(4,31)),new pt(18,new ht(2,14),new ht(4,15)),new pt(26,new ht(4,13),new ht(1,14))),new ut(8,[6,24,42],new pt(24,new ht(2,97)),new pt(22,new ht(2,38),new ht(2,39)),new pt(22,new ht(4,18),new ht(2,19)),new pt(26,new ht(4,14),new ht(2,15))),new ut(9,[6,26,46],new pt(30,new ht(2,116)),new pt(22,new ht(3,36),new ht(2,37)),new pt(20,new ht(4,16),new ht(4,17)),new pt(24,new ht(4,12),new ht(4,13))),new ut(10,[6,28,50],new pt(18,new ht(2,68),new ht(2,69)),new pt(26,new ht(4,43),new ht(1,44)),new pt(24,new ht(6,19),new ht(2,20)),new pt(28,new ht(6,15),new ht(2,16))),new ut(11,[6,30,54],new pt(20,new ht(4,81)),new pt(30,new ht(1,50),new ht(4,51)),new pt(28,new ht(4,22),new ht(4,23)),new pt(24,new ht(3,12),new ht(8,13))),new ut(12,[6,32,58],new pt(24,new ht(2,92),new ht(2,93)),new pt(22,new ht(6,36),new ht(2,37)),new pt(26,new ht(4,20),new ht(6,21)),new pt(28,new ht(7,14),new ht(4,15))),new ut(13,[6,34,62],new pt(26,new ht(4,107)),new pt(22,new ht(8,37),new ht(1,38)),new pt(24,new ht(8,20),new ht(4,21)),new pt(22,new ht(12,11),new ht(4,12))),new ut(14,[6,26,46,66],new pt(30,new ht(3,115),new ht(1,116)),new pt(24,new ht(4,40),new ht(5,41)),new pt(20,new ht(11,16),new ht(5,17)),new pt(24,new ht(11,12),new ht(5,13))),new ut(15,[6,26,48,70],new pt(22,new ht(5,87),new ht(1,88)),new pt(24,new ht(5,41),new ht(5,42)),new pt(30,new ht(5,24),new ht(7,25)),new pt(24,new ht(11,12),new ht(7,13))),new ut(16,[6,26,50,74],new pt(24,new ht(5,98),new ht(1,99)),new pt(28,new ht(7,45),new ht(3,46)),new pt(24,new ht(15,19),new ht(2,20)),new pt(30,new ht(3,15),new ht(13,16))),new ut(17,[6,30,54,78],new pt(28,new ht(1,107),new ht(5,108)),new pt(28,new ht(10,46),new ht(1,47)),new pt(28,new ht(1,22),new ht(15,23)),new pt(28,new ht(2,14),new ht(17,15))),new ut(18,[6,30,56,82],new pt(30,new ht(5,120),new ht(1,121)),new pt(26,new ht(9,43),new ht(4,44)),new pt(28,new ht(17,22),new ht(1,23)),new pt(28,new ht(2,14),new ht(19,15))),new ut(19,[6,30,58,86],new pt(28,new ht(3,113),new ht(4,114)),new pt(26,new ht(3,44),new ht(11,45)),new pt(26,new ht(17,21),new ht(4,22)),new pt(26,new ht(9,13),new ht(16,14))),new ut(20,[6,34,62,90],new pt(28,new ht(3,107),new ht(5,108)),new pt(26,new ht(3,41),new ht(13,42)),new pt(30,new ht(15,24),new ht(5,25)),new pt(28,new ht(15,15),new ht(10,16))),new ut(21,[6,28,50,72,94],new pt(28,new ht(4,116),new ht(4,117)),new pt(26,new ht(17,42)),new pt(28,new ht(17,22),new ht(6,23)),new pt(30,new ht(19,16),new ht(6,17))),new ut(22,[6,26,50,74,98],new pt(28,new ht(2,111),new ht(7,112)),new pt(28,new ht(17,46)),new pt(30,new ht(7,24),new ht(16,25)),new pt(24,new ht(34,13))),new ut(23,[6,30,54,78,102],new pt(30,new ht(4,121),new ht(5,122)),new pt(28,new ht(4,47),new ht(14,48)),new pt(30,new ht(11,24),new ht(14,25)),new pt(30,new ht(16,15),new ht(14,16))),new ut(24,[6,28,54,80,106],new pt(30,new ht(6,117),new ht(4,118)),new pt(28,new ht(6,45),new ht(14,46)),new pt(30,new ht(11,24),new ht(16,25)),new pt(30,new ht(30,16),new ht(2,17))),new ut(25,[6,32,58,84,110],new pt(26,new ht(8,106),new ht(4,107)),new pt(28,new ht(8,47),new ht(13,48)),new pt(30,new ht(7,24),new ht(22,25)),new pt(30,new ht(22,15),new ht(13,16))),new ut(26,[6,30,58,86,114],new pt(28,new ht(10,114),new ht(2,115)),new pt(28,new ht(19,46),new ht(4,47)),new pt(28,new ht(28,22),new ht(6,23)),new pt(30,new ht(33,16),new ht(4,17))),new ut(27,[6,34,62,90,118],new pt(30,new ht(8,122),new ht(4,123)),new pt(28,new ht(22,45),new ht(3,46)),new pt(30,new ht(8,23),new ht(26,24)),new pt(30,new ht(12,15),new ht(28,16))),new ut(28,[6,26,50,74,98,122],new pt(30,new ht(3,117),new ht(10,118)),new pt(28,new ht(3,45),new ht(23,46)),new pt(30,new ht(4,24),new ht(31,25)),new pt(30,new ht(11,15),new ht(31,16))),new ut(29,[6,30,54,78,102,126],new pt(30,new ht(7,116),new ht(7,117)),new pt(28,new ht(21,45),new ht(7,46)),new pt(30,new ht(1,23),new ht(37,24)),new pt(30,new ht(19,15),new ht(26,16))),new ut(30,[6,26,52,78,104,130],new pt(30,new ht(5,115),new ht(10,116)),new pt(28,new ht(19,47),new ht(10,48)),new pt(30,new ht(15,24),new ht(25,25)),new pt(30,new ht(23,15),new ht(25,16))),new ut(31,[6,30,56,82,108,134],new pt(30,new ht(13,115),new ht(3,116)),new pt(28,new ht(2,46),new ht(29,47)),new pt(30,new ht(42,24),new ht(1,25)),new pt(30,new ht(23,15),new ht(28,16))),new ut(32,[6,34,60,86,112,138],new pt(30,new ht(17,115)),new pt(28,new ht(10,46),new ht(23,47)),new pt(30,new ht(10,24),new ht(35,25)),new pt(30,new ht(19,15),new ht(35,16))),new ut(33,[6,30,58,86,114,142],new pt(30,new ht(17,115),new ht(1,116)),new pt(28,new ht(14,46),new ht(21,47)),new pt(30,new ht(29,24),new ht(19,25)),new pt(30,new ht(11,15),new ht(46,16))),new ut(34,[6,34,62,90,118,146],new pt(30,new ht(13,115),new ht(6,116)),new pt(28,new ht(14,46),new ht(23,47)),new pt(30,new ht(44,24),new ht(7,25)),new pt(30,new ht(59,16),new ht(1,17))),new ut(35,[6,30,54,78,102,126,150],new pt(30,new ht(12,121),new ht(7,122)),new pt(28,new ht(12,47),new ht(26,48)),new pt(30,new ht(39,24),new ht(14,25)),new pt(30,new ht(22,15),new ht(41,16))),new ut(36,[6,24,50,76,102,128,154],new pt(30,new ht(6,121),new ht(14,122)),new pt(28,new ht(6,47),new ht(34,48)),new pt(30,new ht(46,24),new ht(10,25)),new pt(30,new ht(2,15),new ht(64,16))),new ut(37,[6,28,54,80,106,132,158],new pt(30,new ht(17,122),new ht(4,123)),new pt(28,new ht(29,46),new ht(14,47)),new pt(30,new ht(49,24),new ht(10,25)),new pt(30,new ht(24,15),new ht(46,16))),new ut(38,[6,32,58,84,110,136,162],new pt(30,new ht(4,122),new ht(18,123)),new pt(28,new ht(13,46),new ht(32,47)),new pt(30,new ht(48,24),new ht(14,25)),new pt(30,new ht(42,15),new ht(32,16))),new ut(39,[6,26,54,82,110,138,166],new pt(30,new ht(20,117),new ht(4,118)),new pt(28,new ht(40,47),new ht(7,48)),new pt(30,new ht(43,24),new ht(22,25)),new pt(30,new ht(10,15),new ht(67,16))),new ut(40,[6,30,58,86,114,142,170],new pt(30,new ht(19,118),new ht(6,119)),new pt(28,new ht(18,47),new ht(31,48)),new pt(30,new ht(34,24),new ht(34,25)),new pt(30,new ht(20,15),new ht(61,16)))];
74
+ /**
75
+ * @module QRCode
76
+ * @package @nuintun/qrcode
77
+ * @license MIT
78
+ * @version 5.0.2
79
+ * @author nuintun <nuintun@qq.com>
80
+ * @description A pure JavaScript QRCode encode and decode library.
81
+ * @see https://github.com/nuintun/qrcode#readme
82
+ */class mt{#x;#w;constructor(e,t){const{length:o}=t;if(o<=0){throw new Error("polynomial coefficients cannot empty")}this.#x=e;if(o>1&&t[0]===0){let e=1;while(e<o&&t[e]===0){e++}if(e===o){this.#w=new Int32Array([0])}else{const i=new Int32Array(o-e);i.set(t.subarray(e));this.#w=i}}else{this.#w=t}}get coefficients(){return this.#w}isZero(){return this.#w[0]===0}getDegree(){return this.#w.length-1}getCoefficient(e){const t=this.#w;return t[t.length-1-e]}evaluate(e){if(e===0){return this.getCoefficient(0)}let t;const o=this.#w;if(e===1){t=0;for(const e of o){t^=e}return t}[t]=o;const i=this.#x;const{length:n}=o;for(let r=1;r<n;r++){t=i.multiply(e,t)^o[r]}return t}multiply(e){const t=this.#x;const o=this.#w;const{length:i}=o;if(e instanceof mt){if(this.isZero()||e.isZero()){return t.zero}const n=e.#w;const r=n.length;const s=new Int32Array(i+r-1);for(let e=0;e<i;e++){const i=o[e];for(let o=0;o<r;o++){s[e+o]^=t.multiply(i,n[o])}}return new mt(t,s)}if(e===0){return t.zero}if(e===1){return this}const n=new Int32Array(i);for(let r=0;r<i;r++){n[r]=t.multiply(o[r],e)}return new mt(t,n)}multiplyByMonomial(e,t){const o=this.#x;if(t===0){return o.zero}const i=this.#w;const{length:n}=i;const r=new Int32Array(n+e);for(let e=0;e<n;e++){r[e]=o.multiply(i[e],t)}return new mt(o,r)}addOrSubtract(e){if(this.isZero()){return e}if(e.isZero()){return this}let t=e.#w;let o=t.length;let i=this.#w;let n=i.length;if(o<n){[o,n]=[n,o];[t,i]=[i,t]}const r=o-n;const s=new Int32Array(o);s.set(t.subarray(0,r));for(let e=r;e<o;e++){s[e]=i[e-r]^t[e]}return new mt(this.#x,s)}divide(e){const t=this.#x;let o=t.zero;let i=this;const n=e.getCoefficient(e.getDegree());const r=t.invert(n);while(i.getDegree()>=e.getDegree()&&!i.isZero()){const n=i.getDegree();const s=n-e.getDegree();const a=t.multiply(i.getCoefficient(n),r);const l=e.multiplyByMonomial(s,a);const d=t.buildPolynomial(s,a);o=o.addOrSubtract(d);i=i.addOrSubtract(l)}return[o,i]}}
83
+ /**
84
+ * @module QRCode
85
+ * @package @nuintun/qrcode
86
+ * @license MIT
87
+ * @version 5.0.2
88
+ * @author nuintun <nuintun@qq.com>
89
+ * @description A pure JavaScript QRCode encode and decode library.
90
+ * @see https://github.com/nuintun/qrcode#readme
91
+ */class gt{#m;#y;#k;#v;#C;#z;constructor(e,t,o){let i=1;const n=new Int32Array(t);for(let o=0;o<t;o++){n[o]=i;i*=2;if(i>=t){i^=e;i&=t-1}}const r=new Int32Array(t);for(let e=0,o=t-1;e<o;e++){r[n[e]]=e}this.#m=t;this.#C=n;this.#z=r;this.#v=o;this.#y=new mt(this,new Int32Array([1]));this.#k=new mt(this,new Int32Array([0]))}get size(){return this.#m}get one(){return this.#y}get zero(){return this.#k}get generator(){return this.#v}exp(e){return this.#C[e]}log(e){return this.#z[e]}invert(e){return this.#C[this.#m-this.#z[e]-1]}multiply(e,t){if(e===0||t===0){return 0}const o=this.#z;return this.#C[(o[e]+o[t])%(this.#m-1)]}buildPolynomial(e,t){if(t===0){return this.#k}const o=new Int32Array(e+1);o[0]=t;return new mt(this,o)}}const bt=new gt(285,256,0);
92
+ /**
93
+ * @module QRCode
94
+ * @package @nuintun/qrcode
95
+ * @license MIT
96
+ * @version 5.0.2
97
+ * @author nuintun <nuintun@qq.com>
98
+ * @description A pure JavaScript QRCode encode and decode library.
99
+ * @see https://github.com/nuintun/qrcode#readme
100
+ */function xt(e,t){const o=[];for(const i of e){const e=i.codePointAt(0);o.push(e==null||e>t?63:e)}return new Uint8Array(o)}function wt(e,t){switch(t){case Pe.ASCII:return xt(e,127);case Pe.ISO_8859_1:return xt(e,255);case Pe.UTF_8:return(new TextEncoder).encode(e);default:throw Error(`built-in encode not support charset: ${t.label}`)}}
101
+ /**
102
+ * @module QRCode
103
+ * @package @nuintun/qrcode
104
+ * @license MIT
105
+ * @version 5.0.2
106
+ * @author nuintun <nuintun@qq.com>
107
+ * @description A pure JavaScript QRCode encode and decode library.
108
+ * @see https://github.com/nuintun/qrcode#readme
109
+ */const yt=.75;function kt(e){return qe(e/32)}function vt(e){return new Int32Array(Math.ceil(e/32))}class Ct{#_;#n;constructor(e=0){this.#_=e;this.#n=vt(e)}#I(e){const t=this.#n;if(e>t.length*32){const o=vt(Math.ceil(e/yt));o.set(t);this.#n=o}this.#_=e}get length(){return this.#_}get byteLength(){return Math.ceil(this.#_/8)}set(e){this.#n[kt(e)]|=Ne(e)}get(e){return Ue(this.#n[kt(e)]>>>We(e))}xor(e){const t=this.#n;const o=e.#n;const i=Math.min(this.#_,e.#_);for(let e=0;e<i;e++){t[e]^=o[e]}}append(e,t=1){let o=this.#_;if(e instanceof Ct){t=e.#_;this.#I(o+t);for(let i=0;i<t;i++){if(e.get(i)!==0){this.set(o)}o++}}else{this.#I(o+t);for(let i=t-1;i>=0;i--){if(Ue(e>>>i)!==0){this.set(o)}o++}}}writeToUint8Array(e,t,o,i){for(let n=0;n<i;n++){let i=0;for(let t=0;t<8;t++){if(this.get(e++)!==0){i|=1<<7-t}}t[o+n]=i}}clear(){this.#n.fill(0)}}
110
+ /**
111
+ * @module QRCode
112
+ * @package @nuintun/qrcode
113
+ * @license MIT
114
+ * @version 5.0.2
115
+ * @author nuintun <nuintun@qq.com>
116
+ * @description A pure JavaScript QRCode encode and decode library.
117
+ * @see https://github.com/nuintun/qrcode#readme
118
+ */class zt{#m;#j;constructor(e){this.#m=e;this.#j=new Int8Array(e*e)}get size(){return this.#m}set(e,t,o){this.#j[t*this.#m+e]=o}get(e,t){return this.#j[t*this.#m+e]}clear(e){this.#j.fill(e)}}
119
+ /**
120
+ * @module QRCode
121
+ * @package @nuintun/qrcode
122
+ * @license MIT
123
+ * @version 5.0.2
124
+ * @author nuintun <nuintun@qq.com>
125
+ * @description A pure JavaScript QRCode encode and decode library.
126
+ * @see https://github.com/nuintun/qrcode#readme
127
+ */const _t=1335;const It=21522;const jt=7973;const St=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,1,1,1,0,1],[1,0,1,1,1,0,1],[1,0,1,1,1,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]];const Ft=[[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]];const Mt=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]];function Tt(e,t,o){return e.get(t,o)===-1}function Et(e,t,o){for(let i=0;i<7;i++){const n=St[i];for(let r=0;r<7;r++){e.set(t+r,o+i,n[r])}}}function At(e,t,o){for(let i=0;i<8;i++){e.set(t+i,o,0)}}function $t(e,t,o){for(let i=0;i<7;i++){e.set(t,o+i,0)}}function Bt(e){const t=7;const o=8;const i=7;const{size:n}=e;Et(e,0,0);Et(e,n-t,0);Et(e,0,n-t);At(e,0,o-1);At(e,n-o,o-1);At(e,0,n-o);$t(e,i,0);$t(e,n-i-1,0);$t(e,i,n-i)}function Dt(e){const t=e.size-8;for(let o=8;o<t;o++){const t=o+1&1;if(Tt(e,o,6)){e.set(o,6,t)}}for(let o=8;o<t;o++){const t=o+1&1;if(Tt(e,6,o)){e.set(6,o,t)}}}function Rt(e,t,o){for(let i=0;i<5;i++){const n=Ft[i];for(let r=0;r<5;r++){e.set(t+r,o+i,n[r])}}}function Lt(e,{version:t}){if(t>=2){const{alignmentPatterns:o}=ft[t-1];const{length:i}=o;for(let t=0;t<i;t++){const n=o[t];for(let t=0;t<i;t++){const i=o[t];if(Tt(e,i,n)){Rt(e,i-2,n-2)}}}}}function Ot(e){e.set(8,e.size-8,1)}function Ht(e,t,o){const i=t.bits<<3|o;e.append(i,5);const n=Qe(i,_t);e.append(n,10);const r=new Ct;r.append(It,15);e.xor(r)}function Pt(e,t,o){const i=new Ct;Ht(i,t,o);const{size:n}=e;const{length:r}=i;for(let t=0;t<r;t++){const[o,s]=Mt[t];const a=i.get(r-1-t);e.set(o,s,a);if(t<8){e.set(n-t-1,8,a)}else{e.set(8,n-7+(t-8),a)}}Ot(e)}function Ut(e,t){e.append(t,6);const o=Qe(t,jt);e.append(o,12)}function qt(e,{version:t}){if(t>=7){const o=new Ct;Ut(o,t);let i=6*3-1;const{size:n}=e;for(let t=0;t<6;t++){for(let r=0;r<3;r++){const s=o.get(i--);e.set(t,n-11+r,s);e.set(n-11+r,t,s)}}}}function Nt(e,t,o){let i=0;const{size:n}=e;const{length:r}=t;for(let s=n-1;s>=1;s-=2){if(s===6){s=5}for(let a=0;a<n;a++){for(let l=0;l<2;l++){const d=s-l;const c=(s+1&2)===0;const h=c?n-1-a:a;if(Tt(e,d,h)){let n=0;if(i<r){n=t.get(i++)}if(lt(o,d,h)){n^=1}e.set(d,h,n)}}}}}function Wt(e,t){Bt(e);Lt(e,t);Dt(e)}function Vt(e,t,o,i,n){Pt(e,i,n);qt(e,o);Nt(e,t,n)}function Qt(e,t,o,i){const n=new zt(t.size);n.clear(-1);Wt(n,t);Vt(n,e,t,o,i);return n}
128
+ /**
129
+ * @module QRCode
130
+ * @package @nuintun/qrcode
131
+ * @license MIT
132
+ * @version 5.0.2
133
+ * @author nuintun <nuintun@qq.com>
134
+ * @description A pure JavaScript QRCode encode and decode library.
135
+ * @see https://github.com/nuintun/qrcode#readme
136
+ */class Zt{#S;#F;constructor(e,t){this.#S=t;this.#F=e}get ecCodewords(){return this.#S}get dataCodewords(){return this.#F}}
137
+ /**
138
+ * @module QRCode
139
+ * @package @nuintun/qrcode
140
+ * @license MIT
141
+ * @version 5.0.2
142
+ * @author nuintun <nuintun@qq.com>
143
+ * @description A pure JavaScript QRCode encode and decode library.
144
+ * @see https://github.com/nuintun/qrcode#readme
145
+ */function Jt(e,t,o){const{length:i}=t;if(o>=i){const{generator:n}=e;let r=t[i-1];for(let s=i;s<=o;s++){const o=new Int32Array([1,e.exp(s-1+n)]);const i=r.multiply(new mt(e,o));t.push(i);r=i}}return t[o]}let Gt=class e{#x;#M;constructor(e=bt){this.#x=e;this.#M=[new mt(e,new Int32Array([1]))]}encode(e,t){const o=e.length-t;const i=new Int32Array(o);const n=Jt(this.#x,this.#M,t);i.set(e.subarray(0,o));const r=new mt(this.#x,i);const s=r.multiplyByMonomial(t,1);const[,a]=s.divide(n);const{coefficients:l}=a;const d=t-l.length;const c=o+d;e.fill(0,o,c);e.set(l,c)}};
146
+ /**
147
+ * @module QRCode
148
+ * @package @nuintun/qrcode
149
+ * @license MIT
150
+ * @version 5.0.2
151
+ * @author nuintun <nuintun@qq.com>
152
+ * @description A pure JavaScript QRCode encode and decode library.
153
+ * @see https://github.com/nuintun/qrcode#readme
154
+ */function Xt(e,t){const o=e.length;const i=new Int32Array(o+t);i.set(e);(new Gt).encode(i,t);return new Uint8Array(i.subarray(o))}function Kt(e,{ecBlocks:t,numECCodewordsPerBlock:o}){let i=0;let n=0;let r=0;const s=[];for(const{count:a,numDataCodewords:l}of t){for(let t=0;t<a;t++){const t=new Uint8Array(l);e.writeToUint8Array(r*8,t,0,l);const a=Xt(t,o);s.push(new Zt(t,a));r+=l;i=Math.max(i,a.length);n=Math.max(n,l)}}const a=new Ct;for(let e=0;e<n;e++){for(const{dataCodewords:t}of s){if(e<t.length){a.append(t[e],8)}}}for(let e=0;e<i;e++){for(const{ecCodewords:t}of s){if(e<t.length){a.append(t[e],8)}}}return a}function Yt(e,t){const o=t*8;for(let t=0;t<4&&e.length<o;t++){e.append(0)}const i=e.length&7;if(i>0){for(let t=i;t<8;t++){e.append(0)}}const n=t-e.byteLength;for(let t=0;t<n;t++){e.append(t&1?17:236,8)}}function eo(e){return e.mode===Je.BYTE}function to(e){return e.mode===Je.HANZI}function oo(e,t){e.append(t.bits,4)}function io(e,t,o){if(eo(t)){const[i]=t.charset.values;if(i!==o){e.append(Je.ECI.bits,4);if(i<=127){e.append(i,8)}else if(i<=16383){e.append(32768|i,16)}else{e.append(12582912|i,24)}return i}}return o}function no(e,t){const[o,i]=t;switch(o){case"GS1":oo(e,Je.FNC1_FIRST_POSITION);break;case"AIM":oo(e,Je.FNC1_SECOND_POSITION);e.append(i,8);break}}function ro(e,t){if(eo(e)){return t.byteLength}return e.content.length}function so(e,t,o,i){e.append(i,t.getCharacterCountBits(o))}function ao(e,t,o){const i=t.getECBlocks(o);const n=Math.ceil(e/8);return i.numTotalDataCodewords>=n}function lo(e,t){for(const o of ft){if(ao(e,o,t)){return o}}throw new Error("data too big for all versions")}function co(e,t){let o=0;for(const{mode:i,head:n,body:r}of e){o+=n.length+i.getCharacterCountBits(t)+r.length}return o}function ho(e,t){const o=co(e,ft[0]);const i=lo(o,t);const n=co(e,i);return lo(n,t)}function po(e,t,o){let i=0;let n=Qt(e,t,o,i);let r=at(n);for(let s=1;s<8;s++){const a=Qt(e,t,o,s);const l=at(a);if(l<r){i=s;n=a;r=l}}return[i,n]}
155
+ /**
156
+ * @module QRCode
157
+ * @package @nuintun/qrcode
158
+ * @license MIT
159
+ * @version 5.0.2
160
+ * @author nuintun <nuintun@qq.com>
161
+ * @description A pure JavaScript QRCode encode and decode library.
162
+ * @see https://github.com/nuintun/qrcode#readme
163
+ */const uo=(1<<12)-1;class fo{#T;#E;#n;#A;#m;#$;#B;constructor(e){const t=1<<e;const o=t+1;this.#T=t;this.#E=o;this.#A=e;this.reset()}get bof(){return this.#T}get eof(){return this.#E}get bits(){return this.#n}get depth(){return this.#A}reset(){const e=this.#A+1;this.#n=e;this.#m=1<<e;this.#B=new Map;this.#$=this.#E+1}add(e,t){let o=this.#$;if(o>uo){return false}this.#B.set(e<<8|t,o++);let i=this.#n;let n=this.#m;if(o>n){n=1<<++i}this.#n=i;this.#m=n;this.#$=o;return true}get(e,t){return this.#B.get(e<<8|t)}}
164
+ /**
165
+ * @module QRCode
166
+ * @package @nuintun/qrcode
167
+ * @license MIT
168
+ * @version 5.0.2
169
+ * @author nuintun <nuintun@qq.com>
170
+ * @description A pure JavaScript QRCode encode and decode library.
171
+ * @see https://github.com/nuintun/qrcode#readme
172
+ */class mo{#n=0;#D;#R=0;#j=[];constructor(e){this.#D=e}write(e){let t=this.#n;let o=this.#R|e<<t;t+=this.#D.bits;const i=this.#j;while(t>=8){i.push(o&255);o>>=8;t-=8}this.#n=t;this.#R=o}pipe(e){const t=this.#j;if(this.#n>0){t.push(this.#R)}e.writeByte(this.#D.depth);const{length:o}=t;for(let i=0;i<o;){const n=o-i;if(n>=255){e.writeByte(255);e.writeBytes(t,i,255);i+=255}else{e.writeByte(n);e.writeBytes(t,i,n);i=o}}e.writeByte(0)}}
173
+ /**
174
+ * @module QRCode
175
+ * @package @nuintun/qrcode
176
+ * @license MIT
177
+ * @version 5.0.2
178
+ * @author nuintun <nuintun@qq.com>
179
+ * @description A pure JavaScript QRCode encode and decode library.
180
+ * @see https://github.com/nuintun/qrcode#readme
181
+ */function go(e,t,o){const i=new fo(t);const n=new mo(i);n.write(i.bof);if(e.length>0){let t=e[0];const{length:o}=e;for(let r=1;r<o;r++){const o=e[r];const s=i.get(t,o);if(s!=null){t=s}else{n.write(t);if(!i.add(t,o)){n.write(i.bof);i.reset()}t=o}}n.write(t)}n.write(i.eof);n.pipe(o)}
182
+ /**
183
+ * @module QRCode
184
+ * @package @nuintun/qrcode
185
+ * @license MIT
186
+ * @version 5.0.2
187
+ * @author nuintun <nuintun@qq.com>
188
+ * @description A pure JavaScript QRCode encode and decode library.
189
+ * @see https://github.com/nuintun/qrcode#readme
190
+ */class bo{#j=[];get bytes(){return this.#j}writeByte(e){this.#j.push(e&255)}writeInt16(e){this.#j.push(e&255,e>>8&255)}writeBytes(e,t=0,o=e.length){const i=this.#j;for(let n=0;n<o;n++){i.push(e[t+n]&255)}}}
191
+ /**
192
+ * @module QRCode
193
+ * @package @nuintun/qrcode
194
+ * @license MIT
195
+ * @version 5.0.2
196
+ * @author nuintun <nuintun@qq.com>
197
+ * @description A pure JavaScript QRCode encode and decode library.
198
+ * @see https://github.com/nuintun/qrcode#readme
199
+ */const{fromCharCode:xo}=String;function wo(e){e&=63;if(e>=0){if(e<26){return 65+e}else if(e<52){return 97+(e-26)}else if(e<62){return 48+(e-52)}else if(e===62){return 43}else if(e===63){return 47}}throw new Error(`illegal char: ${xo(e)}`)}class yo{#n=0;#R=0;#_=0;#L=new bo;get bytes(){return this.#L.bytes}write(e){let t=this.#n+8;const o=this.#L;const i=this.#R<<8|e&255;while(t>=6){o.writeByte(wo(i>>>t-6));t-=6}this.#_++;this.#n=t;this.#R=i}close(){const e=this.#n;const t=this.#L;if(e>0){t.writeByte(wo(this.#R<<6-e));this.#n=0;this.#R=0}const o=this.#_;if(o%3!=0){const e=3-o%3;for(let o=0;o<e;o++){t.writeByte(61)}}}}
200
+ /**
201
+ * @module QRCode
202
+ * @package @nuintun/qrcode
203
+ * @license MIT
204
+ * @version 5.0.2
205
+ * @author nuintun <nuintun@qq.com>
206
+ * @description A pure JavaScript QRCode encode and decode library.
207
+ * @see https://github.com/nuintun/qrcode#readme
208
+ */class ko{#O;#H;#P;#U;#q=[];constructor(e,t,{foreground:o=[0,0,0],background:i=[255,255,255]}={}){this.#O=e;this.#H=t;this.#P=o;this.#U=i}#N(){const e=this.#O;const t=this.#H;const o=new bo;const i=this.#U;const n=this.#P;o.writeBytes([71,73,70,56,57,97]);o.writeInt16(e);o.writeInt16(t);o.writeBytes([128,0,0]);o.writeBytes([i[0],i[1],i[2]]);o.writeBytes([n[0],n[1],n[2]]);o.writeByte(44);o.writeInt16(0);o.writeInt16(0);o.writeInt16(e);o.writeInt16(t);o.writeByte(0);go(this.#q,2,o);o.writeByte(59);return o.bytes}set(e,t,o){this.#q[t*this.#O+e]=o}toDataURL(){const e=this.#N();const t=new yo;for(const o of e){t.write(o)}t.close();const o=t.bytes;let i="data:image/gif;base64,";for(const e of o){i+=xo(e)}return i}}
209
+ /**
210
+ * @module QRCode
211
+ * @package @nuintun/qrcode
212
+ * @license MIT
213
+ * @version 5.0.2
214
+ * @author nuintun <nuintun@qq.com>
215
+ * @description A pure JavaScript QRCode encode and decode library.
216
+ * @see https://github.com/nuintun/qrcode#readme
217
+ */class vo{#W;#a;#g;#V;constructor(e,t,o,i){this.#W=i;this.#a=o;this.#V=e;this.#g=t}get size(){return this.#V.size}get mask(){return this.#W}get level(){return this.#a.name}get version(){return this.#g.version}get(e,t){const{size:o}=this.#V;if(e<0||t<0||e>=o||t>=o){throw new Error(`illegal coordinate: [${e}, ${t}]`)}return this.#V.get(e,t)}toDataURL(e=2,{margin:t=e*4,...o}={}){e=Math.max(1,e>>0);t=Math.max(0,t>>0);const i=this.#V;const n=i.size;const r=e*n+t*2;const s=new ko(r,r,o);const a=r-t;for(let o=0;o<r;o++){for(let n=0;n<r;n++){if(n>=t&&n<a&&o>=t&&o<a){const r=qe((n-t)/e);const a=qe((o-t)/e);s.set(n,o,i.get(r,a))}else{s.set(n,o,0)}}}return s.toDataURL()}}
218
+ /**
219
+ * @module QRCode
220
+ * @package @nuintun/qrcode
221
+ * @license MIT
222
+ * @version 5.0.2
223
+ * @author nuintun <nuintun@qq.com>
224
+ * @description A pure JavaScript QRCode encode and decode library.
225
+ * @see https://github.com/nuintun/qrcode#readme
226
+ */function Co(e){if(e===""){throw new Error("segment content should be at least 1 character")}}function zo(e){if(!(e instanceof Pe)){throw new Error("illegal charset")}}function _o(e){const{fnc1:t}=e;if(t!=null){const[e]=t;if(e!=="GS1"&&e!=="AIM"){throw new Error("illegal fn1 hint")}if(e==="AIM"){const[,e]=t;if(e<0||e>255||!Number.isInteger(e)){throw new Error("illegal fn1 application indicator")}}}}function Io(e){if(["L","M","Q","H"].indexOf(e)<0){throw new Error("illegal error correction level")}}function jo(e){if(e!=="Auto"){if(e<1||e>40||!Number.isInteger(e)){throw new Error("illegal version")}}}
227
+ /**
228
+ * @module QRCode
229
+ * @package @nuintun/qrcode
230
+ * @license MIT
231
+ * @version 5.0.2
232
+ * @author nuintun <nuintun@qq.com>
233
+ * @description A pure JavaScript QRCode encode and decode library.
234
+ * @see https://github.com/nuintun/qrcode#readme
235
+ */class So{#Q;#a;#N;#g;constructor({hints:e={},level:t="L",version:o="Auto",encode:i=wt}={}){_o(e);Io(t);jo(o);this.#Q=e;this.#N=i;this.#g=o;this.#a=ct[t]}encode(...e){const t=this.#a;const o=this.#N;const{fnc1:i}=this.#Q;const n=this.#g;const r=[];let s=false;let[a]=Pe.ISO_8859_1.values;for(const t of e){const{mode:e}=t;const n=new Ct;const l=t.encode(o);const d=ro(t,l);a=io(n,t,a);if(i!=null&&!s){s=true;no(n,i)}oo(n,e);if(to(t)){n.append(1,4)}r.push({mode:e,head:n,body:l,length:d})}let l;if(n==="Auto"){l=ho(r,t)}else{l=ft[n-1];const e=co(r,l);if(!ao(e,l,t)){throw new Error("data too big for requested version")}}const d=new Ct;for(const{mode:e,head:t,body:o,length:i}of r){d.append(t);so(d,e,l,i);d.append(o)}const c=l.getECBlocks(t);Yt(d,c.numTotalDataCodewords);const h=Kt(d,c);const[p,u]=po(h,l,t);return new vo(u,l,t,p)}}
236
+ /**
237
+ * @module QRCode
238
+ * @package @nuintun/qrcode
239
+ * @license MIT
240
+ * @version 5.0.2
241
+ * @author nuintun <nuintun@qq.com>
242
+ * @description A pure JavaScript QRCode encode and decode library.
243
+ * @see https://github.com/nuintun/qrcode#readme
244
+ */class Fo{#Z;#J;constructor(e,t=Pe.ISO_8859_1){Co(e);zo(t);this.#Z=e;this.#J=t}get mode(){return Je.BYTE}get content(){return this.#Z}get charset(){return this.#J}encode(e){const t=new Ct;const o=e(this.#Z,this.#J);for(const e of o){t.append(e,8)}return t}}const Mo={number:"",isWorking:false,close:async function(e){const{onOk:t,onError:o}=e??{};const{number:i}=this;if(i){const e=await d({url:`/resource/update_id/${i}`,method:"delete"});if(e.success){this.number="";t?.()}else{o?.()}}}};const To=".mobile-upload{display:flex;justify-content:flex-end;margin-bottom:4px}.btn{position:relative;padding:4px 8px;border-radius:4px;cursor:pointer;overflow:hidden;display:flex;justify-content:center;align-items:center;white-space:nowrap}.btn::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%}.btn:hover::after{background-color:rgba(0,0,0,0.04)}.btn-link{color:#0D75FB}.btn-default{background-color:#ffffff;color:#0D75FB;border:1px solid #0D75FB}.btn-primary{background-color:#0D75FB;color:#ffffff}.loading{font-size:12px;color:#999999}.mask{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);display:flex;justify-content:center;align-items:center;z-index:10000}.mask .upload-wrapper{width:540px;max-width:80%;max-height:80%;background-color:#ffffff;padding:32px 24px;border-radius:16px;overflow-y:auto}.mask .upload-wrapper .upload-box{display:flex;flex-direction:column;align-items:center}.time-expire{margin:8px 0;text-align:center;font-size:12px;color:#555555}.time-count-down{margin-left:8px;color:#0D75FB}.alert-tip{margin-top:8px;text-align:center;font-size:12px;color:#999999}.qrcode-wrapper{width:160px;height:160px;display:flex;justify-content:center;align-items:center;border:1px solid #e5e5e5;border-radius:4px;padding:1px}.qrcode-wrapper .qrcode{width:100%;height:100%}.modal-footer{margin-top:32px;display:flex;justify-content:center;align-items:center;gap:8px}.modal-footer .btn{min-width:100px}.qrcode-textarea{width:calc(100% - 16px);min-height:120px;border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}";const Eo=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ao=class o{constructor(o){e(this,o);this.ok=t(this,"ok")}name="";rows=8;maxLength=undefined;uploadHeaders;uploadParams;QR_CODE_VALID_TIME=0;open=false;mobileUrl="";setStartMobileUpload=false;startMobileUploadLoading=false;qrcodeStatus="loading";value="";ok;setStartMobileUploadWrapper=e=>{Mo.isWorking=e;this.setStartMobileUpload=e};qrcodeUrl="";setMobileUrlWrapper=e=>{this.mobileUrl=e;if(e){const t=new So;const o=t.encode(new Fo(e));this.qrcodeUrl=o.toDataURL()}else{this.qrcodeUrl=""}};pollingQueryNumberInfo=async e=>{const t=await d({url:`/sdk/v1/update_id/${e}/status`,method:"get"});if(t?.success){const e=t.data??{};const{custom_data:o}=e;this.value=o??""}if(Mo.isWorking){setTimeout((()=>{this.pollingQueryNumberInfo(e)}),3e3)}};handleStartMobileUpload=async()=>{const e=this;this.qrcodeStatus="loading";this.startMobileUploadLoading=true;const t=this.uploadParams??{};const o={cfg:{fromUserName:"",fromUserId:"",upload:e.uploadParams,name:e.name,rows:e.rows,maxLength:e.maxLength,params:t}};const i=await d({url:`/sdk/v1/update_id`,method:"post",data:o});if(i?.success){const e=i.data??{};Mo.number=e.update_id;this.QR_CODE_VALID_TIME=Number(e.exp)-Number(e.now);const t=`${f}/agents/inputByCode?num=${Mo.number}`;this.setMobileUrlWrapper(t);this.setStartMobileUploadWrapper(true);this.qrcodeStatus="active";this.pollingQueryNumberInfo(Mo.number)}this.startMobileUploadLoading=false};cancelLoading=false;cancelMobileUpload=async()=>{this.cancelLoading=true;await Mo.close({onError(){y.info("取消失败")}});this.cancelLoading=false;this.QR_CODE_VALID_TIME=0;this.setStartMobileUploadWrapper(false);this.setMobileUrlWrapper("");this.qrcodeStatus="expired";this.value="";this.open=false};render(){const e=m();if(e){return null}else{return i("div",null,i("div",{class:"mobile-upload"},i("div",{class:"btn btn-link",onClick:()=>{this.open=true;this.handleStartMobileUpload()}},"扫码填写")),this.open&&i("div",{class:"mask"},i("div",{class:"upload-wrapper"},this.setStartMobileUpload?i("div",{class:"upload-box"},i("div",{class:"qrcode-wrapper"},this.qrcodeStatus==="active"&&i("img",{class:"qrcode",src:this.qrcodeUrl}),this.qrcodeStatus==="loading"&&i("span",{class:"loading"},"加载中..."),this.qrcodeStatus==="expired"&&i("div",{class:"btn btn-link",onClick:this.handleStartMobileUpload},"重新获取")),i("div",{class:"time-expire"},"二维码有效期",i("span",{class:"time-count-down"},!!this.QR_CODE_VALID_TIME&&i("pcm-time-count-down",{time:this.QR_CODE_VALID_TIME,onFinished:()=>{this.qrcodeStatus="expired"}}))),i("div",{class:"alert-tip"},"填写过程中请不要关闭此弹窗"),this.qrcodeStatus==="active"&&i("div",{style:{marginTop:"12px",fontSize:"12px"},class:"btn btn-link",onClick:()=>{navigator.clipboard.writeText(this.mobileUrl).then((()=>{y.success("已复制到剪贴板")})).catch((()=>{y.error("复制失败")}))}},"复制二维码地址")):this.startMobileUploadLoading&&i("span",{class:"loading"},"加载中..."),i("div",{style:{marginTop:"12px"}},!!this.value?.length&&i("textarea",{readOnly:true,class:"qrcode-textarea",value:this.value,onChange:e=>{this.value=e.target.value}})),i("div",{class:"modal-footer"},i("div",{class:"btn btn-default",onClick:this.cancelMobileUpload},"取消"),i("div",{class:"btn btn-primary",onClick:()=>{if(!this.value){y.info(`请输入内容`);return}if(this.value.length>this.maxLength){y.info(`输入内容不能超过${this.maxLength}个字符`);return}this.ok.emit(this.value);this.cancelMobileUpload()}},"完成")))))}}};Ao.style=To+Eo;const $o={number:"",isWorking:false,close:async function(e){const{onOk:t,onError:o}=e??{};const{number:i}=this;if(i){const e=await d({url:`/resource/update_id/${i}`,method:"delete"});if(e.success){this.number="";t?.()}else{o?.()}}}};const Bo=".mobile-upload{display:flex;justify-content:flex-end;margin-bottom:4px}.btn{position:relative;padding:4px 8px;border-radius:4px;cursor:pointer;overflow:hidden;display:flex;justify-content:center;align-items:center;white-space:nowrap}.btn::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%}.btn:hover::after{background-color:rgba(0,0,0,0.04)}.btn-link{color:#0D75FB}.btn-default{background-color:#ffffff;color:#0D75FB;border:1px solid #0D75FB}.btn-primary{background-color:#0D75FB;color:#ffffff}.loading{font-size:12px;color:#999999}.mask{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);display:flex;justify-content:center;align-items:center;z-index:10000}.mask .upload-wrapper{width:540px;max-width:80%;max-height:80%;background-color:#ffffff;padding:32px 24px;border-radius:16px;overflow-y:auto}.mask .upload-wrapper .upload-box{display:flex;flex-direction:column;align-items:center}.time-expire{margin:8px 0;text-align:center;font-size:12px;color:#555555}.time-count-down{margin-left:8px;color:#0D75FB}.alert-tip{margin-top:8px;text-align:center;font-size:12px;color:#999999}.qrcode-wrapper{width:160px;height:160px;display:flex;justify-content:center;align-items:center;border:1px solid #e5e5e5;border-radius:4px;padding:1px}.qrcode-wrapper .qrcode{width:100%;height:100%}.modal-footer{margin-top:32px;display:flex;justify-content:center;align-items:center;gap:8px}.modal-footer .btn{min-width:100px}";const Do=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ro=class{constructor(o){e(this,o);this.ok=t(this,"ok")}multiple=false;acceptFileSuffixList=[];maxFileCount=Infinity;maxFileSize=Infinity;uploadHeaders;uploadParams;QR_CODE_VALID_TIME=0;open=false;mobileUrl="";setStartMobileUpload=false;startMobileUploadLoading=false;qrcodeStatus="loading";value=[];ok;setStartMobileUploadWrapper=e=>{$o.isWorking=e;this.setStartMobileUpload=e};qrcodeUrl="";setMobileUrlWrapper=e=>{this.mobileUrl=e;if(e){const t=new So;const o=t.encode(new Fo(e));this.qrcodeUrl=o.toDataURL()}else{this.qrcodeUrl=""}};pollingQueryNumberInfo=async e=>{const t=await d({url:`/sdk/v1/update_id/${e}/status`,method:"get"});if(t?.success){const e=t.data??{};const{file_list:o}=e;this.value=o??[]}if($o.isWorking){setTimeout((()=>{this.pollingQueryNumberInfo(e)}),3e3)}};handleStartMobileUpload=async()=>{const e=this;this.qrcodeStatus="loading";this.startMobileUploadLoading=true;const t=this.uploadParams??{};const o={is_knowledge_doc:false,tags:t.tags,cfg:{maxSize:e.maxFileSize,maxCount:e.multiple?e.maxFileCount:1,fromUserName:"",fromUserId:"",customAccept:e.acceptFileSuffixList.join(","),upload:e.uploadParams}};const i=await d({url:`/sdk/v1/update_id`,method:"post",data:o});if(i?.success){const e=i.data??{};$o.number=e.update_id;this.QR_CODE_VALID_TIME=Number(e.exp)-Number(e.now);const t=`${f}/agents/uploadFileByCode?num=${$o.number}`;this.setMobileUrlWrapper(t);this.setStartMobileUploadWrapper(true);this.qrcodeStatus="active";this.pollingQueryNumberInfo($o.number)}this.startMobileUploadLoading=false};cancelLoading=false;cancelMobileUpload=async()=>{this.cancelLoading=true;await $o.close({onError(){y.info("取消失败")}});this.cancelLoading=false;this.QR_CODE_VALID_TIME=0;this.setStartMobileUploadWrapper(false);this.setMobileUrlWrapper("");this.qrcodeStatus="expired";this.value=[];this.open=false};handleDelete=async e=>{const t=await d({url:`/sdk/v1/update_id/${$o.number}/file`,method:"delete",params:{update_id:$o.number,cos_key:e}});if(t?.success){this.value=this.value.filter((t=>t.cos_key!==e))}};render(){const e=m();if(e){return null}else{return i("div",null,i("div",{class:"mobile-upload"},i("div",{class:"btn btn-link",onClick:()=>{if(this.maxFileCount<1){y.info("文件数量已达到上限!");return}this.open=true;this.handleStartMobileUpload()}},"扫码上传")),this.open&&i("div",{class:"mask"},i("div",{class:"upload-wrapper"},this.setStartMobileUpload?i("div",{class:"upload-box"},i("div",{class:"qrcode-wrapper"},this.qrcodeStatus==="active"&&i("img",{class:"qrcode",src:this.qrcodeUrl}),this.qrcodeStatus==="loading"&&i("span",{class:"loading"},"加载中..."),this.qrcodeStatus==="expired"&&i("div",{class:"btn btn-link",onClick:this.handleStartMobileUpload},"重新获取")),i("div",{class:"time-expire"},"二维码有效期",i("span",{class:"time-count-down"},!!this.QR_CODE_VALID_TIME&&i("pcm-time-count-down",{time:this.QR_CODE_VALID_TIME,onFinished:()=>{this.qrcodeStatus="expired"}}))),i("div",{class:"alert-tip"},"上传过程中请不要关闭此弹窗"),this.qrcodeStatus==="active"&&i("div",{style:{marginTop:"12px",fontSize:"12px"},class:"btn btn-link",onClick:()=>{navigator.clipboard.writeText(this.mobileUrl).then((()=>{y.success("已复制到剪贴板")})).catch((()=>{y.error("复制失败")}))}},"复制二维码地址")):this.startMobileUploadLoading&&i("span",{class:"loading"},"加载中..."),i("div",{style:{marginTop:"12px"}},this.value?.map?.(((e,t)=>i("div",{class:"file-item",key:t},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},e?.file_name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.handleDelete(e.cos_key)}},"×"))))),i("div",{class:"modal-footer"},i("div",{class:"btn btn-default",onClick:this.cancelMobileUpload},"取消"),i("div",{class:"btn btn-primary",onClick:()=>{if(this.value.length>this.maxFileCount){y.info(`最多只能选择${this.maxFileCount}个文件,请删除多余文件!`);return}this.ok.emit(this.value);this.cancelMobileUpload()}},"完成")))))}}};Ro.style=Bo+Do;const Lo="";const Oo=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ho=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="面试报告";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_urls&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-msbg-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传面试内容");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始面试时出错:",e);w.captureError(e,{action:"handleStartInterview",component:"pcm-msbg-modal",title:"开始面试时出错"});x.emitError({error:e,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_urls);const a=Boolean(this.customInputs?.file_urls&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传面试内容"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传面试内容"),i("p",{class:"upload-hint"},"支持 mp3、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018877",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_urls:this.customInputs?.file_urls||this.uploadedFileInfo?.cos_key,file_names:this.customInputs?.file_names||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Ho.style=Lo+Oo;const Po="";const Uo=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const qo=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="千岗千简历";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始出题";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-qgqjl-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始面试时出错:",e);w.captureError(e,{action:"handleStartInterview",component:"pcm-qgqjl-modal",title:"开始面试时出错"});x.emitError({error:e,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};qo.style=Po+Uo;const No="";const Wo=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Vo=e=>{const t=e.toString();return t[1]?t:`0${t}`};const Qo=e=>{const t=Math.floor(e/3600);const o=Math.floor((e-t*3600)/60);const i=e-t*3600-o*60;return`${Vo(t)}:${Vo(o)}:${Vo(i)}`};const Zo=class{constructor(o){e(this,o);this.finished=t(this,"finished")}time;finished;currentTime;componentWillLoad(){this.currentTime=this.time}watchStateHandler(e){let t;if(e>0){t=setTimeout((()=>{this.currentTime=e-1;clearTimeout(t)}),1e3)}else{this.finished.emit()}}render(){return i("span",{key:"88065e0a7955b893f71110ae8389ee1d1d37bdf6"},Qo(this.currentTime))}static get watchers(){return{currentTime:["watchStateHandler"]}}};Zo.style=No+Wo;const Jo="";const Go=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Xo=class{constructor(o){e(this,o);this.uploadFailed=t(this,"uploadFailed");this.uploadChange=t(this,"uploadChange")}multiple=false;mobileUploadAble=false;labelText="上传文件";acceptFileSuffixList=[];maxFileCount=Infinity;maxFileSize=Infinity;uploadHeaders;uploadParams;uploadFailed;uploadChange;get hostElement(){return o(this)}selectedFiles=null;async getIsUploading(){return!!this.selectedFiles?.some((e=>e.state===g.Uploading))}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async uploadFile(e){try{const t=await h(e,this.uploadHeaders||{},this.uploadParams||{});return{...t,file:e,file_name:e.name,file_size:e.size,state:g.Success}}catch(t){this.clearSelectedFile();w.captureError(t,{action:"uploadFile",component:"pcm-mnms-modal",title:"文件上传失败"});this.uploadFailed.emit({error:t,message:"文件上传失败,请重试"});return{file:e,error:t,state:g.Failed}}}handleFileChange=async e=>{const t=e.target;if(this.multiple);else{const e=t.files?.[0];if(!e)return;if(this.acceptFileSuffixList?.length){const t="."+e.name.split(".").pop()?.toLowerCase();if(!this.acceptFileSuffixList.includes(t)){y.info(`请上传 ${this.acceptFileSuffixList.join("、")} 格式的文件`);return}}if(this.maxFileSize<e.size){y.info(`文件大小不能超过 ${b(this.maxFileSize)??"-"}`);return}this.selectedFiles=[{file:e,file_name:e.name,file_size:e.size,state:g.Uploading,cos_key:"",error:undefined}];const o=await this.uploadFile(e);this.selectedFiles=[o];this.clearSelectedFile();this.emitUploadChange()}};emitUploadChange=()=>{this.uploadChange.emit(this.selectedFiles?.map?.((e=>({cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}))))};uploadBtn(){return i("div",null,!!this.mobileUploadAble&&i("pcm-mobile-upload-btn",{multiple:this.multiple,acceptFileSuffixList:this.acceptFileSuffixList,maxFileCount:this.maxFileCount,maxFileSize:this.maxFileSize,uploadHeaders:this.uploadHeaders,uploadParams:this.uploadParams,onOk:e=>{this.selectedFiles=[...this.selectedFiles??[],...(e.detail??[]).map((e=>({...e,state:g.Success})))];this.emitUploadChange()}}),i("div",{class:"upload-placeholder",onClick:this.handleUploadClick},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},!!this.acceptFileSuffixList?.length&&i("p",null,"支持 ",this.acceptFileSuffixList.join("、")," 格式。"),!!this.maxFileSize&&this.maxFileSize!==Infinity&&i("p",null,"文件大小不能超过 ",b(this.maxFileSize)??"","。"),!!this.maxFileCount&&this.maxFileCount!==Infinity&&i("p",null,"最多上传 ",this.maxFileCount," 个文件。"))))}render(){return i("div",{key:"faec753d60f8c6bfb1e3996b67552f8a12155c07"},i("div",{key:"55e1e83f962dc17c033885869d8cb7e73b65bb95",class:"resume-upload-section"},i("label",{key:"80cb959d043a015267bfb55c20bae44afd509ebd"},this.labelText),i("div",{key:"e7aa8c65761f945287de858ea7b3ad036fb4cb6d",class:"upload-area"},i("div",{key:"48bef805f845bdd6e6a542bccbc1d2b8d30b4a02"},this.selectedFiles?.map?.(((e,t)=>i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name",style:e.state===g.Failed?{color:"red",textDecoration:"line-through"}:undefined},e?.file_name),e.state===g.Failed&&i("span",{style:{color:"red",marginLeft:"4px"}},"(",e.error?.message??"上传失败",")")),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.selectedFiles=this.selectedFiles?.filter(((e,o)=>t!==o))}},"×"))))),this.multiple?i("div",null,(this.selectedFiles?.length??0)<this.maxFileCount&&this.uploadBtn()):i("div",null,!this.selectedFiles?.length&&this.uploadBtn()))),i("input",{key:"480b2f35655d4cdb5a99c058e4b894baf0e4c6a8",type:"file",class:"file-input",onChange:this.handleFileChange}))}};Xo.style=Jo+Go;const Ko=":host{display:block;font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000;-webkit-overflow-scrolling:touch;}.fullscreen-overlay{padding:0;position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-container{background-image:url(https://pub.pincaimao.com/static/web/images/login/bg_login_m.png);background-size:100%;height:100%;border-radius:0px 0px 8px 8px}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:400px}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{width:38px;height:38px;border-radius:16px;background:#0d75fb;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color 0.2s ease}.send-button img{width:24px;height:24px}.send-button:hover{background:#0a62d6}.send-button.disabled{background:#d9d9d9;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:10px 20px 0px 20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:0px 16px 16px 16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:end;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:10px;border:1px solid #d9d9d9;border-radius:6px}.toolbar-actions:hover{background-color:#f0f0f0}.toolbar-button{background:transparent;border:none;color:#666;cursor:pointer;padding:0;margin:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.toolbar-button>div,.toolbar-button>svg{display:flex;justify-content:center;align-items:center}.toolbar-button img{width:16px;height:16px}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}.toolbar-button.recording{background-color:rgba(255, 0, 0, 0.1);color:#ff3b30;animation:pulse 1.5s infinite}.toolbar-button.converting{background-color:rgba(0, 122, 255, 0.1);color:#007aff}.toolbar-button .recording-time{font-size:12px;margin-left:4px}.converting-indicator{display:flex;justify-content:center;align-items:center}.converting-indicator svg{animation:spin 1.5s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0.4)}70%{box-shadow:0 0 0 6px rgba(255, 0, 0, 0)}100%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0)}}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.references-section{margin-top:30px;padding:12px;background-color:#f9f9f9;border-radius:8px;border:1px solid #e8e8e8}.references-title{font-size:14px;color:#666;margin:0 0 8px 0;font-weight:500}.references-list{display:flex;flex-direction:column;gap:8px}.reference-item{background-color:#fff;border:1px solid #e8e8e8;border-radius:6px;padding:10px;cursor:pointer;transition:background-color 0.2s, box-shadow 0.2s}.reference-item:hover{background-color:#f5f5f5;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1)}.reference-header{display:flex;align-items:center;gap:6px;position:relative}.reference-icon{color:#1890ff;display:flex;align-items:center}.reference-name{font-size:13px;font-weight:500;color:#333;flex:1}.download-icon{color:#1890ff;display:flex;align-items:center}.reference-content{display:none}.suggested-questions{margin-top:20px;padding:12px;background-color:#f0f7ff;border-radius:8px;border:1px solid #d6e8ff}.suggested-title{font-size:14px;color:#1890ff;margin:0 0 8px 0;font-weight:500}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#fff;border:1px solid #e6f7ff;border-radius:6px;cursor:pointer;font-size:14px;color:#1890ff;transition:all 0.3s;margin-bottom:8px}.suggested-question:last-child{margin-bottom:0}.suggested-question:hover{background-color:#e6f7ff;border-color:#91d5ff}.arrow-right{color:#1890ff;display:flex;align-items:center}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e6f7ff;border-top-color:#1890ff;border-radius:50%;animation:spin 1s linear infinite}";const Yo=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.tokenInvalid=t(this,"tokenInvalid");this.clearConversation=t(this,"clearConversation")}modalTitle;token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;tokenInvalid;SCROLL_THRESHOLD=20;fullscreen=false;textAnswer="";isSubmittingText=false;customInputs={show_suggested_questions:"false"};suggestedQuestions=[];suggestedQuestionsLoading=false;currentRefs=[];showReferences=false;employeeId;isRecordingAudio=false;audioRecorder=null;audioChunks=[];isConvertingAudio=false;audioRecordingTimeLeft=60;audioRecordingTimer=null;audioRecordingStartTime=0;maxAudioRecordingTime=60;employeeDetails=null;isLoadingEmployeeDetails=false;quickQuestions=[];tokenInvalidListener;clearConversation;shouldHideReferences=false;isUserScrolling=false;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleClose=()=>{this.modalClosed.emit()};async sendMessageToAPI(e){if(!this.employeeId){alert("请提供有效的数字员工ID");return}this.isLoading=true;let t="";const o=new Date;const i=`${o.getHours()}:${o.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||"请开始";this.suggestedQuestions=[];this.currentRefs=[];this.shouldHideReferences=false;const r={id:`temp-${Date.now()}`,conversation_id:this.conversationId,parent_message_id:"00000000-0000-0000-0000-000000000000",inputs:this.customInputs||{},query:n,answer:"",message_files:[],feedback:{},retriever_resources:[],created_at:Math.floor(Date.now()/1e3).toString(),agent_thoughts:[],status:"normal",error:null,time:i,isStreaming:true};this.currentStreamingMessage=r;this.shouldAutoScroll=true;this.scrollToBottom();const s={response_mode:"streaming",conversation_id:this.conversationId,query:n,employee_id:this.employeeId};s.inputs={...this.customInputs};await l({url:`/sdk/v1/knowledge/chat/chat-messages`,method:"POST",data:s,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_started"&&e.data.title.includes("聘才猫推荐开始")){this.suggestedQuestionsLoading=true}if(e.event==="node_started"&&e.data.title.includes("不显示引用")){this.shouldHideReferences=true}if(e.event==="node_finished"&&e.data.title.includes("聘才猫推荐结束")){let t=[];try{let o=e.data.outputs.text;if(typeof o==="string"){o=o.replace(/```json\n/,"").replace(/```/,"").trim();const e=JSON.parse(o);if(e.status==="success"&&Array.isArray(e.items)){t=e.items.map((e=>e.question))}}else{const e=o;if(e.status==="success"&&Array.isArray(e.items)){t=e.items.map((e=>e.question))}}}catch(e){console.warn("解析问题建议失败:",e)}this.suggestedQuestions=t;this.suggestedQuestionsLoading=false}if(e.event==="node_finished"&&e.data?.inputs?.documents){const t=[];e.data.inputs.documents.forEach((e=>{if(e.result_list&&Array.isArray(e.result_list)){e.result_list.forEach((e=>{if(e.doc_info&&e.content){t.push({doc_info:{doc_name:e.doc_info.doc_name,doc_id:e.doc_info.doc_id},content:e.content})}}))}}));const o=new Map;t.forEach((e=>{if(e.doc_info&&e.doc_info.doc_id){o.set(e.doc_info.doc_id,e)}}));this.currentRefs=Array.from(o.values())}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const o={...this.currentStreamingMessage,answer:t,id:e.message_id||this.currentStreamingMessage.id,isStreaming:true,parent_message_id:e.parent_message_id||this.currentStreamingMessage.parent_message_id,retriever_resources:e.retriever_resources||this.currentStreamingMessage.retriever_resources,agent_thoughts:e.agent_thoughts||this.currentStreamingMessage.agent_thoughts};this.currentStreamingMessage=o;this.scrollToBottom()}}}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:e=>{console.error("发生错误:",e);alert(e instanceof Error?e.message:"消息发送失败,请稍后再试");this.messages=[...this.messages,{...r,answer:"抱歉,发生了错误,请稍后再试。",error:e,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.messages=[...this.messages,e];this.currentStreamingMessage=null}})}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:o,clientHeight:i}=e;const n=o-t-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){if(!this.shouldAutoScroll)return;const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}componentDidRender(){if(this.isLoadingHistory||this.shouldAutoScroll&&this.isOpen){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e){e.scrollTop=e.scrollHeight}}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;try{const e=await d({url:"/sdk/v1/knowledge/chat/conversation-history",method:"GET",data:{conversation_id:this.conversationId}});if(e.success&&e.data){const t=e.data.data||[];const o=t.map((e=>{const t=new Date(parseInt(e.created_at)*1e3);const o=t.getHours().toString().padStart(2,"0");const i=t.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;return{id:e.id,conversation_id:e.conversation_id,parent_message_id:e.parent_message_id||"00000000-0000-0000-0000-000000000000",inputs:e.inputs||{},query:e.query||"",answer:e.answer||"",message_files:e.message_files||[],feedback:e.feedback||{},retriever_resources:e.retriever_resources||[],created_at:e.created_at,agent_thoughts:e.agent_thoughts||[],status:e.status||"normal",error:e.error,time:n,isStreaming:false}}));this.messages=o}}catch(e){console.error("加载历史消息失败:",e);alert(e instanceof Error?e.message:"加载历史消息失败,请刷新重试")}finally{this.isLoadingHistory=false;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200)}}async convertAudioToText(e){try{const t=await d({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:e}});if(t.success&&t.data&&t.data.text){return t.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(e){console.error("音频转文字错误:",e);return null}}async fetchEmployeeDetails(){if(!this.employeeId||!this.token)return;this.isLoadingEmployeeDetails=true;try{const e=await d({url:`/sdk/v1/knowledge/chat/employee/${this.employeeId}`,method:"GET"});if(e.success&&e.data){this.employeeDetails=e.data;if(this.employeeDetails.show_quote_doc!==undefined){this.showReferences=this.employeeDetails.show_quote_doc}if(this.employeeDetails.quick_questions){this.quickQuestions=this.employeeDetails.quick_questions.split(",").map((e=>e.trim())).filter((e=>e))}if(this.conversationId){await this.loadHistoryMessages()}}else{alert("获取智能体详情失败,请检查token和employeeId是否正确")}}catch(e){console.error("获取智能体详情失败:",e)}finally{this.isLoadingEmployeeDetails=false}}async handleIsOpenChange(e){if(e){if(!this.employeeId){console.error("未提供数字员工ID (employeeId)");setTimeout((()=>alert("请提供有效的数字员工ID")),0);return}await s(this.token);await this.fetchEmployeeDetails()}}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}this.stopAudioRecording()}handleTextInputChange=e=>{const t=e.target;this.textAnswer=t.value};handleKeyDown=e=>{if(e.key==="Enter"){if(e.ctrlKey){return}else{e.preventDefault();if(this.textAnswer.trim()&&!this.isSubmittingText&&!this.isLoading&&!this.currentStreamingMessage){this.submitTextAnswer()}}}};submitTextAnswer=async()=>{if(!this.textAnswer.trim()||this.isSubmittingText){return}this.isSubmittingText=true;try{const e=this.textAnswer;this.textAnswer="";await this.sendMessageToAPI(e)}catch(e){console.error("提交文本回答失败:",e);alert("提交回答失败,请重试")}finally{this.isSubmittingText=false}};handleVoiceInputClick=()=>{if(this.isRecordingAudio){this.stopAudioRecording()}else{navigator.mediaDevices.getUserMedia({audio:true}).then((e=>{this.startRecordingWithStream(e)})).catch((e=>{console.error("麦克风权限请求失败:",e);if(e.name==="NotAllowedError"||e.name==="PermissionDeniedError"){alert("麦克风访问被拒绝。\n\n在Mac上,请前往系统偏好设置 > 安全性与隐私 > 隐私 > 麦克风,确保您的浏览器已被允许访问麦克风。")}else{alert("无法访问麦克风,请确保已授予权限并且麦克风设备正常工作。")}}))}};startRecordingWithStream(e){try{const t=this.getSupportedAudioMimeType();let o;try{o=new MediaRecorder(e,{mimeType:t})}catch(t){console.warn("指定的音频MIME类型不受支持,使用默认设置:",t);try{o=new MediaRecorder(e)}catch(t){e.getTracks().forEach((e=>e.stop()));console.error("无法创建音频录制器:",t);alert("您的浏览器不支持音频录制功能");return}}this.audioRecorder=o;this.audioChunks=[];this.isRecordingAudio=true;this.audioRecordingStartTime=Date.now();this.audioRecordingTimeLeft=this.maxAudioRecordingTime;o.ondataavailable=e=>{if(e.data.size>0){this.audioChunks.push(e.data)}};o.onstop=()=>{e.getTracks().forEach((e=>e.stop()));this.processAudioRecording()};o.start(100);this.audioRecordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.audioRecordingStartTime)/1e3);this.audioRecordingTimeLeft=Math.max(0,this.maxAudioRecordingTime-e);if(this.audioRecordingTimeLeft<=0){this.stopAudioRecording()}}),1e3)}catch(t){e.getTracks().forEach((e=>e.stop()));console.error("开始录音失败:",t);alert("开始录音失败,请确保麦克风设备正常工作")}}async processAudioRecording(){if(this.audioChunks.length===0){console.warn("没有录制到音频数据");return}try{this.isConvertingAudio=true;const e=this.getSupportedAudioMimeType()||"audio/webm";const t=new Blob(this.audioChunks,{type:e});if(t.size===0){console.warn("录制的音频为空");this.isConvertingAudio=false;return}const o=e.includes("webm")?"webm":"mp3";const i=`audio_input.${o}`;const n=new File([t],i,{type:e});const r=await h(n,{},{tags:["audio"]});const s=await this.convertAudioToText(r.cos_key);if(s){const e=this.hostElement.shadowRoot?.querySelector(".text-answer-input");const t=e?.selectionStart||this.textAnswer.length;const o=this.textAnswer.substring(0,t);const i=this.textAnswer.substring(t);const n=o.length>0&&!o.endsWith(" ")?" ":"";this.textAnswer=o+n+s+i;setTimeout((()=>{if(e){const o=t+n.length+s.length;e.focus();e.setSelectionRange(o,o)}}),0)}else{console.warn("未能识别语音内容");alert("未能识别语音内容,请重试或直接输入文字")}}catch(e){console.error("处理音频录制失败:",e);alert("语音识别失败,请重试")}finally{this.isConvertingAudio=false;this.audioChunks=[]}}getSupportedAudioMimeType(){const e=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查音频MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""}stopAudioRecording(){if(this.audioRecorder&&this.isRecordingAudio){this.audioRecorder.stop();this.isRecordingAudio=false;if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}}}handleSuggestedQuestionClick=e=>{if(this.isLoading||this.currentStreamingMessage)return;this.textAnswer=e;this.submitTextAnswer()};async handleDocumentDownload(e){try{const t=e.doc_info.doc_id.match(/docID_(\d+)/);if(!t||!t[1]){alert("无法解析文档ID");return}const o=t[1];const i=await d({url:`/sdk/v1/files/${o}/info`,method:"GET"});if(i.success&&i.data?.file_url){const e=i.data.file_url;const t=`${e}${e.includes("?")?"&":"?"}ci-process=doc-preview&copyable=1&dstType=html`;window.open(t,"_blank")}else{alert("获取文档链接失败")}}catch(e){console.error("下载文档失败:",e);alert("下载文档失败,请稍后再试")}}handleClearConversation=()=>{if(this.isLoading||this.currentStreamingMessage)return;this.clearConversation.emit(this.conversationId);this.messages=[];this.currentStreamingMessage=null;this.conversationId=undefined;this.currentRefs=[];this.suggestedQuestions=[]};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.icon||(this.employeeDetails?.avatar||"");const r=this.modalTitle||(this.employeeDetails?.name||"在线客服");const s=()=>{if(!this.showReferences||this.currentRefs.length===0||this.currentStreamingMessage||this.shouldHideReferences)return null;return i("div",{class:"references-section"},i("h3",{class:"references-title"},"引用文档"),i("div",{class:"references-list"},this.currentRefs.map(((e,t)=>i("div",{class:"reference-item",key:`ref-${t}`,onClick:()=>this.handleDocumentDownload(e)},i("div",{class:"reference-header"},i("span",{class:"reference-icon"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))),i("span",{class:"reference-name"},e.doc_info.doc_name),i("span",{class:"download-icon"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))))))))};const a=()=>{if(!this.customInputs.show_suggested_questions&&!this.currentStreamingMessage){return null}if(this.suggestedQuestionsLoading){return i("div",{class:"loading-suggestions"},i("div",{class:"loading-spinner-small"}))}if(this.suggestedQuestions.length===0)return null;return i("div",{class:"suggested-questions"},i("h3",{class:"suggested-title"},"推荐问题"),this.suggestedQuestions.map(((e,t)=>i("div",{class:"suggested-question",key:`question-${t}`,onClick:()=>this.handleSuggestedQuestionClick(e)},i("span",null,e),i("span",{class:"arrow-right"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})))))))};const l=()=>{if(this.conversationId||this.quickQuestions.length===0||this.currentStreamingMessage)return null;return i("div",{class:"suggested-questions"},i("h3",{class:"suggested-title"},"常见问题"),this.quickQuestions.map(((e,t)=>i("div",{class:"suggested-question",key:`preset-question-${t}`,onClick:()=>this.handleSuggestedQuestionClick(e)},i("span",null,e),i("span",{class:"arrow-right"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})))))))};const d=()=>i("div",{class:"text-input-area"},i("textarea",{class:"text-answer-input",placeholder:"发消息",value:this.textAnswer,onInput:this.handleTextInputChange,onKeyDown:this.handleKeyDown,disabled:this.isRecordingAudio||this.isConvertingAudio}),i("div",{class:"input-toolbar"},i("div",{class:"toolbar-actions"},i("button",{class:"toolbar-button",title:"清除对话记录",onClick:this.handleClearConversation,disabled:this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.messages.length===0},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/brush-alt-svgrepo-com.png",alt:"清除对话记录"}))),i("div",{class:"toolbar-actions"},i("button",{class:{"toolbar-button":true,recording:this.isRecordingAudio,converting:this.isConvertingAudio},title:this.isRecordingAudio?"点击停止录音":this.isConvertingAudio?"正在识别语音...":"语音输入",onClick:this.handleVoiceInputClick,disabled:this.isConvertingAudio||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage},this.isRecordingAudio?i("div",null,i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}),i("circle",{cx:"12",cy:"11",r:"4",fill:"red"}))):this.isConvertingAudio?i("div",{class:"converting-indicator"},i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}))):i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})))),i("div",{class:{"send-button":true,disabled:!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.isRecordingAudio||this.isConvertingAudio},onClick:()=>{if(!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.isRecordingAudio||this.isConvertingAudio){return}this.submitTextAnswer()}},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/i_send.png",alt:"发送"}))));return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},n&&i("img",{src:n,class:"header-icon",alt:"应用图标"}),i("div",null,r)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),i("div",{class:"chat-container"},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((e=>i("div",{id:`message_${e.id}`,key:e.id},i("pcm-chat-message",{message:e,showFeedbackButtons:false,onMessageChange:t=>{const o=this.messages.map((o=>o.id===e.id?{...o,...t.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{message:this.currentStreamingMessage,showFeedbackButtons:false})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},this.isLoadingEmployeeDetails?i("p",null,"加载中..."):this.employeeDetails?.default_greeting?i("p",null,this.employeeDetails.default_greeting):i("p",null,"请输入...")),s(),a(),l())),i("div",{class:"recording-section"},i("div",{class:"recording-container"},d())))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Yo.style=Ko;const ei=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const ti=".plan-type-section{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.plan-type-section label{font-weight:600;color:#333;margin-bottom:8px}.plan-type-options{display:flex;gap:15px;flex-wrap:wrap}.plan-type-option{flex:1;min-width:120px;border:1px solid #e8e8e8;border-radius:8px;padding:15px;cursor:pointer;display:flex;flex-direction:column;align-items:center;transition:all 0.3s}.plan-type-option:hover{border-color:#1890ff;background-color:#f0f7ff}.plan-type-option.selected{border-color:#1890ff;background-color:#e6f7ff;box-shadow:0 2px 8px rgba(24, 144, 255, 0.2)}.option-icon{font-size:24px;margin-bottom:8px}.option-label{font-size:14px;font-weight:500;color:#333}.resume-upload-section{display:flex;flex-direction:column;gap:8px}.resume-upload-section label{font-weight:600;color:#333;margin-bottom:8px}";const oi=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.planningComplete=t(this,"planningComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="职业规划助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始规划";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;planningComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;isSubmitting=false;selectedPlanType="长期规划";get hostElement(){return o(this)}tokenInvalidListener;removeErrorListener;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.clearSelectedFile();this.showChatModal=false}else{if(this.customInputs&&this.customInputs.type){const e=this.customInputs.type;if(e==="长期规划"||e==="转行建议"||e==="晋升路径"){this.selectedPlanType=e}}await s(this.token);if(this.conversationId||this.customInputs?.file_url){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=x.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};handlePlanTypeChange=e=>{this.selectedPlanType=e};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const e=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=e;this.uploadSuccess.emit(e)}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();w.captureError(e,{action:"uploadFile",component:"pcm-zygh-modal",title:"文件上传失败"});x.emitError({error:e,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartPlanning=async()=>{if(!this.selectedFile){alert("请上传简历");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(e){console.error("开始规划时出错:",e);w.captureError(e,{action:"handleStartPlanning",component:"pcm-zygh-modal",title:"开始规划时出错"});x.emitError({error:e,message:"开始规划时出错,请重试"})}finally{this.isSubmitting=false}};handlePlanningComplete=e=>{this.planningComplete.emit({...e.detail,type:this.selectedPlanType})};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.file_url);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!r&&i("div",{class:"input-container"},i("div",{class:"plan-type-section"},i("label",null,"选择规划类型"),i("div",{class:"plan-type-options"},i("div",{class:`plan-type-option ${this.selectedPlanType==="长期规划"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("长期规划")},i("div",{class:"option-icon"},"📈"),i("div",{class:"option-label"},"长期规划")),i("div",{class:`plan-type-option ${this.selectedPlanType==="转行建议"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("转行建议")},i("div",{class:"option-icon"},"🔄"),i("div",{class:"option-label"},"转行建议")),i("div",{class:`plan-type-option ${this.selectedPlanType==="晋升路径"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("晋升路径")},i("div",{class:"option-icon"},"🚀"),i("div",{class:"option-label"},"晋升路径")))),i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!this.selectedFile||this.isUploading||this.isSubmitting,onClick:this.handleStartPlanning},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始规划"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018898",fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,type:this.selectedPlanType},interviewMode:"text",onInterviewComplete:this.handlePlanningComplete}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};oi.style=ei+ti;export{C as pcm_1zhanshi_mnms_modal,ne as pcm_app_chat_modal,se as pcm_button,le as pcm_card,be as pcm_chat_message,we as pcm_drawer,ke as pcm_hr_chat_modal,ze as pcm_htws_modal,je as pcm_hyzj_modal,Me as pcm_jd_modal,Ae as pcm_jlpp_modal,De as pcm_mnct_modal,Oe as pcm_mnms_modal,Ao as pcm_mobile_input_btn,Ro as pcm_mobile_upload_btn,Ho as pcm_msbg_modal,qo as pcm_qgqjl_modal,Zo as pcm_time_count_down,Xo as pcm_upload,Yo as pcm_zsk_chat_modal,oi as pcm_zygh_modal};
245
+ //# sourceMappingURL=p-f5f96853.entry.js.map