pcm-agents 0.6.96 → 0.6.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components-position-selector.cjs.entry.js +1 -1
- package/dist/cjs/{conversation-utils-BTAEg4xl.js → conversation-utils-DEyWLr1X.js} +4 -4
- package/dist/cjs/{conversation-utils-BTAEg4xl.js.map → conversation-utils-DEyWLr1X.js.map} +1 -1
- package/dist/cjs/{index-77favCKO.js → index-C_wovzZM.js} +3 -3
- package/dist/cjs/{index-77favCKO.js.map → index-C_wovzZM.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/oem-htws-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-jd-modal.cjs.entry.js +2 -2
- package/dist/cjs/oem-jlpp-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-jlsx-modal.cjs.entry.js +2 -2
- package/dist/cjs/oem-jlzz-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-mnct-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-mnms-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-qgqjl-modal.cjs.entry.js +3 -3
- package/dist/cjs/oem-zygh-modal_31.cjs.entry.js +9 -5
- package/dist/cjs/oem-zygh-modal_31.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +2 -2
- package/dist/cjs/{sentry-reporter-Bk4sUyeD.js → sentry-reporter-D-zjvMQZ.js} +3 -3
- package/dist/cjs/{sentry-reporter-Bk4sUyeD.js.map → sentry-reporter-D-zjvMQZ.js.map} +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +18 -2
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
- package/dist/collection/i18n/pcm-app-chat-modal.i18n.en.json +1 -0
- package/dist/collection/i18n/pcm-app-chat-modal.i18n.zh.json +1 -0
- package/dist/components/components-position-selector.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/oem-htws-modal.js +6 -6
- package/dist/components/oem-jd-modal.js +4 -4
- package/dist/components/oem-jlpp-modal.js +8 -8
- package/dist/components/oem-jlsx-modal.js +6 -6
- package/dist/components/oem-jlzz-modal.js +6 -6
- package/dist/components/oem-mnct-modal.js +8 -8
- package/dist/components/oem-mnms-modal.js +9 -9
- package/dist/components/oem-qgqjl-modal.js +10 -10
- package/dist/components/oem-zygh-modal.js +6 -6
- package/dist/components/{p-C0H4jZIi.js → p-6bkwAKoN.js} +3 -3
- package/dist/components/{p-C0H4jZIi.js.map → p-6bkwAKoN.js.map} +1 -1
- package/dist/components/{p-DjHvQ3lN.js → p-Bqe8RnBv.js} +3 -3
- package/dist/components/{p-DjHvQ3lN.js.map → p-Bqe8RnBv.js.map} +1 -1
- package/dist/components/{p-BG6_220L.js → p-BuuSFiV6.js} +3 -3
- package/dist/components/{p-BG6_220L.js.map → p-BuuSFiV6.js.map} +1 -1
- package/dist/components/{p-DzsyVC1t.js → p-CF5t0Na2.js} +3 -3
- package/dist/components/{p-DzsyVC1t.js.map → p-CF5t0Na2.js.map} +1 -1
- package/dist/components/{p-CD5KK3wz.js → p-CPVPHk5Q.js} +3 -3
- package/dist/components/{p-CD5KK3wz.js.map → p-CPVPHk5Q.js.map} +1 -1
- package/dist/components/{p-Cwl8lxbK.js → p-C_6dc91o.js} +3 -3
- package/dist/components/{p-Cwl8lxbK.js.map → p-C_6dc91o.js.map} +1 -1
- package/dist/components/{p-D464Cbwq.js → p-CeCXTxye.js} +4 -4
- package/dist/components/{p-D464Cbwq.js.map → p-CeCXTxye.js.map} +1 -1
- package/dist/components/{p-CdOggYcY.js → p-CgSFF1H-.js} +3 -3
- package/dist/components/{p-CdOggYcY.js.map → p-CgSFF1H-.js.map} +1 -1
- package/dist/components/{p-BxadQZxO.js → p-D139Ae-m.js} +3 -3
- package/dist/components/{p-BxadQZxO.js.map → p-D139Ae-m.js.map} +1 -1
- package/dist/components/{p-CAgn6yl5.js → p-DB1Xb_SN.js} +3 -3
- package/dist/components/{p-CAgn6yl5.js.map → p-DB1Xb_SN.js.map} +1 -1
- package/dist/components/{p-BrYBIrKw.js → p-ny7Ww0_g.js} +3 -3
- package/dist/components/{p-BrYBIrKw.js.map → p-ny7Ww0_g.js.map} +1 -1
- package/dist/components/{p-BMU_3YY-.js → p-rOAW6Z1w.js} +11 -7
- package/dist/components/p-rOAW6Z1w.js.map +1 -0
- package/dist/components/pcm-1zhanshi-mnms-modal.js +5 -5
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-ats-mnms-modal.js +5 -5
- package/dist/components/pcm-card.js +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-digital-human.js +1 -1
- package/dist/components/pcm-export-records-modal.js +1 -1
- package/dist/components/pcm-hr-chat-modal.js +2 -2
- package/dist/components/pcm-htws-modal.js +8 -8
- package/dist/components/pcm-hyzj-modal.js +5 -5
- package/dist/components/pcm-jd-modal.js +5 -5
- package/dist/components/pcm-jlpp-modal.js +8 -8
- package/dist/components/pcm-jlsx-modal.js +5 -5
- package/dist/components/pcm-jlzz-modal.js +6 -6
- package/dist/components/pcm-mnct-modal.js +7 -7
- package/dist/components/pcm-mnms-modal.js +8 -8
- package/dist/components/pcm-mnms-zp-modal.js +8 -8
- package/dist/components/pcm-mobile-input-btn.js +1 -1
- package/dist/components/pcm-mobile-upload-btn.js +1 -1
- package/dist/components/pcm-msbg-modal.js +5 -5
- package/dist/components/pcm-qgqjl-modal.js +9 -9
- package/dist/components/pcm-thousand-resume-wrapper.js +1 -1
- package/dist/components/pcm-upload.js +1 -1
- package/dist/components/pcm-virtual-chat-modal.js +1 -1
- package/dist/components/pcm-zsk-chat-modal.js +2 -2
- package/dist/components/pcm-zygh-modal.js +7 -7
- package/dist/components/pcm-zygh-v2-modal.js +7 -7
- package/dist/esm/components-position-selector.entry.js +1 -1
- package/dist/esm/{conversation-utils-BIr_PfAh.js → conversation-utils-D45d-WT8.js} +4 -4
- package/dist/esm/{conversation-utils-BIr_PfAh.js.map → conversation-utils-D45d-WT8.js.map} +1 -1
- package/dist/esm/{index-Comif8Mg.js → index-B2sU0ath.js} +3 -3
- package/dist/esm/{index-Comif8Mg.js.map → index-B2sU0ath.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/oem-htws-modal.entry.js +1 -1
- package/dist/esm/oem-jd-modal.entry.js +2 -2
- package/dist/esm/oem-jlpp-modal.entry.js +1 -1
- package/dist/esm/oem-jlsx-modal.entry.js +2 -2
- package/dist/esm/oem-jlzz-modal.entry.js +1 -1
- package/dist/esm/oem-mnct-modal.entry.js +1 -1
- package/dist/esm/oem-mnms-modal.entry.js +1 -1
- package/dist/esm/oem-qgqjl-modal.entry.js +3 -3
- package/dist/esm/oem-zygh-modal_31.entry.js +9 -5
- package/dist/esm/oem-zygh-modal_31.entry.js.map +1 -1
- package/dist/esm/pcm-hr-chat-modal.entry.js +2 -2
- package/dist/esm/{sentry-reporter-nfF0-Uk2.js → sentry-reporter-BWPbyZsF.js} +3 -3
- package/dist/esm/{sentry-reporter-nfF0-Uk2.js.map → sentry-reporter-BWPbyZsF.js.map} +1 -1
- package/dist/pcm-agents/i18n/pcm-app-chat-modal.i18n.en.json +1 -0
- package/dist/pcm-agents/i18n/pcm-app-chat-modal.i18n.zh.json +1 -0
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/{p-cc8d9aec.entry.js → p-245d3dba.entry.js} +2 -2
- package/dist/pcm-agents/{p-25fa617a.entry.js → p-3069b708.entry.js} +2 -2
- package/dist/pcm-agents/{p-fa0907cf.entry.js → p-32b990fa.entry.js} +2 -2
- package/dist/pcm-agents/{p-0aa9f384.entry.js → p-50e9b7c8.entry.js} +2 -2
- package/dist/pcm-agents/{p-d9b6a309.entry.js → p-5af061ed.entry.js} +2 -2
- package/dist/pcm-agents/{p-6c2ad070.entry.js → p-5def8872.entry.js} +2 -2
- package/dist/pcm-agents/{p-53fb22c2.entry.js → p-9e352fde.entry.js} +2 -2
- package/dist/pcm-agents/{p-BEWKdGwe.js → p-BOH1gYZj.js} +2 -2
- package/dist/pcm-agents/{p-BEWKdGwe.js.map → p-BOH1gYZj.js.map} +1 -1
- package/dist/pcm-agents/p-Duxw4aNn.js +2 -0
- package/dist/pcm-agents/{p-DdVhVtJm.js.map → p-Duxw4aNn.js.map} +1 -1
- package/dist/pcm-agents/{p-De3vyGBR.js → p-KC5DRaFJ.js} +2 -2
- package/dist/pcm-agents/{p-De3vyGBR.js.map → p-KC5DRaFJ.js.map} +1 -1
- package/dist/pcm-agents/{p-6da308b6.entry.js → p-b7a2f1fb.entry.js} +2 -2
- package/dist/pcm-agents/{p-6a5bc73b.entry.js → p-c194b3b5.entry.js} +2 -2
- package/dist/pcm-agents/{p-5db93e8b.entry.js → p-efe2d769.entry.js} +3 -3
- package/dist/pcm-agents/p-efe2d769.entry.js.map +1 -0
- package/dist/pcm-agents/{p-e71df1c6.entry.js → p-f511c080.entry.js} +2 -2
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-BMU_3YY-.js.map +0 -1
- package/dist/pcm-agents/p-5db93e8b.entry.js.map +0 -1
- package/dist/pcm-agents/p-DdVhVtJm.js +0 -2
- /package/dist/pcm-agents/{p-cc8d9aec.entry.js.map → p-245d3dba.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-25fa617a.entry.js.map → p-3069b708.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-fa0907cf.entry.js.map → p-32b990fa.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-0aa9f384.entry.js.map → p-50e9b7c8.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-d9b6a309.entry.js.map → p-5af061ed.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-6c2ad070.entry.js.map → p-5def8872.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-53fb22c2.entry.js.map → p-9e352fde.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-6da308b6.entry.js.map → p-b7a2f1fb.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-6a5bc73b.entry.js.map → p-c194b3b5.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-e71df1c6.entry.js.map → p-f511c080.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as o,h as t}from"./p-Bq0K-WqZ.js";import{g as i}from"./p-De3vyGBR.js";import{M as n}from"./p-DXVhHj6-.js";const a=":host{display:block;width:100%;height:100%}.position-selector-container{display:flex;flex-direction:column;width:100%;height:100%;background:#fff}.search-bar{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.search-input-wrapper{position:relative;display:flex;align-items:center;flex:1;min-width:200px;max-width:500px}.search-icon{position:absolute;left:12px;color:#bfbfbf;pointer-events:none}.search-input{width:100%;height:36px;padding:4px 36px 4px 36px;font-size:14px;line-height:1.5;color:rgba(0, 0, 0, 0.85);background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:6px;transition:all 0.3s;outline:none}.search-input:hover{border-color:#40a9ff}.search-input:focus{border-color:#40a9ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.search-input::placeholder{color:#bfbfbf}.clear-button{position:absolute;right:12px;background:none;border:none;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#bfbfbf;transition:color 0.3s}.clear-button:hover{color:#8c8c8c}.search-button{padding:4px 15px;height:36px;font-size:14px;line-height:1.5;border-radius:6px;color:#fff;background-color:#1890ff;border:1px solid #1890ff;cursor:pointer;transition:all 0.3s;outline:none;white-space:nowrap;flex-shrink:0}.search-button:hover{background-color:#40a9ff;border-color:#40a9ff}.search-button:active{background-color:#096dd9;border-color:#096dd9}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;gap:16px;color:#8c8c8c}.loading-spinner{width:32px;height:32px;border:3px solid #f0f0f0;border-top-color:#1890ff;border-radius:50%;animation:spin 0.8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.empty-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;gap:16px}.empty-icon{opacity:0.5}.empty-text{margin:0;color:#8c8c8c;font-size:14px}.position-list{flex:1;overflow-y:auto;min-height:0}.table-container{width:100%;overflow-x:auto}.position-table{width:100%;border-collapse:collapse;font-size:14px}.position-table thead{background-color:#fafafa;position:sticky;top:0;z-index:1}.position-table th{padding:12px 16px;text-align:left;font-weight:500;color:rgba(0, 0, 0, 0.85);border-bottom:1px solid #f0f0f0;white-space:nowrap}.position-table td{padding:12px 16px;border-bottom:1px solid #f0f0f0;color:rgba(0, 0, 0, 0.65)}.position-table tbody tr{transition:background-color 0.3s}.position-table tbody tr:hover{background-color:#fafafa}.position-table tbody tr.selected-row{background-color:#e6f7ff}.checkbox-column{width:50px;text-align:center}.title-column{min-width:150px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.company-column{min-width:120px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-column{min-width:100px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.requirements-column{min-width:200px;max-width:300px}.requirements-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-break:break-word;line-height:1.5}.salary-column{min-width:100px;white-space:nowrap}.action-column{width:100px;text-align:center}.position-checkbox{width:16px;height:16px;cursor:pointer;accent-color:#1890ff}.select-button{padding:4px 15px;height:28px;font-size:14px;line-height:1.5;border-radius:6px;color:#fff;background-color:#1890ff;border:1px solid #1890ff;cursor:pointer;transition:all 0.3s;outline:none}.select-button:hover{background-color:#40a9ff;border-color:#40a9ff}.select-button:active{background-color:#096dd9;border-color:#096dd9}@media screen and (max-width: 768px){.search-bar{padding:12px;gap:8px}.search-input-wrapper{min-width:auto;max-width:none}.search-input{height:40px;font-size:16px}.search-button{height:40px;padding:4px 12px}.table-container{overflow-x:auto;-webkit-overflow-scrolling:touch}.position-table{font-size:12px}.position-table th,.position-table td{padding:8px 12px}.title-column,.company-column,.location-column{min-width:100px}.select-button{padding:4px 12px;height:32px;font-size:14px}}.pagination-container{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px;border-top:1px solid #f0f0f0;flex-shrink:0}.pagination-button{padding:4px 15px;height:32px;font-size:14px;line-height:1.5;border-radius:6px;color:rgba(0, 0, 0, 0.85);background-color:#fff;border:1px solid #d9d9d9;cursor:pointer;transition:all 0.3s;outline:none}.pagination-button:hover:not(:disabled){color:#40a9ff;border-color:#40a9ff}.pagination-button:active:not(:disabled){color:#096dd9;border-color:#096dd9}.pagination-button:disabled{color:rgba(0, 0, 0, 0.25);background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.pagination-info{font-size:14px;color:rgba(0, 0, 0, 0.65)}.position-list::-webkit-scrollbar{width:8px;height:8px}.position-list::-webkit-scrollbar-track{background:#f1f1f1}.position-list::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.position-list::-webkit-scrollbar-thumb:hover{background:#555}";const r='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.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;cursor:pointer}.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;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const s=class{constructor(t){e(this,t);this.positionSelected=o(this,"positionSelected");this.positionSelectionChange=o(this,"positionSelectionChange");this.search=o(this,"search");this.sort=o(this,"sort")}oemId;multiple=false;selectedIds=[];pageSize=10;positionSelected;positionSelectionChange;search;sort;searchKeyword="";currentSelectedIds=[];currentPage=1;totalCount=0;positionsList=[];loading=false;handleSelectedIdsChange(e){this.currentSelectedIds=[...e]}async handleOemIdChange(e){if(e){await this.loadPositions()}}async componentWillLoad(){this.currentSelectedIds=[...this.selectedIds];if(this.oemId){await this.loadPositions()}}async loadPositions(){this.loading=true;try{const e=await i({oemId:this.oemId,page:this.currentPage,pageSize:this.pageSize,keyword:this.searchKeyword||undefined});if(e.success&&e.data){this.positionsList=e.data.items||[];this.totalCount=e.data.total||0}else{n.error(e.message||"获取职位列表失败");this.positionsList=[];this.totalCount=0}}catch(e){console.error("获取职位列表失败:",e);n.error("获取职位列表失败");this.positionsList=[];this.totalCount=0}finally{this.loading=false}}handleSearchInput=e=>{const o=e.target;this.searchKeyword=o.value};handleSearchKeyPress=async e=>{if(e.key==="Enter"){this.currentPage=1;await this.loadPositions()}};handleSearchClick=async()=>{this.currentPage=1;await this.loadPositions()};handleSearchClear=async()=>{this.searchKeyword="";this.currentPage=1;await this.loadPositions()};handlePageChange=async e=>{this.currentPage=e;await this.loadPositions()};getTotalPages=()=>Math.ceil(this.totalCount/this.pageSize);getDisplayPositions=()=>this.positionsList;formatPositionText=e=>{const o=[];if(e.title)o.push(`职位名称:${e.title}`);if(e.company_name)o.push(`公司名称:${e.company_name}`);if(e.department)o.push(`部门:${e.department}`);if(e.employment_type)o.push(`招聘类型:${e.employment_type}`);if(e.salary_range)o.push(`薪资范围:${e.salary_range}`);if(e.salary_min||e.salary_max){const t=`薪资:${e.salary_min||""}${e.salary_min&&e.salary_max?"-":""}${e.salary_max||""}`;if(t!=="薪资:")o.push(t)}if(e.location)o.push(`工作地点:${e.location}`);if(e.province)o.push(`省份:${e.province}`);if(e.city)o.push(`城市:${e.city}`);if(e.district)o.push(`区域:${e.district}`);if(e.address)o.push(`详细地址:${e.address}`);if(e.education_required)o.push(`学历要求:${e.education_required}`);if(e.experience_required)o.push(`经验要求:${e.experience_required}`);if(e.work_experience)o.push(`工作经验:${e.work_experience}`);if(e.recruiting_number)o.push(`招聘人数:${e.recruiting_number}`);if(e.job_description)o.push(`职位描述:${e.job_description}`);if(e.job_responsibilities)o.push(`工作职责:${e.job_responsibilities}`);if(e.job_requirements)o.push(`任职要求:${e.job_requirements}`);if(e.skills_required)o.push(`技能要求:${e.skills_required}`);if(e.benefits)o.push(`福利待遇:${e.benefits}`);if(e.job_type)o.push(`职位类型:${e.job_type}`);if(e.work_industry)o.push(`所属行业:${e.work_industry}`);if(e.recruitment_channel)o.push(`招聘渠道:${e.recruitment_channel}`);if(e.deadline)o.push(`截止日期:${e.deadline}`);return o.join("\n")};handleSelect=e=>{if(!this.multiple){const o={...e,formatted_text:this.formatPositionText(e)};this.positionSelected.emit(o)}};handleCheckboxChange=(e,o)=>{if(!this.multiple)return;if(o){if(!this.currentSelectedIds.includes(e.id)){this.currentSelectedIds=[...this.currentSelectedIds,e.id];this.positionSelectionChange.emit({action:"add",positions:[e]})}}else{this.currentSelectedIds=this.currentSelectedIds.filter((o=>o!==e.id));this.positionSelectionChange.emit({action:"remove",positions:[e]})}};isSelected=e=>this.currentSelectedIds.includes(e);render(){const e=this.getDisplayPositions();const o=this.getTotalPages();const i=o>1;return t("div",{key:"b9a2a7a5fcf7f6babf545618c29c94767c9a7f15",class:"position-selector-container"},t("div",{key:"34b07a48a6407fb38232fa15bca9a1bc46a44977",class:"search-bar"},t("div",{key:"d9d6753b9c15deda249d712aab910b3bd3291ee6",class:"search-input-wrapper"},t("svg",{key:"0e3d4f496e946da810a951ec053b87742ea5d6a1",class:"search-icon",viewBox:"0 0 1024 1024",width:"16",height:"16"},t("path",{key:"81430360a9066757d05dec77db66d9ae2bf4f934",d:"M945.066667 898.133333l-189.866667-189.866666c55.466667-64 87.466667-149.333333 87.466667-241.066667 0-204.8-168.533333-373.333333-373.333334-373.333333S96 264.533333 96 469.333333 264.533333 842.666667 469.333333 842.666667c91.733333 0 174.933333-34.133333 241.066667-87.466667l189.866667 189.866667c6.4 6.4 14.933333 8.533333 23.466666 8.533333s17.066667-2.133333 23.466667-8.533333c8.533333-12.8 8.533333-34.133333-2.133333-46.933334zM469.333333 778.666667C298.666667 778.666667 160 640 160 469.333333S298.666667 160 469.333333 160 778.666667 298.666667 778.666667 469.333333 640 778.666667 469.333333 778.666667z",fill:"currentColor"})),t("input",{key:"e7c7a2411ef25c92febcb8d954a5b39adf6f2ddb",type:"text",class:"search-input",placeholder:"搜索职位名称",value:this.searchKeyword,onInput:this.handleSearchInput,onKeyPress:this.handleSearchKeyPress}),this.searchKeyword&&t("button",{key:"a0ca6955d7f8cfd0e7a1f8cbf8917fd34f9ec0c6",class:"clear-button",onClick:this.handleSearchClear},t("svg",{key:"2deeeb04f3ec672fb6ddb6a94c28f02d054673b2",viewBox:"0 0 1024 1024",width:"14",height:"14"},t("path",{key:"ef7a34671fd551b10bd80207e8b5c95e9a181a51",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-0.3L512 563.4l-99.3 118.4-66.1 0.3c-4.4 0-8-3.5-8-8 0-1.9 0.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1 0.3L512 464.6l99.3-118.4 66-0.3c4.4 0 8 3.5 8 8 0 1.9-0.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})))),t("button",{key:"75463782a60e1a9cdd92ab50d5c958682606b5c2",class:"search-button",onClick:this.handleSearchClick},"搜索")),this.loading&&t("div",{key:"377bb0fefe3a0712a18d876de9728996a33537be",class:"loading-container"},t("div",{key:"8af27dad62ec9606e71433f37410a9392751e176",class:"loading-spinner"}),t("p",{key:"a8912f94c5a7b947f19166634653b6501fe0ebfe"},"加载中...")),!this.loading&&t("div",{key:"49a30136533f75beea03038bf99242a8165a6a71",class:"position-list"},e.length===0?t("div",{class:"empty-container"},t("svg",{class:"empty-icon",viewBox:"0 0 1024 1024",width:"64",height:"64"},t("path",{d:"M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128z m0 704c-176 0-320-144-320-320s144-320 320-320 320 144 320 320-144 320-320 320z",fill:"#d9d9d9"}),t("path",{d:"M512 320c-17.6 0-32 14.4-32 32v256c0 17.6 14.4 32 32 32s32-14.4 32-32V352c0-17.6-14.4-32-32-32z m0 384c-17.6 0-32 14.4-32 32s14.4 32 32 32 32-14.4 32-32-14.4-32-32-32z",fill:"#d9d9d9"})),t("p",{class:"empty-text"},"暂无职位")):t("div",{class:"table-container"},t("table",{class:"position-table"},t("thead",null,t("tr",null,this.multiple&&t("th",{class:"checkbox-column"}),t("th",{class:"title-column"},"职位名称"),t("th",{class:"company-column"},"公司名称"),t("th",{class:"location-column"},"工作地点"),t("th",{class:"requirements-column"},"职位要求"),!this.multiple&&t("th",{class:"action-column"},"操作"))),t("tbody",null,e.map((e=>t("tr",{key:e.id,class:{"selected-row":this.multiple&&this.isSelected(e.id)}},this.multiple&&t("td",{class:"checkbox-column"},t("input",{type:"checkbox",class:"position-checkbox",checked:this.isSelected(e.id),onChange:o=>this.handleCheckboxChange(e,o.target.checked)})),t("td",{class:"title-column",title:e.title},e.title),t("td",{class:"company-column",title:e.company_name},e.company_name||"-"),t("td",{class:"location-column",title:e.location},e.location||"-"),t("td",{class:"requirements-column"},t("div",{class:"requirements-text",title:e.job_requirements||e.job_responsibilities||"-"},e.job_requirements||e.job_responsibilities||"-")),!this.multiple&&t("td",{class:"action-column"},t("button",{class:"select-button",onClick:()=>this.handleSelect(e)},"选择"))))))))),i&&t("div",{key:"a120b2b9a11f140d3b4bb690bdded76c84953fbf",class:"pagination-container"},t("button",{key:"230a815e0715d1c43d2b28845488bd929d47e4ed",class:"pagination-button",disabled:this.currentPage===1,onClick:()=>this.handlePageChange(this.currentPage-1)},"上一页"),t("span",{key:"18932249cd20ec09990a1f63732d81073f9d49d3",class:"pagination-info"},"第 ",this.currentPage," / ",o," 页,共 ",this.totalCount," 条"),t("button",{key:"856b49851b722b4d267ba34f65a7793b864b0c18",class:"pagination-button",disabled:this.currentPage>=o,onClick:()=>this.handlePageChange(this.currentPage+1)},"下一页")))}static get watchers(){return{selectedIds:["handleSelectedIdsChange"],oemId:["handleOemIdChange"]}}};s.style=a+r;export{s as components_position_selector};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as o,h as t}from"./p-Bq0K-WqZ.js";import{g as i}from"./p-KC5DRaFJ.js";import{M as n}from"./p-DXVhHj6-.js";const a=":host{display:block;width:100%;height:100%}.position-selector-container{display:flex;flex-direction:column;width:100%;height:100%;background:#fff}.search-bar{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.search-input-wrapper{position:relative;display:flex;align-items:center;flex:1;min-width:200px;max-width:500px}.search-icon{position:absolute;left:12px;color:#bfbfbf;pointer-events:none}.search-input{width:100%;height:36px;padding:4px 36px 4px 36px;font-size:14px;line-height:1.5;color:rgba(0, 0, 0, 0.85);background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:6px;transition:all 0.3s;outline:none}.search-input:hover{border-color:#40a9ff}.search-input:focus{border-color:#40a9ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.search-input::placeholder{color:#bfbfbf}.clear-button{position:absolute;right:12px;background:none;border:none;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#bfbfbf;transition:color 0.3s}.clear-button:hover{color:#8c8c8c}.search-button{padding:4px 15px;height:36px;font-size:14px;line-height:1.5;border-radius:6px;color:#fff;background-color:#1890ff;border:1px solid #1890ff;cursor:pointer;transition:all 0.3s;outline:none;white-space:nowrap;flex-shrink:0}.search-button:hover{background-color:#40a9ff;border-color:#40a9ff}.search-button:active{background-color:#096dd9;border-color:#096dd9}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;gap:16px;color:#8c8c8c}.loading-spinner{width:32px;height:32px;border:3px solid #f0f0f0;border-top-color:#1890ff;border-radius:50%;animation:spin 0.8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.empty-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;gap:16px}.empty-icon{opacity:0.5}.empty-text{margin:0;color:#8c8c8c;font-size:14px}.position-list{flex:1;overflow-y:auto;min-height:0}.table-container{width:100%;overflow-x:auto}.position-table{width:100%;border-collapse:collapse;font-size:14px}.position-table thead{background-color:#fafafa;position:sticky;top:0;z-index:1}.position-table th{padding:12px 16px;text-align:left;font-weight:500;color:rgba(0, 0, 0, 0.85);border-bottom:1px solid #f0f0f0;white-space:nowrap}.position-table td{padding:12px 16px;border-bottom:1px solid #f0f0f0;color:rgba(0, 0, 0, 0.65)}.position-table tbody tr{transition:background-color 0.3s}.position-table tbody tr:hover{background-color:#fafafa}.position-table tbody tr.selected-row{background-color:#e6f7ff}.checkbox-column{width:50px;text-align:center}.title-column{min-width:150px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.company-column{min-width:120px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-column{min-width:100px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.requirements-column{min-width:200px;max-width:300px}.requirements-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-break:break-word;line-height:1.5}.salary-column{min-width:100px;white-space:nowrap}.action-column{width:100px;text-align:center}.position-checkbox{width:16px;height:16px;cursor:pointer;accent-color:#1890ff}.select-button{padding:4px 15px;height:28px;font-size:14px;line-height:1.5;border-radius:6px;color:#fff;background-color:#1890ff;border:1px solid #1890ff;cursor:pointer;transition:all 0.3s;outline:none}.select-button:hover{background-color:#40a9ff;border-color:#40a9ff}.select-button:active{background-color:#096dd9;border-color:#096dd9}@media screen and (max-width: 768px){.search-bar{padding:12px;gap:8px}.search-input-wrapper{min-width:auto;max-width:none}.search-input{height:40px;font-size:16px}.search-button{height:40px;padding:4px 12px}.table-container{overflow-x:auto;-webkit-overflow-scrolling:touch}.position-table{font-size:12px}.position-table th,.position-table td{padding:8px 12px}.title-column,.company-column,.location-column{min-width:100px}.select-button{padding:4px 12px;height:32px;font-size:14px}}.pagination-container{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px;border-top:1px solid #f0f0f0;flex-shrink:0}.pagination-button{padding:4px 15px;height:32px;font-size:14px;line-height:1.5;border-radius:6px;color:rgba(0, 0, 0, 0.85);background-color:#fff;border:1px solid #d9d9d9;cursor:pointer;transition:all 0.3s;outline:none}.pagination-button:hover:not(:disabled){color:#40a9ff;border-color:#40a9ff}.pagination-button:active:not(:disabled){color:#096dd9;border-color:#096dd9}.pagination-button:disabled{color:rgba(0, 0, 0, 0.25);background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.pagination-info{font-size:14px;color:rgba(0, 0, 0, 0.65)}.position-list::-webkit-scrollbar{width:8px;height:8px}.position-list::-webkit-scrollbar-track{background:#f1f1f1}.position-list::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.position-list::-webkit-scrollbar-thumb:hover{background:#555}";const r='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.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;cursor:pointer}.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;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const s=class{constructor(t){e(this,t);this.positionSelected=o(this,"positionSelected");this.positionSelectionChange=o(this,"positionSelectionChange");this.search=o(this,"search");this.sort=o(this,"sort")}oemId;multiple=false;selectedIds=[];pageSize=10;positionSelected;positionSelectionChange;search;sort;searchKeyword="";currentSelectedIds=[];currentPage=1;totalCount=0;positionsList=[];loading=false;handleSelectedIdsChange(e){this.currentSelectedIds=[...e]}async handleOemIdChange(e){if(e){await this.loadPositions()}}async componentWillLoad(){this.currentSelectedIds=[...this.selectedIds];if(this.oemId){await this.loadPositions()}}async loadPositions(){this.loading=true;try{const e=await i({oemId:this.oemId,page:this.currentPage,pageSize:this.pageSize,keyword:this.searchKeyword||undefined});if(e.success&&e.data){this.positionsList=e.data.items||[];this.totalCount=e.data.total||0}else{n.error(e.message||"获取职位列表失败");this.positionsList=[];this.totalCount=0}}catch(e){console.error("获取职位列表失败:",e);n.error("获取职位列表失败");this.positionsList=[];this.totalCount=0}finally{this.loading=false}}handleSearchInput=e=>{const o=e.target;this.searchKeyword=o.value};handleSearchKeyPress=async e=>{if(e.key==="Enter"){this.currentPage=1;await this.loadPositions()}};handleSearchClick=async()=>{this.currentPage=1;await this.loadPositions()};handleSearchClear=async()=>{this.searchKeyword="";this.currentPage=1;await this.loadPositions()};handlePageChange=async e=>{this.currentPage=e;await this.loadPositions()};getTotalPages=()=>Math.ceil(this.totalCount/this.pageSize);getDisplayPositions=()=>this.positionsList;formatPositionText=e=>{const o=[];if(e.title)o.push(`职位名称:${e.title}`);if(e.company_name)o.push(`公司名称:${e.company_name}`);if(e.department)o.push(`部门:${e.department}`);if(e.employment_type)o.push(`招聘类型:${e.employment_type}`);if(e.salary_range)o.push(`薪资范围:${e.salary_range}`);if(e.salary_min||e.salary_max){const t=`薪资:${e.salary_min||""}${e.salary_min&&e.salary_max?"-":""}${e.salary_max||""}`;if(t!=="薪资:")o.push(t)}if(e.location)o.push(`工作地点:${e.location}`);if(e.province)o.push(`省份:${e.province}`);if(e.city)o.push(`城市:${e.city}`);if(e.district)o.push(`区域:${e.district}`);if(e.address)o.push(`详细地址:${e.address}`);if(e.education_required)o.push(`学历要求:${e.education_required}`);if(e.experience_required)o.push(`经验要求:${e.experience_required}`);if(e.work_experience)o.push(`工作经验:${e.work_experience}`);if(e.recruiting_number)o.push(`招聘人数:${e.recruiting_number}`);if(e.job_description)o.push(`职位描述:${e.job_description}`);if(e.job_responsibilities)o.push(`工作职责:${e.job_responsibilities}`);if(e.job_requirements)o.push(`任职要求:${e.job_requirements}`);if(e.skills_required)o.push(`技能要求:${e.skills_required}`);if(e.benefits)o.push(`福利待遇:${e.benefits}`);if(e.job_type)o.push(`职位类型:${e.job_type}`);if(e.work_industry)o.push(`所属行业:${e.work_industry}`);if(e.recruitment_channel)o.push(`招聘渠道:${e.recruitment_channel}`);if(e.deadline)o.push(`截止日期:${e.deadline}`);return o.join("\n")};handleSelect=e=>{if(!this.multiple){const o={...e,formatted_text:this.formatPositionText(e)};this.positionSelected.emit(o)}};handleCheckboxChange=(e,o)=>{if(!this.multiple)return;if(o){if(!this.currentSelectedIds.includes(e.id)){this.currentSelectedIds=[...this.currentSelectedIds,e.id];this.positionSelectionChange.emit({action:"add",positions:[e]})}}else{this.currentSelectedIds=this.currentSelectedIds.filter((o=>o!==e.id));this.positionSelectionChange.emit({action:"remove",positions:[e]})}};isSelected=e=>this.currentSelectedIds.includes(e);render(){const e=this.getDisplayPositions();const o=this.getTotalPages();const i=o>1;return t("div",{key:"b9a2a7a5fcf7f6babf545618c29c94767c9a7f15",class:"position-selector-container"},t("div",{key:"34b07a48a6407fb38232fa15bca9a1bc46a44977",class:"search-bar"},t("div",{key:"d9d6753b9c15deda249d712aab910b3bd3291ee6",class:"search-input-wrapper"},t("svg",{key:"0e3d4f496e946da810a951ec053b87742ea5d6a1",class:"search-icon",viewBox:"0 0 1024 1024",width:"16",height:"16"},t("path",{key:"81430360a9066757d05dec77db66d9ae2bf4f934",d:"M945.066667 898.133333l-189.866667-189.866666c55.466667-64 87.466667-149.333333 87.466667-241.066667 0-204.8-168.533333-373.333333-373.333334-373.333333S96 264.533333 96 469.333333 264.533333 842.666667 469.333333 842.666667c91.733333 0 174.933333-34.133333 241.066667-87.466667l189.866667 189.866667c6.4 6.4 14.933333 8.533333 23.466666 8.533333s17.066667-2.133333 23.466667-8.533333c8.533333-12.8 8.533333-34.133333-2.133333-46.933334zM469.333333 778.666667C298.666667 778.666667 160 640 160 469.333333S298.666667 160 469.333333 160 778.666667 298.666667 778.666667 469.333333 640 778.666667 469.333333 778.666667z",fill:"currentColor"})),t("input",{key:"e7c7a2411ef25c92febcb8d954a5b39adf6f2ddb",type:"text",class:"search-input",placeholder:"搜索职位名称",value:this.searchKeyword,onInput:this.handleSearchInput,onKeyPress:this.handleSearchKeyPress}),this.searchKeyword&&t("button",{key:"a0ca6955d7f8cfd0e7a1f8cbf8917fd34f9ec0c6",class:"clear-button",onClick:this.handleSearchClear},t("svg",{key:"2deeeb04f3ec672fb6ddb6a94c28f02d054673b2",viewBox:"0 0 1024 1024",width:"14",height:"14"},t("path",{key:"ef7a34671fd551b10bd80207e8b5c95e9a181a51",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-0.3L512 563.4l-99.3 118.4-66.1 0.3c-4.4 0-8-3.5-8-8 0-1.9 0.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1 0.3L512 464.6l99.3-118.4 66-0.3c4.4 0 8 3.5 8 8 0 1.9-0.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})))),t("button",{key:"75463782a60e1a9cdd92ab50d5c958682606b5c2",class:"search-button",onClick:this.handleSearchClick},"搜索")),this.loading&&t("div",{key:"377bb0fefe3a0712a18d876de9728996a33537be",class:"loading-container"},t("div",{key:"8af27dad62ec9606e71433f37410a9392751e176",class:"loading-spinner"}),t("p",{key:"a8912f94c5a7b947f19166634653b6501fe0ebfe"},"加载中...")),!this.loading&&t("div",{key:"49a30136533f75beea03038bf99242a8165a6a71",class:"position-list"},e.length===0?t("div",{class:"empty-container"},t("svg",{class:"empty-icon",viewBox:"0 0 1024 1024",width:"64",height:"64"},t("path",{d:"M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128z m0 704c-176 0-320-144-320-320s144-320 320-320 320 144 320 320-144 320-320 320z",fill:"#d9d9d9"}),t("path",{d:"M512 320c-17.6 0-32 14.4-32 32v256c0 17.6 14.4 32 32 32s32-14.4 32-32V352c0-17.6-14.4-32-32-32z m0 384c-17.6 0-32 14.4-32 32s14.4 32 32 32 32-14.4 32-32-14.4-32-32-32z",fill:"#d9d9d9"})),t("p",{class:"empty-text"},"暂无职位")):t("div",{class:"table-container"},t("table",{class:"position-table"},t("thead",null,t("tr",null,this.multiple&&t("th",{class:"checkbox-column"}),t("th",{class:"title-column"},"职位名称"),t("th",{class:"company-column"},"公司名称"),t("th",{class:"location-column"},"工作地点"),t("th",{class:"requirements-column"},"职位要求"),!this.multiple&&t("th",{class:"action-column"},"操作"))),t("tbody",null,e.map((e=>t("tr",{key:e.id,class:{"selected-row":this.multiple&&this.isSelected(e.id)}},this.multiple&&t("td",{class:"checkbox-column"},t("input",{type:"checkbox",class:"position-checkbox",checked:this.isSelected(e.id),onChange:o=>this.handleCheckboxChange(e,o.target.checked)})),t("td",{class:"title-column",title:e.title},e.title),t("td",{class:"company-column",title:e.company_name},e.company_name||"-"),t("td",{class:"location-column",title:e.location},e.location||"-"),t("td",{class:"requirements-column"},t("div",{class:"requirements-text",title:e.job_requirements||e.job_responsibilities||"-"},e.job_requirements||e.job_responsibilities||"-")),!this.multiple&&t("td",{class:"action-column"},t("button",{class:"select-button",onClick:()=>this.handleSelect(e)},"选择"))))))))),i&&t("div",{key:"a120b2b9a11f140d3b4bb690bdded76c84953fbf",class:"pagination-container"},t("button",{key:"230a815e0715d1c43d2b28845488bd929d47e4ed",class:"pagination-button",disabled:this.currentPage===1,onClick:()=>this.handlePageChange(this.currentPage-1)},"上一页"),t("span",{key:"18932249cd20ec09990a1f63732d81073f9d49d3",class:"pagination-info"},"第 ",this.currentPage," / ",o," 页,共 ",this.totalCount," 条"),t("button",{key:"856b49851b722b4d267ba34f65a7793b864b0c18",class:"pagination-button",disabled:this.currentPage>=o,onClick:()=>this.handlePageChange(this.currentPage+1)},"下一页")))}static get watchers(){return{selectedIds:["handleSelectedIdsChange"],oemId:["handleOemIdChange"]}}};s.style=a+r;export{s as components_position_selector};
|
|
2
|
+
//# sourceMappingURL=p-5def8872.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,b as a,s as l,d,v as c}from"./p-De3vyGBR.js";import{E as h}from"./p-C0FYX2-Z.js";import{S as p}from"./p-DdVhVtJm.js";import"./p-Bs-zO1WZ.js";const u=":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 g=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const m=class{constructor(i){e(this,i);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 i(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!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.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){p.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;p.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 r(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:"文件上传失败,请重试"});p.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 i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];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 u={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};u.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(",");u.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:u,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.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 i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="error"){const t=e.data?.message||e.message||"请求失败";this.messages=[...this.messages,{...c,answer:t,error:e.data,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false;h.emitError({error:e.data,message:t});return}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:"消息发送失败,请稍后再试"});p.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,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=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});p.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:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=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 l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});p.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 d(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 c(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 i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;p.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});p.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:"视频播放失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});p.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 i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});p.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 l({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:"保存视频答案失败"});p.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});p.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:"音频播放错误"});p.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:"音频播放失败"});p.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 i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;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 i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("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&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("pcm-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};m.style=u+g;export{m as pcm_hr_chat_modal};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,b as a,s as l,d,v as c}from"./p-KC5DRaFJ.js";import{E as h}from"./p-C0FYX2-Z.js";import{S as p}from"./p-Duxw4aNn.js";import"./p-Bs-zO1WZ.js";const u=":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 g=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const m=class{constructor(i){e(this,i);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 i(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!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.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){p.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;p.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 r(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:"文件上传失败,请重试"});p.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 i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];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 u={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};u.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(",");u.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:u,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.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 i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="error"){const t=e.data?.message||e.message||"请求失败";this.messages=[...this.messages,{...c,answer:t,error:e.data,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false;h.emitError({error:e.data,message:t});return}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:"消息发送失败,请稍后再试"});p.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,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=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});p.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:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=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 l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});p.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 d(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 c(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 i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;p.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});p.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:"视频播放失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});p.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 i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});p.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 l({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:"保存视频答案失败"});p.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});p.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:"音频播放错误"});p.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:"音频播放失败"});p.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 i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;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 i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("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&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("pcm-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};m.style=u+g;export{m as pcm_hr_chat_modal};
|
|
2
|
+
//# sourceMappingURL=p-9e352fde.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{s as t}from"./p-KC5DRaFJ.js";import{S as s}from"./p-Duxw4aNn.js";import{E as e}from"./p-C0FYX2-Z.js";function r(t){try{const s=typeof t==="string"?parseInt(t,10):t;if(isNaN(s)||s<=0){return"未知时间"}const e=new Date(s*1e3);if(isNaN(e.getTime())){return"未知时间"}const r=new Date;const n=Math.floor((r.getTime()-e.getTime())/(1e3*60*60*24));const o=e.getHours().toString().padStart(2,"0");const a=e.getMinutes().toString().padStart(2,"0");const i=(e.getMonth()+1).toString().padStart(2,"0");const c=e.getDate().toString().padStart(2,"0");if(n===0){return`今天 ${o}:${a}`}if(n===1){return`昨天 ${o}:${a}`}if(n>1&&n<7){const t=["周日","周一","周二","周三","周四","周五","周六"];return`${t[e.getDay()]} ${o}:${a}`}return`${i}-${c} ${o}:${a}`}catch{return"时间解析失败"}}async function n(n,o,a="",i=20){try{const s=await t({url:"/sdk/v1/chat/conversations",method:"GET",data:{bot_id:n,last_id:a,limit:i}});if(s.success&&s.data){const t=s.data.data||s.data.items||[];const e=typeof s.data.has_more==="boolean"?s.data.has_more:t.length>i;const n=t.slice(0,i).map((t=>({id:t.id,name:t.name||"新会话",created_at:Number(t.created_at),updated_at:Number(t.updated_at),status:t.status,message_count:t.message_count||0,timeDisplay:r(t.created_at),inputs:t.inputs})));return{items:n,hasMore:e,nextCursor:n.length>0?n[n.length-1].id:""}}return{items:[],hasMore:false,nextCursor:""}}catch(t){console.error("获取历史会话失败:",t);s.captureError(t,{action:"fetchHistoryConversations",component:o,title:"获取历史会话失败"});e.emitError({error:t,message:"获取历史会话失败"});return{items:[],hasMore:false,nextCursor:""}}}export{n as f};
|
|
2
|
+
//# sourceMappingURL=p-BOH1gYZj.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BOH1gYZj.js","sources":["src/utils/conversation-utils.ts"],"sourcesContent":["import { sendHttpRequest } from './utils';\r\nimport { SentryReporter } from './sentry-reporter';\r\nimport { ErrorEventBus } from './error-event';\r\nimport { ConversationItem, ConversationPageResult, ConversationDetail } from '../interfaces/chat';\r\n\r\ninterface ConversationApiItem {\r\n id: string;\r\n name?: string;\r\n created_at: number | string;\r\n updated_at: number | string;\r\n status?: string;\r\n message_count?: number;\r\n inputs?: any;\r\n}\r\n\r\ninterface ConversationApiData {\r\n data?: ConversationApiItem[];\r\n items?: ConversationApiItem[];\r\n has_more?: boolean;\r\n}\r\n\r\n/**\r\n * 格式化会话时间戳为可读字符串\r\n */\r\nfunction formatConversationTime(createdAt: number | string): string {\r\n try {\r\n const timestamp = typeof createdAt === 'string' ? parseInt(createdAt, 10) : createdAt;\r\n if (isNaN(timestamp) || timestamp <= 0) {\r\n return '未知时间';\r\n }\r\n\r\n const createdTime = new Date(timestamp * 1000);\r\n if (isNaN(createdTime.getTime())) {\r\n return '未知时间';\r\n }\r\n\r\n const now = new Date();\r\n const diffDays = Math.floor((now.getTime() - createdTime.getTime()) / (1000 * 60 * 60 * 24));\r\n const hh = createdTime.getHours().toString().padStart(2, '0');\r\n const mm = createdTime.getMinutes().toString().padStart(2, '0');\r\n const month = (createdTime.getMonth() + 1).toString().padStart(2, '0');\r\n const day = createdTime.getDate().toString().padStart(2, '0');\r\n\r\n if (diffDays === 0) {\r\n return `今天 ${hh}:${mm}`;\r\n }\r\n\r\n if (diffDays === 1) {\r\n return `昨天 ${hh}:${mm}`;\r\n }\r\n\r\n if (diffDays > 1 && diffDays < 7) {\r\n const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];\r\n return `${weekdays[createdTime.getDay()]} ${hh}:${mm}`;\r\n }\r\n\r\n return `${month}-${day} ${hh}:${mm}`;\r\n } catch {\r\n return '时间解析失败';\r\n }\r\n}\r\n\r\n/**\r\n * 获取历史会话列表\r\n * @param botId 机器人 ID\r\n * @param componentName 调用组件名称\r\n * @param lastId 上一页最后一条会话 ID,空字符串表示第一页\r\n * @param limit 每页数量\r\n * @returns 游标分页结果\r\n */\r\nexport async function fetchHistoryConversations(\r\n botId: string,\r\n componentName: string,\r\n lastId: string = '',\r\n limit: number = 20,\r\n): Promise<ConversationPageResult> {\r\n try {\r\n const result = await sendHttpRequest<ConversationApiData>({\r\n url: '/sdk/v1/chat/conversations',\r\n method: 'GET',\r\n data: {\r\n bot_id: botId,\r\n last_id: lastId,\r\n limit,\r\n },\r\n });\r\n\r\n if (result.success && result.data) {\r\n const rawConversations: ConversationApiItem[] = result.data.data || result.data.items || [];\r\n const hasMore = typeof result.data.has_more === 'boolean'\r\n ? result.data.has_more\r\n : rawConversations.length > limit;\r\n const conversations: ConversationItem[] = rawConversations.slice(0, limit).map((conv: ConversationApiItem) => ({\r\n id: conv.id,\r\n name: conv.name || '新会话',\r\n created_at: Number(conv.created_at),\r\n updated_at: Number(conv.updated_at),\r\n status: conv.status,\r\n message_count: conv.message_count || 0,\r\n timeDisplay: formatConversationTime(conv.created_at),\r\n inputs: conv.inputs,\r\n }));\r\n\r\n return {\r\n items: conversations,\r\n hasMore,\r\n nextCursor: conversations.length > 0 ? conversations[conversations.length - 1].id : '',\r\n };\r\n }\r\n\r\n return {\r\n items: [],\r\n hasMore: false,\r\n nextCursor: '',\r\n };\r\n } catch (error) {\r\n console.error('获取历史会话失败:', error);\r\n SentryReporter.captureError(error, {\r\n action: 'fetchHistoryConversations',\r\n component: componentName,\r\n title: '获取历史会话失败',\r\n });\r\n ErrorEventBus.emitError({ error, message: '获取历史会话失败' });\r\n\r\n return {\r\n items: [],\r\n hasMore: false,\r\n nextCursor: '',\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * 获取单个会话详情\r\n * @param conversationId 会话 ID\r\n * @param componentName 调用组件名称\r\n * @returns 会话详情\r\n */\r\nexport async function fetchConversationDetail(\r\n conversationId: string,\r\n componentName: string,\r\n): Promise<ConversationDetail | null> {\r\n try {\r\n const result = await sendHttpRequest<{ data: ConversationDetail }>({\r\n url: '/sdk/v1/chat/conversation',\r\n method: 'GET',\r\n data: {\r\n conversation_id: conversationId,\r\n },\r\n });\r\n\r\n if (result.success && result.data?.data) {\r\n return result.data.data;\r\n }\r\n\r\n return null;\r\n } catch (error) {\r\n console.error('获取会话详情失败:', error);\r\n SentryReporter.captureError(error, {\r\n action: 'fetchConversationDetail',\r\n component: componentName,\r\n title: '获取会话详情失败',\r\n });\r\n ErrorEventBus.emitError({ error, message: '获取会话详情失败' });\r\n\r\n return null;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAqBA;;AAEG;AACH,SAAS,sBAAsB,CAAC,SAA0B,EAAA;AACtD,IAAA,IAAI;AACA,QAAA,MAAM,SAAS,GAAG,OAAO,SAAS,KAAK,QAAQ,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS;QACrF,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC,EAAE;AACpC,YAAA,OAAO,MAAM;;QAGjB,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAC9C,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE;AAC9B,YAAA,OAAO,MAAM;;AAGjB,QAAA,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE;AACtB,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC5F,QAAA,MAAM,EAAE,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC7D,QAAA,MAAM,EAAE,GAAG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EAAE;aACzF;;QAGL,OAAO;AACH,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,UAAU,EAAE,EAAE;SACjB;;IACH,OAAO,KAAK,EAAE;AACZ,QAAA,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC;AACjC,QAAA,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE;AAC/B,YAAA,MAAM,EAAE,2BAA2B;AACnC,YAAA,SAAS,EAAE,aAAa;AACxB,YAAA,KAAK,EAAE,UAAU;AACpB,SAAA,CAAC;QACF,aAAa,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;QAEvD,OAAO;AACH,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,UAAU,EAAE,EAAE;SACjB;;AAET;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as s}from"./p-KC5DRaFJ.js";import{s as t,a as r,c,b as e}from"./p-Bs-zO1WZ.js";class a{static captureError(e,a){try{const o=s.getItem("pcm-sdk-CUser");if(o){t({id:String(o)})}let i=e;if(a?.title){i=new Error(a.title);if(e?.stack){i.stack=e.stack}i.cause=e}if(a){const{title:s,...t}=a;r("error_context",t)}c(i)}catch(s){console.error("Sentry 上报错误失败:",s)}}static captureMessage(c,a){try{const o=s.getItem("pcm-sdk-CUser");if(o){t({id:String(o)})}if(a){r("message_context",a)}e(c)}catch(s){console.error("Sentry 上报消息失败:",s)}}}export{a as S};
|
|
2
|
+
//# sourceMappingURL=p-Duxw4aNn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-Duxw4aNn.js","sources":["src/utils/sentry-reporter.ts"],"sourcesContent":["import * as Sentry from \"@sentry/browser\";\r\nimport { configStore } from \"../../store/config.store\";\r\n\r\n/**\r\n * Sentry事件上报工具类\r\n * 提供统一的错误上报接口,自动添加用户认证信息\r\n */\r\nexport class SentryReporter {\r\n\r\n /**\r\n * 捕获并上报错误\r\n * @param error 错误对象\r\n * @param context 错误上下文\r\n */\r\n static captureError(error: any, context?: Record<string, any> & { title?: string }): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n let finalError = error;\r\n \r\n // 如果提供了自定义标题,创建新的错误对象\r\n if (context?.title) {\r\n finalError = new Error(context.title);\r\n if (error?.stack) {\r\n finalError.stack = error.stack;\r\n }\r\n finalError.cause = error;\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n const { title, ...otherContext } = context;\r\n Sentry.setContext('error_context', otherContext);\r\n }\r\n \r\n // 上报错误\r\n Sentry.captureException(finalError);\r\n } catch (e) {\r\n console.error('Sentry 上报错误失败:', e);\r\n }\r\n }\r\n\r\n /**\r\n * 捕获并上报消息\r\n * @param message 消息内容\r\n * @param context 消息上下文\r\n */\r\n static captureMessage(message: string, context?: Record<string, any>): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n Sentry.setContext('message_context', context);\r\n }\r\n \r\n // 上报消息\r\n Sentry.captureMessage(message);\r\n } catch (e) {\r\n console.error('Sentry 上报消息失败:', e);\r\n }\r\n }\r\n\r\n}"],"names":["Sentry.setUser","Sentry.setContext","Sentry.captureException","Sentry.captureMessage"],"mappings":";;;AAGA;;;AAGG;MACU,cAAc,CAAA;AAEzB;;;;AAIG;AACH,IAAA,OAAO,YAAY,CAAC,KAAU,EAAE,OAAkD,EAAA;AAChF,QAAA,IAAI;;YAEF,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;YAClD,IAAI,KAAK,EAAE;AACT,gBAAAA,OAAc,CAA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t);if(!n){e.set(t,[o])}else if(!n.includes(o)){n.push(o)}};const s=(e,t)=>{let o;return(...n)=>{if(o){clearTimeout(o)}o=setTimeout((()=>{o=0;e(...n)}),t)}};const c=e=>!("isConnected"in e)||e.isConnected;const a=s((e=>{for(let t of e.keys()){e.set(t,e.get(t).filter(c))}}),2e3);const i=()=>{if(typeof e!=="function"){return{}}const o=new Map;return{dispose:()=>o.clear(),get:t=>{const n=e();if(n){r(o,t,n)}},set:e=>{const n=o.get(e);if(n){o.set(e,n.filter(t))}a(o)},reset:()=>{o.forEach((e=>e.forEach(t)));a(o)}}};const u=e=>typeof e==="function"?e():e;const l=(e,t=(e,t)=>e!==t)=>{const o=u(e);let n=new Map(Object.entries(o??{}));const r={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(u(e)??{}));r.reset.forEach((e=>e()))};const c=()=>{r.dispose.forEach((e=>e()));s()};const a=e=>{r.get.forEach((t=>t(e)));return n.get(e)};const i=(e,o)=>{const s=n.get(e);if(t(o,s,e)){n.set(e,o);r.set.forEach((t=>t(e,o,s)))}};const l=typeof Proxy==="undefined"?{}:new Proxy(o,{get(e,t){return a(t)},ownKeys(e){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(e,t){return n.has(t)},set(e,t,o){i(t,o);return true}});const f=(e,t)=>{r[e].push(t);return()=>{d(r[e],t)}};const h=(t,o)=>{const n=f("set",((e,n)=>{if(e===t){o(n)}}));const r=f("reset",(()=>o(u(e)[t])));return()=>{n();r()}};const w=(...e)=>{const t=e.reduce(((e,t)=>{if(t.set){e.push(f("set",t.set))}if(t.get){e.push(f("get",t.get))}if(t.reset){e.push(f("reset",t.reset))}if(t.dispose){e.push(f("dispose",t.dispose))}return e}),[]);return()=>t.forEach((e=>e()))};const m=e=>{const t=n.get(e);r.set.forEach((o=>o(e,t,t)))};return{state:l,get:a,set:i,on:f,onChange:h,use:w,dispose:c,reset:s,forceUpdate:m}};const d=(e,t)=>{const o=e.indexOf(t);if(o>=0){e[o]=e[e.length-1];e.length--}};const f=(e,t)=>{const o=l(e,t);o.use(i());return o};const{state:h,onChange:w}=f({token:localStorage.getItem("pcm-sdk-auth-token")||null});const m={getToken:()=>h.token,setToken:e=>{h.token=e;localStorage.setItem("pcm-sdk-auth-token",e)},clearToken:()=>{h.token=null;localStorage.removeItem("pcm-sdk-auth-token")}};w("token",(e=>{if(e){localStorage.setItem("pcm-sdk-auth-token",e)}else{localStorage.removeItem("pcm-sdk-auth-token")}}));const p=()=>{try{const e=localStorage.getItem("pcm-sdk-config-data");return e?JSON.parse(e):{}}catch(e){console.error("Error parsing stored config:",e);return{}}};const{state:y,onChange:g}=f({data:p()});const k={getConfig:()=>y.data,getItem:(e,t)=>y.data[e]!==undefined?y.data[e]:t,setItem:(e,t)=>{y.data={...y.data,[e]:t}},removeItem:e=>{const t={...y.data};delete t[e];y.data=t},clear:()=>{y.data={}},updateConfig:e=>{y.data={...y.data,...e}}};g("data",(e=>{try{if(Object.keys(e).length>0){localStorage.setItem("pcm-sdk-config-data",JSON.stringify(e))}else{localStorage.removeItem("pcm-sdk-config-data")}}catch(e){console.error("Error saving config to localStorage:",e)}}));const T="0.6.96";function E(e,t,o){return(e||"")+(t?` ${t}`:"")+(o?` ${o}`:"")}const S=()=>m.getToken()||"";const $=3*60*1e3;const v=async(e,t,o=$)=>{const n=new AbortController;const r=setTimeout((()=>n.abort()),o);try{const o=await fetch(e,{...t,signal:n.signal});clearTimeout(r);return o}catch(e){clearTimeout(r);if(e instanceof Error&&e.name==="AbortError"){throw new Error("请求超时,请检查网络连接后重试")}throw e}};const b=async(e,t=false)=>{const{url:n,method:r,headers:s={},data:c,onMessage:a,onError:i,onComplete:u}=e;try{const i=`${o}${n}`;if(!s["authorization"]&&!s["Authorization"]){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const l=await v(i,{method:r,headers:{Accept:"text/event-stream","Content-Type":"application/json",...s},body:c?JSON.stringify(c):undefined});if(l.status===401){P();if(!t){return b(e,true)}}if(!l.ok){console.error(`HTTP error! status: ${l.status}`)}const d=l.body?.getReader();if(!d)throw new Error("No reader available");const f=new TextDecoder;let h="";while(true){const{value:e,done:t}=await d.read();if(t)break;h+=f.decode(e,{stream:true});const o=h.split("\n");h=o.pop()||"";for(const e of o){if(e.startsWith("data:")){try{const t=e.substring(5).trim();if(!t)continue;const o=JSON.parse(t);a?.(o)}catch(t){console.error("解析 SSE 数据错误:",t,"原始数据:",e)}}}}u?.()}catch(o){console.error("SSE 请求错误:",o);if(!t){return b(e,true)}i?.(o)}};const P=()=>{const e=new CustomEvent("pcm-token-invalid",{bubbles:true,composed:true,detail:{timestamp:(new Date).getTime()}});document.dispatchEvent(e)};const M=async(e,t=true)=>{const{url:n,method:r="GET",headers:s={},params:c={},data:a,formData:i,onMessage:u}=e;try{const l=new URLSearchParams;Object.entries(c).forEach((([e,t])=>{if(t!==undefined&&t!==null){l.append(e,String(t))}}));let d=`${o}${n}${l.toString()?`?${l.toString()}`:""}`;if(s["authorization"]==undefined&&s["Authorization"]==undefined){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const f={method:r,headers:i?{...s}:{"Content-Type":"application/json",...s}};if(i){f.body=i}else if(r!=="GET"&&r!=="HEAD"&&a){f.body=JSON.stringify(a)}if(r==="GET"&&a){const e=new URLSearchParams;Object.entries(a).forEach((([t,o])=>{if(o!==undefined&&o!==null){e.append(t,String(o))}}));d+=(l.toString()?"&":"?")+e.toString()}const h=await v(d,f);if(h.status===401){P();if(t){return M(e,false)}}const w=await h.json();if(u){u(w)}if(!h.ok){console.error(`HTTP错误: ${h.status} ${h.statusText}`);return{success:false,message:w.message||`HTTP错误: ${h.status}`,error:w}}if(w.code!==0){console.error(`API错误: ${w.message}`);return{success:false,message:w.message,error:w}}return{success:true,data:w.data}}catch(o){console.error("HTTP请求错误:",o);if(t){return M(e,false)}if(e.onError){e.onError(o)}return{success:false,error:o,message:o instanceof Error?o.message:"未知错误"}}finally{if(e.onComplete){e.onComplete()}}};const O=async e=>{const t=await M({url:"/sdk/v1/user",method:"GET",headers:{Authorization:`Bearer ${e}`},data:{sdk_version:T}},false);if(!t.success&&t.error&&t.error.code===401){return false}else{k.setItem("pcm-sdk-CUser",`${t.data.user}(${t.data.chat_user})`);return t.success}};const C=async e=>{if(!e){throw new Error("智能体ID不能为空")}try{const t=await M({url:`/sdk/v1/agent/${e}/info`,method:"GET"});if(!t.success){throw new Error(t.message||"获取智能体信息失败")}return t.data}catch(e){console.error("获取智能体信息失败:",e);throw e}};var _;(function(e){e["Init"]="init";e["Uploading"]="uploading";e["Success"]="success";e["Failed"]="failed"})(_||(_={}));const A=async e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=async e=>{try{const o=e.target?.result;const n=await crypto.subtle.digest("SHA-256",o);const r=Array.from(new Uint8Array(n));const s=r.map((e=>e.toString(16).padStart(2,"0"))).join("");t(s)}catch(e){o(e)}};n.onerror=()=>o(new Error("读取文件失败"));n.readAsArrayBuffer(e)}));const I=async(e,t,o="application/octet-stream",n=2)=>{let r=0;while(true){try{const n=await v(e,{method:"PUT",body:t,headers:{"Content-Type":o}});if(!n.ok){throw new Error(`文件上传失败: ${n.status} ${n.statusText}`)}return n}catch(e){r++;console.error(`文件上传错误(尝试 ${r}/${n}):`,e);if(r>=n){throw e}}}};const R=async(e,t,o)=>{try{const n=await A(e);const r=await M({url:"/sdk/v1/files/generate-upload-url",method:"POST",data:{...o,filename:e.name,filesize:e.size,sha256:n},headers:t});if(!r.success||!r.data){throw new Error(r.message||"获取上传URL失败")}const s=r.data;if(s.is_deleted!=1){const o=await I(s.upload_url,e,s.content_type||"application/octet-stream");if(!o.ok){throw new Error(`文件上传到腾讯云失败: ${o.status} ${o.statusText}`)}M({url:"/sdk/v1/files/mark-as-upload",method:"POST",data:{cos_key:s.cos.cos_key},headers:t})}return{cos_key:s.cos.cos_key,file_name:s.filename,file_size:s.filesize,ext:s.filetype}}catch(e){console.error("文件上传错误:",e);throw e}};const U=async(e,t,n=false)=>{const r=S();if(!r){throw new Error("API密钥不能为空")}try{const s=await v(`${o}/sdk/v1/tts/synthesize_audio`,{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+r},body:JSON.stringify({text:e})});if(s.status===401){P();if(!n){return U(e,t,true)}}if(!s.ok){throw new Error("语音合成失败")}const c=await s.blob();return URL.createObjectURL(c)}catch(o){console.error("语音合成错误:",o);if(!n){return U(e,t,true)}throw o}};const j=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/presigned-url",method:"GET",params:{cos_key:e},headers:t});if(o.success&&o.data?.file_url){return o.data.file_url}return null}catch(e){console.error("获取预签名URL失败:",e);return null}};const N=async(e,t)=>{try{const o=await j(e,t);if(o){return`${o}${o.includes("?")?"&":"?"}ci-process=doc-preview©able=1&dstType=html`}return null}catch(e){console.error("获取预览URL失败:",e);return null}};const x=e=>{if(!e&&e!==0){return null}const t=Number(e);if(isNaN(t))return null;if(e<1024){return e+"B"}if(e<1024*1024){return(e/1024).toFixed(1)+"KB"}return(e/1024/1024).toFixed(1)+"MB"};const B=()=>{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""};const L=()=>{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""};const z=async e=>{try{const t=await M({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);throw new Error("音频转文字失败")}};const G=async(e,t,o=0)=>{try{const n=await M({url:"/sdk/v1/verify_sms_code",method:"POST",params:{mobile:e,code:t,code_type:o}});return n}catch(e){console.error("校验短信验证码错误:",e);throw e}};const D=async e=>{const{oemId:t,page:o=1,pageSize:n=10,keyword:r}=e;try{const e=new URLSearchParams;e.append("page",o.toString());e.append("page_size",n.toString());if(r){e.append("keyword",r)}const s=await M({url:`/sdk/v1/oem/${t}/positions?${e.toString()}`,method:"GET"});return s}catch(e){console.error("获取OEM职位列表错误:",e);throw e}};const H=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/upload-by-url",method:"POST",data:e,headers:t});return o}catch(e){console.error("通过URL上传文件错误:",e);throw e}};export{_ as F,n as P,m as a,b,k as c,U as d,G as e,N as f,D as g,H as h,C as i,B as j,z as k,L as l,j as m,x as n,E as o,M as s,R as u,O as v};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{a as e,f as t}from"./p-Bq0K-WqZ.js";const o="https://api.pincaimao.com/agents/platform";const n="https://www.pincaimao.com";const r=(e,t,o)=>{const n=e.get(t);if(!n){e.set(t,[o])}else if(!n.includes(o)){n.push(o)}};const s=(e,t)=>{let o;return(...n)=>{if(o){clearTimeout(o)}o=setTimeout((()=>{o=0;e(...n)}),t)}};const c=e=>!("isConnected"in e)||e.isConnected;const a=s((e=>{for(let t of e.keys()){e.set(t,e.get(t).filter(c))}}),2e3);const i=()=>{if(typeof e!=="function"){return{}}const o=new Map;return{dispose:()=>o.clear(),get:t=>{const n=e();if(n){r(o,t,n)}},set:e=>{const n=o.get(e);if(n){o.set(e,n.filter(t))}a(o)},reset:()=>{o.forEach((e=>e.forEach(t)));a(o)}}};const u=e=>typeof e==="function"?e():e;const l=(e,t=(e,t)=>e!==t)=>{const o=u(e);let n=new Map(Object.entries(o??{}));const r={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(u(e)??{}));r.reset.forEach((e=>e()))};const c=()=>{r.dispose.forEach((e=>e()));s()};const a=e=>{r.get.forEach((t=>t(e)));return n.get(e)};const i=(e,o)=>{const s=n.get(e);if(t(o,s,e)){n.set(e,o);r.set.forEach((t=>t(e,o,s)))}};const l=typeof Proxy==="undefined"?{}:new Proxy(o,{get(e,t){return a(t)},ownKeys(e){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(e,t){return n.has(t)},set(e,t,o){i(t,o);return true}});const f=(e,t)=>{r[e].push(t);return()=>{d(r[e],t)}};const h=(t,o)=>{const n=f("set",((e,n)=>{if(e===t){o(n)}}));const r=f("reset",(()=>o(u(e)[t])));return()=>{n();r()}};const w=(...e)=>{const t=e.reduce(((e,t)=>{if(t.set){e.push(f("set",t.set))}if(t.get){e.push(f("get",t.get))}if(t.reset){e.push(f("reset",t.reset))}if(t.dispose){e.push(f("dispose",t.dispose))}return e}),[]);return()=>t.forEach((e=>e()))};const m=e=>{const t=n.get(e);r.set.forEach((o=>o(e,t,t)))};return{state:l,get:a,set:i,on:f,onChange:h,use:w,dispose:c,reset:s,forceUpdate:m}};const d=(e,t)=>{const o=e.indexOf(t);if(o>=0){e[o]=e[e.length-1];e.length--}};const f=(e,t)=>{const o=l(e,t);o.use(i());return o};const{state:h,onChange:w}=f({token:localStorage.getItem("pcm-sdk-auth-token")||null});const m={getToken:()=>h.token,setToken:e=>{h.token=e;localStorage.setItem("pcm-sdk-auth-token",e)},clearToken:()=>{h.token=null;localStorage.removeItem("pcm-sdk-auth-token")}};w("token",(e=>{if(e){localStorage.setItem("pcm-sdk-auth-token",e)}else{localStorage.removeItem("pcm-sdk-auth-token")}}));const p=()=>{try{const e=localStorage.getItem("pcm-sdk-config-data");return e?JSON.parse(e):{}}catch(e){console.error("Error parsing stored config:",e);return{}}};const{state:y,onChange:g}=f({data:p()});const k={getConfig:()=>y.data,getItem:(e,t)=>y.data[e]!==undefined?y.data[e]:t,setItem:(e,t)=>{y.data={...y.data,[e]:t}},removeItem:e=>{const t={...y.data};delete t[e];y.data=t},clear:()=>{y.data={}},updateConfig:e=>{y.data={...y.data,...e}}};g("data",(e=>{try{if(Object.keys(e).length>0){localStorage.setItem("pcm-sdk-config-data",JSON.stringify(e))}else{localStorage.removeItem("pcm-sdk-config-data")}}catch(e){console.error("Error saving config to localStorage:",e)}}));const T="0.6.97";function E(e,t,o){return(e||"")+(t?` ${t}`:"")+(o?` ${o}`:"")}const S=()=>m.getToken()||"";const $=3*60*1e3;const v=async(e,t,o=$)=>{const n=new AbortController;const r=setTimeout((()=>n.abort()),o);try{const o=await fetch(e,{...t,signal:n.signal});clearTimeout(r);return o}catch(e){clearTimeout(r);if(e instanceof Error&&e.name==="AbortError"){throw new Error("请求超时,请检查网络连接后重试")}throw e}};const b=async(e,t=false)=>{const{url:n,method:r,headers:s={},data:c,onMessage:a,onError:i,onComplete:u}=e;try{const i=`${o}${n}`;if(!s["authorization"]&&!s["Authorization"]){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const l=await v(i,{method:r,headers:{Accept:"text/event-stream","Content-Type":"application/json",...s},body:c?JSON.stringify(c):undefined});if(l.status===401){P();if(!t){return b(e,true)}}if(!l.ok){console.error(`HTTP error! status: ${l.status}`)}const d=l.body?.getReader();if(!d)throw new Error("No reader available");const f=new TextDecoder;let h="";while(true){const{value:e,done:t}=await d.read();if(t)break;h+=f.decode(e,{stream:true});const o=h.split("\n");h=o.pop()||"";for(const e of o){if(e.startsWith("data:")){try{const t=e.substring(5).trim();if(!t)continue;const o=JSON.parse(t);a?.(o)}catch(t){console.error("解析 SSE 数据错误:",t,"原始数据:",e)}}}}u?.()}catch(o){console.error("SSE 请求错误:",o);if(!t){return b(e,true)}i?.(o)}};const P=()=>{const e=new CustomEvent("pcm-token-invalid",{bubbles:true,composed:true,detail:{timestamp:(new Date).getTime()}});document.dispatchEvent(e)};const M=async(e,t=true)=>{const{url:n,method:r="GET",headers:s={},params:c={},data:a,formData:i,onMessage:u}=e;try{const l=new URLSearchParams;Object.entries(c).forEach((([e,t])=>{if(t!==undefined&&t!==null){l.append(e,String(t))}}));let d=`${o}${n}${l.toString()?`?${l.toString()}`:""}`;if(s["authorization"]==undefined&&s["Authorization"]==undefined){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const f={method:r,headers:i?{...s}:{"Content-Type":"application/json",...s}};if(i){f.body=i}else if(r!=="GET"&&r!=="HEAD"&&a){f.body=JSON.stringify(a)}if(r==="GET"&&a){const e=new URLSearchParams;Object.entries(a).forEach((([t,o])=>{if(o!==undefined&&o!==null){e.append(t,String(o))}}));d+=(l.toString()?"&":"?")+e.toString()}const h=await v(d,f);if(h.status===401){P();if(t){return M(e,false)}}const w=await h.json();if(u){u(w)}if(!h.ok){console.error(`HTTP错误: ${h.status} ${h.statusText}`);return{success:false,message:w.message||`HTTP错误: ${h.status}`,error:w}}if(w.code!==0){console.error(`API错误: ${w.message}`);return{success:false,message:w.message,error:w}}return{success:true,data:w.data}}catch(o){console.error("HTTP请求错误:",o);if(t){return M(e,false)}if(e.onError){e.onError(o)}return{success:false,error:o,message:o instanceof Error?o.message:"未知错误"}}finally{if(e.onComplete){e.onComplete()}}};const O=async e=>{const t=await M({url:"/sdk/v1/user",method:"GET",headers:{Authorization:`Bearer ${e}`},data:{sdk_version:T}},false);if(!t.success&&t.error&&t.error.code===401){return false}else{k.setItem("pcm-sdk-CUser",`${t.data.user}(${t.data.chat_user})`);return t.success}};const C=async e=>{if(!e){throw new Error("智能体ID不能为空")}try{const t=await M({url:`/sdk/v1/agent/${e}/info`,method:"GET"});if(!t.success){throw new Error(t.message||"获取智能体信息失败")}return t.data}catch(e){console.error("获取智能体信息失败:",e);throw e}};var _;(function(e){e["Init"]="init";e["Uploading"]="uploading";e["Success"]="success";e["Failed"]="failed"})(_||(_={}));const A=async e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=async e=>{try{const o=e.target?.result;const n=await crypto.subtle.digest("SHA-256",o);const r=Array.from(new Uint8Array(n));const s=r.map((e=>e.toString(16).padStart(2,"0"))).join("");t(s)}catch(e){o(e)}};n.onerror=()=>o(new Error("读取文件失败"));n.readAsArrayBuffer(e)}));const I=async(e,t,o="application/octet-stream",n=2)=>{let r=0;while(true){try{const n=await v(e,{method:"PUT",body:t,headers:{"Content-Type":o}});if(!n.ok){throw new Error(`文件上传失败: ${n.status} ${n.statusText}`)}return n}catch(e){r++;console.error(`文件上传错误(尝试 ${r}/${n}):`,e);if(r>=n){throw e}}}};const R=async(e,t,o)=>{try{const n=await A(e);const r=await M({url:"/sdk/v1/files/generate-upload-url",method:"POST",data:{...o,filename:e.name,filesize:e.size,sha256:n},headers:t});if(!r.success||!r.data){throw new Error(r.message||"获取上传URL失败")}const s=r.data;if(s.is_deleted!=1){const o=await I(s.upload_url,e,s.content_type||"application/octet-stream");if(!o.ok){throw new Error(`文件上传到腾讯云失败: ${o.status} ${o.statusText}`)}M({url:"/sdk/v1/files/mark-as-upload",method:"POST",data:{cos_key:s.cos.cos_key},headers:t})}return{cos_key:s.cos.cos_key,file_name:s.filename,file_size:s.filesize,ext:s.filetype}}catch(e){console.error("文件上传错误:",e);throw e}};const U=async(e,t,n=false)=>{const r=S();if(!r){throw new Error("API密钥不能为空")}try{const s=await v(`${o}/sdk/v1/tts/synthesize_audio`,{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+r},body:JSON.stringify({text:e})});if(s.status===401){P();if(!n){return U(e,t,true)}}if(!s.ok){throw new Error("语音合成失败")}const c=await s.blob();return URL.createObjectURL(c)}catch(o){console.error("语音合成错误:",o);if(!n){return U(e,t,true)}throw o}};const j=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/presigned-url",method:"GET",params:{cos_key:e},headers:t});if(o.success&&o.data?.file_url){return o.data.file_url}return null}catch(e){console.error("获取预签名URL失败:",e);return null}};const N=async(e,t)=>{try{const o=await j(e,t);if(o){return`${o}${o.includes("?")?"&":"?"}ci-process=doc-preview©able=1&dstType=html`}return null}catch(e){console.error("获取预览URL失败:",e);return null}};const x=e=>{if(!e&&e!==0){return null}const t=Number(e);if(isNaN(t))return null;if(e<1024){return e+"B"}if(e<1024*1024){return(e/1024).toFixed(1)+"KB"}return(e/1024/1024).toFixed(1)+"MB"};const B=()=>{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""};const L=()=>{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""};const z=async e=>{try{const t=await M({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);throw new Error("音频转文字失败")}};const G=async(e,t,o=0)=>{try{const n=await M({url:"/sdk/v1/verify_sms_code",method:"POST",params:{mobile:e,code:t,code_type:o}});return n}catch(e){console.error("校验短信验证码错误:",e);throw e}};const D=async e=>{const{oemId:t,page:o=1,pageSize:n=10,keyword:r}=e;try{const e=new URLSearchParams;e.append("page",o.toString());e.append("page_size",n.toString());if(r){e.append("keyword",r)}const s=await M({url:`/sdk/v1/oem/${t}/positions?${e.toString()}`,method:"GET"});return s}catch(e){console.error("获取OEM职位列表错误:",e);throw e}};const H=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/upload-by-url",method:"POST",data:e,headers:t});return o}catch(e){console.error("通过URL上传文件错误:",e);throw e}};export{_ as F,n as P,m as a,b,k as c,U as d,G as e,N as f,D as g,H as h,C as i,B as j,z as k,L as l,j as m,x as n,E as o,M as s,R as u,O as v};
|
|
2
|
+
//# sourceMappingURL=p-KC5DRaFJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-De3vyGBR.js","sources":["src/utils/env.ts","node_modules/.pnpm/@stencil+store@2.1.3_@stencil+core@4.31.0/node_modules/@stencil/store/dist/index.js","store/auth.store.ts","store/config.store.ts"],"sourcesContent":["// 默认 API 域名\r\nconst DEFAULT_API_DOMAIN = 'https://api.pincaimao.com/agents/platform';\r\nconst DEFAULT_PCM_DOMAIN = 'https://www.pincaimao.com';\r\n\r\n\r\n// 从环境变量获取 API 域名,如果未设置则使用默认值\r\nexport const API_DOMAIN = process.env.API_DOMAIN || DEFAULT_API_DOMAIN;\r\nexport const PCM_DOMAIN = process.env.PCM_DOMAIN || DEFAULT_PCM_DOMAIN;\r\n\r\n// 导出其他环境变量\r\nexport const ENV = {\r\n API_DOMAIN,\r\n PCM_DOMAIN,\r\n // 可以添加其他环境变量\r\n}; ","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2_000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState ?? {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(unwrap(defaultState) ?? {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","// src/store/auth.store.ts\r\nimport { createStore } from '@stencil/store';\r\n\r\nexport const { state: authState, onChange } = createStore({\r\n token: localStorage.getItem('pcm-sdk-auth-token') || null\r\n});\r\n\r\n// 添加一些辅助方法\r\nexport const authStore = {\r\n getToken: () => authState.token,\r\n setToken: (token: string) => {\r\n authState.token = token;\r\n localStorage.setItem('pcm-sdk-auth-token', token);\r\n },\r\n clearToken: () => {\r\n authState.token = null;\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('token', value => {\r\n if (value) {\r\n localStorage.setItem('pcm-sdk-auth-token', value);\r\n } else {\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n});","import { createStore } from '@stencil/store';\r\n\r\n// 定义配置数据的类型\r\nexport interface ConfigData {\r\n [key: string]: any;\r\n}\r\n\r\n// 从localStorage获取初始配置\r\nconst getInitialConfig = (): ConfigData => {\r\n try {\r\n const storedConfig = localStorage.getItem('pcm-sdk-config-data');\r\n return storedConfig ? JSON.parse(storedConfig) : {};\r\n } catch (error) {\r\n console.error('Error parsing stored config:', error);\r\n return {};\r\n }\r\n};\r\n\r\n// 创建配置存储\r\nexport const { state: configState, onChange } = createStore<{\r\n data: ConfigData;\r\n}>({\r\n data: getInitialConfig()\r\n});\r\n\r\n// 配置存储的辅助方法\r\nexport const configStore = {\r\n // 获取整个配置对象\r\n getConfig: (): ConfigData => configState.data,\r\n \r\n // 获取特定配置项\r\n getItem: <T>(key: string, defaultValue?: T): T => {\r\n return configState.data[key] !== undefined ? configState.data[key] : defaultValue;\r\n },\r\n \r\n // 设置特定配置项\r\n setItem: <T>(key: string, value: T): void => {\r\n configState.data = {\r\n ...configState.data,\r\n [key]: value\r\n };\r\n },\r\n \r\n // 移除特定配置项\r\n removeItem: (key: string): void => {\r\n const newConfig = { ...configState.data };\r\n delete newConfig[key];\r\n configState.data = newConfig;\r\n },\r\n \r\n // 清除所有配置\r\n clear: (): void => {\r\n configState.data = {};\r\n },\r\n \r\n // 批量更新配置\r\n updateConfig: (newConfig: Partial<ConfigData>): void => {\r\n configState.data = {\r\n ...configState.data,\r\n ...newConfig\r\n };\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('data', value => {\r\n try {\r\n if (Object.keys(value).length > 0) {\r\n localStorage.setItem('pcm-sdk-config-data', JSON.stringify(value));\r\n } else {\r\n localStorage.removeItem('pcm-sdk-config-data');\r\n }\r\n } catch (error) {\r\n console.error('Error saving config to localStorage:', error);\r\n }\r\n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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|
|
1
|
+
{"version":3,"file":"p-KC5DRaFJ.js","sources":["src/utils/env.ts","node_modules/.pnpm/@stencil+store@2.1.3_@stencil+core@4.31.0/node_modules/@stencil/store/dist/index.js","store/auth.store.ts","store/config.store.ts"],"sourcesContent":["// 默认 API 域名\r\nconst DEFAULT_API_DOMAIN = 'https://api.pincaimao.com/agents/platform';\r\nconst DEFAULT_PCM_DOMAIN = 'https://www.pincaimao.com';\r\n\r\n\r\n// 从环境变量获取 API 域名,如果未设置则使用默认值\r\nexport const API_DOMAIN = process.env.API_DOMAIN || DEFAULT_API_DOMAIN;\r\nexport const PCM_DOMAIN = process.env.PCM_DOMAIN || DEFAULT_PCM_DOMAIN;\r\n\r\n// 导出其他环境变量\r\nexport const ENV = {\r\n API_DOMAIN,\r\n PCM_DOMAIN,\r\n // 可以添加其他环境变量\r\n}; ","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2_000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState ?? {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(unwrap(defaultState) ?? {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","// src/store/auth.store.ts\r\nimport { createStore } from '@stencil/store';\r\n\r\nexport const { state: authState, onChange } = createStore({\r\n token: localStorage.getItem('pcm-sdk-auth-token') || null\r\n});\r\n\r\n// 添加一些辅助方法\r\nexport const authStore = {\r\n getToken: () => authState.token,\r\n setToken: (token: string) => {\r\n authState.token = token;\r\n localStorage.setItem('pcm-sdk-auth-token', token);\r\n },\r\n clearToken: () => {\r\n authState.token = null;\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('token', value => {\r\n if (value) {\r\n localStorage.setItem('pcm-sdk-auth-token', value);\r\n } else {\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n});","import { createStore } from '@stencil/store';\r\n\r\n// 定义配置数据的类型\r\nexport interface ConfigData {\r\n [key: string]: any;\r\n}\r\n\r\n// 从localStorage获取初始配置\r\nconst getInitialConfig = (): ConfigData => {\r\n try {\r\n const storedConfig = localStorage.getItem('pcm-sdk-config-data');\r\n return storedConfig ? JSON.parse(storedConfig) : {};\r\n } catch (error) {\r\n console.error('Error parsing stored config:', error);\r\n return {};\r\n }\r\n};\r\n\r\n// 创建配置存储\r\nexport const { state: configState, onChange } = createStore<{\r\n data: ConfigData;\r\n}>({\r\n data: getInitialConfig()\r\n});\r\n\r\n// 配置存储的辅助方法\r\nexport const configStore = {\r\n // 获取整个配置对象\r\n getConfig: (): ConfigData => configState.data,\r\n \r\n // 获取特定配置项\r\n getItem: <T>(key: string, defaultValue?: T): T => {\r\n return configState.data[key] !== undefined ? configState.data[key] : defaultValue;\r\n },\r\n \r\n // 设置特定配置项\r\n setItem: <T>(key: string, value: T): void => {\r\n configState.data = {\r\n ...configState.data,\r\n [key]: value\r\n };\r\n },\r\n \r\n // 移除特定配置项\r\n removeItem: (key: string): void => {\r\n const newConfig = { ...configState.data };\r\n delete newConfig[key];\r\n configState.data = newConfig;\r\n },\r\n \r\n // 清除所有配置\r\n clear: (): void => {\r\n configState.data = {};\r\n },\r\n \r\n // 批量更新配置\r\n updateConfig: (newConfig: Partial<ConfigData>): void => {\r\n configState.data = {\r\n ...configState.data,\r\n ...newConfig\r\n };\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('data', value => {\r\n try {\r\n if (Object.keys(value).length > 0) {\r\n localStorage.setItem('pcm-sdk-config-data', JSON.stringify(value));\r\n } else {\r\n localStorage.removeItem('pcm-sdk-config-data');\r\n }\r\n } catch (error) {\r\n console.error('Error saving config to localStorage:', error);\r\n }\r\n}); "],"names":["onChange"],"mappings":";;AAAA;AAKA;AACO,MAAM,UAAU,GAAG,2CAA4C;AACzD,MAAA,UAAU,GAAG;;ACL1B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;AACnC,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;AAClC;AACA,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrC,QAAQ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACzB;AACA,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK;AAC7B,IAAI,IAAI,SAAS;AACjB,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK;AACxB,QAAQ,IAAI,SAAS,EAAE;AACvB,YAAY,YAAY,CAAC,SAAS,CAAC;AACnC;AACA,QAAQ,SAAS,GAAG,UAAU,CAAC,MAAM;AACrC,YAAY,SAAS,GAAG,CAAC;AACzB,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC;AACvB,SAAS,EAAE,EAAE,CAAC;AACd,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,CAAC,YAAY,KAAK,EAAE,aAAa,IAAI,YAAY,CAA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